Device networking method and apparatus, computer device, and storage medium
Patent Information
- Application Number
- CN202311327895.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-13
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2043-10-13
AI Technical Summary
As the network scale increases, multi-hop networks may lead to data backlog, increased bit error rate, increased latency, and even link interruption. There is an urgent need for a device networking method to reduce latency.
The near-domain network platform generates a network update flag based on the total network error, instructing the target device to obtain the current number of connections and the target number of connections, adjust the latency information, and select the device with the best signal strength and latency information from the candidate access devices for access, thereby reconfiguring the network to optimize the network.
It reduced the total network error, reduced resource consumption, improved network service performance, and reduced overall latency.
Smart Images

Figure CN117354816B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of wireless communication and terminal technology, and in particular to a device networking method, apparatus, computer equipment, storage medium and computer program product. Background Technology
[0002] With the development of wireless communication and terminal technologies, near-field multi-hop networking technology has emerged, greatly improving communication quality in network coverage blind spots and user hotspots. However, multi-hop networks place higher demands on quality of service (QoS) indicators, especially as network scale increases. This can lead to significant data backlogs, resulting in higher bit error rates and significantly increased latency, potentially even causing link outages. When more relays are involved in the communication link, meaning more devices are connected, latency increases dramatically. Therefore, a device networking method to reduce latency is urgently needed. Summary of the Invention
[0003] Therefore, it is necessary to provide a device networking method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can reduce latency in response to the above-mentioned technical problems.
[0004] Firstly, this application provides a device networking method, applied to target devices already networked, comprising:
[0005] Upon receiving a network update flag indicating a network update from the near-field network platform, the current number of connections and the target number of connections of the target device are obtained. The network update flag is generated by the near-field network platform based on the total network error of each target device already in the current network. The total network error is obtained based on the network information of each target device already in the network.
[0006] Based on the current number of connections and the target number of connections, obtain the latency information of the target device, write the latency information into the service information of the target device, and then disband the network.
[0007] If the target device is not a gateway device, the target access device is obtained from the candidate access devices based on the latency information and signal strength in the service information of the candidate access devices, and the target device is connected to the target access device; the candidate access devices include node devices that have been re-networked after the network was disbanded.
[0008] In one embodiment, obtaining the current number of connections and the target number of connections of the target device includes:
[0009] Obtain the current number of connections to the target device, and the number of connections to each node device connected to the target device;
[0010] The target number of connections is obtained based on the number of connections of each node device and the current number of connections.
[0011] In one embodiment, the latency information of the target device is obtained based on the current number of connections and the target number of connections, including:
[0012] If the current number of connections is less than the target number of connections, the target device's latency information is obtained by reducing a preset latency value based on the target device's initial latency.
[0013] If the current number of connections is greater than the target number of connections, a preset delay value is added to the initial delay of the target device to obtain the delay information of the target device.
[0014] In one embodiment, when the target device is not a gateway device, the method includes, based on the latency information and signal strength in the service information of the acquired candidate access devices:
[0015] If the target device is not a gateway device, a probe request frame is sent to all channels, and if a probe response frame is received based on the probe request frame, the device that returns the probe response frame is taken as a candidate access device.
[0016] Send service discovery requests to candidate access devices and receive service information returned by candidate access devices based on the service discovery requests;
[0017] Based on the service information, the latency information and signal strength of the candidate access devices are obtained.
[0018] In one embodiment, if the target device is not a gateway device, before basing the information on latency and signal strength in the service information of the acquired candidate access devices, the method further includes:
[0019] Obtain the cellular signal strength of the target device;
[0020] If the cellular signal strength is below a set threshold, it is determined that the target device is not a gateway device;
[0021] When the cellular signal strength is higher than a set threshold, the target device is identified as a gateway device, and a network is established to transmit data with the base station.
[0022] In one embodiment, sending a probe request frame to all channels and, upon receiving a probe response frame returned based on the probe request frame, includes:
[0023] If a probe request frame is sent to all channels but no probe response frame is received, return to the step of sending probe request frames to all channels until a probe response frame is received.
[0024] In one embodiment, obtaining the target access device from the candidate access devices includes:
[0025] Obtain the delay weighting coefficient and the signal strength weighting coefficient;
[0026] Based on the delay information and signal strength of each candidate access device, along with the delay weighting coefficient and the signal strength weighting coefficient, the service quality benefit value corresponding to each candidate access device is obtained.
[0027] The candidate access device with the highest service quality benefit value is selected as the target access device.
[0028] Secondly, this application provides a device networking method applied to a near-field network platform, including:
[0029] Based on the networking information of each target device already in the current network, the total networking error of the current network is obtained;
[0030] Based on the total network error, the network update identifier is obtained;
[0031] The network update flag is sent to each target device that has already formed a network. The network update flag is used to instruct each target device to generate corresponding service information based on its latency information and then disband the network when the network update flag indicates a network update. It also instructs each target device to determine the target access device and connect to the target access device based on the latency information and signal strength in the service information of the candidate access device if it is determined not to be a gateway device. The latency information is obtained by each networked device based on its current number of connections and the target number of connections. The candidate access devices include node devices that have been re-networked after the network was disbanded.
[0032] In one embodiment, a network update identifier is obtained based on the total network error, including:
[0033] When the total network error is less than the preset target network error, a network update flag indicating that the network is not updated is obtained.
[0034] When the total network error is greater than the preset target network error, a network update flag is obtained to characterize the network update.
[0035] In one embodiment, the total network error of the current network is obtained based on the network information of each networked device in the current network, including:
[0036] Based on the networking information of each networked target device, the current number of connections and the current number of hops for each networked target device are obtained;
[0037] Based on the current number of connections and the current number of hops, the target number of connections for each networked target device is obtained;
[0038] Based on the current number of connections and the target number of connections, the total network error for the current network topology is obtained.
[0039] In one embodiment, the target number of connections for each networked device is obtained based on the current number of connections and the current hop count, including:
[0040] Based on the current number of connections and the current number of hops, the initial mathematical model of total network latency is obtained through a pre-constructed mathematical model of total network latency.
[0041] Based on the initial network total latency mathematical model, a multivariate particle swarm optimization algorithm is used to obtain network total latency mathematical models with different total latencies. The network total latency mathematical model with the smallest total latency is determined as the target network total latency mathematical model, and the current connection number of each networked device in the target network total latency mathematical model is obtained as the target connection number of each networked device.
[0042] In one embodiment, the steps for constructing the mathematical model of total network latency include:
[0043] Obtain the subcarrier bandwidth and data transmission rate of the single-hop link of the target device, and then obtain the minimum single-hop transmission delay of the target device;
[0044] Based on the number of target devices and the current number of connections to the target devices, the average number of single-hop transmission rounds for the target devices is obtained;
[0045] The single-hop delay of the target device is obtained based on the average number of single-hop transmission rounds and the minimum single-hop transmission delay.
[0046] The transmission delay of the target device is obtained based on the single-hop delay and the current hop count;
[0047] Obtain the transmission latency of each target device and construct a mathematical model of the total network latency for the current network.
[0048] In one embodiment, after sending the network update identifier to each networked device, the method further includes:
[0049] After a preset period, the network update flag is reset, and the number of optimizations for the current network is obtained. If the number of optimizations is less than the preset maximum number, the network information of each networked device under the newly created network is obtained, and the process returns to execute the step of obtaining the network error based on the network information to further obtain the network update flag, until the total network error is less than the preset target network error or the number of optimizations is greater than or equal to the preset maximum number.
[0050] Thirdly, this application also provides a device networking apparatus, applied to target devices that have already been networked, comprising:
[0051] The acquisition module is used to acquire the current number of connections and the target number of connections of the target device when it receives the network update flag indicating network update from the near-field network platform. The network update flag is generated by the near-field network platform based on the total network error of each networked target device in the current network. The total network error is obtained based on the network information of each networked target device.
[0052] The write module is used to obtain the latency information of the target device based on the current number of connections and the target number of connections, and then write the latency information into the service information of the target device before disbanding the network.
[0053] The access module is used to select the target access device from the candidate access devices based on the latency information and signal strength in the service information of the candidate access devices when the target device is not a gateway device, and to connect the target device to the target access device; the candidate access devices include node devices that have been re-networked after the network was disbanded.
[0054] Fourthly, this application also provides a device networking apparatus for use in a near-field network platform, comprising:
[0055] The calculation module is used to obtain the total network error of the current network based on the network information of each target device already in the current network.
[0056] The generation module is used to obtain the network update flag based on the total network error;
[0057] The sending module is used to send network update flags to each networked target device. The network update flag is used to instruct each target device to generate corresponding service information based on its latency information and then disband the network when the network update flag indicates a network update. It also instructs each target device, if it is determined not to be a gateway device, to determine the target access device based on the latency information and signal strength in the service information of the candidate access device and then access the target access device. The latency information is obtained by each networked device based on its current number of connections and the target number of connections. The candidate access devices include node devices that have been re-networked after the network was disbanded.
[0058] Fifthly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described method steps.
[0059] Sixthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method steps.
[0060] In a seventh aspect, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method steps.
[0061] The aforementioned networking method, apparatus, computer equipment, storage medium, and computer program products involve a near-field network platform that obtains the total networking error based on the networking information of each already networked target device. This total error is used to generate a networking update flag, which the platform then distributes to each already networked target device. If the total networking error exceeds expectations, the networking update flag indicates that the network needs updating. Upon receiving the networking update flag, each target device obtains the current connection count and the target connection count to obtain latency information. This latency information is then written into its corresponding service information, and the network is disbanded. If the target device is not a gateway device, it obtains the latency information and signal strength from the service information of other re-networked node devices. Based on the latency information and signal strength, it determines the target access device and connects to it. This application determines whether the network needs to be updated based on the total network error obtained from the network topology information. If an update is required, a network update flag is sent to each target device. Before updating the network, each target device obtains latency information by using its current number of connections and the number of target connections. The latency information is used to express its own connection performance. In the subsequent re-networking process, devices use the latency information and signal strength to determine the target access device, which is equivalent to selecting the optimal access node device. This method can re-network and optimize the network as a whole, reduce the total network error, reduce overall latency, improve network service performance, and reduce resource consumption. Attached Figure Description
[0062] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0063] Figure 1 This is an application environment diagram of the device networking method in one embodiment;
[0064] Figure 2 This is a flowchart illustrating a device networking method in one embodiment;
[0065] Figure 3 This is a schematic diagram of the process for determining a target access device in one embodiment;
[0066] Figure 4 This is a flowchart illustrating a device networking method in another embodiment;
[0067] Figure 5 This is a flowchart illustrating the process of obtaining the total network error in one embodiment;
[0068] Figure 6 This is a schematic diagram of the overall system flow of the device networking method in one embodiment;
[0069] Figure 7 This is a flowchart illustrating a networking optimization scheme for a near-domain network platform in one embodiment;
[0070] Figure 8 This is a flowchart illustrating a networking optimization scheme for networked devices in one embodiment.
[0071] Figure 9 This is a flowchart illustrating a network optimization scheme for the devices to be accessed in one embodiment;
[0072] Figure 10 This is a structural block diagram of a device networking apparatus in one embodiment;
[0073] Figure 11 This is a structural block diagram of the device networking apparatus in another embodiment;
[0074] Figure 12 This is an internal structural diagram of a computer terminal device in one embodiment. Detailed Implementation
[0075] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0076] The device networking method provided in this application embodiment can be applied to a multi-hop local area network based on WiFi Direct (wireless direct connection technology), such as... Figure 1In the application environment shown, each target device can connect to and communicate with other targets via a wireless network. Some target devices act as gateway devices, communicating and transmitting data with base station 104 through their own cellular networks, allowing other devices with network needs to indirectly connect to the network after joining the network. The near-field network platform 102 can connect to all node devices in the network via a communication network; it can provide a unified network infrastructure (such as infrastructure built using WiFi Direct technology), enabling devices and nodes to connect and communicate with each other to form a network. It should be understood that after each target device can connect to each other and establish a network via WiFi Direct technology, each target device is equivalent to multiple node devices in the network. The near-field network platform 102 can also provide network management functions, including monitoring network status, managing devices and nodes, and configuring network parameters. The near-domain network platform 102 obtains the total network error based on the network information of each networked target device, and generates a network update flag based on the total network error. The near-domain network platform 102 then distributes the update flag to each networked target device. If the total network error exceeds the expected value, the network update flag indicates that the network needs to be updated. After receiving the network update flag indicating a network update, each target device obtains the current number of connections and the target number of connections, thereby obtaining latency information. After writing the latency information into its corresponding service information, it disbands the network. Then, if the target device is not a gateway device, it obtains the latency information and signal strength from the service information of other re-networked node devices, determines the target access device based on the latency information and accesses the target device, thereby achieving the purpose of re-establishing the network. The target devices can be, but are not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can be smart speakers, smart TVs, smart air conditioners, smart vehicle devices, etc. Portable wearable devices can be smartwatches, smart bracelets, head-mounted devices, etc. The near-domain network platform 102 can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0077] In one exemplary embodiment, such as Figure 2 As shown, a device networking method is provided, which can be applied to... Figure 1 Taking the already networked target devices as an example, the explanation includes:
[0078] Step S202: Upon receiving a network update flag indicating a network update from the near-domain network platform, obtain the current number of connections and the target number of connections for the target device.
[0079] Among them, the network update identifier is generated by the near-field network platform based on the total network error of each target device that has been networked in the current network. The total network error is obtained based on the network information of each target device that has been networked.
[0080] The network update flag can be a unique identifier used to identify a specific update operation; it can be a number, string, or other form of identifier, with specific formats and rules defined according to actual needs and application scenarios. The current connection count refers to the number of other devices connected to the target device in the network. The target connection count can be an expected number of connections obtained based on the connection status of the target device and the connection status of the node devices connected to it. Network information can include node information such as the identifier, location information, and status information of each node device, as well as the connection relationships between node devices. For example, network information can include the connection count of each target device and the hop count of indirect connections to the base station. The total network error can be obtained by summing the absolute values of the differences between the connection counts of all networked target devices and the expected connection count. For example, when the network update flag = 1, it indicates that the network needs to be updated, and the device receiving this flag needs to perform a network update operation. When the network update flag = 0, it means that the network does not need to be updated, and the device receiving this flag does not need to perform a network update operation. For example, when the total network error is greater than expected, the network update flag generated by the near-domain network platform is 1, indicating that the network needs to be updated; when the total network error is less than expected, the network update flag generated by the near-domain network platform is 0, indicating that the network does not need to be updated.
[0081] Step S204: Based on the current number of connections and the target number of connections, obtain the latency information of the target device, write the latency information into the service information of the target device, and then disband the network.
[0082] The latency information is used to characterize the connectivity of target devices. It can be obtained by adaptively adjusting the initial latency information based on the relationship between the current number of connections and the target number of connections. The service information refers to the network-related information sent to other devices after responding to their service discovery requests. The service information can include the target device's latency information, signal strength, network speed, and channel bandwidth. Each target device obtains its own latency information based on its current number of connections and the target number of connections, and writes the latency information into its own service information, thus updating its service information. This allows for recording the current network connectivity and adaptively adjusting its connectivity in the next network setup after the current network is dismantled, thereby reducing the overall network error.
[0083] Step S206: If the target device is not a gateway device, the target access device is obtained from the candidate access devices based on the delay information and signal strength in the service information of the candidate access devices, and the target device is connected to the target access device; the candidate access devices include node devices that have been re-networked after the network was disbanded.
[0084] Among them, such as Figure 1 As shown, a gateway device in a network can be a target device directly connected to a base station. The gateway device can connect to the base station via its own cellular network to perform data transmission and network communication. Non-gateway devices in the network can become relay devices by connecting to the gateway device. Devices with network needs can connect to the relay device and then use the relay device to the gateway device to the base station to achieve network communication and data transmission. A target device can determine whether it can become a gateway device by judging its own network signal strength, thus establishing a network as a gateway device or accessing the network as a non-gateway device. A non-gateway target device will send service discovery requests to newly reorganized node devices as candidate access devices to obtain service information. It will use latency information and signal strength in the service information to determine the connectability of each candidate access device, select a target access device, and establish a connection to it, thus accessing the network. The signal strength of a candidate access device refers to the wireless signal strength between the target device and the candidate device, which characterizes the stability of the channel after the target device directly connects to the candidate access device.
[0085] In the above-described device networking method, the near-field network platform determines whether the network needs to be updated based on the total networking error obtained from the networking information. If an update is required, a networking update flag is sent to each target device. Before updating the network, each target device obtains latency information by using its current number of connections and the number of target connections. The latency information is used to express its own connection performance. In the subsequent renetworking process, devices use latency information and signal strength to determine the target access device, which is equivalent to selecting the optimal access node device. This method can renetwork and optimize the network as a whole, reduce the total networking error, reduce overall latency, improve network service performance, and reduce resource consumption.
[0086] In an exemplary embodiment, obtaining the current number of connections and the target number of connections for the target device includes: obtaining the current number of connections for the target device and the number of connections for each node device connected to the target device; and obtaining the target number of connections based on the number of connections for each node device and the current number of connections.
[0087] The number of connections for each node device connected to the target device can be the sum of the number of devices each node device connected to the target device is connected to. The target device can obtain its target number of connections based on the current number of connections and the number of connections for each node device connected to the target device; specifically, it can be obtained using the following formula:
[0088]
[0089] The target number of connections R(i) for target device i can be obtained by dividing the sum of the number of connections r'(j) of the j node devices connected to target device i by the current number of connections r(i) of target device i.
[0090] In this embodiment, the target number of connections to the target device is obtained by using the number of connections of each node device connected to the target device and the current number of connections of the target device. By reasonably determining the target number of connections, resources can be fully utilized, load balancing can be achieved, scalability can be improved, thereby enhancing the performance, stability and availability of the system.
[0091] In an exemplary embodiment, obtaining the latency information of the target device based on the current number of connections and the target number of connections includes: when the current number of connections is less than the target number of connections, reducing the target device's initial latency by a preset latency value to obtain the target device's latency information; when the current number of connections is greater than the target number of connections, increasing the target device's initial latency by a preset latency value to obtain the target device's latency information.
[0092] The initial latency can be the initial latency value set by the near-field network platform during network deployment based on the network scale or target performance. This initial latency value can be configured for each target device as an initial basic parameter, so that the near-field network platform does not need to reconfigure after initializing device information. The preset latency value can be a fixed value set according to the network scale and actual optimization needs. It should be understood that the preset latency value is less than the initial latency value. It should be understood that if the current number of connections is less than the target number of connections, the target device can increase the number of connections to fully utilize its performance; therefore, the initial latency is reduced by the preset latency value as the latency information for the target device. Conversely, if the current number of connections is less than the target number of connections, the preset latency value is increased.
[0093] In this embodiment, when the current number of connections is less than the target number of connections, the initial delay is reduced by a preset delay value as the delay information of the target device; otherwise, the preset delay value is increased. This allows for adaptive adjustment of the target device's delay information based on the current network connection status, thereby improving the efficiency and quality of the next network setup.
[0094] In an exemplary embodiment, when the target device is not a gateway device, the process includes, based on the latency information and signal strength in the service information of the acquired candidate access devices, the following steps: when the target device is not a gateway device, sending a probe request frame to all channels, and upon receiving a probe response frame returned based on the probe request frame, designating the device that returned the probe response frame as a candidate access device; sending a service discovery request to the candidate access device and receiving the service information returned by the candidate access device based on the service discovery request; and obtaining the latency information and signal strength of the candidate access device based on the service information.
[0095] In wireless communication, a channel refers to a specific frequency range or band used for data transmission. Different wireless communication technologies and standards use different channels for data transmission. In practical applications, the channel used needs to be determined based on the specific wireless communication technology and equipment requirements. A probe request frame can be used to probe all channels to detect the presence of connectable node devices in the network. A probe response frame can be used to identify the responding device as a node device in the network, providing access to the network. After sending probe request frames to all channels, the target device receives some probe response frames and identifies the responding devices as candidate access devices. It then sends service discovery requests to these candidate access devices to obtain the service information returned by the candidate access devices. Based on this service information, it obtains the latency information and signal strength of these candidate access devices.
[0096] In this embodiment, candidate access devices are determined by sending probe request frames to all channels, and their service information is obtained by sending service discovery requests to the aforementioned candidate access devices. Furthermore, the corresponding delay information and signal strength are obtained. This method can efficiently and quickly obtain the service information of candidate access devices, thereby determining the delay information and signal strength.
[0097] In an exemplary embodiment, if the target device is not a gateway device, before determining the latency information and signal strength from the service information of the acquired candidate access devices, the method further includes: acquiring the cellular signal strength of the target device; if the cellular signal strength is lower than a set threshold, determining that the target device is not a gateway device; if the cellular signal strength is higher than the set threshold, determining that the target device is a gateway device, and establishing a network to transmit data with the base station.
[0098] Cellular signal strength refers to the strength of the cellular network signal received by a mobile phone or other wireless device in mobile communication. A stronger signal strength indicates a closer distance between the device and the cellular base station, better signal quality, and higher communication quality. Therefore, if the cellular signal strength of a target device is higher than a set threshold, the target device can act as a gateway device, thus better undertaking network data transmission between the network and the base station. If the cellular signal strength of the target device is lower than the set threshold, it will not act as a gateway device to avoid affecting the data transmission performance of the network.
[0099] In an exemplary embodiment, sending a probe request frame to all channels and, upon receiving a probe response frame returned based on the probe request frame, includes: if a probe request frame has been sent to all channels but no probe response frame has been received, returning to the step of sending a probe request frame to all channels until a probe response frame is received.
[0100] In this embodiment, if a probe request frame is sent to all channels but no probe response frame is received, the step of sending probe request frames to all channels is returned until a probe response frame is received. This ensures that the target device can execute the networking process, avoids the situation where the device is idle and does not participate in networking due to the lack of detection of candidate access devices, and improves the reliability of establishing a network.
[0101] In one exemplary embodiment, such as Figure 3 As shown, obtaining the target access device from the candidate access devices includes:
[0102] Step S302: Obtain the delay weighting coefficient and the signal strength weighting coefficient.
[0103] Step S304: Based on the delay information and signal strength of each candidate access device, along with the delay weighting coefficient and the signal strength weighting coefficient, obtain the service quality benefit value corresponding to each candidate access device.
[0104] Step S306: Select the candidate access device with the highest service quality benefit value as the target access device.
[0105] The service quality benefit value can be determined by the following formula:
[0106] Q(j) = a1D(j) + a2L(j)
[0107] Where Q(j) represents the quality of service benefit value of candidate access device j, a1 represents the signal strength weight coefficient, a2 represents the delay weight coefficient, D(j) represents the signal strength of device j, and L(j) represents the delay information of device j.
[0108] In this embodiment, the service quality benefit value is expressed by summing signal strength and delay information with different weights. This can accurately represent the service performance of candidate access devices in the network. By connecting the candidate access device with the highest service quality benefit value, the high service quality of the newly built network can be ensured.
[0109] In one exemplary embodiment, such as Figure 4 As shown, a device networking method is provided, which can be applied to... Figure 1 The application environment shown is illustrated using the near-field network platform 102 as an example, including:
[0110] Step S402: Based on the networking information of each target device already networked under the current network, obtain the total networking error of the current network.
[0111] Network information refers to information periodically reported by networked devices to the near-field network platform, such as the battery level, signal strength, number of network connections, number of network hops, and number of connections of each device in the network. The total network error can be obtained by summing the absolute values of the differences between the number of connections of each of the networked target devices and the expected number of connections. It can be used to express the error between the total number of network connections and the total expected number of network connections.
[0112] Step S404: Obtain the network update flag based on the total network error.
[0113] Step S406: Send the network update identifier to each target device that has been networked.
[0114] The network update flag is used to instruct each target device to generate corresponding service information based on its latency information and then disband the network when the network update flag indicates a network update. It also instructs each target device, if it is determined not to be a gateway device, to determine the target access device based on the latency information and signal strength in the service information of the candidate access device. The latency information is obtained by each networked device based on its current number of connections and the target number of connections. The candidate access device includes node devices that have been re-networked after the network was disbanded.
[0115] After obtaining the network update flag through the total network error, the network update flag is sent to all target devices in the current network.
[0116] In the above-described device networking method, the near-field network platform determines whether the network needs to be updated based on the total networking error obtained from the networking information. If an update is required, a networking update flag is sent to each target device. Before updating the network, each target device obtains latency information by using its current number of connections and the number of target connections. The latency information is used to express its own connection performance. In the subsequent renetworking process, devices use latency information and signal strength to determine the target access device, which is equivalent to selecting the optimal access node device. This method can renetwork and optimize the network as a whole, reduce the total networking error, reduce overall latency, improve network service performance, and reduce resource consumption.
[0117] In an exemplary embodiment, a network update flag is obtained based on the total network error, including: obtaining a network update flag indicating that the network is not updated when the total network error is less than a preset target network error; and obtaining a network update flag indicating that the network is updated when the total network error is greater than the preset target network error.
[0118] The preset target networking error can be determined by combining the network size and historical networking parameters.
[0119] In this embodiment, network update flags with different meanings are generated by judging the magnitude of the total network error and the preset target network error, so as to indicate whether the network is updated. This allows for flexible determination of whether the network needs to be updated based on the actual network situation.
[0120] In one exemplary embodiment, such as Figure 5 As shown, based on the networking information of each networked device in the current network, the total networking error of the current network is obtained, including:
[0121] Step S502: Based on the networking information of each networked target device, obtain the current number of connections and the current number of hops for each networked target device.
[0122] Step S504: Based on the current number of connections and the current number of hops, obtain the target number of connections for each networked target device.
[0123] Step S506: Based on the current number of connections and the target number of connections, obtain the total network error of the current network.
[0124] Specifically, the current number of connections and hops of the target device can be obtained from the network connection count and hop count in the target device's network information. The target connection count of each networked target device can be constructed using a mathematical model based on network parameters such as the current connection count and hop count. This mathematical model is then used to optimize the network structure, thereby obtaining the target connection count for each target device. The total network error can be obtained by summing the absolute values of the differences between the current connection count and the target connection count for each of the networked target devices. This can be used to express the error between the total number of network connections and the total target number of network connections.
[0125] In this embodiment, the total network error of the current network is obtained by using the current number of connections of all target devices under the current network and the number of target connections. This can truly express the error between the network and the target, and provide reliable and accurate data support for network update determination.
[0126] In an exemplary embodiment, the target number of connections for each networked device is obtained based on the current number of connections and the current number of hops. This includes: obtaining an initial total network latency mathematical model based on the current number of connections and the current number of hops using a pre-built total network latency mathematical model; obtaining total network latency mathematical models with different total latencies using a multivariate particle swarm optimization algorithm based on the initial total network latency mathematical model; determining the total network latency mathematical model with the smallest total latency as the target total network latency mathematical model; and obtaining the current number of connections for each networked device in the target total network latency mathematical model as the target number of connections for each networked device.
[0127] Specifically, the steps for constructing the mathematical model of total network latency include:
[0128] Obtain the subcarrier bandwidth and data transmission rate of the single-hop link of the target device, and then obtain the minimum single-hop transmission delay of the target device; target device u n To the target device u k Minimum single-hop transmission delay τ n,k It can be determined by the following formula:
[0129] τ n,k =(C n,k ) -1 =(ΔBR) n,k ) -1
[0130] Among them, C n,k It is the link capacity, ΔB is the subcarrier bandwidth, and R is the link capacity. n,k It refers to the data transmission rate.
[0131] Based on the number of target devices and their current connections, the average number of single-hop transmission rounds per target device is obtained; based on the above formula, the average number of single-hop transmission rounds is... It can be determined by the following formula:
[0132]
[0133] Where ε is the target device u of the data packet from the sending end. n (Current hop count is h) n The round from the receiving end to another target device. Target device u n The probability of successful transmission is:
[0134]
[0135] The single-hop delay of the target device is obtained based on the average number of single-hop transmission rounds and the minimum single-hop transmission delay; based on the above formula, the single-hop delay T... n,k It can be determined by the following formula:
[0136]
[0137] The end-to-end delay consists of four parts: transmission delay, propagation delay, queuing delay, and processing delay. Propagation delay is relatively short compared to the other delays and is negligible. Processing delay is considered a fixed overhead and is not included here. Since queuing delay is related to network capacity and collisions, the target device automatically backs off when it detects a busy channel; therefore, the average queuing delay is T. w =(1+N) cw )T slot / 2, where N cw : The time slot length of the backoff window, T slot : Retreat window.
[0138] Based on the single-hop delay and the current hop count, the transmission delay of the target device is obtained; based on the above formula, the transmission delay of the target device u... n Transmission delay T to base station gNB total It can be determined by the following formula:
[0139]
[0140] Obtain the transmission latency of each target device and construct a mathematical model of the total network latency for the current network topology. Based on the above formula, the mathematical model can be expressed as:
[0141]
[0142] st:1≤h n ≤H,
[0143]
[0144]
[0145] Where H is the maximum hop count set in the network configuration; γ hn Is the current target device u n Maximum number of connections; U is the set of target devices in the network; N u It is the number of target devices in the network; R T It is the minimum transmission rate of the link; C n,k It's the link capacity. User u n The set of next-hop connected devices.
[0146] To obtain a network with low total latency, a multivariate particle swarm optimization algorithm is used to obtain mathematical models of total latency with different total latencies. The mathematical model with the smallest total latency is determined as the target total latency mathematical model, and the current number of connections of each networked device in the target total latency mathematical model is obtained as the target number of connections for each networked device.
[0147] In the above embodiments, a mathematical model of total network latency was constructed based on network information. A multivariate particle swarm optimization algorithm was used to obtain mathematical models of total network latency with different total latencies. The mathematical model with the smallest total latency was determined as the target mathematical model of total network latency. The current number of connections of each networked device in the target mathematical model of total network latency was obtained as the target number of connections of each networked device. The target number of connections of each networked device under the current network was reasonably determined, providing reliable data support for rebuilding the network to improve service quality.
[0148] In an exemplary embodiment, after sending the network update flag to each networked device, the method further includes: resetting the network update flag after a preset period, obtaining the current number of optimizations for the network, and if the number of optimizations is less than the preset maximum number, obtaining the network information of each networked device under the newly created network, and returning to execute the step of obtaining the network error based on the network information to further obtain the network update flag, until the total network error is less than the preset target network error or the number of optimizations is greater than or equal to the preset maximum number.
[0149] The preset period can be determined based on the establishment time of each network in the historical records, or it can be determined based on the network requirements in different environments. Resetting the network update flag can refer to initializing the network update flag, thus not affecting the devices under the network. For example, the near-field network platform can set the initial optimization count to 0. When the network update flag is issued for the first time (1), the initial optimization count is increased by 1. After the network update flag is sent to each networked device for the preset period, the network update flag is reset, and then the current optimization count of the network (i.e., 1) is obtained. For example, the maximum preset count is set to 6. Therefore, the current optimization count of 1 is less than the maximum preset count of 6. The network information of each networked device under the newly created network is obtained, and the process returns to execute the step of obtaining the network error based on the network information to further obtain the network update flag, until the total network error is less than the preset target network error or the optimization count is greater than or equal to the preset maximum count of 6.
[0150] In this embodiment, after dismantling the network for a preset period, the total network error of the newly built network is recalculated, and the current number of optimizations is obtained. If the total network error is less than the preset target network error or the number of optimizations is greater than or equal to the preset maximum number of optimizations, the acquisition of network information is stopped to determine whether to generate a network update flag for updating the network. This avoids endless updates to the network, saves network resources, and ensures that the network optimized within the preset maximum number of optimizations has low latency, thereby guaranteeing the quality of service of the network.
[0151] In an exemplary embodiment, the overall system flowchart of the device networking method can be as follows: Figure 6 As shown, specifically, the network optimization scheme for the near-domain network platform group can be as follows: Figure 7 As shown, it includes:
[0152] (1) System initialization, setting the target networking error R e Maximum number of optimizations T m (Maximum preset number of times), initial network update flag = 0, optimization number t = 0.
[0153] (2) The system collects information such as the power level, signal strength, number of network connections, number of network hops, and number of connections of the next-hop relay for each terminal device.
[0154] (3) Calculate the total networking error r of the current network. e The total network error is obtained by summing the absolute values of the differences between the current number of connections r(i) of all terminals i and the target number of connections R(i) of the network.
[0155] The target number of network connections R(i) can be obtained by the near-field network platform through a network optimization algorithm. The total network error r... ecan be determined by the following formula:
[0156]
[0157] (4) Determine whether the current total networking error r e is less than the target networking error R e . If yes, proceed to step (6); otherwise, set the networking update identifier to 1, and the optimization counter t = t+1.
[0158] (5) After a preset period, determine whether the current optimization count t is less than the maximum optimization count T m . If the maximum count is not reached, proceed to step (2) to repeat the routing optimization steps until the network networking error is less than the set range or the current round exceeds the maximum optimization count; otherwise, reset the networking update identifier to 0, and proceed to step (6).
[0159] (6) The platform issues a control instruction to all devices in the group, updates the networking update identifier, and ends the process.
[0160] Specifically, the networking update scheme for already-networked devices on the terminal side, that is, sub-process ①, can be as Figure 8 shown, including:
[0161] 1) The terminal m that has accessed the network initializes device information and networking information: set weight factors a1 and a2, collect information such as device power E, connection count r, hop count h, next-hop relay connection count r', and initialize the delay information as the initial delay.
[0162] 2) Determine whether the current networking update identifier is equal to 1. If the identifier is 1, proceed to step 3); otherwise, proceed to step 7).
[0163] 3) Calculate the current target connection count R(m) of the terminal node. The calculation method is: R(m) = sum of the connection counts r'(n) of the child nodes n of terminal m / the own connection count r(m) of the terminal. The target connection count R(m) of terminal u m can be determined by the following formula:
[0164]
[0165] 4) Judge the relationship between the connection count r(m) of the current terminal and the target connection count R(m). If r < R, the delay information L(m) decreases by a preset delay value ΔL; if r > R, the delay information L(m) increases by the preset delay value ΔL.
[0166] 5) The device updates the delay information L(m) in the globally broadcast service discovery query information (SD Query, Service Device Query).
[0167] 6) Dissolve the existing network and proceed to sub-process ② to re-network.
[0168] 7) End subprocess ①.
[0169] Specifically, the network update scheme for the terminal-side devices to be accessed, i.e., sub-process ②, can be as follows: Figure 9 As shown, it includes:
[0170] (1) Determine the gateway device. If the cellular signal strength of the device to be accessed is higher than the set threshold, it becomes the gateway device and proceeds to step (5); otherwise, proceed to step (2).
[0171] (2) Terminal device discovery process: Periodically scan all channels and send probe request frames to discover devices and services.
[0172] (3) If the terminal detects a probe response frame from another terminal j (candidate access device), it sends a service discovery query (SD Quary) to perform service discovery. The latency information L(j) and signal strength D(j) of the GO in the service information (SD Response) of the service discovery query response are parsed to construct the Quality of Service (QoS) benefit function Q(j). The terminal selects the service set identifier (SSID) with the best QoS benefit value GO as the target access device (upper hop) for group establishment, marks itself as a relay GO, and proceeds to step (5). Otherwise, proceed to step (4). Here, GO (Group Owner) is the group manager in the network. The QoS benefit function Q(j) can be determined by the following formula:
[0173] Q(j) = a1D(j) + a2L(j)
[0174] (4) If the terminal does not receive a Probe Response frame or a Beacon frame after scanning all channels, repeat step (3) until the scanning timer ends or a Probe Response frame of another GO is scanned.
[0175] (5) The terminal device is grouped and transmits data with the base station as an LC (Legacy Client), thus ending sub-process ②.
[0176] Specifically, network optimization algorithms may include:
[0177] The near-field network platform acquires network topology information. Using the subcarrier bandwidth and data transmission rate of the single-hop link of the target device within this information, it obtains the minimum single-hop transmission delay of the target device. nTo the target device u k Minimum single-hop transmission delay τ n,k It can be determined by the following formula:
[0178] τ n,k =(C n,k ) -1 =(ΔBR) n,k ) -1
[0179] Among them, C n,k It is the link capacity, ΔB is the subcarrier bandwidth, and R is the link capacity. n,k It refers to the data transmission rate.
[0180] Based on the number of target devices in the network and the current number of connections to those devices, the average number of single-hop transmission rounds per target device is obtained; based on the above formula, the average number of single-hop transmission rounds is... It can be determined by the following formula:
[0181]
[0182] Where ε is the target device u of the data packet from the sending end. n (Current hop count is h) n The round from the receiving end to another target device. Target device u n The probability of successful transmission is:
[0183]
[0184] The single-hop delay of the target device is obtained based on the average number of single-hop transmission rounds and the minimum single-hop transmission delay; based on the above formula, the single-hop delay T n,k It can be determined by the following formula:
[0185]
[0186] The end-to-end delay consists of four parts: transmission delay, propagation delay, queuing delay, and processing delay. Propagation delay is relatively short compared to the other delays and is negligible. Processing delay is considered a fixed overhead and is not included here. Since queuing delay is related to network capacity and collisions, the target device automatically backs off when it detects a busy channel; therefore, the average queuing delay is T. w = (1+N) cw )T slot / 2, where N cw : The time slot length of the backoff window, T slot : Retreat window.
[0187] Based on the single-hop delay and the current hop count, the transmission delay of the target device is obtained; based on the above formula, the transmission delay of the target device u... nTransmission delay T to base station gNB total It can be determined by the following formula:
[0188]
[0189] Obtain the transmission latency of each target device and construct a mathematical model of the total network latency for the current network topology. Based on the above formula, the mathematical model can be expressed as:
[0190]
[0191] st:1≤h n ≤H,
[0192]
[0193]
[0194] Where H is the maximum hop count set in the network configuration; γ hn Is the current target device u n Maximum number of connections; U is the set of target devices in the network; N u It is the number of target devices in the network; R T It is the minimum transmission rate of the link; C n,k It's the link capacity. User u n The set of next-hop connected devices.
[0195] To obtain a network with low total latency, a multivariate particle swarm optimization algorithm is used to obtain mathematical models of total latency with different total latencies. The mathematical model with the smallest total latency is determined as the target total latency mathematical model, and the current number of connections of each networked device in the target total latency mathematical model is obtained as the target number of connections for each networked device.
[0196] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0197] Based on the same inventive concept, this application also provides a device networking apparatus for implementing the device networking method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more device networking apparatus embodiments provided below can be found in the limitations of the device networking method described above, and will not be repeated here.
[0198] In one exemplary embodiment, such as Figure 10 As shown, a device networking apparatus 800 is provided, applied to target devices that have already formed a network, including: an acquisition module 801, a writing module 802, and an access module 803, wherein:
[0199] The acquisition module 801 is used to acquire the current number of connections and the target number of connections of the target device when it receives the network update flag indicating network update issued by the near-field network platform. The network update flag is generated by the near-field network platform based on the total network error of each networked target device in the current network. The total network error is obtained based on the network information of each networked target device.
[0200] The writing module 802 is used to obtain the latency information of the target device based on the current number of connections and the target number of connections, and then write the latency information into the service information of the target device before disbanding the network.
[0201] The access module 803 is used to obtain the target access device from the candidate access devices based on the delay information and signal strength in the service information of the candidate access devices when the target device is not a gateway device, and to connect the target device to the target access device; the candidate access devices include node devices that have been re-networked after the network was disbanded.
[0202] In an exemplary embodiment, the acquisition module 801 is further configured to acquire the current number of connections of the target device and the number of connections of each node device connected to the target device; and to obtain the target number of connections based on the number of connections of each node device and the current number of connections.
[0203] In an exemplary embodiment, the writing module 802 is further configured to, when the current number of connections is less than the target number of connections, reduce a preset delay value based on the initial delay of the target device to obtain the delay information of the target device; and when the current number of connections is greater than the target number of connections, increase a preset delay value based on the initial delay of the target device to obtain the delay information of the target device.
[0204] In an exemplary embodiment, the access module 803 is further configured to send a probe request frame to all channels when the target device is not a gateway device, and, upon receiving a probe response frame returned based on the probe request frame, designate the device that returned the probe response frame as a candidate access device; send a service discovery request to the candidate access device and receive service information returned by the candidate access device based on the service discovery request; and obtain the delay information and signal strength of the candidate access device based on the service information.
[0205] In an exemplary embodiment, the access module 803 is further configured to acquire the cellular signal strength of the target device; if the cellular signal strength is lower than a set threshold, determine that the target device is not a gateway device; if the cellular signal strength is higher than the set threshold, determine that the target device is a gateway device, and establish a network to transmit data with the base station.
[0206] In an exemplary embodiment, the access module 803 is further configured to, if it sends a probe request frame to all channels but does not receive a probe response frame, return to the step of sending a probe request frame to all channels until a probe response frame is received.
[0207] In an exemplary embodiment, the access module 803 is further configured to obtain a delay weighting coefficient and a signal strength weighting coefficient; based on the delay information and signal strength of each candidate access device, and the delay weighting coefficient and signal strength weighting coefficient, obtain the service quality benefit value corresponding to each candidate access device; and select the candidate access device with the largest service quality benefit value as the target access device.
[0208] In one exemplary embodiment, such as Figure 11 As shown, a device networking apparatus 900 is provided, applied to a near-field network platform, including: a computing module 901, a generation module 902, and a transmission module 903, wherein:
[0209] The calculation module 901 is used to obtain the total network error of the current network based on the network information of each target device already in the current network.
[0210] The generation module 902 is used to obtain the network update flag based on the total network error.
[0211] The sending module 903 is used to send a network update flag to each of the already networked target devices. The network update flag is used to instruct each target device to generate corresponding service information based on its latency information and then disband the network when the network update flag indicates a network update. It also instructs each target device to determine the target access device based on the latency information and signal strength in the service information of the candidate access device if it is determined not to be a gateway device. The latency information is obtained by each of the already networked devices based on its current number of connections and the target number of connections. The candidate access devices include node devices that have been re-networked after the network was disbanded.
[0212] In an exemplary embodiment, the generation module 902 is further configured to obtain a network update flag indicating that the network is not updated when the total network error is less than the preset target network error; and to obtain a network update flag indicating that the network is updated when the total network error is greater than the preset target network error.
[0213] In an exemplary embodiment, the calculation module 901 is further configured to obtain the current number of connections and the current number of hops of each networked target device based on the networking information of each networked target device; obtain the target number of connections of each networked target device based on the current number of connections and the current number of hops; and obtain the total networking error of the current network based on the current number of connections and the target number of connections.
[0214] In an exemplary embodiment, the calculation module 901 is further configured to obtain an initial total network latency mathematical model based on the current number of connections and the current number of hops, using a pre-constructed total network latency mathematical model; based on the initial total network latency mathematical model, to obtain total network latency mathematical models with different total latencies using a multivariate particle swarm optimization algorithm, to determine the total network latency mathematical model with the smallest total latency as the target total network latency mathematical model, and to obtain the current number of connections of each networked device in the target total network latency mathematical model as the target number of connections of each networked device.
[0215] In an exemplary embodiment, the sending module 903 is further configured to reset the network update flag after a preset period, and obtain the current number of optimizations for the network. If the number of optimizations is less than the preset maximum number, the module obtains the network information of each networked device under the newly created network, and returns to execute the step of obtaining the network error based on the network information to further obtain the network update flag, until the total network error is less than the preset target network error or the number of optimizations is greater than or equal to the preset maximum number.
[0216] Each module in the aforementioned network device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0217] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 12 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a device networking method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0218] Those skilled in the art will understand that Figure 12 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0219] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0220] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0221] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0222] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0223] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0224] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0225] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A device networking method, characterized in that, Applied to target devices already in a network, the method includes: Upon receiving a network update flag indicating a network update from the near-field network platform, the target connection number is obtained based on the connection number of each node device connected to the already networked target device and the current connection number of the already networked target device. The network update flag is generated by the near-field network platform based on the total network error of each already networked target device in the current network. The total network error is determined by the sum of the absolute values of the differences between the connection number of each already networked target device and the expected connection number. If the current number of connections is less than the target number of connections, a preset delay value is reduced based on the initial delay of the target device to obtain the delay information of the target device. The delay information is then written into the service information of the target device and the network is disbanded. If the current number of connections is greater than the target number of connections, the preset delay value is added based on the initial delay of the target device to obtain the delay information of the target device. The delay information is then written into the service information of the target device before the network is disbanded. If the target device is not a gateway device, the target access device is obtained from the candidate access devices based on the latency information and signal strength in the service information of the candidate access devices, and the target device is connected to the target access device; the candidate access devices include node devices that have been re-networked after the network was disbanded.
2. The method according to claim 1, characterized in that, When the target device is not a gateway device, the method based on the latency information and signal strength in the service information of the acquired candidate access devices includes: If the target device is not a gateway device, a probe request frame is sent to all channels, and if a probe response frame is received based on the probe request frame, the device that returned the probe response frame is selected as a candidate access device. Send a service discovery request to the candidate access device and receive service information returned by the candidate access device based on the service discovery request; Based on the service information, the delay information and signal strength of the candidate access device are obtained.
3. The method according to claim 2, characterized in that, If the target device is not a gateway device, before basing the information on latency and signal strength in the service information of the acquired candidate access devices, the process further includes: Obtain the cellular signal strength of the target device; If the cellular signal strength is below a set threshold, it is determined that the target device is not a gateway device; If the cellular signal strength is higher than a set threshold, the target device is identified as a gateway device, and a network is established to transmit data with the base station.
4. The method according to claim 2, characterized in that, The step of sending probe request frames to all channels and receiving probe response frames based on the probe request frames includes: If a probe request frame is sent to all channels but no probe response frame is received, the process returns to the step of sending a probe request frame to all channels until the probe response frame is received.
5. The method according to claim 1, characterized in that, The step of obtaining the target access device from the candidate access devices includes: Obtain the delay weighting coefficient and the signal strength weighting coefficient; Based on the delay information and signal strength of each candidate access device, and the delay weighting coefficient and signal strength weighting coefficient, the service quality benefit value corresponding to each candidate access device is obtained; The candidate access device with the highest service quality benefit value is selected as the target access device.
6. A device networking method, characterized in that, Applied to a near-field network platform, the method includes: Based on the networking information of each networked target device in the current network, the total networking error of the current network is obtained; the total networking error is determined by the sum of the absolute values of the differences between the number of connections and the expected number of connections for each of the networked target devices. Based on the total network error, the network update identifier is obtained; The network update flag is sent to each of the already networked target devices. The network update flag, when indicating a network update, instructs each target device to generate corresponding service information based on its latency information and then disband the network. It also instructs each target device, if determined not to be a gateway device, to determine a target access device based on latency information and signal strength in the service information of candidate access devices. The latency information is determined by reducing a preset latency value based on the target device's initial latency when the current number of connections to the already networked target device is less than the target number of connections, or by increasing a preset latency value based on the target device's initial latency when the current number of connections is greater than the target number of connections. The target number of connections is determined based on the number of connections of each node device accessing the already networked target device and the current number of connections to the already networked target device. The candidate access devices include node devices that have re-networked after disbanding the network.
7. The method according to claim 6, characterized in that, The step of obtaining the network update identifier based on the total network error includes: When the total network error is less than the preset target network error, a network update flag indicating that the network is not updated is obtained; When the total network error is greater than the preset target network error, a network update flag is obtained to characterize the network update.
8. The method according to claim 7, characterized in that, Based on the networking information of each target device already networked under the current network, the total networking error of the current network is obtained, including: Based on the networking information of each of the networked target devices, the current number of connections and the current number of hops of each of the networked target devices are obtained; Based on the current number of connections and the current number of hops, the target number of connections for each of the networked target devices is obtained; The total network error of the current network is obtained based on the current number of connections and the target number of connections.
9. The method according to claim 8, characterized in that, The process of obtaining the target connection number for each of the networked target devices based on the current connection number and the current hop count includes: Based on the current number of connections and the current number of hops, an initial mathematical model for total network latency is obtained through a pre-constructed mathematical model for total network latency. Based on the initial total network latency mathematical model, a multivariate particle swarm optimization algorithm is used to obtain total network latency mathematical models with different total latencies. The total network latency mathematical model with the smallest total latency is determined as the target total network latency mathematical model. The current connection number of each networked target device in the target total network latency mathematical model is obtained as the target connection number of each networked target device.
10. The method according to claim 9, characterized in that, The steps for constructing the mathematical model of total network latency include: Obtain the subcarrier bandwidth and data transmission rate of the single-hop link of the target device, and then obtain the minimum single-hop transmission delay of the target device; Based on the number of target devices and the current number of connections of the target devices, the average number of single-hop transmission rounds for the target devices is obtained; The single-hop delay of the target device is obtained based on the average number of single-hop transmission rounds and the minimum single-hop transmission delay. The transmission delay of the target device is obtained based on the single-hop delay and the current hop count; Obtain the transmission delay of each target device and construct a mathematical model of the total network delay of the current network.
11. The method according to claim 10, characterized in that, After sending the network update identifier to each of the networked target devices, the process further includes: After a preset period, the network update flag is reset, and the number of optimizations for the current network is obtained. If the number of optimizations is less than the preset maximum number, the network information of each target device already in the newly created network is obtained, and the process returns to the step of obtaining the network error based on the network information to obtain the network update flag, until the total network error is less than the preset target network error or the number of optimizations is greater than or equal to the preset maximum number.
12. A device networking apparatus, characterized in that, Applied to target devices already in a network, the device includes: The acquisition module is used to, upon receiving a network update flag indicating a network update from the near-field network platform, obtain the target connection number based on the connection number of each node device connected to the already networked target device and the current connection number of the already networked target device; the network update flag is generated by the near-field network platform based on the total network error of each already networked target device in the current network, and the total network error is determined by the sum of the absolute values of the differences between the connection number of each already networked target device and the expected connection number; The writing module is used to, when the current number of connections is less than the target number of connections, reduce the preset delay value based on the initial delay of the target device to obtain the delay information of the target device, write the delay information into the service information of the target device, and then disband the network; when the current number of connections is greater than the target number of connections, increase the preset delay value based on the initial delay of the target device to obtain the delay information of the target device, write the delay information into the service information of the target device, and then disband the network. The access module is used to, when the target device is not a gateway device, obtain the target access device from the candidate access devices based on the latency information and signal strength in the service information of the candidate access devices, and connect the target device to the target access device; the candidate access devices include node devices that have been re-networked after the network was disbanded.
13. A device networking apparatus, characterized in that, The device, applied to a near-field network platform, includes: The calculation module is used to obtain the total network error of the current network based on the network information of each networked target device in the current network. The total network error is determined by the sum of the absolute values of the differences between the number of connections and the expected number of connections for each of the networked target devices. The generation module is used to obtain the network update identifier based on the total network error; A sending module is used to send the network update flag to each of the already networked target devices. The network update flag, when indicating a network update, instructs each target device to generate corresponding service information based on its latency information and then disband the network. It also instructs each target device, if determined not to be a gateway device, to determine a target access device based on latency information and signal strength in the service information of candidate access devices to access the target access device. The latency information is determined by reducing a preset latency value based on the initial latency of the target device when the current number of connections of the already networked target device is less than the target number of connections, or by increasing a preset latency value based on the initial latency of the target device when the current number of connections is greater than the target number of connections. The target number of connections is determined based on the number of connections of each node device accessing the already networked target device and the current number of connections of the already networked target device. The candidate access devices include node devices that have re-networked after disbanding the network.
14. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 11.
15. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 11.
16. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Data transmission method and electronic equipment
CN113873678A
Communication networking control method and device, medium and electronic equipment
CN114666857A
