Data transmission method and device, electronic equipment and readable storage medium
By using mutual aid devices to obtain the target logical address in a complex network environment and sending data using the physical address routing table, the problem of finding the data transmission path is solved, and the accuracy and stability of data transmission are achieved.
Patent Information
- Application Number
- CN202311791551.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-22
- Publication Date
- 2025-06-24
AI Technical Summary
In a complex network environment, how to accurately find the transmission path of the data to be transmitted to ensure the accurate transmission of data has become a technical problem that needs to be solved urgently.
Through the connection between the mutual aid device and the routing device and the sub-device, the target logical address in the data to be transmitted is obtained, and the data is sent to the routing device or sub-device according to the physical address routing table to ensure the accuracy of the transmission path.
It ensures the accuracy and stability of data transmission in complex network environments, and improves the networking experience of sub-device.
Smart Images

Figure CN120200970A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet of Things technology, and in particular, to a data transmission method, a transmission device, an electronic device, and a readable storage medium. Background Art
[0002] In the related art, during the process of data transmission between electronic devices, it is necessary to accurately find the address of the electronic device to which the data needs to be transmitted to ensure the accurate transmission of the data. However, in the actual operation process, the number of electronic devices connected to the same network is large, and the connection methods are complex. Therefore, in a complex network environment, how to accurately find the transmission path of the data to be transmitted to ensure the accurate transmission of the data has become a technical problem to be solved urgently. Summary of the Invention
[0003] The present application aims to solve at least one of the technical problems existing in the prior art.
[0004] To this end, the first aspect of the present application provides a data transmission method.
[0005] The second aspect of the present application provides a data transmission method.
[0006] The third aspect of the present application provides a data transmission device.
[0007] The fourth aspect of the present application provides a data transmission device.
[0008] The fifth aspect of the present application provides an electronic device.
[0009] The sixth aspect of the present application provides a computer-readable storage medium.
[0010] The seventh aspect of the present application provides a computer program product.
[0011] The first aspect of the present application provides a data transmission method, which is executed by a mutual assistance device. The mutual assistance device is connected to a routing device, the routing device is connected to a first network, and the mutual assistance device is connected to a sub-device. The transmission method includes: when receiving data to be transmitted, obtaining a target logical address in the data to be transmitted; when the target logical address does not correspond to the first physical address of the mutual assistance device, obtaining a physical address routing table of the first network; and sending the data to be transmitted to the routing device or the sub-device according to the physical address routing table.
[0012] The data transmission method provided by the present application is executed by a mutual assistance device. The mutual assistance device is connected to a routing device, the routing device is connected to a first network, and the mutual assistance device is connected to a sub-device. That is, the mutual assistance device is connected to the first network through the routing device, and the sub-device is connected to the first network through the mutual assistance device.
[0013] It is understandable that when the sub-device does not meet the connection conditions of the first network, that is, when the sub-device cannot directly connect to the first network through the routing device, at least one mutual assistance device is searched. Among them, the mutual assistance device is connected to the first network, that is, the mutual assistance device is connected to the routing device of the first network, so as to realize connecting to the first network through the routing device. Thus, when the signal strength of the network signal of the routing device received by the sub-device is low and it is impossible to ensure continuous and stable connection to the first network through the routing device, continuous and stable connection to the first network is realized through the mutual assistance device, improving the networking experience of the sub-device.
[0014] Furthermore, during the data transmission process, when the mutual assistance device receives the data to be transmitted, it can detect the target logical address of the data to be transmitted according to the received transmission data, that is, the device to which the data to be transmitted needs to be transferred. If it is detected that the target logical address does not correspond to the first physical address of the mutual assistance device, at this time, the mutual assistance device can directly obtain the physical address routing table of the first network, and then send the data to be transmitted to the routing device or transmit it to the sub-device connected to the mutual assistance device according to the physical address routing table.
[0015] The data transmission method provided by this application is executed by the mutual assistance device. The mutual assistance device is connected to the routing device, the routing device is connected to the first network, and the mutual assistance device is connected to the sub-device. Furthermore, when the mutual assistance device receives the data to be transmitted, it can detect the target logical address of the data to be transmitted according to the received transmission data, that is, the device to which the data to be transmitted needs to be transferred. If it is detected that the target logical address does not correspond to the first physical address of the mutual assistance device, the mutual assistance device can send the data to be transmitted to the routing device or transmit it to the sub-device connected to the mutual assistance device according to the physical address routing table to ensure the accuracy of the transmission path of the data to be transmitted.
[0016] According to the second aspect of this application, a data transmission method is proposed, which is executed by the sub-device. The sub-device is connected to the mutual assistance device, the mutual assistance device is connected to the routing device, and the routing device is connected to the first network. The transmission method includes: detecting the first physical address of the mutual assistance device; when the first physical address is detected, sending the data to be transmitted to the mutual assistance device corresponding to the first physical address; when the first physical address is not detected, sending the data to be transmitted to the routing device.
[0017] The data transmission method provided by this application, during the data transmission process, when the data to be transmitted is generated by a sub-device, the first physical address of the mutual assistance device connected to the sub-device can be detected according to the generated transmission data. If the first physical address of the mutual assistance device can be detected, the data to be transmitted is directly sent to the mutual assistance device according to the first physical address.
[0018] If the first physical address of the mutual assistance device is not detected, it indicates that the data to be transmitted can only be sent to the routing device. At this time, the sub-device can directly send the data to be transmitted to the routing device level by level.
[0019] The data transmission method provided by this application is executed by a sub-device. The sub-device is connected to a mutual assistance device, the mutual assistance device is connected to a routing device, and the routing device is connected to a first network. Further, when the sub-device generates data to be transmitted, if the first physical address of the mutual assistance device can be obtained, the data to be transmitted is directly sent to the mutual assistance device corresponding to the first physical address. If the first physical address is not detected, the data to be transmitted is sent to the routing device. To ensure the accuracy of the transmission path of the data to be transmitted.
[0020] According to the third aspect of this application, a data transmission device is proposed for a mutual assistance device. The mutual assistance device is connected to a routing device, the routing device is connected to a first network, and the mutual assistance device is connected to a sub-device. The transmission device includes: an acquisition unit, configured to acquire the target logical address in the data to be transmitted when receiving the data to be transmitted; the acquisition unit is further configured to acquire the physical address routing table of the first network when the target logical address does not correspond to the first physical address; a transmission unit, configured to send the data to be transmitted to the routing device or the sub-device according to the physical address routing table.
[0021] The data transmission device provided by this application is executed by a mutual assistance device. The mutual assistance device is connected to a routing device, the routing device is connected to a first network, and the mutual assistance device is connected to a sub-device. Further, when the mutual assistance device receives the data to be transmitted, the target logical address of the data to be transmitted, that is, the device to which the data to be transmitted needs to be delivered, can be detected according to the received transmission data. If it is detected that the target logical address does not correspond to the first physical address of the mutual assistance device, the mutual assistance device can send the data to be transmitted to the routing device or transmit it to the sub-device connected to the mutual assistance device according to the physical address routing table, to ensure the accuracy of the transmission path of the data to be transmitted.
[0022] According to the fourth aspect of the present application, a data transmission device is provided, which is executed by a sub-device. The sub-device is connected to a mutual assistance device, the mutual assistance device is connected to a routing device, and the routing device is connected to a first network. The transmission device includes: a detection unit for detecting the first physical address of the mutual assistance device; a transmission unit for, when the first physical address is detected, sending the data to be transmitted to the mutual assistance device corresponding to the first physical address through a four-address transmission protocol; and when the first physical address is not detected, sending the data to be transmitted to the routing device.
[0023] The data transmission device provided by the present application is executed by a sub-device. The sub-device is connected to a mutual assistance device, the mutual assistance device is connected to a routing device, and the routing device is connected to a first network. Further, when the sub-device generates data to be transmitted, if the first physical address of the mutual assistance device can be obtained, the data to be transmitted is directly sent to the mutual assistance device corresponding to the first physical address. If the first physical address is not detected, the data to be transmitted is sent to the routing device. This ensures the accuracy of the transmission path of the data to be transmitted.
[0024] According to the fifth aspect of the present application, an electronic device is provided, including: a processor and a memory. The memory stores a program or instruction that can run on the processor. When the program or instruction is executed by the processor, the steps of the method as described in the first aspect and / or the second aspect are implemented.
[0025] The electronic device provided by the present application includes a memory and a processor, and also includes a program or instruction stored on the memory. When the program or instruction is executed by the processor, the steps of the method as described in the first aspect and / or the second aspect can be implemented. Therefore, the electronic device has all the beneficial effects of the above data transmission method and will not be elaborated here.
[0026] According to the sixth aspect of the present application, a computer-readable storage medium is provided, on which a program or instruction is stored. When the program or instruction is executed by the processor, the steps of the method as described in the first aspect and / or the second aspect are implemented.
[0027] The computer-readable storage medium provided by the present application stores a program or instruction. Since when the program or instruction is executed by the processor, the steps of the method as described in the first aspect and / or the second aspect can be implemented, the computer-readable storage medium has all the beneficial effects of the above data transmission method and will not be elaborated here.
[0028] According to the seventh aspect of the present application, a computer program product is provided, including a computer program or instruction. When the computer program or instruction is executed by the processor, the steps of the method as described in the first aspect and / or the second aspect are implemented.
[0029] The computer program product provided by the present application includes a computer program or instructions. When the computer program or instructions are executed by a processor, the steps of the method in the first aspect and / or the second aspect are implemented. Therefore, the computer program product has all the beneficial effects of the above data transmission method, which will not be elaborated here.
[0030] The additional aspects and advantages of the present application will become apparent in the following description section, or be learned through the practice of the present application. Brief Description of the Drawings
[0031] The above and / or additional aspects and advantages of the present application will become apparent and be easily understood from the description of the embodiments in conjunction with the following drawings, where:
[0032] Figure 1 Fig. 1 shows one of the flow diagrams of the data transmission method provided by the embodiment of the present application;
[0033] Figure 2 Fig. 2 shows another flow diagram of the data transmission method provided by the embodiment of the present application;
[0034] Figure 3 Fig. 3 shows one of the block diagrams of the structure of the data transmission device provided by the embodiment of the present application;
[0035] Figure 4 Fig. 4 shows another block diagram of the structure of the data transmission device provided by the embodiment of the present application;
[0036] Figure 5 Fig. 5 shows the topology diagram of the network connection provided by the embodiment of the present application;
[0037] Figure 6 Fig. 6 shows the schematic diagram of the address mode during the data transmission provided by the embodiment of the present application;
[0038] Figure 7 Fig. 7 shows one of the address link diagrams of the network connection provided by the embodiment of the present application;
[0039] Figure 8 Fig. 8 shows another address link diagram of the network connection provided by the embodiment of the present application.
[0040] Wherein, Figures 3 to 5 The corresponding relationship between the reference numerals in the drawings and the component names is as follows:
[0041] 300 is the data transmission device, 302 is the acquisition unit, 304 is the transmission unit, 400 is the data transmission device, 402 is the detection unit, 404 is the transmission unit, 502 is the device to be connected, 504 is the routing device, 506 is the mutual assistance device, and 508 is the target mutual assistance device. Detailed Description of the Embodiments
[0042] In order to more clearly understand the above objects, features and advantages of the present application, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that, without conflict, the embodiments of the present application and the features in the embodiments may be combined with each other.
[0043] In the following description, many specific details are set forth in order to fully understand the present application. However, the present application may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present application is not limited by the specific embodiments disclosed below.
[0044] The following refers to Figures 1 to 8 to describe a data transmission method, a transmission device, an electronic device and a readable storage medium according to some embodiments of the present application.
[0045] As Figure 1 shown, according to an embodiment of the present application, a data transmission method is proposed, which is executed by a mutual assistance device. The mutual assistance device is connected to a routing device, and the routing device is connected to a first network. The mutual assistance device is connected to a sub-device. The transmission method includes:
[0046] S102, when receiving data to be transmitted, obtain the target logical address in the data to be transmitted;
[0047] S104, when the target logical address does not correspond to the first physical address of the mutual assistance device, obtain the physical address routing table of the first network;
[0048] S106, according to the physical address routing table, send the data to be transmitted to the routing device or the sub-device.
[0049] The data transmission method provided by the present application is executed by a mutual assistance device. Among them, the mutual assistance device is connected to a routing device, and the routing device is connected to a first network. The mutual assistance device is connected to a sub-device. That is, the mutual assistance device is connected to the first network through the routing device, and the sub-device is connected to the first network through the mutual assistance device.
[0050] It can be understood that when the sub-device does not meet the connection conditions of the first network, that is, when the sub-device cannot directly connect to the first network through the routing device, at least one mutual assistance device is searched. Among them, the mutual assistance device is connected to the first network, that is, the mutual assistance device is connected to the routing device of the first network, so as to realize connecting to the first network through the routing device. Thus, when the signal strength of the network signal of the routing device received by the sub-device is low and it is impossible to ensure continuous and stable connection to the first network through the routing device, continuous and stable connection to the first network is realized through the mutual assistance device, improving the networking experience of the sub-device.
[0051] Further, during the data transmission process, when the mutual assistance device receives the data to be transmitted, it can detect the target logical address of the data to be transmitted based on the received transmission data, that is, the device to which the data to be transmitted needs to be delivered. If it is detected that the target logical address does not correspond to the first physical address of the mutual assistance device, the mutual assistance device can directly obtain the physical address routing table of the first network, and then, based on the physical address routing table, send the data to be transmitted to the routing device or transmit it to the sub-device connected to the mutual assistance device.
[0052] The data transmission method provided by this application is executed by a mutual assistance device. The mutual assistance device is connected to a routing device, the routing device is connected to a first network, and the mutual assistance device is connected to a sub-device. Further, when the mutual assistance device receives the data to be transmitted, it can detect the target logical address of the data to be transmitted based on the received transmission data, that is, the device to which the data to be transmitted needs to be delivered. If it is detected that the target logical address does not correspond to the first physical address of the mutual assistance device, the mutual assistance device can, based on the physical address routing table, send the data to be transmitted to the routing device or transmit it to the sub-device connected to the mutual assistance device to ensure the accuracy of the transmission path of the data to be transmitted.
[0053] In some embodiments, optionally, sending the data to be transmitted to the routing device or the sub-device according to the physical address routing table includes: determining the target device of the data to be transmitted according to the physical address routing table; when the target device is the routing device, transmitting the data to be transmitted to the routing device through a three-address transmission protocol; when the target device is the sub-device, transmitting the data to be transmitted to the sub-device through a four-address transmission protocol.
[0054] In this embodiment, when it is detected that the target logical address in the data to be transmitted does not correspond to the first physical address of the mutual assistance device, the mutual assistance device can first determine the target device of the data to be transmitted according to the physical address routing table, that is, the device to which the data to be transmitted needs to be transmitted, to determine whether the target device to which the data to be transmitted needs to be transmitted is the routing device or the sub-device.
[0055] Further, when the target device is determined to be the routing device, the mutual assistance device transmits the data to be transmitted to the routing device through a three-address transmission protocol. Specifically, the data to be transmitted includes three addresses, which are: the target address - the physical address of the routing device, the sending address - the physical address of the mutual assistance device, and the source address - the physical address of the device that generates the data to be transmitted.
[0056] Further, when the target device is determined to be a sub-device, the mutual assistance device transmits the data to be transmitted to the sub-device through a four-address transmission protocol. Specifically, the data to be transmitted includes four addresses, namely: the receiving address - the physical address of the sub-device, the sending address - the physical address of the mutual assistance device, the target address - the physical address of the routing device, and the source address - the physical address of the device that generates the data to be transmitted.
[0057] In some embodiments, optionally, when the target logical address does not correspond to the first physical address of the mutual assistance device, obtaining the physical address routing table of the first network includes: obtaining the first address resolution protocol of the mutual assistance device; determining the physical address routing table according to the first address resolution protocol.
[0058] In this embodiment, the physical address routing table of the first network to which the mutual assistance device is connected can be determined according to the first address resolution protocol of the mutual assistance device itself.
[0059] In some embodiments, optionally, when the target logical address does not correspond to the first physical address, obtaining the physical address routing table of the first network includes: sending a physical address routing table request to the devices connected to the mutual assistance device in a broadcast form; determining the physical address routing table according to the received request feedback.
[0060] In this embodiment, after receiving the data to be transmitted, the mutual assistance device can obtain the target logical address in the data to be transmitted and determine whether the target logical address in the data to be transmitted corresponds to the first physical address of the mutual assistance device itself.
[0061] If the target logical address does not correspond to the first physical address, the mutual assistance device can look up its own address resolution protocol, that is, obtain the second address resolution protocol of the mutual assistance device. Then, look up the physical address routing table of the first network in the second address resolution protocol. If the physical address routing table of the first network cannot be found in the second address resolution protocol, at this time, the mutual assistance device can send a physical address routing table request to the devices connected to the mutual assistance device in a broadcast form. Among them, the mutual assistance device and other devices connected to the mutual assistance device are all connected to the first network. Therefore, the physical address routing table of the first network can be obtained by sending a physical address routing table request to other devices. Further, after receiving the request feedback from other devices, the mutual assistance device can determine the physical address routing table of the first network according to the request feedback.
[0062] In some embodiments, optionally, the transmission method further includes: when the target logical address corresponds to the first physical address, sending the data to be transmitted to the application layer of the mutual assistance device.
[0063] In this embodiment, after the mutual assistance device receives the data to be transmitted, it can obtain the target logical address in the data to be transmitted and determine whether the target logical address in the data to be transmitted corresponds to the first physical address of the mutual assistance device itself.
[0064] If the target logical address corresponds to the first physical address, it indicates that the data to be transmitted needs to be processed by the mutual assistance device. At this time, the data to be transmitted can be sent to the application layer of the mutual assistance device to realize the processing of the data to be transmitted through the mutual assistance device.
[0065] As Figure 2 shown, according to an embodiment of the present application, a data transmission method is proposed, which is executed by a sub-device. The sub-device is connected to a mutual assistance device, the mutual assistance device is connected to a routing device, and the routing device is connected to a first network. The transmission method includes:
[0066] S202, detecting the first physical address of the mutual assistance device;
[0067] S204, when the first physical address is detected, sending the data to be transmitted to the mutual assistance device corresponding to the first physical address;
[0068] S206, when the first physical address is not detected, sending the data to be transmitted to the routing device.
[0069] In the data transmission method provided by the present application, during the data transmission process, when the data to be transmitted is generated by the sub-device, the first physical address of the mutual assistance device connected to the sub-device can be detected according to the generated transmission data. If the first physical address of the mutual assistance device can be detected, the data to be transmitted is directly sent to the mutual assistance device according to the first physical address.
[0070] If the first physical address of the mutual assistance device is not detected, it indicates that the data to be transmitted can only be sent to the routing device. At this time, the sub-device can directly send the data to be transmitted to the routing device step by step.
[0071] The data transmission method provided by the present application is executed by a sub-device. The sub-device is connected to a mutual assistance device, the mutual assistance device is connected to a routing device, and the routing device is connected to a first network. Further, when the sub-device generates the data to be transmitted, if the first physical address of the mutual assistance device can be obtained, the data to be transmitted is directly sent to the mutual assistance device corresponding to the first physical address. If the first physical address is not detected, the data to be transmitted is sent to the routing device. To ensure the accuracy of the transmission path of the data to be transmitted.
[0072] In some embodiments, optionally, when the first physical address is detected, sending the data to be transmitted to the mutual assistance device corresponding to the first physical address includes: when the first physical address is detected, sending the data to be transmitted to the mutual assistance device corresponding to the first physical address through a four-address transmission protocol.
[0073] In this technical solution, after determining the mutual assistance device corresponding to the first physical address, the sub-device and the mutual assistance device can transmit the data to be transmitted through a four-address transmission protocol. Specifically, the sub-device transmits the data to be transmitted to the mutual assistance device through a four-address transmission protocol. The data to be transmitted includes four addresses, which are respectively: receiving address - the physical address of the mutual assistance device, sending address - the physical address of the sub-device, target address - the physical address of the routing device connected to the mutual assistance device, and source address - the physical address of the device that generates the data to be transmitted.
[0074] In some embodiments, when the first physical address is not detected, sending the data to be transmitted to the routing device includes: when the first physical address is not detected, obtaining the physical address routing table of the first network; according to the physical address routing table, sending the data to be transmitted to the routing device step by step.
[0075] In this embodiment, if the first physical address of the mutual assistance device is not detected, at this time, the sub-device can directly obtain the physical address routing table of the first network, and then according to the physical address routing table, send the data host to be transmitted to the routing device.
[0076] Specifically, the physical address routing table of the first network connected to the mutual assistance device can be determined according to the address resolution protocol of the mutual assistance device.
[0077] Among them, the data transmission between the sub-device and the mutual assistance device is carried out through a four-address transmission protocol, and the data transmission between the mutual assistance device and the routing device is carried out through a three-address transmission protocol.
[0078] In some embodiments, optionally, detecting the first physical address of the mutual assistance device includes: obtaining the second address resolution protocol of the sub-device; according to the second address resolution protocol, determining the first physical address.
[0079] In this embodiment, the first physical address of the mutual assistance device can be determined in the following way. First, obtain the first address resolution protocol of the sub-device. Further, look for the first physical address of the mutual assistance device in the first address resolution protocol. If the first physical address can be found, directly send the data to be transmitted to the mutual assistance device corresponding to the first physical address. If the first physical address cannot be found, according to the physical address routing table, gradually transmit the data to be transmitted to the routing device.
[0080] In a specific embodiment, as Figure 5 shown, when the device to be connected 502 needs to connect to the first network, first, control the device to be connected 502 to send a connection request for the first network to discover connectable Internet devices. Specifically, the device to be connected 502 can send a connection request every 0.5 s. If no response from other devices is received for a long time, the device to be connected 502 can send requests at random intervals of 0.1 s within 5 s. At the same time, the device to be connected 502 also listens to the beacon sent by the routing device 504, and makes a comprehensive judgment based on the scanned device information of the wireless access point and the mutual assistance device 506 to determine whether to connect to the routing device 504 or the mutual assistance device 506.
[0081] Specifically, during the information interaction process between the device to be connected 502, the routing device 504, and the mutual assistance device 506, the information sent includes multiple fields. Among them, the key fields include capability display, frame type, message ID, CMD, level, etc. In one embodiment, the key fields are described as follows: Capability display: 8 bits, b0:1 supports mutual assistance; b0:0 does not support mutual assistance; other bits are reserved; Frame type: 01: probe request; 02: probe response; 03: action; Message ID: global ID, set by the initiator and the responder returns the same ID. CMD: 01: key negotiation; 02: password update; 03: routing table update; Level: the network layer where the mutual assistance device 506 is located. The mutual assistance device 506 directly connected to the routing device 504 is layer 0, the mutual assistance device 506 connected to the mutual assistance device 506 directly connected to the routing device 504 is 1, and the leaf connected to 1 is 2... The level range can be less than or equal to 4 layers.
[0082] Specifically, the connection request sent by the device to be connected 502 may include the following fields: protocol version, capability display, frame type, message ID, CMD, negotiation step, Pubkey, Sha, R1. In one embodiment, the protocol version is used to indicate the version of the communication protocol of the sent connection request; the capability display is used to show whether the device to be connected 502 supports the connection of the mutual assistance device 506; the frame type is used to indicate the message type of the sent connection request; the message ID is used to show the sent ID information, set by the initiator and the responder returns the same ID; CMD, 01 represents key negotiation, 02 represents password update, 03 represents routing table update; the negotiation step is used to show the process in the current connection process; Pub key is the public key generated by the device to be connected 502; Sha is the ciphertext encryption method; R1 is the ciphertext based on public key encryption.
[0083] Further, after receiving the response information of the routing device 504, the signal strength of the network signal of the routing device 504 that the device to be connected 502 can receive is determined according to the response information of the routing device 504. If the signal strength of the network signal of the routing device 504 that the device to be connected 502 can receive is lower than -55 dBm, it will cause the device to be connected 502 to be unable to connect to the routing device 504 or frequent disconnections may occur. At this time, it can be determined whether the response information of the mutual assistance device 506 is received.
[0084] When the mutual assistance device 506 receives a connection request, it sends a response message after rule judgment. Judgment rules: 1. It allows the device to be connected to access itself; 2. The device that the device to be connected 502 requests to access is the mutual assistance device 506; 3. The name of the routing device 504 requesting access is the same as the network it accesses. The response information includes other information such as commercial private information, the number of connected terminals, and the floor where it is located.
[0085] Specifically, the response information sent by the mutual assistance device 506 may include the following fields in addition to the fields in the connection request sent by the device to be connected 502: level, which is used to indicate the level of the mutual assistance device 506 in the first network; access point number, which is used to indicate the number of devices accessed by the mutual assistance device 506; signal strength of the network signal; R2, a ciphertext encrypted based on the public key of the mutual assistance device 506; R1.
[0086] Further, according to the response information sent by multiple mutual assistance devices 506, a target mutual assistance device 508 is determined among the multiple mutual assistance devices 506. First, a preliminary selection can be made according to the signal strength of the mutual assistance device 506, the floor of the mutual assistance device 506 in the first network, and the number of devices connected by the mutual assistance device 506. Specifically, the mutual assistance device 506 with a signal strength greater than -55 dBm, a floor less than or equal to 4 floors, and a connection point number less than 6 can be screened out.
[0087] Further, among the screened mutual assistance devices 506, the connection index of the mutual assistance device 506 is determined according to the signal strength of the mutual assistance device 506, the floor of the mutual assistance device 506 in the first network, and the number of devices connected by the mutual assistance device 506, and the mutual assistance device 506 with the largest connection index is determined as the target mutual assistance device 508. Specifically, first, the signal strength of the mutual assistance device 506, the strength weight and strength score corresponding to the signal strength, the floor weight and floor score corresponding to the floor, and the point weight and point score corresponding to the connection point number can be determined, and then the connection index of each mutual assistance device 506 is calculated.
[0088] Specifically, the connection index can be calculated according to the formula P = A×a + B×b + C×c, where P is the connection index, A is the strength score, a is the strength weight, B is the point score, b is the point weight, C is the layer score, and c is the layer weight. For example, the strength weight of the signal strength is 0.5. When the signal strength is -50 dBm, the corresponding strength score is 4. The point weight of the connection points is 0.5. When the number of connection points is 5, the point score is 4. The layer weight of the number of layers is 0.3. When the number of layers is 3, the corresponding layer score is 4. When the model strength of the mutual assistance device 506 is -50 dBm, the number of connection points is 5, and the number of layers is 3, the connection index of the mutual assistance device is: P = 4×0.5 + 4×0.3 + 4×0.2 = 4.
[0089] Further, after determining the target mutual assistance device 508, the control device 502 to be connected negotiates a key with the target mutual assistance device 508 to generate a key for data transmission between the device 502 to be connected and the target mutual assistance device 508. The connection request sent by the device 502 to be connected includes the text R1 encrypted by the public key of the device 502 to be connected. Correspondingly, the response information sent by the target mutual assistance device 508 to the device 502 to be connected includes R1 and the texts R1 and R2 encrypted by the public key of the device 502 to be connected.
[0090] During the key negotiation process, the encryption key is obtained using the ECC encryption algorithm (elliptic curve encryption algorithm). While the device to be connected initiates a scan, it also initiates key negotiation, and the target mutual assistance device 508 responds to implement the second step of key negotiation. The third and fourth steps use the ACTION frame to confirm the key.
[0091] First, after the device 502 to be connected receives the response information from the target mutual assistance device 508, it decrypts the encrypted text. If the decrypted text includes R1, it indicates that the key negotiation between the device 502 to be connected and the mutual assistance device 506 is successful. Then the device 502 to be connected encrypts the negotiation result "OK" based on the public key of the mutual assistance device 506 and sends it to the mutual assistance device 506. After receiving the negotiation result, the mutual assistance device 506 generates a key according to R1 and R2, encrypts the text "OK" based on the generated key, and sends it to the device 502 to be connected, and the key negotiation is completed. Then, data transmission is performed between the device 502 to be connected and the mutual assistance device 506 based on the generated key. Specifically, during the key negotiation process, the device 502 to be connected uses the 4-address mode action frame to send key negotiation information. Among them, the information sent by the device 502 to be connected and the mutual assistance device 506 can include the following fields: protocol version, capability display, frame type, message ID, CMD, negotiation step, and ciphertext.
[0092] Further, after the key negotiation is completed, the device node link of the first network can be updated. Specifically, in the original link of the first network, if there is no device node downstream of the target mutual assistance device 508, the device node of the device to be connected 502 can be directly added downstream of the target mutual assistance device 508 in the original link to complete the update of the device node link of the first network.
[0093] If the downstream node of the target mutual assistance device 508 is occupied, that is, there is a device node downstream of the target mutual assistance device 508. At this time, the original link of the first network can be assisted to generate a copy link, and the copy link is the same as the original link of the first network at this time. Then, the downstream device node of the target mutual assistance device 508 in the copy link is replaced with the device node of the device to be connected 502, so as to generate a new device node link and complete the update of the device node link of the first network.
[0094] For example, as Figure 7 and Figure 8 shown, the original link is A - B - C - D. When E accesses, D adds E to the end to get A - B - C - D - E. At the same time, the device node direction in front of D reports adding E at the end of the A - B - C - D routing table. After each node receives this information, it will add E after D. The node synchronization is completed. If a new F is added to the end of D on the A - B - C - D path at the same time. At this time, D finds that its end is occupied, so it copies a connection and adds F to the end of D. At the same time, the D node synchronizes the information that needs to be added to the end to the root node. If each node is occupied, it is also copied and added. Each node gets two complete linked lists: A - B - C - D - F and A - B - C - D - E. Specifically, the data sent to the forward device node for all node updates may include the following fields: protocol version; capability display; frame type; message ID; CMD; Sub, which is used to update the linked list for the associated network link; Len, which is used to indicate the length of the string, usually a multiple of 6; Macdata, mac data, 6(N + 2) bytes, where N represents the layer where the device is currently located. The Mac is in little - endian alignment and is arranged sequentially from the mutual assistance device connected to the routing device backwards. The MACdata arrangement example: MAC root, MAC1, MAC2... MACend.
[0095] Further, after the device to be connected 502 is connected to the first network through the target mutual assistance device 508, the data forwarding rules are as follows:
[0096] As Figure 6As shown, a 4 - address mode is used for data transmission between the device to be connected 502 and the target mutual - assistance device 508. A 3 - address mode is used for data transmission between the target mutual - assistance device 508 and other mutual - assistance devices 506, as well as between the target mutual - assistance device 508 and the routing device 504. The device to be connected 502 is connected to the target mutual - assistance device 508, the target mutual - assistance device 508 is connected to the routing device 504, and the routing device 504 is connected to the host device. The process of the device to be connected 502 sending data to the host device: The device to be connected 502 sends 4 addresses to the target mutual - assistance device 508: receiving address (RA) - physical address of the target mutual - assistance device 508, sending address (TA) - physical address of the device to be connected 502, destination address (DA) - physical address of the host device, source address (SA) - physical address of the device to be connected 502; The target mutual - assistance device 508 sends 3 addresses to the routing device 504: receiving address (RA) - physical address of the routing device 504, source address (SA) - physical address of the target mutual - assistance device 508, destination address (DA) - physical address of the host device; The routing device 504 sends 3 addresses to the host device: destination address (DA) - physical address of the host device, sending address (TA) - physical address of the routing device 504, source address (SA) - physical address of the target mutual - assistance device 508.
[0097] The process of the host device sending data to the device to be connected 502: The host device sends 3 addresses to the routing device 504: receiving address (RA) - physical address of the routing device 504, source address (SA) - physical address of the host device, destination address (DA) - physical address of the target mutual - assistance device 508; The routing device 504 sends 3 addresses to the target mutual - assistance device 508: destination address (DA) - physical address of the target mutual - assistance device 508, sending address (TA) - physical address of the routing device 504, source address (SA) - physical address of the host device; The target mutual - assistance device 508 sends 4 addresses to the device to be connected 502: receiving address (RA) - physical address of the device to be connected 502, sending address (TA) - physical address of the target mutual - assistance device 508, destination address (DA) - physical address of the device to be connected 502, source address (SA) - physical address of the host device.
[0098] Specifically: When the device to be connected 502 actively sends data, it checks whether the address resolution protocol (ARP table) of the device to be connected 502 contains the physical address of the target mutual - assistance device 508. If it does, it directly converts it into a 4 - address mode and sends it to the target mutual - assistance device 508. If not, it sends the data through the 4 - address mode step - by - step through the target mutual - assistance device 508 to the mutual - assistance device 506 connected to the routing device 504.
[0099] When the mutual assistance device 506 connected to the routing device 504 receives the data sent by the routing device 504, it first determines whether the logical address of the local device exists in the received data. If the logical address of the local device exists, the data is transmitted to the application layer of the local device. If not, the physical address of the next-level device is determined from the physical address routing table stored in the local device, and the data is transmitted to the next-level device.
[0100] Further, after the device to be connected 502 is connected to the first network through the target mutual assistance device 508, the device to be connected 502 sends detection data to the target mutual assistance device 508 once every 1 minute. If the target mutual assistance device 508 does not receive the detection data of the device to be connected 502 for 2 minutes, it is considered that the device to be connected 502 is lost, and the relevant information of the device to be connected 502 is cleared; when the device to be connected 502 does not receive the detection data reply from the target mutual assistance device 508, it means that the connection fails, and all devices under this node need to be notified to clear the connection relationship and search for the network again. The detection data may include the following fields: protocol version, capability display, frame type, message ID, and CMD.
[0101] Further, after the device to be connected 502 is connected to the first network through the target mutual assistance device 508, it is necessary to detect the connection anomaly of the device to be connected 502 in real time. Specifically, when the connection between the target mutual assistance device 508 and the routing device 504 is disconnected, the routing device 504 should retain the device information of all mutual assistance devices 506 connected to it and the address resolution protocol. After the routing device 504 is restarted, at this time, it is not necessary to clear the device information of the mutual assistance devices 506 connected to the routing device 504 and the address resolution protocol, and only the device addresses in the address resolution protocol need to be cleared. Then, an instruction is sent to the mutual assistance device 506 connected to it to notify the mutual assistance device 506 to re-initiate the Dynamic Host Configuration Protocol and update the physical address routing table, so that the mutual assistance device 506 and the routing device 504 re-establish the connection. Among them, the instruction sent by the routing device 504 may include the following fields: protocol version, capability display, frame type, message ID, and CMD.
[0102] Further, when the target mutual assistance device 508 finds that it is disconnected from the routing device 504, it can send an instruction to the device to be connected 502 connected to it to notify the device to be connected 502 to re-initiate the connection. Specifically, the instruction sent by the target mutual assistance device 508 may include the following fields: protocol version, capability display, frame type, message ID, and CMD.
[0103] According to the third aspect of the present application, as Figure 3As shown, a data transmission device 300 is proposed for a mutual assistance device. The mutual assistance device is connected to a routing device, the routing device is connected to a first network, and the mutual assistance device is connected to a sub-device. The transmission device includes: an acquisition unit 302, configured to acquire a target logical address in the data to be transmitted when receiving the data to be transmitted; the acquisition unit 302 is further configured to acquire a physical address routing table of the first network when the target logical address does not correspond to the first physical address; a transmission unit 304, configured to send the data to be transmitted to the routing device or the sub-device according to the physical address routing table.
[0104] The data transmission device 300 provided in this application is executed by a mutual assistance device. The mutual assistance device is connected to a routing device, the routing device is connected to a first network, and the mutual assistance device is connected to a sub-device. Further, when the mutual assistance device receives the data to be transmitted, it can detect the target logical address of the data to be transmitted according to the received transmission data, that is, the device to which the data to be transmitted needs to be delivered. If it is detected that the target logical address does not correspond to the first physical address of the mutual assistance device, the mutual assistance device can send the data to be transmitted to the routing device or transmit it to the sub-device connected to the mutual assistance device according to the physical address routing table to ensure the accuracy of the transmission path of the data to be transmitted.
[0105] Further, the transmission unit 304 is specifically configured to determine the target device of the data to be transmitted according to the physical address routing table; when the target device is a routing device, transmit the data to be transmitted to the routing device through a three-address transmission protocol; when the target device is a sub-device, transmit the data to be transmitted to the sub-device through a four-address transmission protocol.
[0106] Further, the acquisition unit 302 is further configured to acquire the first address resolution protocol of the mutual assistance device; determine the physical address routing table according to the second address resolution protocol.
[0107] Further, the acquisition unit 302 is further configured to send a physical address routing table request to the devices connected to the mutual assistance device in a broadcast form; determine the physical address routing table according to the received request feedback.
[0108] Further, the transmission unit 304 is further configured to send the data to be transmitted to the application layer of the mutual assistance device when the target logical address corresponds to the first physical address.
[0109] According to the fourth aspect of the present application, as Figure 4As shown, a data transmission device 400 is proposed, which is executed by a sub-device. The sub-device is connected to a mutual assistance device, the mutual assistance device is connected to a routing device, and the routing device is connected to a first network. The transmission device includes: a detection unit 402 for detecting the first physical address of the mutual assistance device; a transmission unit 404 for, in the case where the first physical address is detected, sending the data to be transmitted to the mutual assistance device corresponding to the first physical address through a four-address transmission protocol; and in the case where the first physical address is not detected, sending the data to be transmitted to the routing device.
[0110] The data transmission device 400 provided in this application is executed by a sub-device. The sub-device is connected to a mutual assistance device, the mutual assistance device is connected to a routing device, and the routing device is connected to a first network. Further, in the case where the sub-device generates data to be transmitted, if the first physical address of the mutual assistance device can be obtained, the data to be transmitted is directly sent to the mutual assistance device corresponding to the first physical address. If the first physical address is not detected, the data to be transmitted is sent to the routing device. This ensures the accuracy of the transmission path of the data to be transmitted.
[0111] Further, the transmission unit 404 is specifically configured to, in the case where the first physical address is detected, send the data to be transmitted to the mutual assistance device corresponding to the first physical address through a four-address transmission protocol.
[0112] Further, the transmission unit 404 is specifically further configured to, in the case where the first physical address is not detected, obtain the physical address routing table of the first network; and according to the physical address routing table, send the data to be transmitted to the routing device step by step.
[0113] Further, the detection unit 402 is specifically configured to obtain the second address resolution protocol of the sub-device; and determine the first physical address according to the second address resolution protocol.
[0114] According to the fifth aspect of this application, an electronic device is proposed, including: a processor and a memory. The memory stores a program or instruction that can run on the processor. When the program or instruction is executed by the processor, the steps of the data transmission method provided in any of the above embodiments are implemented.
[0115] The electronic device of the data provided in this application includes a memory and a processor, and further includes a program or instruction stored on the memory. When the program or instruction is executed by the processor, the steps of the data transmission method provided in any of the above embodiments can be implemented. Therefore, this electronic device has all the beneficial effects of the above data transmission method, which will not be elaborated here.
[0116] According to the sixth aspect of this application, a computer-readable storage medium is proposed, on which a program or instruction is stored. When the program or instruction is executed by the processor, the data transmission method in any of the above embodiments is implemented.
[0117] The computer-readable storage medium provided by the present application stores a program or instructions thereon. When the program or instructions are executed by a processor, the data transmission method as described in any of the above embodiments can be implemented. Therefore, the computer-readable storage medium has all the beneficial effects of the above data transmission method, which will not be elaborated herein.
[0118] According to the seventh aspect of the present application, a computer program product is proposed, including a computer program or instructions. When the computer program or instructions are executed by a processor, the data transmission method as described in any of the above embodiments is implemented.
[0119] The computer program product provided by the present application includes a computer program or instructions. When the computer program or instructions are executed by a processor, the data transmission method as described in any of the above embodiments is implemented. Therefore, the computer program product has all the beneficial effects of the above data transmission method, which will not be elaborated herein.
[0120] In the description of the present application, the term "a plurality" refers to two or more, unless otherwise clearly defined. The orientation or positional relationship indicated by terms such as "upper", "lower", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation to the present application; terms such as "connection", "installation", "fixation", etc. should all be understood in a broad sense. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be directly connected or indirectly connected through an intermediate medium. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to specific circumstances.
[0121] In the description of this specification, the descriptions of terms such as "one embodiment", "some embodiments", "specific embodiments", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or instance. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.
[0122] The above are only the preferred embodiments of the present application and are not used to limit the present application. For those skilled in the art, the present application can have various changes and modifications. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A data transmission method, which is executed by a mutual assistance device, characterized in that, The mutual assistance device is connected to a routing device, the routing device is connected to a first network, and the mutual assistance device is connected to a sub-device. The transmission method includes: When receiving data to be transmitted, obtain the target logical address in the data to be transmitted; When the target logical address does not correspond to the first physical address of the mutual assistance device, obtain the physical address routing table of the first network; According to the physical address routing table, send the data to be transmitted to the routing device or the sub-device.
2. The transmission method according to claim 1, wherein The step of sending the data to be transmitted to the routing device or the sub-device according to the physical address routing table includes: Determine the target device of the data to be transmitted according to the physical address routing table; When the target device is the routing device, transmit the data to be transmitted to the routing device through a three-address transmission protocol; When the target device is the sub-device, transmit the data to be transmitted to the sub-device through a four-address transmission protocol.
3. The transmission method according to claim 1 or 2, characterized in that, The step of obtaining the physical address routing table of the first network when the target logical address does not correspond to the first physical address of the mutual assistance device includes: Obtain the first address resolution protocol of the mutual assistance device; Determine the physical address routing table according to the first address resolution protocol.
4. The transmission method according to claim 1 or 2, characterized in that, The step of obtaining the physical address routing table of the first network when the target logical address does not correspond to the first physical address includes: Send a physical address routing table request to the devices connected to the mutual assistance device in a broadcast form; Determine the physical address routing table according to the received request feedback.
5. The transmission method according to claim 1 or 2, characterized in that The transmission method further includes: When the target logical address corresponds to the first physical address, send the data to be transmitted to the application layer of the mutual assistance device.
6. A data transmission method, executed by a sub-device, characterized in that, The sub-device is connected to the mutual assistance device, the mutual assistance device is connected to the routing device, and the routing device is connected to the first network. The transmission method includes: Detect the first physical address of the mutual assistance device; When the first physical address is detected, send the data to be transmitted to the mutual assistance device corresponding to the first physical address; When the first physical address is not detected, send the data to be transmitted to the routing device.
7. The transmission method according to claim 6, wherein The step of sending the data to be transmitted to the mutual assistance device corresponding to the first physical address when the first physical address is detected includes: When the first physical address is detected, send the data to be transmitted to the mutual assistance device corresponding to the first physical address through a four-address transmission protocol.
8. The transmission method according to claim 6 or 7, characterized in that, The step of sending the data to be transmitted to the routing device when the first physical address is not detected includes: When the first physical address is not detected, obtain the physical address routing table of the first network; According to the physical address routing table, send the data to be transmitted to the routing device step by step.
9. The transmission method according to claim 6 or 7, characterized in that The step of detecting the first physical address of the mutual assistance device includes: Obtain the second address resolution protocol of the sub-device; Determine the first physical address according to the second address resolution protocol.
10. A data transmission device for a mutual assistance device, characterized in that, The mutual assistance device is connected to a routing device, the routing device is connected to a first network, the mutual assistance device is connected to a sub-device, and the transmission device includes: An acquisition unit, configured to acquire a target logical address in the data to be transmitted when receiving the data to be transmitted; The acquisition unit is further configured to acquire a physical address routing table of the first network when the target logical address does not correspond to the first physical address of the mutual assistance device; A transmission unit, configured to send the data to be transmitted to the routing device or the sub-device according to the physical address routing table.
11. A data transmission device, which is executed by a sub-device, characterized in that, The sub-device is connected to the mutual assistance device, the mutual assistance device is connected to the routing device, the routing device is connected to the first network, and the transmission device includes: A detection unit, configured to detect the first physical address of the mutual assistance device; A transmission unit, configured to send the data to be transmitted to the mutual assistance device corresponding to the first physical address when the first physical address is detected; and Send the data to be transmitted to the routing device when the first physical address is not detected.
12. An electronic device, characterized in that, Including: A processor and a memory, the memory stores a program or instruction that can run on the processor, and when the program or instruction is executed by the processor, the steps of the method described in any one of claims 1 to 5 and / or the steps of the method described in any one of claims 6 to 9 are implemented.
13. A computer-readable storage medium, characterized in that, A program or instruction is stored on the computer-readable storage medium, and when the program or instruction is executed by a processor, the steps of the method described in any one of claims 1 to 5 and / or the steps of the method described in any one of claims 6 to 9 are implemented.
14. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instruction is executed by a processor, the steps of the method described in any one of claims 1 to 5 and / or the steps of the method described in any one of claims 6 to 9 are implemented.