A method, apparatus, device, and storage medium for uploading node data
By splitting and distributing data packets in the Mesh network and using the mobile network of other node devices to upload data, the problem of terminal devices being unable to upload data in time when the mobile network signal is unstable or malfunctioning is solved, and the stability and efficiency of data transmission are improved.
Patent Information
- Application Number
- CN202210585884.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-26
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2042-05-26
AI Technical Summary
In the prior art, terminal equipment cannot upload video data in time when the mobile network signal is unstable or malfunctions, resulting in failures in which transactions cannot be completed.
The data to be uploaded is split into multiple data packets through the Mesh network and distributed to other nearby node devices. The mobile network of other node devices is used to upload data to ensure that the data can be quickly and stably transmitted to the cloud server.
It realizes that when the mobile network signal is unstable or malfunctioning, the terminal equipment can upload data in a timely manner to avoid transaction interruption, and improve the stability and efficiency of data transmission.
Smart Images

Figure CN114885373B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of communication technologies, and in particular, to a method, apparatus, electronic device, and storage medium for uploading node data. Background Art
[0002] Terminal devices, such as smart retail cabinets, have greatly facilitated people's lives. Terminal devices in the prior art need to timely upload their respective recognition videos to a cloud server. Usually, terminal devices in the prior art are configured with a 4G mobile communication network to upload videos captured by smart retail cabinets during unmanned sales. However, due to the different environments where terminal devices are deployed, when there are unstable mobile network signals or mobile network failures, terminal devices cannot timely upload their video data, resulting in failures such as inability to complete transactions in a timely manner. Summary of the Invention
[0003] Embodiments of the present invention provide a method, apparatus, device, and storage medium for uploading node data, which realizes the timely uploading of data by each node device in a Mesh network.
[0004] According to one aspect of the present invention, there is provided a method for uploading node data, which is applied to a Mesh network composed of multiple node devices, and includes:
[0005] Splitting the data to be uploaded corresponding to the first node device into multiple data packets according to the preset number of nodes in the Mesh network;
[0006] Distributing the multiple data packets to other node devices near the first node device through the Mesh network, and notifying other node devices to upload the data packets received by them to the cloud server respectively.
[0007] Optionally, before splitting the data to be uploaded corresponding to the first node device into multiple data packets according to the preset number of nodes in the Mesh network, it includes:
[0008] Obtaining historical data transmission information from nearby node devices, and determining the historical transmission rate of each other node device according to the historical data transmission information;
[0009] Sorting other node devices according to the historical transmission rate and determining the number of other node devices that need to distribute data as the preset number of nodes;
[0010] Wherein, the size of each split data packet is positively correlated with the historical transmission rate of each other node device, and data packets of different sizes are distributed to corresponding other node devices near the first node device.
[0011] Optionally, before splitting the data to be uploaded corresponding to the first node device into multiple data packets according to the preset number of nodes in the Mesh network, the following steps are further included:
[0012] Determine whether there is an abnormality in the first node device uploading data to the cloud server;
[0013] Determine the preset number of nodes for distributed data upload according to the judgment result.
[0014] Optionally, the determining the preset number of nodes for distributed data upload according to the judgment result includes:
[0015] If there is an abnormality in the first node device uploading data to the cloud server, the preset number of nodes in the Mesh network is the number of other node devices excluding the first node device;
[0016] If the first node device uploads data to the cloud server normally, the preset number of nodes in the Mesh network is the number including the first node device and other node devices.
[0017] Optionally, the multiple data packets are N or N + 1. Distributing the multiple data packets to other node devices near the first node device through the Mesh network includes:
[0018] If there is an abnormality in the first node device uploading data to the cloud server, the first node device distributes the N data packets to N other node devices near the first node device through the Mesh network;
[0019] If the first node device uploads data to the cloud server normally, the first node device retains 1 of the N + 1 data packets for its own upload to the cloud server, and distributes the remaining N data packets to N other node devices near the first node device through the Mesh network.
[0020] Optionally, the other node devices include a second node device and a third node device. After distributing the multiple data packets to other node devices near the first node device through the Mesh network, the following steps are included:
[0021] Determine whether the second node device has received the corresponding data packet;
[0022] If the second node device does not respond or the response is abnormal, resend the data packet corresponding to the second node device to the third node device, and mark the second node device as disconnected or in other abnormal states.
[0023] If the second node device successfully receives the corresponding data packet, notify the second node device to transmit the received data packet to the cloud server.
[0024] Optionally, after notifying other node devices to upload the data packets they received respectively to the cloud server, it includes:
[0025] Determine whether it fails for other node devices to upload the data packets they received respectively to the cloud server;
[0026] If it fails, update the failed data packets as data to be uploaded and re - execute the step of splitting the data to be uploaded corresponding to the first node device into multiple data packets according to the preset number of nodes in the Mesh network.
[0027] According to another aspect of the present invention, there is provided a node data uploading device, including:
[0028] A data splitting module, configured to split the data to be uploaded corresponding to the first node device into multiple data packets according to the preset number of nodes in the Mesh network;
[0029] A multi - node uploading module, configured to distribute the multiple data packets to other node devices near the first node device through the Mesh network, and notify other node devices to upload the data packets they received respectively to the cloud server.
[0030] According to another aspect of the present invention, there is provided an electronic device, the electronic device includes:
[0031] At least one processor; and
[0032] A memory communicatively connected to the at least one processor; wherein,
[0033] The memory stores a computer program executable by the at least one processor, and when the computer program is executed by the at least one processor, it enables the at least one processor to execute the node data uploading method according to any embodiment of the present invention.
[0034] According to another aspect of the present invention, there is provided a computer - readable storage medium, the computer - readable storage medium stores computer instructions, and when the computer instructions are used by a processor to execute, they implement the node data uploading method according to any embodiment of the present invention.
[0035] In an embodiment of the present invention, the data to be uploaded corresponding to the first node device is split into multiple data packets according to the preset number of nodes in the Mesh network; the multiple data packets are distributed to other node devices near the first node device through the Mesh network, and other node devices are notified to upload the data packets received by each of them to the cloud server respectively, solving the technical problem of unstable data upload of node devices in the existing Mesh network, and enabling each node device to make full use of its own node mobile network and the mobile networks of other node devices to quickly and stably transmit data to the cloud server. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings based on these drawings without creative efforts.
[0037] Figure 1 is a flowchart of a node data upload method provided in Embodiment 1 of the present invention;
[0038] Figure 2 is a flowchart of a node data upload method provided in Embodiment 2 of the present invention;
[0039] Figure 3 is a flowchart of a node data upload method provided in Embodiment 3 of the present invention;
[0040] Figure 4 is a schematic diagram of a node data upload device provided in Embodiment 4 of the present invention;
[0041] Figure 5 is a schematic diagram of the structure of an electronic device provided in Embodiment 5 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0042] In order to enable those skilled in the art to better understand the solutions of the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0043] It should be noted that the terms "first", "second", etc. in the description, claims and above-mentioned drawings of the present invention are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present invention described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units does not necessarily limit to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0044] Embodiment 1
[0045] Figure 1 It is a flowchart of a method for uploading node data provided by Embodiment 1 of the present invention. This embodiment can be applied to a Mesh network composed of multiple node devices. This method can be executed by a node data uploading device, which can be implemented in a software and / or hardware manner and is generally integrated in an electronic device. The electronic device can be a terminal device or a server device, and is used in cooperation with a cloud server for receiving uploaded data. The specific device type of the electronic device is not limited in the embodiments of the present invention. Correspondingly, as Figure 1 shown, the method includes the following operations:
[0046] S110. Split the data to be uploaded corresponding to the first node device into multiple data packets according to the preset number of nodes in the Mesh network.
[0047] In this embodiment, the Mesh network is also called a multi-hop network. Any node device in the Mesh network can simultaneously serve as a fixed access point and a router. The first node device in this embodiment is any node device in the Mesh network. Any node device in this embodiment is configured with a mobile communication module, and the mobile communication module includes but is not limited to 3G, 4G, and 5G mobile communication networks. Any node device in this embodiment can use its respective mobile communication module to upload the data to be uploaded to the cloud server. Each node device in this embodiment can be an intelligent retail cabinet, an intelligent charging cabinet, etc. The data to be uploaded can be one or more of video data, bill data, and fault data in the transaction process.
[0048] In this embodiment, the preset number of nodes in the Mesh network may also be the total number including the first node device and other node devices. Alternatively, the preset number of nodes in the Mesh network may also be the number of other node devices excluding the first node device. In an alternative embodiment, the preset number of nodes in the Mesh network may also be a part of the number of other node devices. For example, the total number of other node devices is N, and the preset number of nodes is M, where 2 ≤ M < N. Here, M and N are positive integers.
[0049] Taking the preset number of nodes M in the Mesh network of this embodiment as an example of a part of the number of other node devices N, that is, 2 ≤ M < N. At this time, the first node device splits the data to be uploaded into M data packets according to the preset number of nodes M in the Mesh network. In this embodiment, in order to reduce the complexity of data splitting, the sizes of the split data packets can be exactly the same. In an alternative embodiment, in order to improve the efficiency of data upload, the sizes of the split data packets can be positively correlated with the historical transmission rates of each of the other node devices.
[0050] S120: Distribute the multiple data packets to other node devices near the first node device through the Mesh network, and notify the other node devices to upload the data packets received by each of them to the cloud server respectively.
[0051] In this embodiment, the first node device distributes the M data packets to the other M node devices near the first node device through the Mesh network, and notifies the other M node devices to upload the data packets received by each of them to the cloud server respectively.
[0052] In one embodiment, the first node device distributes the multiple data packets to other node devices near the first node device through a Mesh network using an inter-node transmission protocol, which refers to a protocol for transmitting data between different node devices under the same WIFI network in the Mesh network in this network protocol. Specifically, the data packets of the inter-node transmission protocol used in this embodiment at least include one or more of the following: 4-bit header identifier (unsigned char GroupNetHead[4]), data packet [total] data number / hash value (unsigned char HashIndex[4]), total data size_total number of packets (unsigned char PackageInfo[8]), current packet sequence number_number of packets (unsigned char PackagePosInfo[8]), current packet size (unsigned char PackageLen[4]), data pointer of data to be split (unsigned char* Data_ptr), 4-bit ending identifier (unsigned char PackageTail[4]).
[0053] In one embodiment, a multi-node transmission protocol is used for data transmission of multiple data packets between other M node devices and the cloud server. The multi-node transmission protocol of this embodiment is a transmission protocol for multiple device nodes in the same network to transmit data to the cloud server. Specifically, the data packets of the multi-node transmission protocol used in this embodiment at least include one or more of the following: 4-bit identifiers 'M', 'V', 'T', 'N' (unsigned char DataHead[4]), node serial number (unsigned char NodeGroupIndex[4]), serial number of the device in the node network (unsigned char NodeDeviceIndex[1]), hash check value, upload event number (unsigned char HashCheck[8]), start Unix timestamp of the node network (unsigned char TimeStart[6]), current packet Unix timestamp (unsigned char TimeNow[6]), 8 bytes representing the total data length of this segment (unsigned char TotalByte[8]), start address of the data transmitted by this data packet (unsigned char DataPos[8]), length of the data transmitted by this data packet (unsigned char DataLen[8]), data pointer to be uploaded (unsigned char* Data_send), 4-bit end identifier 'M', 'E', 'N', 'D' (unsigned char DataTail[4]).
[0054] The technical solution of this embodiment splits the data to be uploaded into multiple data packets by the first node device according to the preset number of nodes in the Mesh network. The first node device distributes the multiple data packets to other node devices near the first node device through the Mesh network, and notifies other node devices to upload the data packets received by them to the cloud server respectively, solving the technical problem that the first node device itself has a network condition and cannot upload data to the cloud server in time, accelerating the efficiency of uploading data to the cloud server when the network condition of the first node device itself is normal, making full use of the network idle time of other node devices, and achieving the effect of stable, reliable and efficient data upload.
[0055] Embodiment 2
[0056] This embodiment is specific based on the above embodiment. As Figure 2 shown, the method of this embodiment can further improve the efficiency of data upload. The specific steps may include:
[0057] S210. Obtain historical data transmission information from nearby node devices, and determine the historical transmission rate of each other node device according to the historical data transmission information.
[0058] In this embodiment, the first node device is any node device in the Mesh network. The first node device distributes the multiple data packets to other node devices near the first node device through the Mesh network using an inter-node transmission protocol. In this embodiment, the historical data transmission information of other node devices near the first node device obtained by the first node device can be the transmission exception records of other node devices. According to the number of transmission exceptions that have occurred for each of the other node devices recorded in the transmission exception records, the first node device can determine the historical transmission rate of each other node device. For example, in the previous historical period, node device A had 1 transmission exception, then the first node device sets the historical transmission rate of node device A to 90% of the normal rate; node device B had 2 transmission exceptions, then the first node device sets the historical transmission rate of node device B to 80% of the normal rate; node device C had 3 transmission exceptions, then the first node device sets the historical transmission rate of node device C to 70% of the normal rate; node device D had 4 transmission exceptions, then the first node device sets the historical transmission rate of node device D to 60% of the normal rate. The historical period in this embodiment can be several hours, one day, one week, etc., and this embodiment does not make any restrictions.
[0059] S220. Sort other node devices according to the historical transmission rate and determine the number of other node devices to which data needs to be distributed as the preset node number.
[0060] Taking the aforementioned other node devices A - D as an example, assuming that the normal rates of node devices A - D are the same, then the result of sorting other node devices according to the historical transmission rate is A, B, C, D. Taking the preset node number M in the Mesh network of this embodiment as an example of a part of the number N = 4 of other node devices, that is, 2 ≤ M < 4, this embodiment sets M = 3.
[0061] S230. Split the data to be uploaded corresponding to the first node device into multiple data packets according to the preset node number in the Mesh network, and the size of each data packet corresponds to the historical transmission rate of each other node device.
[0062] In this embodiment, the first node device splits the data to be uploaded into 3 data packets, namely data packet A, data packet B, and data packet C, according to the preset number of nodes 2 in the Mesh network. In this embodiment, data packet A > data packet B > data packet C. The size of data packet A corresponds to 90% of the normal rate of node device A, the size of data packet B corresponds to 80% of the normal rate of node device B, and the size of data packet C corresponds to 70% of the normal rate of node device C.
[0063] S240. Distribute the multiple data packets of different sizes to the corresponding other node devices near the first node device through the Mesh network, and notify each other node device to upload the data packets received by each to the cloud server respectively.
[0064] In this embodiment, the first node device distributes the multiple data packets to the other node devices near the first node device through the Mesh network by using the inter-node transmission protocol. Specifically, the first node device distributes data packet A to node device A through the inter-node transmission protocol, distributes data packet B to node device B through the inter-node transmission protocol, and distributes data packet C to node device C through the inter-node transmission protocol. After receiving the corresponding data packets, node device A, node device B, and node device C use the multi-node transmission protocol to transmit data packet A and data packet B to the cloud server respectively.
[0065] In this embodiment, in order to improve the efficiency of data upload, the size of the split data packets is positively correlated with the historical transmission rate of each other node device. The size of the data packets received by the other node devices corresponds to the historical transmission rate of their respective other node devices. Since the sizes of the split data packets respectively correspond to the historical transmission rates of the other node devices, the data packets received by the other node devices also respectively match their historical transmission rates. Therefore, the efficiency of each other node device uploading its own data packet is higher, saving the overall time for all data packets to be completely uploaded to the cloud server.
[0066] Embodiment Three
[0067] This embodiment is specific based on the above embodiment. As Figure 3 shown, the method of this embodiment can further utilize idle network resources and reduce the probability of data transmission failure caused by network failures. The method includes:
[0068] S310. Determine whether there is an abnormality in the first node device uploading data to the cloud server;
[0069] The first node device in this embodiment is any node device of the Mesh network. Any node device of the Mesh network can simultaneously serve as a fixed access point and a router. The first node device communicates with other node devices near it using an inter-node transmission protocol. Any node device in the Mesh network of this embodiment is configured with a mobile communication module, and the mobile communication module includes, but is not limited to, 3G, 4G, and 5G mobile communication networks. Any node device in this embodiment can use its respective mobile communication module to upload the data to be uploaded to the cloud server. Each node device in this embodiment can be an intelligent retail cabinet, an intelligent charging cabinet, etc., and the data to be uploaded can be one or more of video data, bill data, and fault data during the transaction process. In this embodiment, if the first node device can upload the data to be stored or generated to the cloud server within a preset time, it indicates that the first node device uploads the data to the cloud server normally. If the first node device cannot upload the data to be stored or generated to the cloud server within the preset time, it indicates that the first node device uploads the data to the cloud server abnormally.
[0070] S320. Determine the preset number of nodes that need to distribute and upload the data according to the judgment result.
[0071] In this embodiment, the first node device determines the number of other node devices that need to distribute and upload the data, that is, the preset number of nodes, according to the situation of its own network. Specifically, if the first node device uploads the data to the cloud server abnormally, the preset number of nodes in the Mesh network is the number of other node devices excluding the first node device; if the first node device uploads the data to the cloud server normally, the preset number of nodes in the Mesh network is the number of the first node device and other node devices.
[0072] In one embodiment, if the first node device uploads the data to the cloud server abnormally, the preset number of nodes that need to distribute and upload the data is N nearby other node devices; if the first node device uploads the data to the cloud server normally, the preset number of nodes that need to distribute and upload the data is N nearby other node devices plus the first node device itself, that is, the preset number of nodes is N + 1.
[0073] S330. Split the data to be uploaded corresponding to the first node device into multiple data packets according to the preset number of nodes.
[0074] Specifically, if the first node device fails to upload data to the cloud server, the first node device splits the data to be uploaded into N data packets according to the preset number of nodes N; if the first node device uploads data to the cloud server normally, the first node device splits the data to be uploaded into N + 1 data packets according to the preset number of nodes N + 1.
[0075] S340. Distribute the multiple data packets to other node devices near the first node device through the Mesh network.
[0076] If the first node device fails to upload data to the cloud server, the first node device distributes the N data packets to N other node devices near the first node device through the Mesh network;
[0077] If the first node device uploads data to the cloud server normally, the first node device retains one of the N + 1 data packets to upload to the cloud server by itself, and distributes the remaining N data packets to N other node devices near the first node device through the Mesh network.
[0078] S350. Determine whether the second node device receives the corresponding data packet;
[0079] In this embodiment, the first node device and other node devices transfer data and information through an inter-node transmission protocol, and confirm whether other target node devices receive the data packets transmitted according to the inter-node protocol based on the protocol feedback information. In one embodiment, other target node devices include at least a second node device and a third node device. The first node device respectively determines whether the second node device and the third node device receive the corresponding data packets.
[0080] S360. If the second node device does not respond or responds abnormally, retransmit the data packet corresponding to the second node device to the third node device, and mark the second node device as disconnected or in other abnormal states.
[0081] If it is determined according to the above judgment result that the second node device does not respond or responds abnormally, that is, it cannot normally receive the corresponding data packet; and the third node device can normally receive the corresponding data packet, then retransmit the data packet corresponding to the second node device to the third node device, and mark the second node device as disconnected or in other abnormal states. If the second node device successfully receives the corresponding data packet, notify the second node device to transmit the received data packet to the cloud server.
[0082] S370. Notify other node devices to upload the data packets they receive to the cloud server respectively.
[0083] The first node device distributes the multiple data packets to other node devices near the first node device through the Mesh network by using an inter-node transmission protocol. Specifically, the first node device distributes data packet A to the second node device through the inter-node transmission protocol, and the first node device distributes data packet B to the third node device through the inter-node transmission protocol. Since the second node device receives data packet A abnormally, the first node device re-sends the corresponding data packet A of the second node device to the third node device and marks the second node device as disconnected or in other abnormal states. In this embodiment, after receiving the corresponding data packets A and B, the third node device uses the multi-node transmission protocol to transmit data packet A and data packet B to the cloud server respectively. In an alternative embodiment, the third node device can be one or more node devices.
[0084] S380. Determine whether it fails that other node devices upload the data packets they receive to the cloud server respectively;
[0085] If the first node device receives the feedback information that other node devices have completed the data packet upload within the preset time, it is determined that the corresponding other node device has successfully uploaded the data packet, otherwise it indicates that the corresponding other node device has failed to upload the data packet.
[0086] S390. If it fails, update the failed data packet as the data to be uploaded and re-execute step S330.
[0087] Specifically, if the first node device does not receive the feedback information that other node devices, such as the third node device, have completed the upload of data packet B within the preset time, then use data packet B as the data to be uploaded and re-execute the distribution and upload step S330, that is, if the third node device fails to upload data packet B, update the failed data packet B as the data to be uploaded and re-execute step S330: split the data to be uploaded corresponding to the first node device into multiple data packets according to the preset number of nodes in the Mesh network.
[0088] In this embodiment, the first node device further determines different preset numbers of nodes according to its own network conditions for uploading data, and performs different methods of distribution and upload on the data to be uploaded, which basically meets the requirement that when individual or some node devices have abnormal mobile network transmissions, other node devices can still be used for relay upload, and in the case of no abnormal state, the first node device itself can also participate in the data upload work synchronously, improving the data transmission efficiency and avoiding the situation where node devices cannot be used due to unstable network.
[0089] It should be noted that any permutation and combination of the technical features in the above embodiments also belong to the protection scope of the present invention.
[0090] Embodiment 4
[0091] Figure 4 This is a schematic diagram of a node data uploading device provided in the fourth embodiment of the present invention. As Figure 4 shown, the device 400 includes: a data splitting module 410 and a multi-node uploading module 420, where:
[0092] The data splitting module 410 is configured to split the data to be uploaded corresponding to the first node device into multiple data packets according to the preset number of nodes in the Mesh network.
[0093] The multi-node uploading module 420 is configured to distribute the multiple data packets to other node devices near the first node device through the Mesh network, and notify the other node devices to upload the data packets received by each of them to the cloud server respectively.
[0094] Optionally, the device in the above embodiment further includes:
[0095] A historical information obtaining module, configured to obtain historical data transmission information from nearby node devices, and determine the historical transmission rate of each other node device according to the historical data transmission information.
[0096] A distribution node determining module, configured to sort other node devices according to the historical transmission rate and determine the number of other node devices that need to distribute data as the preset number of nodes.
[0097] Optionally, in an embodiment, the size of each split data packet is positively correlated with the historical transmission rate of each other node device, and data packets of different sizes are distributed to corresponding other node devices near the first node device.
[0098] A first data uploading judgment module, configured to judge whether it is abnormal for the first node device to upload data to the cloud server.
[0099] The distribution node determination module further determines the preset number of nodes for which data needs to be distributed and uploaded according to the result of the judgment on whether the device 1 uploads data to the cloud server abnormally. Specifically, if the first node device uploads data to the cloud server abnormally, the preset number of nodes in the Mesh network is the number of other node devices excluding the first node device. If the first node device uploads data to the cloud server normally, the preset number of nodes in the Mesh network is the number of the first node device and other node devices. Correspondingly, the multi-node upload module 420 distributes the multiple data packets to other node devices near the first node device through the Mesh network. Specifically, it further includes that if the first node device uploads data to the cloud server abnormally, the first node device distributes the N data packets to N other node devices near the first node device through the Mesh network; if the first node device uploads data to the cloud server normally, the first node device retains 1 of the N + 1 data packets for its own upload to the cloud server, and distributes the remaining N data packets to N other node devices near the first node device through the Mesh network.
[0100] Optionally, the device in the above embodiment further includes:
[0101] The data packet receiving and judging module is used to judge whether other node devices, such as the second node device, receive the corresponding data packets; if the second node device does not respond or responds abnormally, the data packets corresponding to the second node device are resent to the third node device, and the second node device is marked as disconnected or in other abnormal states. If the second node device successfully receives the corresponding data packets, it notifies the second node device to transmit the received data packets to the cloud server.
[0102] Optionally, the device in the above embodiment further includes:
[0103] The second data upload judgment module is used to judge whether other node devices fail to upload the data packets they receive to the cloud server respectively; if it fails, the failed data packets are updated as data to be uploaded, and the data splitting module 410 is controlled to re-execute splitting the data to be uploaded corresponding to the first node device into multiple data packets according to the preset number of nodes in the Mesh network.
[0104] The above node data uploading device can execute the node data uploading method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method. For the technical details not described in detail in this embodiment, reference can be made to the node data uploading method provided in any embodiment of the present invention. Since the above-introduced node data uploading device is a device that can execute the node data uploading method in the embodiment of the present invention, based on the node data uploading method introduced in the embodiment of the present invention, those skilled in the art can understand the specific implementation manner and various variations of the node data uploading device in this embodiment. Therefore, the specific implementation of how the node data uploading device implements the node data uploading method in the embodiment of the present invention will not be described in detail here. As long as the device adopted by those skilled in the art to implement the node data uploading method in the embodiment of the present invention belongs to the scope protected by this application.
[0105] Embodiment 5
[0106] Figure 5 FIG. shows a schematic structural diagram of an electronic device 10 that can be used to implement the embodiments of the present invention. The electronic device is intended to represent various forms of digital computers, such as, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, personal digital processors, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are only examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0107] As Figure 5 shown, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc. Among them, the memory stores a computer program executable by the at least one processor. The processor 11 can execute various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.
[0108] Multiple components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disc, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0109] The processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the node data uploading method.
[0110] In some embodiments, the node data uploading method can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the node data uploading method described above can be executed. Alternatively, in other embodiments, the processor 11 can be configured to execute the node data uploading method by any other suitable means (e.g., by means of firmware).
[0111] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a dedicated or general-purpose programmable processor, and can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0112] A computer program for implementing the method of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, a special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions / operations specified in the flowchart and / or block diagram to be implemented. The computer program may be executed entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
[0113] In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium may be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0114] In order to provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0115] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), blockchain network, and the Internet.
[0116] A computing system can include a client and a server. The client and the server are generally far from each other and usually interact through a communication network. The client-server relationship is created by computer programs that run on respective computers and have a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.
[0117] Embodiment Six
[0118] Embodiment Six of the present invention further provides a computer storage medium storing a computer program, where the computer program is used to execute the node data uploading method according to any one of the above embodiments of the present invention when executed by a computer processor.
[0119] The computer storage medium of the embodiments of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (a non-exhaustive list) of the computer-readable storage medium include: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM, or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0120] A computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. The computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device.
[0121] The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, Radio Frequency (RF), etc., or any suitable combination of the foregoing.
[0122] The computer program code for performing the operations of the present invention may be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0123] It should be understood that the various forms of the flow shown above may be used, with steps reordered, added, or deleted. For example, the steps recited in the present invention may be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. No limitation is imposed herein.
[0124] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions may be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A method for uploading node data, which is applied to a Mesh network composed of multiple node devices, and is characterized in that, Including: Splitting the data to be uploaded corresponding to the first node device into multiple data packets according to the preset number of nodes in the Mesh network; wherein, the preset number of nodes in the Mesh network is the total number including the first node device and other node devices, or the preset number of nodes in the Mesh network is the number of other node devices excluding the first node device; Distributing the multiple data packets to other node devices near the first node device through the Mesh network, and notifying the other node devices to upload the data packets received by each of them to the cloud server respectively; Before splitting the data to be uploaded corresponding to the first node device into multiple data packets according to the preset number of nodes in the Mesh network, it further includes: Judging whether there is an abnormality in the first node device uploading data to the cloud server; Determining the preset number of nodes for which data needs to be distributed and uploaded according to the judgment result; Before splitting the data to be uploaded corresponding to the first node device into multiple data packets according to the preset number of nodes in the Mesh network, it includes: Obtaining historical data transmission information from nearby node devices, and determining the historical transmission rate of each other node device according to the historical data transmission information; wherein, the historical data transmission information of other node devices near the first node device obtained by the first node device is the transmission abnormality record of the other node devices, and the historical transmission rate of each other node device is determined according to the number of transmission abnormalities that each of the other node devices has appeared as recorded in the transmission abnormality record; Sorting other node devices according to the historical transmission rate and determining the number of other node devices to which data needs to be distributed as the preset number of nodes; Wherein, the size of each split data packet is positively correlated with the historical transmission rate of each other node device, and data packets of different sizes are distributed to corresponding other node devices near the first node device; The determining the preset number of nodes for which data needs to be distributed and uploaded according to the judgment result includes: If there is an abnormality in the first node device uploading data to the cloud server, the preset number of nodes in the Mesh network is the number of other node devices excluding the first node device; If the first node device uploads data to the cloud server normally, the preset number of nodes in the Mesh network is the total number including the first node device and other node devices.
2. The node data uploading method according to claim 1, wherein The multiple data packets are N or N + 1. The distributing the multiple data packets to other node devices near the first node device through the Mesh network includes: If there is an abnormality in the first node device uploading data to the cloud server, the first node device distributes the N data packets to N other node devices near the first node device through the Mesh network; If the first node device uploads data to the cloud server normally, the first node device retains 1 of the N + 1 data packets for its own upload to the cloud server, and distributes the remaining N data packets to N other node devices near the first node device through the Mesh network.
3. The node data uploading method according to claim 1, wherein The other node devices include a second node device and a third node device. After distributing the multiple data packets to the other node devices near the first node device through the Mesh network, it includes: Determine whether the second node device has received the corresponding data packet; If the second node device does not respond or the response is abnormal, resend the data packet corresponding to the second node device to the third node device, and mark the second node device as disconnected or in other abnormal states; If the second node device successfully receives the corresponding data packet, notify the second node device to transmit the received data packet to the cloud server.
4. The node data uploading method according to claim 1, wherein After notifying the other node devices to upload the data packets they received respectively to the cloud server, it includes: Determine whether it fails for the other node devices to upload the data packets they received respectively to the cloud server; If it fails, update the failed data packet as data to be uploaded and re - execute the step of splitting the data to be uploaded corresponding to the first node device into multiple data packets according to the preset number of nodes in the Mesh network.
5. A node data uploading device, characterized in that, It includes: A data splitting module, configured to split the data to be uploaded corresponding to the first node device into multiple data packets according to the preset number of nodes in the Mesh network; wherein, the preset number of nodes in the Mesh network is the total number including the first node device and other node devices, or the preset number of nodes in the Mesh network is the number of other node devices excluding the first node device; A multi - node upload module, configured to distribute the multiple data packets to the other node devices near the first node device through the Mesh network, and notify the other node devices to upload the data packets they received respectively to the cloud server; A first data upload judgment module, configured to judge whether it is abnormal for the first node device to upload data to the cloud server; A distribution node determination module, configured to determine the preset number of nodes that need to perform distributed upload of data according to the judgment result; A historical information acquisition module, configured to obtain historical data transmission information from the nearby node devices, and determine the historical transmission rate of each other node device according to the historical data transmission information; wherein, the historical data transmission information of the other node devices near the first node device obtained by the first node device is the transmission exception record of the other node devices, and the historical transmission rate of each other node device is determined according to the number of transmission exceptions that each of the other node devices has appeared as recorded in the transmission exception record; The distribution node determination module is configured to sort the other node devices according to the historical transmission rate and determine the number of other node devices that need to distribute data as the preset number; Wherein, the size of each split data packet is positively correlated with the historical transmission rate of each other node device, and data packets of different sizes are distributed to the corresponding other node devices near the first node device; The distribution node determination module is specifically configured to: if the first node device uploads data to the cloud server abnormally, the preset number of nodes in the Mesh network is the number of other node devices excluding the first node device; if the first node device uploads data to the cloud server normally, the preset number of nodes in the Mesh network is the number of the first node device and other node devices.
6. An electronic device, characterized in that, The electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the node data uploading method according to any one of claims 1-4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a processor to implement the node data uploading method according to any one of claims 1-4 when executed.
Citation Information
Patent Citations
Multi-channel uplink data transmission method and system, client and server
CN107529186A
Data processing method and device
CN107545005A
Method, device, system and apparatus for p2p network-based data transmission, and medium
WO2021134928A1