Data communication methods, devices, electronic equipment and storage media
By introducing a communication device matching mechanism into the data communication system and using communication distance and status detection algorithms to select a suitable relay node to forward passive IoT terminal data, the problem of data transmission interruption of passive IoT terminals is solved, and the transmission reliability and efficiency are improved.
Patent Information
- Application Number
- CN202310174678.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-27
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2043-02-27
AI Technical Summary
Due to the unique way passive IoT terminals obtain energy, they suffer from transmission interruptions and low reliability during data transmission.
By introducing a matching mechanism between the first and second communication devices in the data communication system, and using communication distance calculation and preset status detection algorithms, the most suitable relay node is selected to forward the data of the passive IoT terminal, avoiding the passive IoT terminal from directly forwarding to external devices, saving power and improving the reliability of data transmission.
This improves the reliability of data transmission in passive IoT terminals, reduces data transmission interruptions caused by insufficient power, shortens communication time, and improves communication efficiency.
Smart Images

Figure CN116156609B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a data communication method, apparatus, electronic device and storage medium. Background Technology
[0002] Passive Internet of Things (IoT) is a new type of IoT technology where network nodes can be passive, meaning they obtain energy from the environment to support data sensing, transmission, and distributed computing. Terminals developed based on this passive IoT technology are called passive IoT terminals.
[0003] In existing technologies, when passive IoT terminals are applied in practical application scenarios, the passive IoT terminals are often configured to send the acquired data to a server or base station in real time, so that the server or base station can monitor the environment in which the passive IoT terminal is located based on the acquired data.
[0004] However, due to the unique way passive IoT terminals obtain power, data transmission is often interrupted and has low reliability. Summary of the Invention
[0005] The purpose of this application is to address the shortcomings of the prior art by providing a data communication method, apparatus, electronic device, and storage medium that can improve the reliability of data transmission methods.
[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows:
[0007] In a first aspect, the present invention provides a data communication method applied to a first communication device in a data communication system, the first communication device being communicatively connected to at least one second communication device in the data communication system, the first communication device being configured to include a first communication address, and each of the second communication devices being configured to include a second communication address, the method comprising:
[0008] Obtain a first candidate communication index table, which includes: a first candidate device identifier of at least one second candidate communication device that can establish a communication connection with the first communication device, and a first candidate communication address of each second candidate communication device;
[0009] Based on the first communication address and each of the first candidate communication addresses, calculate the communication distance between the first communication device and each of the second candidate communication devices;
[0010] Based on the respective communication distances, a second target communication device that matches the first communication device is determined in the first candidate communication index table.
[0011] In an optional implementation, determining a second target communication device matching the first communication device in the first candidate communication index table based on each of the communication distances includes:
[0012] Based on the communication distances described, a second communication device that matches the first communication device is determined in the first candidate communication index table, wherein the matching second communication device has the closest communication distance to the first communication device;
[0013] Send a pairing request message to the matched second communication device, the pairing request message including the first device identifier of the first communication device;
[0014] The matching result is received from the matching second communication device, wherein the matching result is determined by the matching second communication device after executing a preset status detection algorithm according to the matching request message, and the matching result is used to indicate whether the pairing is successful.
[0015] In an optional implementation, the preset state detection algorithm includes at least one of the following:
[0016] Determine whether the idle channel of the matched second communication device meets the first preset requirement;
[0017] Determine whether the idle computing resources of the matched second communication device meet the second preset requirements;
[0018] Determine whether the number of first communication devices currently matched with the second matching communication device meets a third preset requirement.
[0019] In an optional implementation, the first communication device is a passive IoT terminal and the second communication device is a first relay node; or, the first communication device is a first relay node and the second communication device is a passive IoT terminal.
[0020] In an optional implementation, if the first communication device is a first relay node, the second communication device is a passive IoT terminal, and the first communication device is also connected to at least one third communication device in the data communication system, the third communication device is a second relay node, the second relay node includes a second candidate communication index table, the second candidate communication index table includes: a second optional device identifier of at least one second optional communication device that can establish a communication connection with the second relay node, and a second optional communication address of each second optional communication device;
[0021] The step of determining a second target communication device matching the first communication device in the first candidate communication index table based on each of the communication distances includes:
[0022] Send an interaction request to each of the second relay nodes, the interaction request carrying the first candidate communication index table corresponding to the first relay node;
[0023] The system receives interaction response messages returned by each of the second relay nodes in accordance with the interaction request. The interaction response messages are used to indicate whether the second target communication device needs to be updated. The interaction response messages are determined by each of the second relay nodes based on the first candidate communication index table and the second candidate communication index table.
[0024] In an optional implementation, the interactive response message is specifically determined by the second relay node based on the first candidate device identifier in the first candidate communication index table and the second optional device identifier in the second candidate communication index table. If the second relay node determines that there is a second target optional device identifier that is the same as the second target candidate device identifier, and the second communication distance is less than the first communication distance, then the interactive response message instructs the first relay node to delete the second target candidate device identifier and the first candidate communication address corresponding to the second target candidate device identifier from the first candidate communication index table, and to determine the second target communication device based on the updated first candidate communication index table.
[0025] The first communication distance is used to indicate the communication distance between the first relay node and the second target candidate device identifier, and the second communication distance is used to indicate the communication distance between the second relay node and the second target optional device identifier.
[0026] In an optional implementation, the method further includes:
[0027] If a second candidate communication device that is offline is detected in the first candidate communication index table, or if a newly online second communication device is detected in the data communication system, then the first candidate communication index table is updated.
[0028] In a second aspect, the present invention provides a data communication device, comprising a first communication device applied in a data communication system, the first communication device being communicatively connected to at least one second communication device in the data communication system, the first communication device being configured to include a first communication address, and each of the second communication devices being configured to include a second communication address, the data communication device comprising:
[0029] The acquisition module is used to acquire a first candidate communication index table, which includes: a first candidate device identifier of at least one second candidate communication device that can establish a communication connection with the first communication device, and a first candidate communication address of each second candidate communication device;
[0030] The calculation module is used to calculate the communication distance between the first communication device and each of the second candidate communication devices based on the first communication address and each of the first candidate communication addresses;
[0031] The determining module is configured to determine a second target communication device that matches the first communication device in the first candidate communication index table based on the communication distances described.
[0032] In an optional implementation, the determining module is specifically used for:
[0033] Based on the communication distances described, a second communication device that matches the first communication device is determined in the first candidate communication index table, wherein the matching second communication device has the closest communication distance to the first communication device;
[0034] Send a pairing request message to the matched second communication device, the pairing request message including the first device identifier of the first communication device;
[0035] The matching result is received from the matching second communication device, wherein the matching result is determined by the matching second communication device after executing a preset status detection algorithm according to the matching request message, and the matching result is used to indicate whether the pairing is successful.
[0036] In an optional implementation, the preset state detection algorithm includes at least one of the following:
[0037] Determine whether the idle channel of the matched second communication device meets the first preset requirement;
[0038] Determine whether the idle computing resources of the matched second communication device meet the second preset requirements;
[0039] Determine whether the number of first communication devices currently matched with the second matching communication device meets a third preset requirement.
[0040] In an optional implementation, the first communication device is a passive IoT terminal and the second communication device is a first relay node; or, the first communication device is a first relay node and the second communication device is a passive IoT terminal.
[0041] In an optional implementation, if the first communication device is a first relay node, the second communication device is a passive IoT terminal, and the first communication device is also connected to at least one third communication device in the data communication system, the third communication device is a second relay node, the second relay node includes a second candidate communication index table, the second candidate communication index table includes: a second optional device identifier of at least one second optional communication device that can establish a communication connection with the second relay node, and a second optional communication address of each second optional communication device;
[0042] The determining module is specifically used for:
[0043] Send an interaction request to each of the second relay nodes, the interaction request carrying the first candidate communication index table corresponding to the first relay node;
[0044] The system receives interaction response messages returned by each of the second relay nodes in accordance with the interaction request. The interaction response messages are used to indicate whether the second target communication device needs to be updated. The interaction response messages are determined by each of the second relay nodes based on the first candidate communication index table and the second candidate communication index table.
[0045] In an optional implementation, the interactive response message is specifically determined by the second relay node based on the first candidate device identifier in the first candidate communication index table and the second optional device identifier in the second candidate communication index table. If the second relay node determines that there is a second target optional device identifier that is the same as the second target candidate device identifier, and the second communication distance is less than the first communication distance, then the interactive response message instructs the first relay node to delete the second target candidate device identifier and the first candidate communication address corresponding to the second target candidate device identifier from the first candidate communication index table, and to determine the second target communication device based on the updated first candidate communication index table.
[0046] The first communication distance is used to indicate the communication distance between the first relay node and the second target candidate device identifier, and the second communication distance is used to indicate the communication distance between the second relay node and the second target optional device identifier.
[0047] In an optional implementation, the data communication device further includes an update module, configured to update the first candidate communication index table if a second candidate communication device in a disconnected state is detected in the first candidate communication index table, or if a newly connected second communication device is detected in the data communication system.
[0048] Thirdly, the present invention provides an electronic device, comprising: a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of any of the data communication methods described in the foregoing embodiments.
[0049] Fourthly, the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of any of the data communication methods described in the foregoing embodiments.
[0050] The beneficial effects of this application are:
[0051] The data communication method, apparatus, electronic device, and storage medium provided in this application embodiment can be applied to a first communication device in a data communication system. The first communication device is communicatively connected to at least one second communication device in the data communication system. The first communication device is configured to include a first communication address, and each second communication device is configured to include a second communication address. The method includes: obtaining a first candidate communication index table, the first candidate communication index table including: a first candidate device identifier of at least one second candidate communication device that can establish a communication connection with the first communication device, and a first candidate communication address of each second candidate communication device; calculating the communication addresses of the first communication device and each second candidate communication device based on the first communication address and each first candidate communication address. The communication distance between the second candidate communication devices; based on each communication distance, a second target communication device matching the first communication device is determined in the first candidate communication index table. This enables the forwarding of terminal data acquired by the passive IoT terminal through the newly introduced communication device, avoiding the passive IoT terminal from directly forwarding to external devices, thereby saving the power of the passive IoT terminal, reducing the probability of data transmission interruption due to insufficient power during data transmission, and improving the reliability of the data transmission method; in addition, this application can match a suitable second target communication device for the first communication device based on the communication distance, thereby shortening the communication time between the first communication device and the second target communication device and improving communication efficiency. Attached Figure Description
[0052] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0053] Figure 1An architecture diagram of a data communication system provided in this application embodiment;
[0054] Figure 2 A flowchart illustrating a data communication method provided in an embodiment of this application;
[0055] Figure 3 A flowchart illustrating another data communication method provided in an embodiment of this application;
[0056] Figure 4 A flowchart illustrating yet another data communication method provided in an embodiment of this application;
[0057] Figure 5 A flowchart illustrating another data communication method provided in an embodiment of this application;
[0058] Figure 6 This is a schematic diagram of the functional modules of another data communication device provided in an embodiment of this application;
[0059] Figure 7 This is a schematic diagram of an electronic device structure provided in an embodiment of this application. Detailed Implementation
[0060] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0061] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0062] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0063] With the continuous advancement of energy harvesting technology, passive IoT (Ambient IoT), or the Internet of Things without batteries, has emerged. Ambient IoT terminals are IoT devices that are powered through external energy harvesting or limited energy storage capacity (such as capacitors). They acquire energy through wireless radio frequency signals, solar energy, sunlight, kinetic energy, and temperature differences. Using dedicated energy harvesting devices, this energy can be collected to power IoT devices. Furthermore, due to their extremely simple structure, maintenance-free lifespan, and environmental friendliness, passive IoT terminals are widely used in sensor data reporting scenarios such as smart grids and smart farms.
[0064] However, due to the unique way passive IoT terminals obtain power, when sending acquired data to servers or base stations through passive IoT terminals, there is often a problem of data transmission interruption due to insufficient energy. Therefore, the existing data transmission methods have the problem of low reliability.
[0065] In view of this, this application provides a data communication method that can improve the reliability of data transmission.
[0066] Figure 1 An architecture diagram of a data communication system provided in this application embodiment is shown below. Figure 1 As shown, the data communication system includes at least one first communication device 110 and at least one second communication device 120, wherein each first communication device 110 is communicatively connected to at least one second communication device 120 in the data communication system. Optionally, the first communication device 110 can be a passive IoT terminal, and the second communication device 120 can be a first relay node; or, the first communication device 110 can be a first relay node, and the second communication device 120 can be a passive IoT terminal, which is not limited here. Of course, this application does not limit the specific communication method between the first communication device 110 and each of the second communication devices 120. Depending on the actual application scenario, communication connections can be established through various communication methods such as low-power Wi-Fi, low-power Bluetooth, NB-IoT, ZigBee, and LoRa.
[0067] Taking the first communication device 110 as the first relay node and the second communication device 120 as a passive IoT terminal as an example, during data communication, the second communication device 120 can send the collected terminal data to the first communication device 110, which can then forward it to the external device 130. Optionally, the external device 130 can be a target base station, server, etc., without limitation. By implementing this application, the terminal data obtained by the passive IoT terminal can be forwarded through the newly introduced communication device, avoiding the passive IoT terminal from directly forwarding to the external device. This can save the power of the passive IoT terminal, reduce the probability of data transmission interruption due to insufficient power during data transmission, and improve the reliability of the data transmission method.
[0068] In some embodiments, the passive IoT terminal described above can be an environmental monitoring unit for temperature, humidity, noise, light, wind speed, air quality, etc., or it can be a device operation status monitoring unit for voltage, current, vibration, etc.; or it can be an image acquisition unit for acquiring passenger and freight flow, personnel activity information, etc., which is not limited here.
[0069] In some embodiments, the first relay node may be any of the following types of communication devices: 5G terminal (NR UE), LTE terminal (LTE UE), NB-IoT terminal, dedicated relay base station, wireless CPE node, edge computing platform, edge gateway, passive IoT terminal of the same type, third-party power device with protocol conversion function, third-party power amplifier and forwarding device with transmission protocol compatibility, etc., without limitation, and may vary depending on the actual application scenario.
[0070] Figure 2 This is a flowchart illustrating a data communication method provided in an embodiment of this application. The method can be applied to a first communication device in the aforementioned data communication system. The first communication device can be configured to include a first communication address, and each second communication device can be configured to include a second communication address. The first communication address can indicate the coordinate information of the first communication device, and the second communication address can indicate the coordinate information of the second communication device.
[0071] Optionally, the aforementioned coordinate information can be any of the following types of coordinate information: GPS system positioning coordinate information, BeiDou system positioning coordinate information, GLONASS system positioning coordinate information, absolute coordinate positioning information, relative coordinate positioning information, real-time coordinate positioning information, etc., without limitation. Taking the first communication device as an example, in some embodiments, the first communication address can be obtained through a positioning unit integrated within the first communication device. For example, this positioning unit can specifically be a GPS positioning unit, a BeiDou positioning unit, etc., without limitation. Of course, in some embodiments, the first communication address can also be pre-specified by the configuration personnel. For example, the first communication address can be set to A001, X_001, etc., without limitation on the specific form of the first communication address.
[0072] Based on the above explanation, as Figure 2 As shown, the method includes:
[0073] S101. Obtain a first candidate communication index table, which includes: the first candidate device identifier of at least one second candidate communication device that can establish a communication connection with the first communication device, and the first candidate communication address of each second candidate communication device.
[0074] Optionally, each of the second communication devices can send a broadcast message to the data communication system in a broadcast manner after its first power-on. The broadcast message can carry the second communication address and second communication identifier of the corresponding second communication device.
[0075] For a first communication device in a data communication system, if it receives a broadcast message, it indicates that the first communication device can communicate with the second communication device corresponding to the broadcast message. At this time, the first communication device can generate a first candidate communication index table based on the received broadcast message. The generated first candidate communication index table may include: a first candidate device identifier of at least one second candidate communication device and a first candidate communication address of each second candidate communication device. Each second candidate communication device is the second communication device corresponding to each received broadcast message, each first candidate device identifier is the second communication identifier carried in each received broadcast message, and each first candidate communication address is the second communication address carried in each received broadcast message.
[0076] It is worth noting that if the first communication device receives multiple broadcast messages from multiple second communication devices within the same time period, the resulting first candidate communication index table will include the first candidate device identifiers and first candidate communication addresses of the multiple second candidate communication devices. Of course, this application does not limit the number of first candidate communication addresses in the first candidate communication index table; it may include one or more depending on the actual application scenario.
[0077] Optionally, the second communication identifier may include, but is not limited to: ID information, product serial number, name information, IP address information, MAC address information, and information about the manufacturer of the device. Furthermore, if the second communication device is a passive physical network terminal, its corresponding ID information may include, but is not limited to: device identification identifier information, device serial number (SerialNumber) information, temporary mobile subscriber identity information (TMSI), globally unique temporary mobile subscriber identity information (GUTI), and radio network temporary identifier information (RNTI).
[0078] S102. Calculate the communication distance between the first communication device and each of the second candidate communication devices based on the first communication address and each of the first candidate communication addresses.
[0079] The first communication device calculates the communication distance between the first communication address and each of the first candidate communication addresses to obtain the communication distance between the first communication device and each of the second candidate communication devices. The magnitude of this communication distance indicates the physical distance between the first communication device and each of the second candidate communication devices. A larger communication distance indicates a greater physical distance between the first communication device and the corresponding second candidate communication device; conversely, a larger distance indicates a closer physical distance.
[0080] S103. Based on the communication distance, determine the second target communication device that matches the first communication device in the first candidate communication index table.
[0081] After obtaining the communication distances, a second target communication device that matches the first communication device can be selected from the first candidate communication index table based on the communication distance. By applying the embodiments of this application, a suitable second target communication device can be matched for the first communication device based on the communication distance, thereby achieving the pairing of the first communication device and the second target communication device, which can shorten the communication time between the first communication device and the second target communication device and improve communication efficiency.
[0082] Understandably, if the first communication device is a passive IoT terminal and the second target communication device is a first target relay node, then the passive IoT terminal can send the acquired terminal data to the first target relay node, which will then forward the terminal data to external devices. Conversely, if the first communication device is a first relay node and the second target communication device is a passive IoT target terminal, then the passive IoT target terminal can send the acquired terminal data to the first relay node, which will then send the terminal data to external devices.
[0083] In summary, this application provides a data communication method that can be applied to a first communication device in a data communication system. The first communication device is communicatively connected to at least one second communication device in the data communication system. The first communication device is configured to include a first communication address, and each second communication device is configured to include a second communication address. The method includes: obtaining a first candidate communication index table, which includes: a first candidate device identifier of at least one second candidate communication device capable of establishing a communication connection with the first communication device, and a first candidate communication address of each second candidate communication device; calculating the communication address between the first communication device and each second candidate communication device based on the first communication address and the first candidate communication address. The communication distance between communication devices is determined. Based on the communication distance, a second target communication device matching the first communication device is determined in the first candidate communication index table. This enables the forwarding of terminal data acquired by the passive IoT terminal through the newly introduced communication device, avoiding the passive IoT terminal from directly forwarding data to external devices, thereby saving the power of the passive IoT terminal, reducing the probability of data transmission interruption due to insufficient power during data transmission, and improving the reliability of the data transmission method. In addition, this application can match a suitable second target communication device for the first communication device based on the communication distance, thereby shortening the communication time between the first communication device and the second target communication device and improving communication efficiency. Figure 3 This is a flowchart illustrating another data communication method provided in an embodiment of this application. Optionally, as... Figure 3 As shown, the above-mentioned determination of a second target communication device matching the first communication device in the first candidate communication index table based on various communication distances includes:
[0084] S201. Based on the communication distance, determine the second communication device that matches the first communication device in the first candidate communication index table.
[0085] Among them, the second communication device that matches the first communication device has the shortest communication distance. In some embodiments, the above-mentioned communication distance can be calculated based on distance calculation algorithms such as Euclidean distance and Manhattan distance, which is not limited here.
[0086] Optionally, when determining the second communication device that matches the first communication device, it can be determined by sorting the communication distances in ascending or descending order. In other words, the second candidate communication device located at the first sorting position or the last sorting position can be determined as the second communication device that matches the first communication device.
[0087] S202. Send a pairing request message to a matching second communication device. The pairing request message includes the first device identifier of the first communication device.
[0088] S203. Receive the pairing result returned by the matching second communication device, wherein the pairing result is determined by the matching second communication device after executing a preset status detection algorithm according to the pairing request message, and the pairing result is used to indicate whether the pairing is successful.
[0089] In this process, by sending a pairing request message to a matching second communication device, it can be determined whether the current operating status of the matching second communication device is suitable for successful pairing with the first communication device. For example, if the matching second communication device is unable to forward messages in a timely manner due to insufficient computing resources, then pairing may fail. Specifically, upon receiving the pairing request message, the matching second communication device can trigger the execution of a preset status detection algorithm to generate a pairing result, indicating whether the pairing was successful. If the pairing result indicates successful pairing, the matching second communication device can be identified as the second target communication device; otherwise, the relevant information of the matching second communication device can be deleted from the first candidate communication index table to further identify a new matching second communication device, and pairing can be re-performed according to the above pairing logic until the pairing result indicates successful pairing.
[0090] By applying the embodiments of this application, during the pairing process, the current operating status of the second communication device can be combined to determine whether the pairing is successful. In other words, bidirectional selection between the first and second communication devices can be realized, increasing the flexibility of pairing. Consequently, when data communication is carried out based on the paired first and second communication devices, the communication efficiency and reliability can be improved.
[0091] Optionally, the aforementioned preset state detection algorithm includes at least one of the following:
[0092] Determine whether the idle channel of the matching second communication device meets the first preset requirement; determine whether the idle computing resources of the matching second communication device meet the second preset requirement; determine whether the number of first communication devices currently matched with the matching second communication device meets the third preset requirement.
[0093] For the second communication device, according to the preset state detection algorithm, it can obtain any of the following parameters in real time: the current idle channel parameters, the current idle computing power resource parameters, and the number of currently matched first communication devices; compare whether the obtained parameters meet the corresponding preset requirements. If they do, a successful pairing result can be generated; otherwise, a failed pairing result will be generated.
[0094] Optionally, the current idle channel parameters may include: the current idle channel bandwidth, transmission rate, signal-to-noise ratio, channel gain, noise power, etc.; the current idle computing power resource parameters may include: the current memory occupancy rate, storage capacity, etc.; the number of currently matched first communication devices may indicate the number of first communication devices that have been successfully paired with the second communication device.
[0095] Of course, it should be noted that the preset state detection algorithm is not limited to what is shown above, and may also include detection conditions depending on the actual application scenario.
[0096] Furthermore, depending on the actual application scenario, the preset state detection algorithm can also be set with a timer. If the matching second communication device still indicates pairing failure when the timer reaches its set time, the final pairing result can be determined to be pairing failure. If the matching second communication device changes from pairing failure to pairing success when the timer reaches its set time, the final pairing result can be determined to be pairing success. By applying the embodiments of this application, the flexibility of the data communication method of this application can be improved.
[0097] Figure 4 This is a flowchart illustrating another data communication method provided in an embodiment of this application. If the first communication device is a first relay node, the second communication device is a passive IoT terminal, and the first communication device is also connected to at least one third communication device in the data communication system, the third communication device is a second relay node. The second relay node includes a second candidate communication index table, which includes: a second optional device identifier of at least one second optional communication device capable of establishing a communication connection with the second relay node, and a second optional communication address of each second optional communication device.
[0098] As can be seen from the above description, the data communication system may include a first relay node and at least one second relay node. Each second relay node may include a second candidate communication index table. The generation method of the second candidate communication index table can be referred to the generation method of the first candidate communication index table mentioned above, and will not be repeated here.
[0099] Optionally, such as Figure 4As shown, the above-mentioned determination of a second target communication device matching the first communication device in the first candidate communication index table based on various communication distances includes:
[0100] S301. Send an interaction request to each of the second relay nodes. The interaction request carries the first candidate communication index table corresponding to the first relay node.
[0101] In some embodiments, considering that the data communication system may include multiple relay nodes, and the same second communication device may be successfully paired with multiple relay nodes at the same time, which may lead to a waste of relay node resources, the first communication device (i.e., the first relay node) may send an interaction request to each second relay node, carrying the first candidate communication index table corresponding to the first relay node.
[0102] S302. Receive the interaction response message returned by each second relay node according to the interaction request. The interaction response message is used to indicate whether the second target communication device needs to be updated.
[0103] The interactive response message is determined by each second relay node based on the first candidate communication index table and the second candidate communication index table.
[0104] After receiving the interaction request, each second relay node can determine the interaction response message based on its own second candidate communication index table and the first candidate communication index table carried in the interaction request, and return it to the first relay node.
[0105] The interactive response message can be used to indicate whether the second target communication device needs to be updated. If an update is required, the first relay node can delete the second target candidate device identifier and the corresponding first candidate communication address from the first candidate communication index table to obtain a new first candidate communication index table. Based on the new first candidate communication index table, and referring to the aforementioned method, a new second target communication device can be further determined. If no update is required, no operation is necessary.
[0106] Optionally, the interactive response message is specifically determined by the second relay node based on the first candidate device identifier in the first candidate communication index table and the second optional device identifier in the second candidate communication index table. If the second relay node determines that there exists a second target optional device identifier that is identical to the second target candidate device identifier, and the second communication distance is less than the first communication distance, then the interactive response message instructs the first relay node to delete the second target candidate device identifier and the corresponding first candidate communication address from the first candidate communication index table, and to determine the second target communication device based on the updated first candidate communication index table. The first communication distance indicates the communication distance between the first relay node and the second target candidate device identifier, and the second communication distance indicates the communication distance between the second relay node and the second target optional device identifier.
[0107] Based on the above explanation, the second relay node can determine whether there is a matching device identifier in the second candidate communication index table based on the first candidate communication index table. If there is, and the communication distance between the second relay node and the second target optional device identifier is less than the communication distance between the second relay node and the second target optional device identifier, it means that the second communication device corresponding to the second target optional device identifier is more suitable for matching with the second relay node; if it is greater, it means that the second communication device corresponding to the second target optional device identifier is more suitable for matching with the first relay node.
[0108] It is worth noting that the second target optional device identifier and the second target optional device identifier correspond to the same second communication device identifier.
[0109] By applying the embodiments of this application, in the case of a data communication system including multiple relay nodes and multiple passive IoT terminals, suitable passive IoT terminals can be paired for each relay node, realizing bidirectional selection between passive IoT terminals and relay nodes, avoiding resource waste, and reducing communication conflicts.
[0110] Figure 5 This is a flowchart illustrating another data communication method provided in an embodiment of this application. Optionally, as... Figure 5 As shown, the above method also includes:
[0111] S401. If a second candidate communication device that is offline is detected in the first candidate communication index table, or if a newly online second communication device is detected in the data communication system, then update the first candidate communication index table.
[0112] Based on the above description, considering that in actual communication processes, data communication systems often have second communication devices that suddenly go offline or come online, and in order to make this application applicable to this application scenario, the first communication device can monitor the communication status of each second communication device in the data communication system in real time.
[0113] Specifically, if monitoring determines that a second candidate communication device is offline in the current first candidate communication index table, then the first candidate device identifier and first candidate communication address of the offline second candidate communication device in the first candidate communication index table can be deleted, thereby updating the first candidate communication index table. Conversely, if a newly online second communication device is detected in the data communication system, the second device identifier and second communication address of the newly online second communication device can be added to the first candidate communication index table, thereby updating the first candidate communication index table. By applying the embodiments of this application, the first candidate communication index table can be updated in a timely manner when the communication status of the second communication device in the data communication system changes, thereby ensuring the effectiveness of subsequent data communication and improving the applicability of the method of this application.
[0114] In summary, by applying the embodiments of this application, bidirectional pairing between passive IoT terminals and relay nodes can be achieved, ensuring the reliability of terminal data uploaded to servers or base stations through relay nodes, and improving data transmission efficiency. In addition, during data transmission, the function of interaction between relay nodes is introduced to eliminate the possibility of multiple relay nodes connecting to the same passive IoT terminal at the same time, avoiding resource waste and reducing conflicts.
[0115] Figure 6 This is a functional block diagram of a data communication device provided in an embodiment of this application. The device can be applied to a first communication device in a data communication system. The first communication device is communicatively connected to at least one second communication device in the data communication system. The first communication device is configured to include a first communication address, and each second communication device is configured to include a second communication address. The basic principle and technical effects of this device are the same as those in the aforementioned corresponding method embodiments. For the sake of brevity, parts not mentioned in this embodiment can be referred to the corresponding content in the method embodiments. Figure 6 As shown, the data communication device 200 includes:
[0116] The acquisition module 210 is used to acquire a first candidate communication index table, which includes: a first candidate device identifier of at least one second candidate communication device that can establish a communication connection with the first communication device, and a first candidate communication address of each second candidate communication device;
[0117] The calculation module 220 is used to calculate the communication distance between the first communication device and each of the second candidate communication devices based on the first communication address and each of the first candidate communication addresses;
[0118] The determination module 230 is used to determine a second target communication device that matches the first communication device in the first candidate communication index table based on each communication distance.
[0119] In an optional implementation, the determining module 230 is specifically used for:
[0120] Based on the communication distances, a second communication device that matches the first communication device is determined in the first candidate communication index table, wherein the matching second communication device has the shortest communication distance to the first communication device;
[0121] Send a pairing request message to a matching second communication device. The pairing request message includes the first device identifier of the first communication device.
[0122] The matching result is received from the matching second communication device. The matching result is determined by the matching second communication device after executing a preset status detection algorithm based on the matching request message. The matching result is used to indicate whether the pairing is successful.
[0123] In an optional implementation, the preset state detection algorithm includes at least one of the following:
[0124] Determine whether the idle channel of the matching second communication device meets the first preset requirement;
[0125] Determine whether the idle computing resources of the matching second communication device meet the second preset requirements;
[0126] Determine whether the number of currently matched first communication devices meets the third preset requirement.
[0127] In an optional implementation, the first communication device is a passive IoT terminal and the second communication device is a first relay node; or, the first communication device is a first relay node and the second communication device is a passive IoT terminal.
[0128] In an optional implementation, if the first communication device is a first relay node, the second communication device is a passive IoT terminal, and the first communication device is also connected to at least one third communication device in the data communication system, the third communication device is a second relay node, and the second relay node includes a second candidate communication index table, which includes: a second optional device identifier of at least one second optional communication device that can establish a communication connection with the second relay node, and a second optional communication address of each second optional communication device;
[0129] Module 230 is specifically used for:
[0130] Send an interaction request to each of the second relay nodes. The interaction request carries the first candidate communication index table corresponding to the first relay node.
[0131] The system receives interaction response messages returned by each second relay node based on the interaction request. The interaction response messages are used to indicate whether the second target communication device needs to be updated. The interaction response messages are determined by each second relay node based on the first candidate communication index table and the second candidate communication index table.
[0132] In an optional implementation, the interactive response message is specifically determined by the second relay node based on the first candidate device identifier in the first candidate communication index table and the second optional device identifier in the second candidate communication index table. If the second relay node determines that there is a second target optional device identifier that is the same as the second target candidate device identifier, and the second communication distance is less than the first communication distance, the interactive response message instructs the first relay node to delete the second target candidate device identifier and the first candidate communication address corresponding to the second target candidate device identifier from the first candidate communication index table, and to determine the second target communication device based on the updated first candidate communication index table.
[0133] The first communication distance is used to indicate the communication distance between the first relay node and the second target candidate device identifier, and the second communication distance is used to indicate the communication distance between the second relay node and the second target optional device identifier.
[0134] In an optional implementation, the data communication device further includes an update module, configured to update the first candidate communication index table if a second candidate communication device in a disconnected state is detected in the first candidate communication index table, or if a newly connected second communication device is detected in the data communication system.
[0135] The above-described device is used to execute the method provided in the foregoing embodiments, and its implementation principle and technical effect are similar, so they will not be described again here.
[0136] These modules can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more microprocessors, or one or more Field Programmable Gate Arrays (FPGAs). Alternatively, when a module is implemented using processing element scheduler code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. Furthermore, these modules can be integrated together as a system-on-a-chip (SOC).
[0137] Figure 7 This is a schematic diagram of an electronic device provided in an embodiment of this application. This electronic device can be integrated into the aforementioned data communication device. Figure 7 As shown, the electronic device may include a processor 310, a storage medium 320, and a bus 330. The storage medium 320 stores machine-readable instructions executable by the processor 310. When the electronic device is running, the processor 310 communicates with the storage medium 320 via the bus 330, and the processor 310 executes the machine-readable instructions to perform the steps of the above method embodiment. The specific implementation and technical effects are similar and will not be described in detail here.
[0138] Optionally, this application also provides a storage medium storing a computer program, which, when run by a processor, executes the steps of the above-described method embodiments. The specific implementation and technical effects are similar and will not be repeated here.
[0139] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0140] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0141] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in a combination of hardware and software functional units.
[0142] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0143] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0144] The above are merely preferred embodiments of this application and are not intended to limit this application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application. It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need further definition and explanation in subsequent figures. The above are merely preferred embodiments of this application and are not intended to limit this application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A data communication method, characterized in that, A first communication device applied in a data communication system, the first communication device being communicatively connected to at least one second communication device in the data communication system, the first communication device being configured to include a first communication address, and each of the second communication devices being configured to include a second communication address, the method comprising: Obtain a first candidate communication index table, which includes: a first candidate device identifier of at least one second candidate communication device that can establish a communication connection with the first communication device, and a first candidate communication address of each second candidate communication device; Based on the first communication address and each of the first candidate communication addresses, calculate the communication distance between the first communication device and each of the second candidate communication devices; Based on the communication distances described, a second target communication device that matches the first communication device is determined in the first candidate communication index table; The first communication device is a first relay node, the second communication device is a passive IoT terminal, and the first communication device is also connected to at least one third communication device in the data communication system. The third communication device is a second relay node, and the second relay node includes a second candidate communication index table. The step of determining a second target communication device matching the first communication device in the first candidate communication index table based on each of the communication distances includes: Send an interaction request to each of the second relay nodes, the interaction request carrying the first candidate communication index table corresponding to the first relay node; The system receives interactive response messages returned by each of the second relay nodes based on the interactive request. The interactive response messages are used to indicate whether the second target communication device needs to be updated. The interactive response messages are determined by each of the second relay nodes based on the first candidate communication index table and the second candidate communication index table. The second relay node is configured such that if it is determined that there is a second target candidate device identifier in the second candidate communication index table that is the same as the second target candidate device identifier, and the second communication distance is less than the first communication distance, the interactive response message instructs the first relay node to delete the second target candidate device identifier and the first candidate communication address corresponding to the second target candidate device identifier in the first candidate communication index table, and to determine the second target communication device according to the updated first candidate communication index table.
2. The method according to claim 1, characterized in that, The step of determining a second target communication device matching the first communication device in the first candidate communication index table based on each of the communication distances includes: Based on the communication distances described, a second communication device that matches the first communication device is determined in the first candidate communication index table, wherein the matching second communication device has the closest communication distance to the first communication device; Send a pairing request message to the matched second communication device, the pairing request message including the first device identifier of the first communication device; The matching result is received from the matching second communication device, wherein the matching result is determined by the matching second communication device after executing a preset status detection algorithm according to the matching request message, and the matching result is used to indicate whether the pairing is successful.
3. The method according to claim 2, characterized in that, The preset state detection algorithm includes at least one of the following: Determine whether the idle channel of the matched second communication device meets the first preset requirement; Determine whether the idle computing resources of the matched second communication device meet the second preset requirements; Determine whether the number of first communication devices currently matched with the second matching communication device meets the third preset requirement.
4. The method according to claim 1, characterized in that, The second candidate communication index table includes: a second optional device identifier of at least one second optional communication device that can establish a communication connection with the second relay node, and a second optional communication address of each second optional communication device.
5. The method according to claim 4, characterized in that, The interactive response message is specifically determined by the second relay node based on the first candidate device identifier in the first candidate communication index table and the second optional device identifier in the second candidate communication index table; The first communication distance is used to indicate the communication distance between the first relay node and the second target candidate device identifier, and the second communication distance is used to indicate the communication distance between the second relay node and the second target optional device identifier.
6. The method according to any one of claims 1-5, characterized in that, The method further includes: If a second candidate communication device that is offline is detected in the first candidate communication index table, or if a newly online second communication device is detected in the data communication system, then the first candidate communication index table is updated.
7. A data communication device, characterized in that, A first communication device applied in a data communication system, the first communication device being communicatively connected to at least one second communication device in the data communication system, the first communication device being configured to include a first communication address, and each of the second communication devices being configured to include a second communication address, the data communication device comprising: The acquisition module is used to acquire a first candidate communication index table, which includes: a first candidate device identifier of at least one second candidate communication device that can establish a communication connection with the first communication device, and a first candidate communication address of each second candidate communication device; The calculation module is used to calculate the communication distance between the first communication device and each of the second candidate communication devices based on the first communication address and each of the first candidate communication addresses; The determining module is configured to determine a second target communication device that matches the first communication device in the first candidate communication index table based on the communication distances described above. The first communication device is a first relay node, the second communication device is a passive IoT terminal, and the first communication device is also connected to at least one third communication device in the data communication system. The third communication device is a second relay node, and the second relay node includes a second candidate communication index table. The determining module is specifically used to send an interaction request to each of the second relay nodes, the interaction request carrying a first candidate communication index table corresponding to the first relay node; The system receives interactive response messages returned by each of the second relay nodes based on the interactive request. The interactive response messages are used to indicate whether the second target communication device needs to be updated. The interactive response messages are determined by each of the second relay nodes based on the first candidate communication index table and the second candidate communication index table. The second relay node is configured such that if it is determined that there is a second target candidate device identifier in the second candidate communication index table that is the same as the second target candidate device identifier, and the second communication distance is less than the first communication distance, the interactive response message instructs the first relay node to delete the second target candidate device identifier and the first candidate communication address corresponding to the second target candidate device identifier in the first candidate communication index table, and to determine the second target communication device according to the updated first candidate communication index table.
8. An electronic device, characterized in that, include: The device includes a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is in operation, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the data communication method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the data communication method as described in any one of claims 1-6.
Citation Information
Patent Citations
Relay selection optimization method based on Internet of Vehicles and urban Internet of Things
CN110381465A