Method and system for realizing data loss prevention based on double Bluetooth

By optimizing the communication path and device screening of Bluetooth devices, it solves the problems of high energy consumption and unstable synchronization in Bluetooth data synchronization, realizes efficient data transmission and backup between dual Bluetooth devices, and is suitable for stable communication in a variety of scenarios.

CN118632222APending Publication Date: 2024-09-10SUN YAT SEN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410688128.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-30
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

The unreasonable communication path in the existing Bluetooth data synchronization technology leads to high energy consumption, unstable synchronization, low cost and efficiency, poor applicability, uneven power consumption between the main device and the secondary device, and increased data loss and errors. risk.

Method used

A data loss prevention method based on dual Bluetooth is adopted. By obtaining the device Bluetooth data record table, the cluster analysis algorithm and pre-stored ad hoc network rules are used to calculate communication quality prediction parameters, and the devices with higher activity are screened out as the main device to optimize communication. path to achieve periodic exchange and data backup synchronization of primary and secondary devices, reducing power consumption.

Benefits of technology

It achieves energy consumption balance between primary and secondary devices, improves data transmission efficiency and accuracy, is suitable for stable communication in small spaces and extreme situations, and reduces power consumption and resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118632222A
    Figure CN118632222A
Patent Text Reader

Abstract

The invention discloses a data loss prevention implementation method based on double Bluetooth, which comprises the following steps of: recording a data set by using equipment Bluetooth data, performing pre-screening through a clustering analysis algorithm and a Bluetooth ad hoc network rule to obtain all communication quality prediction parameters corresponding to Bluetooth equipment, and calculating the weight of the parameters to form a Bluetooth communication path; a device communication record request is sent to the Bluetooth ad hoc network center device through the path, and meanwhile, according to feedback information from the Bluetooth ad hoc network center device, main and auxiliary devices are screened out according to the device communication activeness; the main device and the auxiliary device periodically exchange control information and send a Bluetooth transmission request, so that connection between the two Bluetooth devices and connection, information exchange, data backup and synchronization between the main Bluetooth device and the transmission end device are kept. The invention further discloses a data loss prevention implementation system based on double Bluetooth. According to the invention, the communication balance and transmission efficiency between devices are effectively improved, and stable communication can be realized under normal and special conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of data synchronization and wireless communication, and in particular to a method and system for realizing data anti-loss based on dual Bluetooth. Background Art

[0002] In recent years, with the progress of society and the development of communication technology, Bluetooth devices have been applied in many aspects of people's lives.

[0003] Bluetooth technology is a short-range wireless communication technology that can realize data transmission and synchronization between different devices. The main features of Bluetooth technology are low power consumption, low cost, low complexity and high compatibility. Bluetooth technology has a wide range of application scenarios, such as wireless headphones, smart watches, health monitors, smart homes, etc.

[0004] The commonly used communication method at present is: the main device establishes a Bluetooth connection with the transmission end device, and the main device establishes a Bluetooth connection with the secondary device, and data transmission is performed by data forwarding. The transmission end device sends data information to the main device, and the main device forwards the data information to the secondary device, so that the main device and the secondary device synchronize information. However, the unreasonable communication path of the prior art leads to unstable data transmission synchronization and large differences in energy consumption of the two devices. In addition, when data synchronization needs to be performed between multiple Bluetooth devices, multiple connections and disconnections are required, resulting in a waste of time and resources, and also increasing the risk of data loss and errors.

[0005] One of the current existing technologies is the paper "A Data Synchronization Method Based on Bluetooth" by Wang Lisheng and Huo Lei, which introduces SyncML and a data synchronization method based on Bluetooth in a wireless personal area network, binds SyncML with the object exchange protocol OBEX, and introduces the key technologies involved in the binding, including pairing and session initialization of two Bluetooth devices supporting the OBEX protocol; the sending device sends SyncML commands through the OBEX protocol, and the receiving device converts the SyncML synchronization instructions into a data format that OBEX can understand; the receiving device processes these commands and returns the resulting data to the sending device through the OBEX protocol; after completing the data transmission, the OBEX session is closed to end the synchronization process; the disadvantages of this technology are: SyncML requires higher development and maintenance costs, and has lower compatibility and security.

[0006] The second current prior art is a self-organizing networking method and Bluetooth network of multiple Bluetooth sensors (CN117221846A). This invention determines a Bluetooth sensor network based on an optimal path prediction algorithm, and its steps include: obtaining device information of multiple Bluetooth sensors set in a target networking area; determining a first Bluetooth sensor from the multiple Bluetooth sensors; based on the optimal path prediction algorithm, determining the best several Bluetooth sensors to establish a Bluetooth sensor network; the disadvantages of this invention are: it requires multiple Bluetooth devices, has high cost and low computational efficiency, and has low practicality and applicability. Summary of the invention

[0007] The purpose of the present invention is to overcome the shortcomings of the existing methods and propose a data loss prevention implementation method and system based on dual Bluetooth. The main problems solved by the present invention are: 1) How to solve the problem of high energy consumption and unstable data transmission synchronization caused by unreasonable communication paths in the prior art. Many solutions have high costs, low applicability, large amount of calculation, low efficiency, and are not suitable for popularization; 2) How to solve the problem that in the communication method of the prior art, the main Bluetooth device needs to perform complete Bluetooth data transmission (for example, receiving and forwarding) with the data source device and the slave Bluetooth device respectively, resulting in a large amount of overall transmitted data, and at the same time, the power consumption of the main Bluetooth device is greater than that of the slave Bluetooth device, and the power consumption of the two Bluetooth devices is unbalanced.

[0008] In order to solve the above problem, the present invention proposes a data loss prevention method based on dual Bluetooth, the method comprising:

[0009] Get the pre-stored device Bluetooth data record table, form data points and package them into a data set;

[0010] Using the data set, pre-screening is performed through a cluster analysis algorithm and pre-stored Bluetooth ad hoc network rules to obtain all communication quality prediction parameters corresponding to the two Bluetooth devices;

[0011] According to the communication quality prediction parameters, a corresponding predicted communication quality weight value is calculated, and a candidate Bluetooth communication path is connected and formed;

[0012] Using the candidate Bluetooth communication path, sending a device communication record request to a Bluetooth ad hoc network center device, and receiving feedback information from the Bluetooth ad hoc network center device;

[0013] According to the feedback information of the Bluetooth ad hoc network center device, the device communication activity of the two Bluetooth devices is calculated, and the Bluetooth device with higher activity is selected as the main device and the other one is selected as the secondary device;

[0014] The master device and slave device periodically exchange control information and send Bluetooth transmission requests, thereby backing up and synchronizing data while maintaining the connection between the two Bluetooth devices and the connection between the master Bluetooth device and the transmission end device, and switching the master and slave devices and exchanging information between the master and slave devices.

[0015] Preferably, the obtaining of a pre-stored device Bluetooth data record table, forming data points and packaging them into a data set, specifically includes:

[0016] The pre-stored device Bluetooth data record table comes from the internal storage or external storage card of the Bluetooth device. These data include the MAC address or IP address of the input device, type, connection status, physical location or logical location, signal strength, and communication history (number of times, duration, content). By obtaining the above data and forming data points, calculations can be performed in subsequent steps.

[0017] Preferably, the data set is used to pre-screen by a cluster analysis algorithm and pre-stored Bluetooth ad hoc network rules to obtain all communication quality prediction parameters corresponding to the two Bluetooth devices, specifically:

[0018] Use the K-Means clustering analysis algorithm to obtain data points, the total number of data points, the clusters to which the data points belong, and the center points corresponding to the clusters. Alternately perform the allocation step and the update step until convergence and minimize the objective function. The allocation step, update step, and objective function formulas of the K-Means algorithm are as follows:

[0019]

[0020]

[0021]

[0022] Among them, x i is the ith data point, c i is x i The cluster to which it belongs, is x i The center point of the cluster, μ k is the center point corresponding to the kth cluster, M is the total number of data points, is the set of all data points belonging to the kth cluster in the tth iteration, where t is the number of iterations;

[0023] The formula for the assignment step is i , assign it to the nearest center point The formula of the update step is: For the kth cluster, recalculate the center point of the cluster The objective function is formulated for x i arrive The sum of squared distances is minimized;

[0024] A self-organizing network method and system using Bluetooth technology to extract Bluetooth self-organizing network rules and an information collection system based on Bluetooth self-organizing network, and simultaneously obtain and calculate the distance d between nodes in data points and the signal strength P between nodes r and P t , communication energy consumption between nodes E rx and E tx ; Use the Euclidean distance formula to calculate the distance between nodes, as follows:

[0025]

[0026] Among them, x and y are the coordinates of the two nodes, and n is the number of dimensions;

[0027] The signal strength between nodes is calculated using the attenuation model formula as follows:

[0028]

[0029] Among them, P r is the received signal strength, P t is the transmitted signal strength, G t and G r is the gain of the transmitting and receiving antennas, n is the environmental attenuation factor, d is the distance between nodes, d0 is the reference distance, and χ σ is Gaussian white noise;

[0030] The communication energy consumption between nodes is calculated using the power model formula as follows:

[0031] E tx =E elec ×k+E amp ×k×d α

[0032] E rx =E elec ×k

[0033] Among them, E tx and E rx is the energy consumption of sending and receiving k bits of data, E elec is the circuit energy consumption, E amp is the amplifier energy consumption, d is the distance between nodes, and α is the path loss exponent;

[0034] All communication quality prediction parameters corresponding to the two Bluetooth devices are obtained through the Euclidean distance formula, the attenuation model formula and the power model formula.

[0035] Preferably, the corresponding predicted communication quality weight value is calculated according to the communication quality prediction parameter, and the candidate Bluetooth communication paths are connected and formed, specifically:

[0036] Calculate the parameter average of all predicted communication quality parameters corresponding to each Bluetooth ad hoc network, and input the number of Bluetooth ad hoc networks in the network information corresponding to the Bluetooth communication path into the pre-trained second neural network model to obtain the output predicted communication quality weight, wherein the predicted communication quality weight w is calculated. j The loss function and optimization algorithm used are as follows:

[0037]

[0038] Where y is the true value, is the predicted value, n is the number of samples, and the loss function is used to measure the difference between the predicted value and the true value of the model;

[0039]

[0040] Where θ is the parameter of the model, α is the learning rate, is the gradient of the loss function, t is the number of iterations, and the optimization algorithm is used to update the parameters of the model to reduce the value of the loss function;

[0041] Calculate the average value of the product of the parameter average value of all Bluetooth ad hoc networks passing through the candidate Bluetooth communication path and the predicted communication quality weight to obtain the communication quality parameter corresponding to the candidate Bluetooth communication path; calculate the parameter average value of each Bluetooth ad hoc network, as follows:

[0042]

[0043] where x i is the parameter value of the ith node, n is the total number of nodes, is the parameter mean;

[0044] Calculate the average value of the product of the average value of the parameters of all Bluetooth ad hoc networks passed through the candidate Bluetooth communication path and the predicted communication quality weight, as follows:

[0045]

[0046] in, is the average value of the parameters of the jth Bluetooth ad hoc network, w j is the predicted communication quality weight of the jth Bluetooth ad hoc network, m is the total number of Bluetooth ad hoc networks, is a communication quality parameter.

[0047] Preferably, the device communication activity of two Bluetooth devices is calculated according to the feedback information of the Bluetooth ad hoc network center device, and the Bluetooth device with higher activity is selected as the primary device and the other one as the secondary device, specifically:

[0048] Through the feedback information of the Bluetooth ad hoc network center device, multiple device information records are judged to determine whether the device communication records corresponding to the two Bluetooth devices have been found:

[0049] If the result of the judgment is no, the cluster analysis algorithm and the pre-stored Bluetooth ad hoc network rules are repeatedly executed to filter out all Bluetooth ad hoc network center devices that may correspond to all Bluetooth devices until the result of the judgment is yes;

[0050] If the result of the judgment is yes, the data activity corresponding to any Bluetooth device is calculated according to the total amount of data sent and received by any Bluetooth device in the preset historical time period in the device communication record, wherein the formula for calculating the total amount of data sent and received by the candidate Bluetooth device in the preset historical time period is as follows:

[0051]

[0052] Among them, d i is the size of the i-th data transmission, n is the number of data transmissions, and D is the total amount of data in bits;

[0053] The formula for calculating the length of the historical time period is as follows:

[0054] T=t e -t s

[0055] Among them, t s is the start time of the historical time period, t e is the end time of the historical time period, T is the time length, and the unified unit is seconds;

[0056] The formula for calculating the data activity of each master device is as follows:

[0057]

[0058] Among them, A i is the data activity of the ith master device in bits per second, D i is the total amount of data sent and received by the ith master device in the preset historical time period, T i is the length of the preset historical time period;

[0059] The formula for calculating the average data activity of all master devices is as follows:

[0060]

[0061] in, is the average data activity, n is the total number of master devices, A i is the data activity of the ith master;

[0062] The formula for calculating the ratio of the data activity of each master device to the average value is as follows:

[0063]

[0064] Among them, R i is the device communication activity of the ith master device, A i is the data activity of the ith master device, is the average data activity;

[0065] Through the above formulas, the device communication activity of the Bluetooth device is obtained.

[0066] Preferably, the master device and the slave device periodically exchange control information and send a Bluetooth transmission request, thereby realizing data backup and synchronization while maintaining the connection between the two Bluetooth devices and the connection between the master Bluetooth device and the transmission end device, and switching the master and slave devices and exchanging information between the master and slave devices, specifically:

[0067] The main device and the secondary device are connected via a Bluetooth module based on the BLE low-power Bluetooth protocol or other short-range wireless communication technology, wherein the wireless module of the secondary device and the wireless module of the main device can be integrated into the same wireless chip or can be independent chips;

[0068] In the 2N-1th preset cycle, in the first time period, after the master device sends the first control information, including the switching instruction, the trigger condition information, the connection status message and the synchronization message, to the second Bluetooth device, the slave device sends the second control information to the master device, and in the second time period, the master device sends the Bluetooth transmission request to the transmission end device;

[0069] In the 2Nth preset cycle, in the first time period, after the slave device sends the second control information to the master device, the master device sends the first control information to the slave device, and in the second time period, the slave device sends a Bluetooth transmission request to the transmitting end device, where N is a positive integer greater than 0.

[0070] Accordingly, the present invention also provides a data loss prevention implementation system based on dual Bluetooth, comprising:

[0071] A data acquisition unit, used to acquire a pre-stored device Bluetooth data record table, form data points and package them into a data set;

[0072] A parameter pre-screening unit, using the data set to pre-screen through a cluster analysis algorithm and pre-stored Bluetooth ad hoc network rules, to obtain all communication quality prediction parameters corresponding to the two Bluetooth devices;

[0073] A path construction unit, which calculates a corresponding predicted communication quality weight value according to the communication quality prediction parameter, and connects and forms a candidate Bluetooth communication path;

[0074] An information feedback unit, using the candidate Bluetooth communication path, sends a device communication record request to the Bluetooth ad hoc network center device, and receives feedback information from the Bluetooth ad hoc network center device;

[0075] A device screening unit, which calculates the device communication activity of two Bluetooth devices according to the feedback information of the Bluetooth ad hoc network center device, and screens the Bluetooth device with higher activity as the main device and the other as the secondary device;

[0076] The result generating unit, the master device and the slave device periodically exchange control information and send Bluetooth transmission requests, thereby realizing data backup and synchronization while maintaining the connection between the two Bluetooth devices and the connection between the master Bluetooth device and the transmission end device, and switching the master and slave devices and exchanging information between the master and slave devices.

[0077] The implementation of the present invention has the following beneficial effects:

[0078] The present invention can achieve a better balance between the main device and the auxiliary device, and both the main device and the auxiliary device can control the communication with the data device, and can be switched or backed up at any time; the input and output between the various parts of the present invention are interconnected, and different parameters are extracted and integrated, which improves efficiency and makes the generated results more efficient and more accurate; the present invention uses the K-Means algorithm and the second neural network model, and extracts parameters by calculating the data points of the pre-stored Bluetooth data table, and screens out a Bluetooth device with a higher activity, so as to accurately select the correct device to the maximum extent; while providing a dual Bluetooth device communication method, the present invention also optimizes the communication path selection method of the dual Bluetooth network, and determines a better communication path with the help of the data of the Bluetooth self-organizing network, while getting rid of the wired connection, improving the information exchange efficiency between devices, reducing power consumption, and can be used for stable communication required by certain special situations, such as small spaces, extreme rescue, poor network coverage, etc. BRIEF DESCRIPTION OF THE DRAWINGS

[0079] Figure 1 This is a flow chart of a method for implementing data loss prevention based on dual Bluetooth according to an embodiment of the present invention;

[0080] Figure 2 This is a structural diagram of a data loss prevention system based on dual Bluetooth according to an embodiment of the present invention. DETAILED DESCRIPTION

[0081] 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.

[0082] Figure 1 FIG. 1 is a flow chart of a method for implementing data loss prevention based on dual Bluetooth according to an embodiment of the present invention. Figure 1 As shown, the method includes:

[0083] S1, obtain the pre-stored device Bluetooth data record table, form data points and package them into a data set;

[0084] S2, using the data set, pre-screening through a cluster analysis algorithm and pre-stored Bluetooth ad hoc network rules to obtain all communication quality prediction parameters corresponding to the two Bluetooth devices;

[0085] S3, calculating the corresponding predicted communication quality weight value according to the communication quality prediction parameter, connecting and forming a candidate Bluetooth communication path;

[0086] S4, using the candidate Bluetooth communication path, sending a device communication record request to the Bluetooth ad hoc network center device, and receiving feedback information from the Bluetooth ad hoc network center device;

[0087] S5, calculating the device communication activity of the two Bluetooth devices according to the feedback information of the Bluetooth ad hoc network center device, selecting the Bluetooth device with higher activity as the main device and the other as the secondary device;

[0088] S6, the master device and the slave device periodically exchange control information and send Bluetooth transmission requests, thereby achieving data backup and synchronization while maintaining the connection between the two Bluetooth devices and the connection between the master Bluetooth device and the transmission end device, and switching the master and slave devices and exchanging information between the master and slave devices.

[0089] Step S1 is as follows:

[0090] S1-1: The pre-stored device Bluetooth data record table comes from the internal storage of the Bluetooth device or the external storage card. These data may include the MAC address or IP address of the input device, type, connection status, physical location or logical location, signal strength, communication history (number of times, duration, content), etc. This step needs to obtain these data and form data points, which are then transmitted to the subsequent steps for easy calculation. For simplicity, the data points required in the subsequent steps use the same unit.

[0091] Step S2 is as follows:

[0092] S2-1: This solution is mainly based on the K-Means algorithm. It obtains the data points, the total number of data points, the clusters to which the data points belong, and the center points corresponding to the clusters in step S1, and alternately performs the allocation step and the update step until convergence and the objective function is minimized. The allocation step, update step, and objective function formulas of the K-Means algorithm are as follows:

[0093]

[0094]

[0095] Among them, x i is the ith data point, c i is x i The cluster to which it belongs, is x i The center point of the cluster, μ k is the center point corresponding to the kth cluster, M is the total number of data points, is the set of all data points belonging to the kth cluster in the tth iteration, where t is the number of iterations;

[0096] The formula for the assignment step is i , assign it to the nearest center point The formula of the update step is: For the kth cluster, recalculate the center point of the cluster The objective function is formulated for x i arrive The sum of squared distances is minimized.

[0097] S2-2: Self-organizing network method and system using Bluetooth technology to extract Bluetooth self-organizing network rules and information collection system based on Bluetooth self-organizing network, and simultaneously obtain and calculate the distance d between nodes in the data point and the signal strength P between nodes r and P t , the communication energy consumption between nodes F rx and E tx ; Use the Euclidean distance formula to calculate the distance between nodes, as follows:

[0098]

[0099] Among them, x and y are the coordinates of the two nodes, and n is the number of dimensions;

[0100] The signal strength between nodes is calculated using the attenuation model formula as follows:

[0101]

[0102] Among them, P r is the received signal strength, P t is the transmitted signal strength, G t and G r is the gain of the transmitting and receiving antennas, n is the environmental attenuation factor, d is the distance between nodes, d0 is the reference distance, and χ σ is Gaussian white noise;

[0103] The communication energy consumption between nodes is calculated using the power model formula as follows:

[0104] E tx =E elec ×k+E amp ×k×d α

[0105] E rx =E elec ×k

[0106] Among them, E tx and E rx is the energy consumption of sending and receiving k bits of data, E elec is the circuit energy consumption, E amp is the amplifier energy consumption, d is the distance between nodes, and α is the path loss exponent;

[0107] All communication quality prediction parameters corresponding to the two Bluetooth devices are obtained through the Euclidean distance formula, the attenuation model formula and the power model formula.

[0108] Step S3 is as follows:

[0109] S3-1: Calculate the parameter average of all predicted communication quality parameters corresponding to each Bluetooth ad hoc network, input the number of Bluetooth ad hoc networks in the network information corresponding to the Bluetooth communication path into the pre-trained second neural network model to obtain the output predicted communication quality weight, wherein the predicted communication quality weight w is calculated. j The loss function and optimization algorithm used are as follows:

[0110]

[0111] Where y is the true value, is the predicted value, n is the number of samples, and the loss function is used to measure the difference between the predicted value and the true value of the model;

[0112]

[0113] Where θ is the parameter of the model, α is the learning rate, is the gradient of the loss function, t is the number of iterations, and the optimization algorithm is used to update the parameters of the model to reduce the value of the loss function.

[0114] S3-2: Calculate the average value of the product of the parameter average value of all Bluetooth ad hoc networks passing through the candidate Bluetooth communication path and the predicted communication quality weight, and obtain the communication quality parameter corresponding to the candidate Bluetooth communication path; calculate the parameter average value of each Bluetooth ad hoc network, as follows:

[0115]

[0116] where x i is the parameter value of the ith node, n is the total number of nodes, is the parameter mean;

[0117] Calculate the average value of the product of the average value of the parameters of all Bluetooth ad hoc networks passed through the candidate Bluetooth communication path and the predicted communication quality weight, as follows:

[0118]

[0119] in, is the average value of the parameters of the jth Bluetooth ad hoc network, w j is the predicted communication quality weight of the jth Bluetooth ad hoc network, m is the total number of Bluetooth ad hoc networks, is a communication quality parameter.

[0120] Step S5 is as follows:

[0121] S5-1: judging multiple device information records through the feedback information of the Bluetooth ad hoc network center device, and judging whether the device communication records corresponding to the two Bluetooth devices have been found:

[0122] If the judgment result is no, the cluster analysis algorithm and the pre-stored Bluetooth ad hoc network rules are repeatedly executed to screen out all Bluetooth ad hoc network center devices that may correspond to all Bluetooth devices until the judgment result is yes.

[0123] S5-2: If the result of the judgment is yes, the data activity corresponding to any Bluetooth device is calculated according to the total amount of data sent and received by any Bluetooth device in the preset historical time period in the device communication record, wherein the formula for calculating the total amount of data sent and received by the candidate Bluetooth device in the preset historical time period is as follows:

[0124]

[0125] Among them, d i is the size of the i-th data transmission, n is the number of data transmissions, and D is the total amount of data in bits;

[0126] The formula for calculating the length of the historical time period is as follows:

[0127] T=t e -t s

[0128] Among them, t s is the start time of the historical time period, t e is the end time of the historical time period, T is the time length, and the unified unit is seconds;

[0129] The formula for calculating the data activity of each master device is as follows:

[0130]

[0131] Among them, A i is the data activity of the ith master device in bits per second, D i is the total amount of data sent and received by the ith master device in the preset historical time period, T i is the length of the preset historical time period;

[0132] The formula for calculating the average data activity of all master devices is as follows:

[0133]

[0134] in, is the average data activity, n is the total number of master devices, A i is the data activity of the ith master;

[0135] The formula for calculating the ratio of the data activity of each master device to the average value is as follows:

[0136]

[0137] Among them, R i is the device communication activity of the ith master device, A i is the data activity of the ith master device, is the average data activity;

[0138] Through the above formulas, the device communication activity of the Bluetooth device is obtained.

[0139] Step S6 is as follows:

[0140] S6-1: A connection is established between the main device and the secondary device through a Bluetooth module based on the BLE low-power Bluetooth protocol or other short-range wireless communication technologies (such as WIFI or ZigBee, etc.), wherein the wireless module of the secondary device and the wireless module of the main device can be integrated into the same wireless chip or can be independent chips.

[0141] S6-2: In the 2N-1th preset cycle, within the first time period, after the first control information (switching instructions, trigger condition information, connection status message and synchronization message, etc.) is sent from the main device to the second Bluetooth device, the secondary device sends the second control information to the main device, and within the second time period, the main device sends a Bluetooth transmission request to the transmitting end device.

[0142] S6-3: In the 2Nth preset cycle, within the first time period, after the slave device sends the second control information to the master device, the master device sends the first control information to the slave device, and within the second time period, the slave device sends a Bluetooth transmission request to the transmitting device, where N is a positive integer greater than 0.

[0143] Accordingly, the present invention also provides a data loss prevention implementation system based on dual Bluetooth, such as Figure 2 As shown, including:

[0144] Data acquisition unit 1, used to acquire the pre-stored device Bluetooth data record table, form data points and package them into a data set;

[0145] The parameter pre-screening unit 2 uses the data set to pre-screen through a cluster analysis algorithm and pre-stored Bluetooth ad hoc network rules to obtain all communication quality prediction parameters corresponding to the two Bluetooth devices;

[0146] A path construction unit 3 calculates a corresponding predicted communication quality weight value according to the communication quality prediction parameter, connects and forms a candidate Bluetooth communication path;

[0147] The information feedback unit 4 uses the candidate Bluetooth communication path to send a device communication record request to the Bluetooth ad hoc network center device, and receives feedback information from the Bluetooth ad hoc network center device;

[0148] The device screening unit 5 calculates the device communication activity of two Bluetooth devices according to the feedback information of the Bluetooth ad hoc network center device, and screens the Bluetooth device with higher activity as the main device and the other as the secondary device;

[0149] The result generating unit 6, the master device and the slave device periodically exchange control information and send Bluetooth transmission requests, thereby realizing data backup and synchronization while maintaining the connection between the two Bluetooth devices and the connection between the master Bluetooth device and the transmission end device, and switching the master and slave devices and exchanging information between the master and slave devices.

[0150] Therefore, the present invention can achieve a better balance between the main device and the auxiliary device, and both the main device and the auxiliary device can control the communication with the data device, and can be switched or backed up at any time; the input and output between the various parts of the present invention are interconnected, and different parameters are extracted and integrated, which improves efficiency and makes the generated results more efficient and more accurate; the present invention uses the K-Means algorithm and the second neural network model, and extracts parameters by calculating the data points of the pre-stored Bluetooth data table, and screens out a Bluetooth device with a higher activity, so as to accurately select the correct device to the maximum extent; while providing a dual Bluetooth device communication method, the present invention also optimizes the communication path selection method of the dual Bluetooth network, and uses the data of the Bluetooth self-organizing network to determine a better communication path. While getting rid of wired connections, the information exchange efficiency between devices is improved, and power consumption is reduced. It can be used for stable communication required by certain special situations, such as small spaces, extreme rescue, poor network coverage, etc.

[0151] The above is a detailed introduction to a data anti-loss implementation method and system based on dual Bluetooth provided by an embodiment of the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A data loss prevention method based on dual Bluetooth, characterized in that: The method comprises: Get the pre-stored device Bluetooth data record table, form data points and package them into a data set; Using the data set, pre-screening is performed through a cluster analysis algorithm and pre-stored Bluetooth ad hoc network rules to obtain all communication quality prediction parameters corresponding to the two Bluetooth devices; According to the communication quality prediction parameters, a corresponding predicted communication quality weight value is calculated, and a candidate Bluetooth communication path is connected and formed; Using the candidate Bluetooth communication path, sending a device communication record request to a Bluetooth ad hoc network center device, and receiving feedback information from the Bluetooth ad hoc network center device; According to the feedback information of the Bluetooth ad hoc network center device, the device communication activity of the two Bluetooth devices is calculated, and the Bluetooth device with higher activity is selected as the main device and the other one is selected as the secondary device; The master device and slave device periodically exchange control information and send Bluetooth transmission requests, thereby backing up and synchronizing data while maintaining the connection between the two Bluetooth devices and the connection between the master Bluetooth device and the transmission end device, and switching the master and slave devices and exchanging information between the master and slave devices.

2. A method for realizing data loss prevention based on dual Bluetooth as claimed in claim 1, characterized in that: The method of obtaining a pre-stored device Bluetooth data record table, forming data points and packaging them into a data set is specifically as follows: The pre-stored device Bluetooth data record table comes from the internal storage or external storage card of the Bluetooth device. These data include the MAC address or IP address, type, connection status, physical location or logical location, signal strength, and communication history of the input device. By obtaining the above data and forming data points, calculations can be performed in subsequent steps.

3. The method for realizing data loss prevention based on dual Bluetooth as claimed in claim 1, characterized in that: The data set is used to pre-screen through a cluster analysis algorithm and pre-stored Bluetooth ad hoc network rules to obtain all communication quality prediction parameters corresponding to the two Bluetooth devices, specifically: Use the K-Means clustering analysis algorithm to obtain data points, the total number of data points, the clusters to which the data points belong, and the center points corresponding to the clusters. Alternately perform the allocation step and the update step until convergence and minimize the objective function. The allocation step, update step, and objective function formulas of the K-Means algorithm are as follows: Among them, x i is the ith data point, c i is x i The cluster to which it belongs, is x i The center point of the cluster, μ k is the center point corresponding to the kth cluster, M is the total number of data points, is the set of all data points belonging to the kth cluster in the tth iteration, where t is the number of iterations; The formula for the assignment step is i , assign it to the nearest center point The formula of the update step is: For the kth cluster, recalculate the center point of the cluster The objective function is formulated for x i arrive The sum of squared distances is minimized; A self-organizing network method and system using Bluetooth technology to extract Bluetooth self-organizing network rules and an information collection system based on Bluetooth self-organizing network, and simultaneously obtain and calculate the distance d between nodes in data points and the signal strength P between nodes r and P t , communication energy consumption between nodes E rx and E tx ; Use the Euclidean distance formula to calculate the distance between nodes, as follows: Among them, x and y are the coordinates of the two nodes, and n is the number of dimensions; The signal strength between nodes is calculated using the attenuation model formula as follows: Among them, P r is the received signal strength, P t is the transmitted signal strength, G t and G r is the gain of the transmitting and receiving antennas, n is the environmental attenuation factor, d is the distance between nodes, d0 is the reference distance, and χ σ is Gaussian white noise; The communication energy consumption between nodes is calculated using the power model formula as follows: AND tx =And elec ×k+E amp ×k×d α AND rx =And elec ×k Among them, E tx and E rx is the energy consumption of sending and receiving k bits of data, E elec is the circuit energy consumption, E amp is the amplifier energy consumption, d is the distance between nodes, and α is the path loss exponent; All communication quality prediction parameters corresponding to the two Bluetooth devices are obtained through the Euclidean distance formula, the attenuation model formula and the power model formula.

4. The method for realizing data loss prevention based on dual Bluetooth as claimed in claim 1, characterized in that: The method of calculating the corresponding predicted communication quality weight value according to the communication quality prediction parameter, and connecting and forming a candidate Bluetooth communication path is specifically as follows: Calculate the parameter average of all predicted communication quality parameters corresponding to each Bluetooth ad hoc network, and input the number of Bluetooth ad hoc networks in the network information corresponding to the Bluetooth communication path into the pre-trained second neural network model to obtain the output predicted communication quality weight, wherein the predicted communication quality weight w is calculated. j The loss function and optimization algorithm used are as follows: Where y is the true value, is the predicted value, n is the number of samples, and the loss function is used to measure the difference between the predicted value and the true value of the model; Where θ is the parameter of the model, α is the learning rate, is the gradient of the loss function, t is the number of iterations, and the optimization algorithm is used to update the parameters of the model to reduce the value of the loss function; Calculate the average value of the product of the parameter average value of all Bluetooth ad hoc networks passing through the candidate Bluetooth communication path and the predicted communication quality weight to obtain the communication quality parameter corresponding to the candidate Bluetooth communication path; calculate the parameter average value of each Bluetooth ad hoc network, as follows: where x i is the parameter value of the ith node, n is the total number of nodes, is the parameter mean; Calculate the average value of the product of the average value of the parameters of all Bluetooth ad hoc networks passed through the candidate Bluetooth communication path and the predicted communication quality weight, as follows: in, is the average value of the parameters of the jth Bluetooth ad hoc network, w j is the predicted communication quality weight of the jth Bluetooth ad hoc network, m is the total number of Bluetooth ad hoc networks, is a communication quality parameter.

5. The method for realizing data loss prevention based on dual Bluetooth as claimed in claim 1, characterized in that: The device communication activity of two Bluetooth devices is calculated according to the feedback information of the Bluetooth ad hoc network center device, and the Bluetooth device with higher activity is selected as the main device and the other is selected as the secondary device, specifically: Through the feedback information of the Bluetooth ad hoc network center device, multiple device information records are judged to determine whether the device communication records corresponding to the two Bluetooth devices have been found: If the result of the judgment is no, the cluster analysis algorithm and the pre-stored Bluetooth ad hoc network rules are repeatedly executed to filter out all Bluetooth ad hoc network center devices that may correspond to all Bluetooth devices until the result of the judgment is yes; If the result of the judgment is yes, the data activity corresponding to any Bluetooth device is calculated according to the total amount of data sent and received by any Bluetooth device in the preset historical time period in the device communication record, wherein the formula for calculating the total amount of data sent and received by the candidate Bluetooth device in the preset historical time period is as follows: Among them, d i is the size of the i-th data transmission, n is the number of data transmissions, and D is the total amount of data in bits; The formula for calculating the length of the historical time period is as follows: T=t e -t s Among them, t s is the start time of the historical time period, t e is the end time of the historical time period, T is the time length, and the unified unit is seconds; The formula for calculating the data activity of each master device is as follows: Among them, A i is the data activity of the ith master device in bits per second, D i is the total amount of data sent and received by the ith master device in the preset historical time period, T i is the length of the preset historical time period; The formula for calculating the average data activity of all master devices is as follows: in, is the average data activity, n is the total number of master devices, A i is the data activity of the ith master; The formula for calculating the ratio of the data activity of each master device to the average value is as follows: Among them, R i is the device communication activity of the ith master device, A i is the data activity of the ith master device, is the average data activity; Through the above formulas, the device communication activity of the Bluetooth device is obtained.

6. The method for realizing data loss prevention based on dual Bluetooth as claimed in claim 1, characterized in that: The master device and the slave device periodically exchange control information and send a Bluetooth transmission request, thereby realizing data backup and synchronization while maintaining the connection between the two Bluetooth devices and the connection between the master Bluetooth device and the transmission end device, and switching the master and slave devices and exchanging information between the master and slave devices, specifically: The main device and the secondary device are connected via a Bluetooth module based on the BLE low-power Bluetooth protocol or other short-range wireless communication technology, wherein the wireless module of the secondary device and the wireless module of the main device can be integrated into the same wireless chip or can be independent chips; In the 2N-1th preset cycle, in the first time period, after the master device sends the first control information, including the switching instruction, the trigger condition information, the connection status message and the synchronization message, to the second Bluetooth device, the slave device sends the second control information to the master device, and in the second time period, the master device sends the Bluetooth transmission request to the transmission end device; In the 2Nth preset cycle, in the first time period, after the slave device sends the second control information to the master device, the master device sends the first control information to the slave device, and in the second time period, the slave device sends a Bluetooth transmission request to the transmitting end device, where N is a positive integer greater than 0.

7. A data loss prevention system based on dual Bluetooth, characterized in that: The system comprises: A data acquisition unit, used to acquire a pre-stored device Bluetooth data record table, form data points and package them into a data set; A parameter pre-screening unit, using the data set to pre-screen through a cluster analysis algorithm and pre-stored Bluetooth ad hoc network rules, to obtain all communication quality prediction parameters corresponding to the two Bluetooth devices; A path construction unit, which calculates a corresponding predicted communication quality weight value according to the communication quality prediction parameter, connects and forms a candidate Bluetooth communication path; An information feedback unit, using the candidate Bluetooth communication path, sends a device communication record request to the Bluetooth ad hoc network center device, and receives feedback information from the Bluetooth ad hoc network center device; A device screening unit, which calculates the device communication activity of two Bluetooth devices according to the feedback information of the Bluetooth ad hoc network center device, and screens the Bluetooth device with higher activity as the main device and the other as the secondary device; The result generating unit, the master device and the slave device periodically exchange control information and send Bluetooth transmission requests, thereby realizing data backup and synchronization while maintaining the connection between the two Bluetooth devices and the connection between the master Bluetooth device and the transmission end device, and switching the master and slave devices and exchanging information between the master and slave devices.

8. A dual-Bluetooth based data loss prevention system as claimed in claim 7, characterized in that: The method of obtaining a pre-stored device Bluetooth data record table, forming data points and packaging them into a data set is specifically as follows: The pre-stored device Bluetooth data record table comes from the internal storage or external storage card of the Bluetooth device. These data include the MAC address or IP address, type, connection status, physical location or logical location, signal strength, and communication history of the input device. By obtaining the above data and forming data points, calculations can be performed in subsequent steps.

9. A dual-Bluetooth based data loss prevention system as claimed in claim 7, characterized in that: The data set is used to pre-screen through a cluster analysis algorithm and pre-stored Bluetooth ad hoc network rules to obtain all communication quality prediction parameters corresponding to the two Bluetooth devices, specifically: Use the K-Means clustering analysis algorithm to obtain data points, the total number of data points, the clusters to which the data points belong, and the center points corresponding to the clusters. Alternately perform the allocation step and the update step until convergence and minimize the objective function. The allocation step, update step, and objective function formulas of the K-Means algorithm are as follows: Among them, x i is the ith data point, c i is x i The cluster to which it belongs, is x i The center point of the cluster, μ k is the center point corresponding to the kth cluster, M is the total number of data points, is the set of all data points belonging to the kth cluster in the tth iteration, where t is the number of iterations; The formula for the assignment step is i , assign it to the nearest center point The formula of the update step is: For the kth cluster, recalculate the center point of the cluster The objective function is formulated for x i arrive The sum of squared distances is minimized; A self-organizing network method and system using Bluetooth technology to extract Bluetooth self-organizing network rules and an information collection system based on Bluetooth self-organizing network, and simultaneously obtain and calculate the distance d between nodes in data points and the signal strength P between nodes r and P t , communication energy consumption between nodes E rx and E tx ; Use the Euclidean distance formula to calculate the distance between nodes, as follows: Among them, x and y are the coordinates of the two nodes, and n is the number of dimensions; The signal strength between nodes is calculated using the attenuation model formula as follows: Among them, P r is the received signal strength, P t is the transmitted signal strength, G t and G r is the gain of the transmitting and receiving antennas, n is the environmental attenuation factor, d is the distance between nodes, d0 is the reference distance, and χ σ is Gaussian white noise; The communication energy consumption between nodes is calculated using the power model formula as follows: AND tx =And elec ×k+E amp ×k×d α AND rx =And elec ×k Among them, E tx and E rx is the energy consumption of sending and receiving k bits of data, E elec is the circuit energy consumption, E amp is the amplifier energy consumption, d is the distance between nodes, and α is the path loss exponent; All communication quality prediction parameters corresponding to the two Bluetooth devices are obtained through the Euclidean distance formula, the attenuation model formula and the power model formula.

10. A data loss prevention system based on dual Bluetooth as claimed in claim 7, characterized in that: The method of calculating the corresponding predicted communication quality weight value according to the communication quality prediction parameter, and connecting and forming a candidate Bluetooth communication path is specifically as follows: Calculate the parameter average of all predicted communication quality parameters corresponding to each Bluetooth ad hoc network, and input the number of Bluetooth ad hoc networks in the network information corresponding to the Bluetooth communication path into the pre-trained second neural network model to obtain the output predicted communication quality weight, wherein the predicted communication quality weight w is calculated. j The loss function and optimization algorithm used are as follows: Where y is the true value, is the predicted value, n is the number of samples, and the loss function is used to measure the difference between the predicted value and the true value of the model; Where θ is the parameter of the model, α is the learning rate, is the gradient of the loss function, t is the number of iterations, and the optimization algorithm is used to update the parameters of the model to reduce the value of the loss function; Calculate the average value of the product of the parameter average value of all Bluetooth ad hoc networks passing through the candidate Bluetooth communication path and the predicted communication quality weight to obtain the communication quality parameter corresponding to the candidate Bluetooth communication path; calculate the parameter average value of each Bluetooth ad hoc network, as follows: where x i is the parameter value of the ith node, n is the total number of nodes, is the parameter mean; Calculate the average value of the product of the average value of the parameters of all Bluetooth ad hoc networks passed through the candidate Bluetooth communication path and the predicted communication quality weight, as follows: in, is the average value of the parameters of the jth Bluetooth ad hoc network, w j is the predicted communication quality weight of the jth Bluetooth ad hoc network, m is the total number of Bluetooth ad hoc networks, is a communication quality parameter.

11. The data loss prevention system based on dual Bluetooth as claimed in claim 7, characterized in that: The device communication activity of two Bluetooth devices is calculated according to the feedback information of the Bluetooth ad hoc network center device, and the Bluetooth device with higher activity is selected as the main device and the other is selected as the secondary device, specifically: Through the feedback information of the Bluetooth ad hoc network center device, multiple device information records are judged to determine whether the device communication records corresponding to the two Bluetooth devices have been found: If the result of the judgment is no, the cluster analysis algorithm and the pre-stored Bluetooth ad hoc network rules are repeatedly executed to filter out all Bluetooth ad hoc network center devices that may correspond to all Bluetooth devices until the result of the judgment is yes; If the result of the judgment is yes, the data activity corresponding to any Bluetooth device is calculated according to the total amount of data sent and received by any Bluetooth device in the preset historical time period in the device communication record, wherein the formula for calculating the total amount of data sent and received by the candidate Bluetooth device in the preset historical time period is as follows: Among them, d i is the size of the i-th data transmission, n is the number of data transmissions, and D is the total amount of data in bits; The formula for calculating the length of the historical time period is as follows: T=t e -t s Among them, t s is the start time of the historical time period, t e is the end time of the historical time period, T is the time length, and the unified unit is seconds; The formula for calculating the data activity of each master device is as follows: Among them, A i is the data activity of the ith master device in bits per second, D i is the total amount of data sent and received by the ith master device in the preset historical time period, T i is the length of the preset historical time period; The formula for calculating the average data activity of all master devices is as follows: in, is the average data activity, n is the total number of master devices, A i is the data activity of the ith master; The formula for calculating the ratio of the data activity of each master device to the average value is as follows: Among them, R i is the device communication activity of the ith master device, A i is the data activity of the ith master device, is the average data activity; Through the above formulas, the device communication activity of the Bluetooth device is obtained.

12. The data loss prevention system based on dual Bluetooth as claimed in claim 7, characterized in that: The master device and the slave device periodically exchange control information and send a Bluetooth transmission request, thereby realizing data backup and synchronization while maintaining the connection between the two Bluetooth devices and the connection between the master Bluetooth device and the transmission end device, and switching the master and slave devices and exchanging information between the master and slave devices, specifically: The main device and the secondary device are connected via a Bluetooth module based on the BLE low-power Bluetooth protocol or other short-range wireless communication technology, wherein the wireless module of the secondary device and the wireless module of the main device can be integrated into the same wireless chip or can be independent chips; In the 2N-1th preset cycle, in the first time period, after the master device sends the first control information, including the switching instruction, the trigger condition information, the connection status message and the synchronization message, to the second Bluetooth device, the slave device sends the second control information to the master device, and in the second time period, the master device sends the Bluetooth transmission request to the transmission end device; In the 2Nth preset cycle, in the first time period, after the slave device sends the second control information to the master device, the master device sends the first control information to the slave device, and in the second time period, the slave device sends a Bluetooth transmission request to the transmitting end device, where N is a positive integer greater than 0.