Bluetooth-based edge node network communication construction method and device, equipment and medium

By using Bluetooth technology to establish LAN and monitoring scripts on edge nodes, the problem of high power consumption of edge node WiFi connection is solved, low-power long-term operation and network communication is achieved, and the power replacement frequency is reduced.

CN119277358APending Publication Date: 2025-01-07BEIJING INSPUR CLOUD COMPUTING CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411492514.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

When edge nodes work for a long time in an edge computing environment, their power consumption is high when connected to the edge cloud through a WiFi network, resulting in frequent power replacement and increasing usage costs.

Method used

Adopting Bluetooth-based edge node network communication method, establish scripts and monitoring scripts by executing preset Bluetooth LANs, establish target Bluetooth LANs, and pair with the Bluetooth to be paired to establish network communication connections, monitor and reconnect in real time to ensure continuous communication .

Benefits of technology

It reduces the power consumption of edge nodes, avoids the problem of frequent power replacement, and realizes the network communication requirements that run for a long time under limited resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119277358A_ABST
    Figure CN119277358A_ABST
Patent Text Reader

Abstract

The invention discloses a Bluetooth-based edge node network communication construction method and device, equipment and a medium, and relates to the field of edge computing, and the method comprises the steps: executing a preset Bluetooth local area network establishment script to establish a target Bluetooth local area network, initializing local Bluetooth, carrying out Bluetooth network scanning to join in the target Bluetooth local area network, and carrying out Bluetooth network scanning to join in the target Bluetooth local area network; whether to-be-paired Bluetooth exists in the target Bluetooth local area network or not is judged, if the to-be-paired Bluetooth exists, a preset Bluetooth connection instruction is executed to be paired with the to-be-paired Bluetooth, and network communication connection with a target edge node corresponding to the to-be-paired Bluetooth is established after successful pairing; and executing the preset monitoring script to confirm whether the target edge node is disconnected or not in real time, and if the target edge node is disconnected, executing a preset restart command to re-establish network communication connection with the target edge node. Therefore, based on the characteristics of low power consumption and low cost of Bluetooth communication, the edge node is in a working state for a long time, and the communication requirement of the network is ensured under the condition of limited resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of edge computing, and in particular to a method, device, equipment and medium for establishing edge node network communication based on Bluetooth. Background Art

[0002] The edge computing environment is usually composed of an edge cloud and edge nodes. The edge nodes can be computing nodes in the form of independent servers or edge devices with computing capabilities. Edge nodes must generally be connected to the network through wired or wireless sensor nodes. In edge computing scenarios, due to the complexity of the edge environment, edge computing nodes managed by the edge cloud usually use WiFi (Wireless Fidelity) networks to connect to the edge cloud when there is no wired network connection. Since edge nodes are in working state for a long time, it is necessary to ensure the battery life of edge nodes. However, the method of connecting to the edge cloud through a WiFi network consumes high power consumption, so the power supply needs to be frequently replaced during the continuous operation of the edge node, which greatly increases the cost of use. Summary of the invention

[0003] In view of this, the purpose of the present invention is to provide a method, device, equipment and medium for constructing edge node network communication based on Bluetooth, which can keep edge nodes in working state for a long time based on the low power consumption and low cost characteristics of Bluetooth communication, and ensure the communication requirements of the network under limited resources. The specific scheme is as follows:

[0004] In a first aspect, the present application discloses a method for establishing a Bluetooth-based edge node network communication, which is applied to an edge node and includes:

[0005] Execute a preset Bluetooth local area network establishment script to establish a target Bluetooth local area network and initialize the local Bluetooth to perform Bluetooth network scanning through the initialized target local Bluetooth;

[0006] If the target Bluetooth local area network is scanned, join the target Bluetooth local area network, and determine whether there is a Bluetooth to be paired in the target Bluetooth local area network; the Bluetooth to be paired is at least one unconnected Bluetooth;

[0007] If there is a Bluetooth to be paired, execute the preset Bluetooth connection instruction to pair with the Bluetooth to be paired, and after the pairing is successful, establish a network communication connection with the target edge node corresponding to the Bluetooth to be paired;

[0008] Execute a preset monitoring script to confirm in real time whether the connection with the target edge node is disconnected. If the connection is disconnected, execute a preset restart command to re-establish a network communication connection with the target edge node.

[0009] Optionally, before executing a preset Bluetooth local area network establishment script to establish a target Bluetooth local area network and initializing a local Bluetooth to perform a Bluetooth network scan through the initialized target local Bluetooth, the method further includes:

[0010] Update the Bluetooth environment installation list to obtain an updated Bluetooth environment installation list;

[0011] Determine a number of environment components to be installed based on the updated Bluetooth environment installation list, and install the number of environment components to be installed locally on the edge node;

[0012] An installation check command is executed to determine whether all of the target environment components to be installed have been installed. If there are target environment components to be installed that have not been successfully installed, the target environment components to be installed are reinstalled.

[0013] Optionally, executing a preset Bluetooth local area network establishment script to establish a target Bluetooth local area network and initializing a local Bluetooth to perform Bluetooth network scanning through the initialized target local Bluetooth includes:

[0014] Checking whether the local network interface is a bridge interface, and if so, determining interface parameters of the bridge interface to determine whether there is an error in the configuration of the bridge interface according to the interface parameters;

[0015] If there is no error, establishing a target Bluetooth local area network for the edge node;

[0016] Initialize the local Bluetooth and continue to scan the Bluetooth network through the initialized target local Bluetooth until receiving a scan exit instruction.

[0017] Optionally, determining whether there is an error in the configuration of the bridge interface according to the interface parameters includes:

[0018] Read the interface parameter through a preset parameter reading instruction, and determine whether the return value corresponding to the preset parameter reading instruction is empty;

[0019] If the return value is empty, an error parameter in the interface parameter is determined, and parameter error information is fed back.

[0020] Optionally, if the target Bluetooth local area network is scanned, joining the target Bluetooth local area network and determining whether there is a Bluetooth to be paired in the target Bluetooth local area network includes:

[0021] If the target Bluetooth local area network is scanned, join the target Bluetooth local area network, and loop through the device list in the target Bluetooth local area network to determine whether the device list is empty;

[0022] If the device list is not empty, determine the Bluetooth to be paired in the device list.

[0023] Optionally, if there is a Bluetooth to be paired, executing a preset Bluetooth connection instruction to pair with the Bluetooth to be paired, and establishing a network communication connection with a target edge node corresponding to the Bluetooth to be paired after the pairing is successful, including:

[0024] If there is a Bluetooth to be paired, determine the Bluetooth address to be paired corresponding to the Bluetooth to be paired, establish a connection between the local Bluetooth address and the Bluetooth address to be paired through a preset pairing instruction, and determine whether pairing feedback information is received;

[0025] If the first feedback information indicating successful pairing is received, the next Bluetooth to be paired is connected until all the Bluetooth to be paired are successfully paired;

[0026] If a second feedback message indicating that pairing was unsuccessful is received, a connection is re-established between the local Bluetooth address and the Bluetooth address to be paired through a preset pairing instruction, and the number of retries is recorded. If the number of retries is greater than the preset retry number threshold, a connection is made with the next Bluetooth to be paired.

[0027] Optionally, executing a preset monitoring script to confirm in real time whether the connection with the target edge node is disconnected, and if disconnected, executing a preset restart command to re-establish a network communication connection with the target edge node includes:

[0028] cyclically monitoring whether a preset activity status monitoring interface is in an active state according to a preset cyclic monitoring interval;

[0029] If the preset activity status monitoring interface is not in an active state, it indicates that the connection with the target edge node is disconnected, and a preset restart command is executed to re-establish a network communication connection with the target edge node.

[0030] In a second aspect, the present application discloses a Bluetooth-based edge node network communication construction device, which is applied to an edge node, including:

[0031] A Bluetooth scanning module is used to execute a preset Bluetooth local area network establishment script to establish a target Bluetooth local area network and initialize the local Bluetooth to perform Bluetooth network scanning through the initialized target local Bluetooth;

[0032] A LAN joining module is used to join the target Bluetooth LAN if the target Bluetooth LAN is scanned, and determine whether there is a Bluetooth to be paired in the target Bluetooth LAN; the Bluetooth to be paired is at least one unconnected Bluetooth;

[0033] A Bluetooth pairing module is used to execute a preset Bluetooth connection instruction to pair with the Bluetooth to be paired if there is a Bluetooth to be paired, and to establish a network communication connection with a target edge node corresponding to the Bluetooth to be paired after the pairing is successful;

[0034] The connection monitoring module is used to execute a preset monitoring script to confirm in real time whether the connection with the target edge node is disconnected. If the connection is disconnected, a preset restart command is executed to re-establish a network communication connection with the target edge node.

[0035] In a third aspect, the present application discloses an electronic device, comprising:

[0036] Memory, used to store computer programs;

[0037] The processor is used to execute the computer program to implement the aforementioned method for establishing edge node network communication based on Bluetooth.

[0038] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned method for establishing a Bluetooth-based edge node network communication.

[0039] In the present application, a preset Bluetooth local area network establishment script can be executed to establish a target Bluetooth local area network and initialize the local Bluetooth, so as to perform Bluetooth network scanning through the initialized target local Bluetooth; if the target Bluetooth local area network is scanned, the target Bluetooth local area network is joined, and it is determined whether there is a Bluetooth to be paired in the target Bluetooth local area network; the Bluetooth to be paired is at least one unconnected Bluetooth; if there is a Bluetooth to be paired, the preset Bluetooth connection instruction is executed to pair with the Bluetooth to be paired, and after the pairing is successful, a network communication connection is established with the target edge node corresponding to the Bluetooth to be paired; the preset monitoring script is executed to confirm in real time whether the connection with the target edge node is disconnected, and if it is disconnected, the preset restart command is executed to re-establish a network communication connection with the target edge node. It can be seen that the method of the present application can execute a preset Bluetooth LAN establishment script to establish a target Bluetooth LAN, then initialize Bluetooth, and perform Bluetooth network scanning through the target local Bluetooth to join the scanned target Bluetooth LAN, and if there is a Bluetooth to be paired, pair it with the Bluetooth to be paired, and after the pairing is successful, establish a network communication connection with the target edge node corresponding to the Bluetooth to be paired, and finally execute a preset monitoring script to confirm in real time whether it is disconnected from the target edge node. If it is disconnected, execute a preset restart command to re-establish a network communication connection with the target edge node. In this way, a complete implementation method of an edge node network constructed by Bluetooth technology is provided. Based on the low power consumption and low cost characteristics of Bluetooth communication, the edge node can be kept in working state for a long time, thereby avoiding the problem of frequent power supply replacement under the condition of unsustainable power supply, and ensuring the communication requirements of the network under limited resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0041] Figure 1 A flow chart of a method for establishing a Bluetooth-based edge node network communication disclosed in this application;

[0042] Figure 2 A timing diagram of a method for establishing a Bluetooth-based edge node network communication disclosed in this application;

[0043] Figure 3 A schematic diagram of the structure of a device for building a Bluetooth-based edge node network communication disclosed in this application;

[0044] Figure 4This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0046] In the prior art, WiFi networks are usually used to connect to edge clouds. Since edge nodes are in working state for a long time, it is necessary to ensure the endurance of edge nodes. However, the method of connecting to edge clouds via WiFi networks consumes high power. Therefore, the power supply needs to be frequently replaced during the continuous operation of edge nodes, which greatly increases the cost of use.

[0047] In order to overcome the above technical problems, the present application discloses a method, device, equipment and medium for constructing edge node network communication based on Bluetooth. Based on the low power consumption and low cost characteristics of Bluetooth communication, the edge nodes can be kept in working state for a long time, and the communication requirements of the network can be guaranteed under limited resources.

[0048] See also Figure 1 As shown, the embodiment of the present invention discloses a method for establishing a Bluetooth-based edge node network communication, which is applied to an edge node and includes:

[0049] Step S11, executing a preset Bluetooth local area network establishment script to establish a target Bluetooth local area network, and initialize the local Bluetooth to perform Bluetooth network scanning through the initialized target local Bluetooth.

[0050] In this embodiment, before establishing a Bluetooth LAN and starting Bluetooth scanning, it is necessary to first install the relevant dependent environment on the edge node, specifically, Figure 2As shown, it is necessary to update the Bluetooth environment installation list to determine the latest environment components that need to be installed in the current environment, obtain the updated Bluetooth installation list, and then determine the several environment components to be installed contained in the list according to the obtained updated Bluetooth environment installation list, such as the environment dependency components of python, python-dev, python-pip, bluetooth, bluez, pulseaudio-module-bluetooth, libsystemd-dev, and systemd in the command, and then install the above components. It is necessary to install the several environment components to be installed in the list to the local of the edge node. Furthermore, it is necessary to execute the installation check command to determine whether the above several environment components to be installed have been fully installed. If it is detected that there are target environment components to be installed that have not been successfully installed, it is necessary to reinstall the target environment components to be installed.

[0051] After the environment components are installed, it is necessary to execute the preset Bluetooth LAN establishment script to establish the target Bluetooth LAN. Specifically, since the Bluetooth network is composed of various nodes joining the Bluetooth LAN, a Bluetooth LAN server is required to provide Bluetooth services to the outside world. Therefore, in this embodiment, the bt-pan script is used as the preset Bluetooth LAN establishment script. Specifically, it is necessary to check the local network interface. After determining the local network interface, it is necessary to determine whether the local network interface is a bridge interface. If it is a bridge interface, it is necessary to determine the interface parameters of the bridge interface to determine whether there is an error in the configuration of the bridge interface based on the interface parameters. It is necessary to read the interface parameters through the preset parameter reading instruction, and determine whether the return value corresponding to the preset parameter reading instruction is empty, that is, read the standard error output of the brct1 command corresponding to the bridge interface, and check the return value of brct1.wait() and brct1_stderr If the return value is not empty, then determine the error parameters in the interface parameters and feedback the parameter error information, that is, if the brct1 command fails or has an error output, it means that there is a problem with the bridge interface configuration, and it is necessary to display the error information and the preset recommended commands to guide the user on how to correctly configure the bridge interface. In this way, the environment can be guaranteed to be complete when establishing a Bluetooth LAN.

[0052] Furthermore, if there is no error, a target Bluetooth LAN is established for the edge node, and then the local Bluetooth is initialized. Specifically, sudo bluetoothctl can be executed to enter the bluetoothctl tool, and then poweron, agent on, default-agent are executed in sequence to initialize Bluetooth, and scan on is executed to scan the surrounding Bluetooth networks.

[0053] Step S12: if the target Bluetooth local area network is scanned, join the target Bluetooth local area network, and determine whether there is a Bluetooth to be paired in the target Bluetooth local area network.

[0054] In this embodiment, if a Bluetooth LAN is scanned, it is necessary to join the target Bluetooth LAN and determine the Bluetooth to be paired in the LAN. Specifically, it is necessary to determine whether the established target Bluetooth LAN server is scanned, and join the target Bluetooth LAN after scanning the target Bluetooth LAN. You can execute trust XX:XX:XX:XX:XX:XX:XX, pairXX:XX:XX:XX:XX:XX:XX to pair with the server, where XX:XX:XX:XX:XX:XX:XX is the MAC (Media Access Control Address, LAN address) address of the server.

[0055] After joining the target Bluetooth LAN, it is necessary to loop through the device list in the target Bluetooth LAN to determine whether the device list is empty. If it is empty, it indicates that there is currently no device that can be connected. If the device list is not empty, it indicates that there is currently a Bluetooth to be paired that can be connected.

[0056] Step S13: If there is a Bluetooth to be paired, execute a preset Bluetooth connection instruction to pair with the Bluetooth to be paired, and after the pairing is successful, establish a network communication connection with a target edge node corresponding to the Bluetooth to be paired.

[0057] In this embodiment, if there is a Bluetooth to be paired in the device list, it is necessary to execute the corresponding preset Bluetooth connection instruction to pair with the Bluetooth to be paired. Specifically, ifconfig can be executed to confirm that there is an available IP (Internet Protocol). If there is an available IP, a connection is established with the available IP through the address corresponding to the available IP. If there are multiple Bluetooth nodes to be paired, they can be paired with the Bluetooth nodes to be paired in sequence according to the order of the Bluetooth nodes in the list. After the pairing is successful, a network communication connection can be established with the target edge node corresponding to the Bluetooth to be paired, and communication can be carried out through ping.

[0058] Step S14, executing a preset monitoring script to confirm in real time whether the connection with the target edge node is disconnected. If the connection is disconnected, executing a preset restart command to re-establish a network communication connection with the target edge node.

[0059] In this embodiment, since there may be a disconnection after the communication connection is established between edge nodes, it is necessary to execute a preset monitoring script, and execute a restart command to re-establish the connection after the disconnection occurs. Specifically, it is necessary to cyclically monitor whether the preset activity status monitoring interface is in an active state according to a preset cyclic monitoring interval, wherein the preset cyclic monitoring interval can be set according to the needs of the user, and in this embodiment, it is set to 20 seconds, that is, the monitoring script is executed every 20 seconds. If the preset activity status monitoring interface is not in an active state, it indicates that it is disconnected from the target edge node, and a restart command needs to be executed to re-establish a network communication connection with the target edge node.

[0060] It can be seen that the method of the present application can execute a preset Bluetooth LAN establishment script to establish a target Bluetooth LAN, then initialize Bluetooth, and perform Bluetooth network scanning through the target local Bluetooth to join the scanned target Bluetooth LAN, and if there is a Bluetooth to be paired, pair it with the Bluetooth to be paired, and after the pairing is successful, establish a network communication connection with the target edge node corresponding to the Bluetooth to be paired, and finally execute a preset monitoring script to confirm in real time whether it is disconnected from the target edge node. If it is disconnected, execute a preset restart command to re-establish a network communication connection with the target edge node. In this way, a complete implementation method of an edge node network constructed by Bluetooth technology is provided. Based on the low power consumption and low cost characteristics of Bluetooth communication, the edge node can be kept in working state for a long time, thereby avoiding the problem of frequent power supply replacement under the condition of unsustainable power supply, and ensuring the communication requirements of the network under limited resources.

[0061] See also Figure 3 As shown, the embodiment of the present invention discloses a Bluetooth-based edge node network communication construction device, which is applied to the edge node, including:

[0062] The Bluetooth scanning module 11 is used to execute a preset Bluetooth local area network establishment script to establish a target Bluetooth local area network and initialize the local Bluetooth to perform Bluetooth network scanning through the initialized target local Bluetooth;

[0063] The LAN joining module 12 is used to join the target Bluetooth LAN if the target Bluetooth LAN is scanned, and determine whether there is a Bluetooth to be paired in the target Bluetooth LAN; the Bluetooth to be paired is at least one unconnected Bluetooth;

[0064] The Bluetooth pairing module 13 is used to execute a preset Bluetooth connection instruction to pair with the Bluetooth to be paired if there is a Bluetooth to be paired, and to establish a network communication connection with a target edge node corresponding to the Bluetooth to be paired after the pairing is successful;

[0065] The connection monitoring module 14 is used to execute a preset monitoring script to confirm in real time whether the connection with the target edge node is disconnected. If the connection is disconnected, a preset restart command is executed to re-establish a network communication connection with the target edge node.

[0066] In this embodiment, a preset Bluetooth local area network establishment script can be executed to establish a target Bluetooth local area network and initialize the local Bluetooth, so as to perform Bluetooth network scanning through the initialized target local Bluetooth; if the target Bluetooth local area network is scanned, the target Bluetooth local area network is joined, and it is determined whether there is a Bluetooth to be paired in the target Bluetooth local area network; the Bluetooth to be paired is at least one unconnected Bluetooth; if there is a Bluetooth to be paired, the preset Bluetooth connection instruction is executed to pair with the Bluetooth to be paired, and after the pairing is successful, a network communication connection is established with the target edge node corresponding to the Bluetooth to be paired; the preset monitoring script is executed to confirm in real time whether the connection with the target edge node is disconnected, and if it is disconnected, the preset restart command is executed to re-establish a network communication connection with the target edge node. It can be seen that the method of the present application can execute a preset Bluetooth LAN establishment script to establish a target Bluetooth LAN, then initialize Bluetooth, and perform Bluetooth network scanning through the target local Bluetooth to join the scanned target Bluetooth LAN, and if there is a Bluetooth to be paired, pair it with the Bluetooth to be paired, and after the pairing is successful, establish a network communication connection with the target edge node corresponding to the Bluetooth to be paired, and finally execute a preset monitoring script to confirm in real time whether it is disconnected from the target edge node. If it is disconnected, execute a preset restart command to re-establish a network communication connection with the target edge node. In this way, a complete implementation method of an edge node network constructed by Bluetooth technology is provided. Based on the low power consumption and low cost characteristics of Bluetooth communication, the edge node can be kept in working state for a long time, thereby avoiding the problem of frequent power supply replacement under the condition of unsustainable power supply, and ensuring the communication requirements of the network under limited resources.

[0067] In some specific embodiments, the Bluetooth-based edge node network communication construction device may further include:

[0068] In some specific embodiments, the Bluetooth scanning module 11 may specifically include:

[0069] A list updating unit, used for updating the Bluetooth environment installation list to obtain an updated Bluetooth environment installation list;

[0070] A first installation unit, configured to determine a number of environment components to be installed based on the updated Bluetooth environment installation list, and install the number of environment components to be installed locally on the edge node;

[0071] The second installation unit is used to execute the installation check command to determine whether the plurality of environment components to be installed have been fully installed, and if there are target environment components to be installed that have not been successfully installed, reinstall the target environment components to be installed.

[0072] In some specific embodiments, the Bluetooth scanning module 11 may specifically include:

[0073] a configuration parameter determination unit, configured to check whether the local network interface is a bridge interface, and if so, determine interface parameters of the bridge interface to determine whether there is an error in the configuration of the bridge interface according to the interface parameters;

[0074] A local area network establishing unit, configured to establish a target Bluetooth local area network for the edge node if no error exists;

[0075] The Bluetooth scanning unit is used to initialize the local Bluetooth and continuously scan the Bluetooth network through the initialized target local Bluetooth until a scanning exit instruction is received.

[0076] In some specific embodiments, the configuration parameter determination unit may specifically include:

[0077] A return value judgment unit, used to read the interface parameter through a preset parameter reading instruction, and determine whether the return value corresponding to the preset parameter reading instruction is empty;

[0078] The information feedback unit is used to determine the error parameters in the interface parameters and feed back parameter error information if the return value is empty.

[0079] In some specific embodiments, the local area network joining module 12 may specifically include:

[0080] A list determination unit, configured to join the target Bluetooth local area network if the target Bluetooth local area network is scanned, and traverse the device list in the target Bluetooth local area network in a loop to determine whether the device list is empty;

[0081] The unit for determining a Bluetooth device to be paired is configured to determine a Bluetooth device to be paired in the device list if the device list is not empty.

[0082] In some specific embodiments, the Bluetooth pairing module 13 may specifically include:

[0083] An information receiving and judging unit is used to determine the Bluetooth address to be paired corresponding to the Bluetooth to be paired if there is a Bluetooth to be paired, so as to establish a connection between the local Bluetooth address and the Bluetooth address to be paired through a preset pairing instruction, and to judge whether pairing feedback information is received;

[0084] A Bluetooth connection unit, configured to connect to the next Bluetooth to be paired if first feedback information indicating successful pairing is received, until all the Bluetooth to be paired are successfully paired;

[0085] The connection retry unit is used to re-establish a connection between the local Bluetooth address and the Bluetooth address to be paired through a preset pairing instruction if a second feedback message indicating that pairing was not successful is received, and record the number of retries. If the number of retries is greater than a preset retry threshold, connect to the next Bluetooth to be paired.

[0086] In some specific embodiments, the connection monitoring module 14 may specifically include:

[0087] An activity status monitoring unit, used for cyclically monitoring whether a preset activity status monitoring interface is in an active state according to a preset cyclic monitoring interval;

[0088] The Bluetooth restart unit is used to indicate that the connection with the target edge node is disconnected if the preset activity status monitoring interface is not in an active state, and execute a preset restart command to re-establish a network communication connection with the target edge node.

[0089] Furthermore, the present application also discloses an electronic device. Figure 4 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.

[0090] Figure 4 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the method for constructing a Bluetooth-based edge node network communication disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0091] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0092] In addition, the memory 22 as a carrier for resource storage may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage method may be temporary storage or permanent storage.

[0093] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the Bluetooth-based edge node network communication construction method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.

[0094] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned disclosed method for establishing edge node network communication based on Bluetooth is implemented. The specific steps of the method can refer to the corresponding contents disclosed in the aforementioned embodiments, and will not be repeated here.

[0095] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0096] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0097] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0098] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0099] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for constructing edge node network communication based on Bluetooth, characterized in that: Applied to edge nodes, including: Execute a preset Bluetooth local area network establishment script to establish a target Bluetooth local area network and initialize the local Bluetooth to perform Bluetooth network scanning through the initialized target local Bluetooth; If the target Bluetooth local area network is scanned, join the target Bluetooth local area network, and determine whether there is a Bluetooth to be paired in the target Bluetooth local area network; the Bluetooth to be paired is at least one unconnected Bluetooth; If there is a Bluetooth to be paired, execute the preset Bluetooth connection instruction to pair with the Bluetooth to be paired, and after the pairing is successful, establish a network communication connection with the target edge node corresponding to the Bluetooth to be paired; Execute a preset monitoring script to confirm in real time whether the connection with the target edge node is disconnected. If the connection is disconnected, execute a preset restart command to re-establish a network communication connection with the target edge node.

2. The method for constructing a Bluetooth-based edge node network communication according to claim 1, characterized in that: The method further includes executing a preset Bluetooth local area network establishment script to establish a target Bluetooth local area network and initialize the local Bluetooth to perform Bluetooth network scanning through the initialized target local Bluetooth: Update the Bluetooth environment installation list to obtain an updated Bluetooth environment installation list; Determine a number of environment components to be installed based on the updated Bluetooth environment installation list, and install the number of environment components to be installed locally on the edge node; An installation check command is executed to determine whether all of the target environment components to be installed have been installed. If there are target environment components to be installed that have not been successfully installed, the target environment components to be installed are reinstalled.

3. The method for constructing a Bluetooth-based edge node network communication according to claim 1, characterized in that: The execution of the preset Bluetooth local area network establishment script to establish a target Bluetooth local area network and initialize the local Bluetooth to perform Bluetooth network scanning through the initialized target local Bluetooth includes: Checking whether the local network interface is a bridge interface, and if so, determining interface parameters of the bridge interface to determine whether there is an error in the configuration of the bridge interface according to the interface parameters; If there is no error, establishing a target Bluetooth local area network for the edge node; Initialize the local Bluetooth and continue to scan the Bluetooth network through the initialized target local Bluetooth until receiving a scan exit instruction.

4. The method for constructing a Bluetooth-based edge node network communication according to claim 3, characterized in that: The determining, according to the interface parameters, whether there is an error in the configuration of the bridge interface comprises: Read the interface parameter through a preset parameter reading instruction, and determine whether the return value corresponding to the preset parameter reading instruction is empty; If the return value is empty, an error parameter in the interface parameter is determined, and parameter error information is fed back.

5. The method for constructing edge node network communication based on Bluetooth according to claim 1, characterized in that: If the target Bluetooth local area network is scanned, joining the target Bluetooth local area network and determining whether there is a Bluetooth to be paired in the target Bluetooth local area network include: If the target Bluetooth local area network is scanned, join the target Bluetooth local area network, and loop through the device list in the target Bluetooth local area network to determine whether the device list is empty; If the device list is not empty, determine the Bluetooth to be paired in the device list.

6. The method for constructing edge node network communication based on Bluetooth according to claim 1, characterized in that: If there is a Bluetooth to be paired, a preset Bluetooth connection instruction is executed to pair with the Bluetooth to be paired, and after the pairing is successful, a network communication connection is established with a target edge node corresponding to the Bluetooth to be paired, including: If there is a Bluetooth to be paired, determine the Bluetooth address to be paired corresponding to the Bluetooth to be paired, establish a connection between the local Bluetooth address and the Bluetooth address to be paired through a preset pairing instruction, and determine whether pairing feedback information is received; If the first feedback information indicating successful pairing is received, the next Bluetooth to be paired is connected until all the Bluetooth to be paired are successfully paired; If a second feedback message indicating that pairing was unsuccessful is received, a connection is re-established between the local Bluetooth address and the Bluetooth address to be paired through a preset pairing instruction, and the number of retries is recorded. If the number of retries is greater than the preset retry number threshold, a connection is made with the next Bluetooth to be paired.

7. The method for establishing edge node network communication based on Bluetooth according to any one of claims 1 to 6, characterized in that: The executing of the preset monitoring script to confirm in real time whether the target edge node is disconnected, and if disconnected, executing the preset restart command to re-establish the network communication connection with the target edge node, includes: cyclically monitoring whether a preset activity status monitoring interface is in an active state according to a preset cyclic monitoring interval; If the preset activity status monitoring interface is not in an active state, it indicates that the connection with the target edge node is disconnected, and a preset restart command is executed to re-establish a network communication connection with the target edge node.

8. A device for constructing edge node network communication based on Bluetooth, characterized in that: Applied to edge nodes, including: A Bluetooth scanning module is used to execute a preset Bluetooth local area network establishment script to establish a target Bluetooth local area network and initialize the local Bluetooth to perform Bluetooth network scanning through the initialized target local Bluetooth; A LAN joining module is used to join the target Bluetooth LAN if the target Bluetooth LAN is scanned, and determine whether there is a Bluetooth to be paired in the target Bluetooth LAN; the Bluetooth to be paired is at least one unconnected Bluetooth; A Bluetooth pairing module is used to execute a preset Bluetooth connection instruction to pair with the Bluetooth to be paired if there is a Bluetooth to be paired, and to establish a network communication connection with a target edge node corresponding to the Bluetooth to be paired after the pairing is successful; The connection monitoring module is used to execute a preset monitoring script to confirm in real time whether the connection with the target edge node is disconnected. If the connection is disconnected, a preset restart command is executed to re-establish a network communication connection with the target edge node.

9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor is used to execute the computer program to implement the method for establishing edge node network communication based on Bluetooth as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, the method for establishing a Bluetooth-based edge node network communication is implemented as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • XWIKI system configuration method and system and computer equipment

    CN110673923A

  • Method for constructing Linux edge node network through Bluetooth

    CN112911567A

  • Edge computing gateway for elevator safety monitoring and monitoring system and method thereof

    CN113543105A

  • Method and system for secured pairing for data communication between an edge node and a bluetooth device

    US20240334194A1