Digital key classification method and device based on affinity clustering, and electronic device
Through the digital key classification method based on affinity clustering, the mobile phones are classified, and the problem of difficulty and cost of calibration work caused by the differences in Bluetooth RSSI characteristics of different mobile phones is solved, and the effect of reducing calibration workload and cost is achieved.
Patent Information
- Application Number
- CN202411604029.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2044-11-12
AI Technical Summary
Due to the large differences in Bluetooth RSSI characteristics of different models of mobile phones, it is necessary to calibrate Bluetooth digital keys for each model of mobile phone, which increases the difficulty and cost of calibration work.
The digital key classification method based on affinity clustering is adopted, and the Bluetooth RSSI feature data of the mobile phone is obtained and preprocessed, and the mobile phone is classified using an affinity clustering algorithm to determine the clustering center and cluster neighbors, thereby realizing unsupervised classification of the digital keys.
Through this method, digital keys of the same category can share a set of calibration parameters, reducing calibration workload, reducing calibration costs, and effectively responding to the increasing classification needs.
Smart Images

Figure CN119150170B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the technical field of digital key calibration, and in particular to a digital key classification method and device based on affinity clustering, and an electronic device. Background Art
[0002] The rapid development of smart car technology has made digital keys gradually emerge, and the replacement of traditional physical keys by digital keys has become an irreversible trend. Currently, the digital keys on the market are mainly Bluetooth digital keys. Bluetooth digital keys capture Bluetooth signals from mobile phones through the vehicle-mounted Bluetooth base station, and determine the position of the digital key relative to the vehicle by analyzing the RSSI (Received Signal Strength Indication) value of the Bluetooth signal received by the base station, thereby realizing the unlocking and locking operations of the vehicle. However, due to differences in chip models, mobile phone structures, and mobile phone manufacturing processes, different models of mobile phones have different Bluetooth RSSI characteristics at the same distance from the Bluetooth base station, so it is necessary to calibrate the Bluetooth digital keys of different models of mobile phones to obtain a better user experience of unlocking and locking.
[0003] However, there are many mobile phone models on the market, and dozens of new models are added every year. If each model of mobile phone is calibrated, it will pose a huge challenge to the calibration of Bluetooth digital keys. Therefore, a classification method is urgently needed to classify digital keys so that digital keys of the same category share a set of calibration parameters and can well realize the functions of unlocking and locking the vehicle, thereby reducing the calibration work of Bluetooth digital keys. Summary of the invention
[0004] The embodiments of the present invention provide a digital key classification method and device based on affinity clustering, and an electronic device. By classifying digital keys through an affinity clustering algorithm, terminals of the same type can have good consistency when positioned, which is beneficial to reducing calibration costs.
[0005] In a first aspect, an embodiment of the present invention provides a digital key classification method based on affinity clustering, comprising:
[0006] Acquire the collected characteristic data of the terminals to be classified; the characteristic data includes characteristic values of M types of terminals to be classified at N sampling positions respectively; M and N are both natural numbers greater than 1;
[0007] Preprocessing the feature data;
[0008] According to the preprocessed feature data, a cluster center and cluster neighbors are obtained based on an affinity clustering algorithm; wherein, a terminal classification result is obtained based on the cluster center and cluster neighbors.
[0009] As an embodiment, obtaining the cluster center and the cluster neighbors based on the affinity clustering algorithm according to the preprocessed feature data includes:
[0010] Calculate the similarity matrix between the feature data corresponding to the terminal to be classified at each sampling position;
[0011] Initialize responsibility value and ownership;
[0012] According to the responsibility value and the degree of belonging update formula, the responsibility value and the degree of belonging are updated to update the iterative cluster center;
[0013] Determine whether the cluster center is stable or the maximum number of iterations is reached. If so, determine the cluster center. If not, continue to update the iterative cluster center.
[0014] The cluster neighbors of each cluster center are calculated based on the obtained cluster centers.
[0015] As an embodiment, updating the responsibility value and the degree of attribution according to the responsibility value and degree of attribution update formula to update the iterative clustering center includes:
[0016] The update formula of responsibility value is:
[0017] (1)
[0018] in Indicates the suitability of data point i to select data point k as its cluster center; represents the similarity between data points i and k, is the attribute value, indicating that the data point The degree of suitability as the cluster center of data point i; is the center of all clusters except k Take the maximum value;
[0019] The update formula of the attribution degree is:
[0020] (2)
[0021] When i=k, the attribution degree update formula becomes:
[0022] (3)
[0023] in is the responsibility value of data point k itself, indicating the suitability of k as its own cluster center; It is the sum of the responsibility values of all other data points that support k as the cluster center.
[0024] 1. As an embodiment, determining a cluster center includes:
[0025] For each data point k, if , then k is selected as a cluster center;
[0026] The cluster neighbors of each cluster center are calculated based on the obtained cluster centers, including:
[0027] For each non-cluster center data point i, it is classified into The largest cluster center k.
[0028] As an embodiment, the characteristic value of the terminal to be classified is a Bluetooth RSSI value;
[0029] The preprocessing of the characteristic data comprises:
[0030] Perform 3sigma outlier removal processing on the RSSI value of each terminal at each sampling position;
[0031] Calculate the average RSSI value of each terminal to be classified at each sampling position;
[0032] Accordingly, the calculation of the similarity matrix between the feature data corresponding to the terminal to be classified at each sampling position includes:
[0033] A similarity matrix is calculated based on the average RSSI value.
[0034] As an embodiment, it also includes:
[0035] The RSSI value of each terminal to be classified is collected in the following manner:
[0036] The sampling times of each sampling position are preset times, the distance between adjacent sampling positions is preset, and the terminal to be classified is vertically downward and remains stationary during sampling.
[0037] In a second aspect, an embodiment of the present invention provides a digital key classification device based on affinity clustering, comprising:
[0038] An acquisition module, used to acquire the collected characteristic data of the terminals to be classified; the characteristic data includes characteristic values of M types of terminals to be classified at N sampling positions respectively; M and N are both natural numbers greater than 1;
[0039] A preprocessing module, used for preprocessing the feature data;
[0040] The clustering module is used to obtain the cluster center and cluster neighbors based on the affinity clustering algorithm according to the preprocessed feature data; wherein the terminal classification result is obtained according to the cluster center and cluster neighbors.
[0041] In a third aspect, an embodiment of the present invention provides an electronic device, including a memory and a processor;
[0042] The memory is used to store computer programs; the processor is used to read the computer program in the memory and implement the digital key classification method based on affinity clustering as described above when executing the program.
[0043] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the digital key classification method based on affinity clustering as described in the first aspect.
[0044] Compared with the prior art, the technical solution provided by the embodiment of the present invention has at least the following positive effects:
[0045] In the technical solution of the embodiment of the present invention, the characteristic data of the terminal to be classified is collected, and after the characteristic data is preprocessed, the cluster center and cluster neighbors are obtained based on the characteristic data based on the affinity clustering algorithm, and then the terminal classification result can be obtained based on the cluster center and cluster neighbors. The affinity clustering algorithm classifies by transmitting the responsibility value and the degree of belonging information between the characteristic data of the terminal to be classified. The responsibility value and the degree of belonging information can well reflect the characteristics of the terminal, thereby determining the cluster center and the cluster neighbors, and realizing the unsupervised classification of the digital key, so that the classified digital key meets the use requirements, and at the same time can effectively respond to the increasing classification needs, reduce the calibration workload, and reduce the calibration cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0047] Figure 1 A schematic diagram of a flow chart of a digital key classification method based on affinity clustering provided in the first embodiment of the present invention;
[0048] Figure 2 A flow chart of the clustering step in the digital key classification method provided in the first embodiment of the present invention;
[0049] Figure 3 A schematic diagram of a classification result of the digital key classification method provided in the first embodiment of the present invention;
[0050] Figure 4 A line graph of an affinity matrix of a classification example of the digital key classification method provided in the first embodiment of the present invention;
[0051] Figure 5 A line graph showing changes in RSSI over distance for a classification example of the digital key classification method provided in the first embodiment of the present invention;
[0052] Figure 6 A schematic diagram of the structure of a digital key classification device provided in Embodiment 2 of the present invention;
[0053] Figure 7 This is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0054] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0055] The following describes the digital key classification method and device, electronic device and storage medium based on affinity clustering of the embodiment of the present application with reference to the accompanying drawings. When the smartphone mentioned in the background technology is used as a Bluetooth digital key, due to the differences in the internal structure, Bluetooth chip and manufacturing process of different models of mobile phones, the RSSI values of different models of mobile phones at the same distance are quite different and need to be calibrated separately. However, the large number and increasing number of mobile phone models bring about the large calibration workload and the difficulty of classification. The present application provides a digital key classification method based on affinity clustering. In this method, by obtaining the collected feature data of the terminal to be classified, the feature data is pre-processed, and the cluster center and cluster neighbors are obtained based on the feature data based on the affinity clustering algorithm, and then the number of categories and cluster neighbors obtained according to the number of cluster centers are used to obtain the terminals belonging to each category. The affinity clustering algorithm classifies terminals by transmitting responsibility and attribution information between terminal feature data (such as RSSI values). Since the responsibility and attribution information can well reflect the Bluetooth RSSI characteristics of the terminal, the classification results can meet the requirements of the digital key unlocking function. At the same time, it can reduce the calibration workload and effectively respond to the increasing calibration needs.
[0056] Figure 1A flow chart of a digital key classification method based on affinity clustering provided in an embodiment of the present invention, wherein the method is used to classify Bluetooth digital key terminals, and terminals of the same classification may use the same calibration parameters, such as the RSSI value of unlocking or locking the Bluetooth digital key, and the unlocking RSSI value is the RSSI value corresponding to the set unlocking distance. It can be understood that this embodiment does not impose specific restrictions on the unlocking feature data of the digital key. For example, the unlocking feature data may also be the ranging value of UWB (Ultra-Wide Band). The method may be executed by a digital key classification device based on affinity clustering provided in an embodiment of the present invention, and the device may be implemented in software and / or hardware and configured in an electronic device. Figure 1 As shown, the digital key classification method based on affinity clustering of the present application includes the following steps:
[0057] Step 101: Acquire the collected feature data of the terminal to be classified.
[0058] The terminal to be classified can be a portable smart device such as a smart phone or a smart watch, and no specific restrictions are made here. The characteristic data includes the characteristic values of M types of terminals to be classified at N sampling positions. M and N are both natural numbers greater than 1. The characteristic value of the terminal to be classified is the Bluetooth RSSI value. When collecting characteristic data, the RSSI value of each terminal to be classified at N distances from the Bluetooth base station is collected, and the RSSI value of a preset number of times can be collected at each distance. For each terminal to be classified, it is necessary to collect enough RSSI values to more accurately reflect the RSSI characteristics of the terminal. At the same time, it is necessary to collect the RSSI values of as many models of terminals as possible to determine the categories to which different terminals belong.
[0059] As an example but not a limitation, in step 101, the RSSI characteristic value of the terminal to be classified can be sampled to obtain the RSSI data of each terminal to be classified in the following manner: the number of sampling times for each sampling position is a preset number of times, the distance between adjacent sampling positions is a preset distance, and the terminal to be classified is vertically downward and remains stationary during sampling. The preset number of times is, for example, 500 times, and 500 RSSI values are collected at each sampling position, so as to obtain sufficient RSSI data to ensure the accuracy of RSSI value sampling. The preset distance between adjacent sampling positions is, for example, 1m, that is, a sampling point is set every 1 meter. This embodiment does not impose excessive restrictions on the value of the preset distance. The value of the number of sampling positions N is, for example, 10, for example, within the range of 1~10m, sampling is performed at sampling points such as 1m, 2m...10m, etc. The number of sampling positions can be set according to actual application requirements, and this embodiment does not impose specific restrictions on this. When sampling, the terminal, such as a smart phone, is kept in a vertically downward stationary state for sampling, so that the sampling data has high consistency and is more conducive to accurate classification. It is understandable that the collected RSSI data only needs to be sufficient to reflect the RSSI characteristics of the terminal, and this embodiment does not specifically limit the RSSI data collection method.
[0060] Step 102: Preprocess the feature data.
[0061] That is, the RSSI values of different types of terminals at different distances obtained by sampling are preprocessed. Step 102 of preprocessing the feature data may include: performing 3sigma outlier removal processing on the RSSI values of each terminal at each sampling position, and then calculating the average RSSI value of each terminal to be classified at each sampling position, so as to subsequently perform clustering according to the average RSSI value of each terminal at each sampling position. It can be understood that when preprocessing the data, the density of the average RSSI value can also be calculated, that is, the proportion of RSSI values whose difference with the average RSSI value is less than a preset threshold, the product of the average RSSI value and its density is calculated, and affinity clustering is performed based on the product, so there is no excessive restriction on the preprocessing method of the feature data.
[0062] Step 103: Obtain cluster centers and cluster neighbors based on the preprocessed feature data based on an affinity clustering algorithm.
[0063] The terminal classification results are obtained according to the cluster centers and cluster neighbors, where the number of cluster centers is the number of categories after the terminal classification, and the cluster neighbors of each cluster center are the terminals belonging to the same category.
[0064] Step 103 obtains the cluster center and cluster neighbors based on the affinity clustering algorithm according to the preprocessed feature data, and specifically includes the following steps:
[0065] Step 201: Calculate the similarity matrix between the feature data corresponding to the terminal to be classified at each sampling position.
[0066] Step 202: Initialize the responsibility value and the degree of ownership.
[0067] Step 203: Update the responsibility value and the degree of attribution according to the responsibility value and degree of attribution update formula to update the iterative clustering center.
[0068] Step 204: Determine whether the cluster center is stable or the maximum number of iterations is reached. If so, execute step 205; if not, continue to execute step 203.
[0069] Step 205: Determine the cluster center.
[0070] Step 206: Calculate the cluster neighbors of each cluster center based on the obtained cluster centers.
[0071] The affinity clustering algorithm clusters data points based on information transmission. Unlike traditional clustering algorithms such as K-means, affinity propagation clustering does not require the number of clusters to be specified in advance, but automatically determines the center and number of clusters based on the similarity between data points.
[0072] The affinity clustering algorithm mainly transmits two kinds of information: responsibility value and degree of belonging. Indicates the suitability of data point i to select data point k as its cluster center, while considering the suitability of other candidate cluster center points for data point i. It indicates the degree to which data point k is suitable as the cluster center of data point i, taking into account the evidence of other data points that support point k as the cluster center. The responsibility value and the degree of belonging determine the center of the cluster and the neighbors of the cluster center.
[0073] The update formula of responsibility value is:
[0074] (1)
[0075] in Indicates the suitability of data point i to select data point k as its cluster center, represents the similarity between data points i and k, is the attribute value, indicating that the data point The degree of suitability as the cluster center of data point i; is the center of all clusters except k Take the maximum value.
[0076] The update formula of the attribution degree is:
[0077] (2)
[0078] When i=k, the attribution degree update formula becomes:
[0079] (3)
[0080] in is the responsibility value of data point k itself, indicating the suitability of k as its own cluster center; It is the sum of the responsibility values of all other data points that support k as the cluster center.
[0081] Determining the cluster center includes: for each data point k, if , then k is selected as a cluster center. Based on the obtained cluster centers, the cluster neighbors of each cluster center are calculated, including: for each non-cluster center data point i, classify it into The largest cluster center k.
[0082] The digital key classification method based on affinity clustering according to the embodiment of the present invention is described in detail below through a specific test example:
[0083] The characteristic data of the terminal to be classified is obtained through step 101. When collecting characteristic data, the Bluetooth RSSI values received by the base station at a distance of 1-10m (a sampling point is set every 1m) from 95 mobile phones of different models to the Bluetooth base station can be collected. The Bluetooth RSSI is collected 500 times at each sampling point, and the mobile phone is kept vertically still during the collection process. Each mobile phone of different models is numbered from 0 to 94.
[0084] The acquired RSSI features are preprocessed in step 102. That is, the acquired RSSI is processed by 3sigma, and then the average RSSI values of different models of mobile phones at each distance are calculated.
[0085] The similarity matrix between RSSI data of different terminals is calculated in step 201. Specifically, the negative Euclidean distance is used to calculate the similarity between each pair of data points. The greater the similarity, the closer the distance between the data points.
[0086] In step 202, the responsibility value and the degree of ownership are initialized.
[0087] The responsibility value and the degree of attribution are updated by step 203. , calculate and update the responsibility value according to the above formulas (1) to (3) and belonging .
[0088] Step 204 is used to determine whether the selection of the cluster center is stable or whether the maximum number of iterations has been reached. If not, return to step 203 to continue updating the responsibility value and degree of attribution. Otherwise, if the selection of the cluster center is stable or the maximum number of iterations has been reached, execute step 205.
[0089] The cluster center is determined by step 205. For each data point k, if , then k is selected as a cluster center.
[0090] Classification is performed in step 206. For each data point i that is not a cluster center, it is classified into The largest cluster center k, clustering ends.
[0091] At this point, the number of categories of the terminals to be classified and the category to which each terminal belongs can be obtained.
[0092] The classification results of 95 different mobile phones are analyzed as follows: Figure 3 As shown in the figure, the numbers in the figure represent the serial numbers of different models of mobile phones, and the cluster center of each class is marked with a large number. Figure 3 The horizontal and vertical axes in represent the coordinates of the original data in two-dimensional space after dimensionality reduction. Figure 3 It can be found that:
[0093] ①: The proposed method finally divides 95 different models of mobile phones into 6 categories. The boundaries between categories are relatively clear, and the overall clustering effect is relatively good. Different models of mobile phones can be well divided into different categories.
[0094] ②: Even if some models of mobile phones in cluster 2 and cluster 4 are relatively close, due to the relationship between membership (i.e., degree of belonging), these models of mobile phones will be assigned to the cluster center that is more suitable for them, and will not overlap with each other.
[0095] In order to observe the clustering results more intuitively, select the mobile phone numbered 38 (the cluster center of cluster 5) and plot its affinity matrix with other numbered mobile phones into a line graph, as shown in Figure 4 As shown in the figure. The horizontal axis in the figure is the number of the mobile phone, and the vertical axis is the affinity between the mobile phone number 38 and other models of mobile phones. The affinity is the similarity used to update the responsibility value. From the results in the figure, it can be seen that the similarity between the mobile phones numbered 38 and 49 is closer to 0. The similarity is measured by negative Euclidean distance, which means that the mobile phones numbered 38 and 49 are more similar, which is consistent with Figure 2 The clustering results are consistent, and mobile phones No. 38 and No. 49 are classified into the same category.
[0096] The premise that the uncalibrated mobile phone and the calibrated mobile phone can share a set of calibration parameters is that the trends of their RSSI changes with distance are roughly the same. Therefore, in order to further verify the effectiveness of the proposed method, the RSSI average values corresponding to mobile phones No. 38 and No. 49 (both belonging to cluster 5) are plotted into a line graph, as shown in Figure 2. Figure 5 As shown, Figure 5 The following is a curve chart showing the RSSI variation with distance for mobile phones No. 38 and No. 49. The broken line corresponding to mobile phone No. 49 is above the broken line corresponding to mobile phone No. 38, so the trend of the RSSI variation with distance can be observed from the original data. Figure 5 The results in Figure 2 show that the RSSI of the two phones change in the same way with distance. The RSSI values of the two phones rise or fall at the same distance, but the magnitude of the change is different. In addition, the affinity of the two phones (-0.5 and -1.5 respectively) also shows that the two phones are similar. It can be concluded that the two phones can share the same set of calibration parameters and meet the requirements for consistency of unlocking and locking positioning.
[0097] Compared with the prior art, the digital key classification method based on affinity clustering of the embodiment of the present invention obtains the cluster center and cluster neighbors based on the affinity clustering algorithm according to the characteristic data of the terminal to be classified, and then the terminal classification result can be obtained according to the cluster center and cluster neighbors. That is, the mobile phones are clustered by calculating the responsibility value and degree of belonging of the Bluetooth RSSI of mobile phones of different models. The responsibility value and degree of belonging mine the characteristics of the data itself, and can well classify mobile phones with similar RSSI change trends with distance, providing certain guidance for the calibration of Bluetooth digital keys. The calibration work can refer to the method of the present invention to classify a variety of different models of mobile phones, and calibrate the mobile phone model of the cluster center according to the clustering results. The mobile phone models of the cluster neighbors can share a set of calibration parameters with the mobile phone model of the cluster center, thereby improving the efficiency of the calibration work.
[0098] Embodiment 2 of the present invention provides a digital key classification device based on affinity clustering, which is configured in an electronic device, and the electronic device can be a device that supports affinity clustering, such as a PC, a server, or a notebook. Figure 6 As shown, the classification device 600 includes: an acquisition module 602 , a preprocessing module 604 and a clustering module 606 .
[0099] The acquisition module 602 is used to acquire the collected characteristic data of the terminals to be classified. The characteristic data includes characteristic values of M types of terminals to be classified at N sampling positions respectively; M and N are both natural numbers greater than 1.
[0100] The preprocessing module 604 is used to preprocess the feature data.
[0101] The clustering module 606 is used to obtain the cluster center and cluster neighbors based on the affinity clustering algorithm according to the pre-processed feature data, wherein the terminal classification result is obtained according to the cluster center and cluster neighbors.
[0102] Optionally, the clustering module includes:
[0103] A similarity calculation submodule is used to calculate a similarity matrix between feature data corresponding to the terminal to be classified at each sampling position;
[0104] Initialization submodule, used to initialize responsibility value and attribution degree;
[0105] Iteration submodule; used to update the responsibility value and the degree of attribution according to the responsibility value and the degree of attribution update formula to update the iterative clustering center;
[0106] The iteration control submodule is used to determine whether the cluster center is stable or the maximum number of iterations is reached. If so, the determination submodule is executed; if not, the iteration submodule is executed;
[0107] A determination submodule is used to determine the cluster center; and a cluster neighbor determination submodule is used to calculate the cluster neighbors of each cluster center based on the obtained cluster center.
[0108] Optionally, the update formula of the responsibility value is:
[0109] (1)
[0110] in Indicates the suitability of data point i to select data point k as its cluster center, represents the similarity between data points i and k, is the attribute value, indicating that the data point The degree of suitability as the cluster center of data point i; is the center of all clusters except k Take the maximum value;
[0111] The update formula of the attribution degree is:
[0112] (2)
[0113] When i=k, the attribution degree update formula becomes:
[0114] (3)
[0115] in is the responsibility value of data point k itself, indicating the suitability of k as its own cluster center; It is the sum of the responsibility values of all other data points that support k as the cluster center.
[0116] Optionally, the determination submodule is specifically used for: for each data point k, if , then k is selected as a cluster center.
[0117] Optionally, the cluster neighbor determination submodule is specifically used to: for each non-cluster center data point i, classify it into The largest cluster center k.
[0118] Optionally, the pre-processing module 604 is specifically configured to perform 3sigma outlier removal processing on the RSSI value of each terminal at each sampling position; and calculate an average RSSI value of each terminal to be classified at each sampling position.
[0119] Correspondingly, the similarity calculation submodule is specifically used to calculate the similarity matrix according to the average RSSI value.
[0120] Optionally, collecting characteristic data of the terminal to be classified includes:
[0121] The RSSI value of each terminal to be classified is obtained by sampling in the following manner:
[0122] The sampling times of each sampling position are preset times, the distance between adjacent sampling positions is preset, and the terminal to be classified is vertically downward and remains stationary during sampling.
[0123] Optionally, the classification device 600 further includes a collection module:
[0124] The acquisition module is used to acquire the RSSI value of each terminal to be classified in the following manner:
[0125] The sampling times of each sampling position are preset times, the distance between adjacent sampling positions is preset, and the terminal to be classified is vertically downward and remains stationary during sampling.
[0126] Compared with the prior art, the digital key classification device based on affinity clustering of the embodiment of the present invention obtains the cluster center and cluster neighbors based on the affinity clustering algorithm according to the characteristic data of the terminal to be classified, and then obtains the terminal classification result according to the cluster center and cluster neighbors. That is, the mobile phones are clustered by calculating the responsibility value and degree of belonging of the Bluetooth RSSI of mobile phones of different models, and the characteristics of the data itself are mined through the responsibility value and degree of belonging. Mobile phones with similar RSSI change trends with distance can be well classified into one category, so that when classifying multiple different models of mobile phones, the mobile phone model of the cluster center is calibrated according to the clustering results, and the mobile phone models of the cluster neighbors can share a set of calibration parameters with the mobile phone model of the cluster center, thereby improving the efficiency of the calibration work.
[0127] Figure 7This is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. The electronic device 70 includes a memory 71 and a processor 72;
[0128] The memory 71 is used to store computer programs; the processor 72 is used to read the computer program in the memory 71 and implement the digital key classification method based on affinity clustering as described in the above embodiment when executing the program.
[0129] Embodiment 4 of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a computer processor, it is used to execute the technical solution of any method embodiment.
[0130] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a grid device, etc.) to execute the methods described in each embodiment of the present invention.
[0131] It is worth noting that in the embodiment of the above-mentioned device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0132] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A digital key classification method based on affinity clustering, characterized in that: include: Obtaining the collected characteristic data of the terminal to be classified; The characteristic data includes characteristic values of M types of terminals to be classified at N sampling positions respectively; M and N are both natural numbers greater than 1; Preprocessing the feature data; Obtaining cluster centers and cluster neighbors based on affinity clustering algorithm according to the preprocessed feature data; wherein, obtaining terminal classification results according to the cluster centers and cluster neighbors; obtaining cluster centers and cluster neighbors based on affinity clustering algorithm according to the preprocessed feature data includes: Calculate the similarity matrix between the feature data corresponding to the terminal to be classified at each sampling position; Initialize responsibility value and ownership; According to the responsibility value and the degree of belonging update formula, the responsibility value and the degree of belonging are updated to update the iterative cluster center; Determine whether the cluster center is stable or the maximum number of iterations is reached. If so, determine the cluster center. If not, continue to update the iterative cluster center. The cluster neighbors of each cluster center are calculated based on the obtained cluster centers; The characteristic value of the terminal to be classified is the Bluetooth RSSI value; The preprocessing of the characteristic data comprises: Perform 3sigma outlier removal processing on the RSSI value of each terminal at each sampling position; Calculate the average RSSI value of each terminal to be classified at each sampling position; Accordingly, the calculation of the similarity matrix between the feature data corresponding to the terminal to be classified at each sampling position includes: A similarity matrix is calculated based on the average RSSI value.
2. The digital key classification method based on affinity clustering according to claim 1 is characterized in that: include: The update formula of responsibility value is: (1) in Indicates the suitability of data point i to select data point k as its cluster center; represents the similarity between data points i and k, is the attribute value, indicating that the data point The degree of suitability as the cluster center of data point i; is the center of all clusters except k Take the maximum value; The update formula of the attribution degree is: (2) When i=k, the attribute update formula becomes: (3) in is the responsibility value of data point k itself, indicating the suitability of k as its own cluster center; It is the sum of the responsibility values of all other data points that support k as the cluster center.
3. The digital key classification method based on affinity clustering according to claim 2 is characterized in that: Determine the cluster centers, including: For each data point k, if , then k is selected as a cluster center; The cluster neighbors of each cluster center are calculated based on the obtained cluster centers, including: For each non-cluster center data point i, it is classified into The largest cluster center k.
4. The digital key classification method based on affinity clustering according to claim 1 is characterized in that: Also includes: The RSSI value of each terminal to be classified is collected in the following manner: The sampling times of each sampling position are preset times, the distance between adjacent sampling positions is preset, and the terminal to be classified is vertically downward and remains stationary during sampling.
5. A digital key classification device based on affinity clustering, characterized in that: include: An acquisition module, used to acquire the collected feature data of the terminal to be classified; The characteristic data includes characteristic values of M types of terminals to be classified at N sampling positions respectively; M and N are both natural numbers greater than 1; A preprocessing module, used for preprocessing the feature data; A clustering module, used to obtain cluster centers and cluster neighbors based on the affinity clustering algorithm according to the preprocessed feature data; wherein the terminal classification result is obtained according to the cluster centers and cluster neighbors; The clustering module comprises: A similarity calculation submodule is used to calculate a similarity matrix between feature data corresponding to the terminal to be classified at each sampling position; Initialization submodule, used to initialize responsibility value and attribution degree; Iteration submodule; used to update the responsibility value and the degree of attribution according to the responsibility value and the degree of attribution update formula to update the iterative clustering center; The iteration control submodule is used to determine whether the cluster center is stable or the maximum number of iterations is reached. If yes, the determination submodule is executed; if no, the iteration submodule is executed; Determine a submodule for determining cluster centers; A cluster neighbor determination submodule is used to calculate the cluster neighbors of each cluster center based on the obtained cluster centers; The characteristic value of the terminal to be classified is the Bluetooth RSSI value; the preprocessing module is specifically used to perform 3sigma outlier removal processing on the RSSI value of each terminal at each sampling position; the average RSSI value of each terminal to be classified at each sampling position is calculated; accordingly, the similarity calculation submodule is specifically used to calculate the similarity matrix according to the average RSSI value.
6. An electronic device, characterized in that: including a memory and a processor; A memory for storing computer programs; the processor for reading the computer programs in the memory and implementing the digital key classification method based on affinity clustering as described in any one of claims 1-4 when executing the program.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the digital key classification method based on affinity clustering as described in any one of claims 1 to 4 is implemented.