A terminal device identification method and apparatus, an electronic device, and a storage medium
Patent Information
- Application Number
- CN202610694190.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-19
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2046-05-19
AI Technical Summary
该类方法存在三个突出问题:其一,广播名称易缺失、易伪装,导致识别稳定性不足;其二,仅依赖单次广播包进行判定,容易受到随机地址、瞬时RSSI波动和重复回调的影响,产生误判、漏判或列表抖动;其三,对于苹果类设备,仅做被动广播识别往往只能得到“Apple”或“Apple信号”等泛化结果,难以进一步解析到更细的设备类别或具体型号
[0038] The beneficial effects of the technical solutions provided in this application include at least the following:
Smart Images

Figure CN122420795B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of wireless communication detection and terminal identification technology, and in particular to a terminal device identification method, apparatus, electronic device and storage medium. Background Technology
[0002] In existing terminal detection solutions, a common approach is to perform coarse-grained identification of surrounding devices based solely on broadcast names, MAC address prefixes, or a single manufacturer field. This method suffers from three prominent problems: First, broadcast names are easily missing or spoofed, leading to insufficient identification stability. Second, relying solely on a single broadcast packet for judgment makes it susceptible to random addresses, instantaneous RSSI fluctuations, and repeated callbacks, resulting in false positives, false negatives, or list jitter. Third, for Apple-type devices, passive broadcast identification often only yields generalized results such as "Apple" or "Apple signal," making it difficult to further analyze to more specific device categories or models.
[0003] Especially in complex field environments, the same terminal may be received in the form of multiple MAC addresses, multiple broadcast frames, or multiple status frames; different terminals may also be incorrectly merged due to similar instantaneous signal strength. Without multi-stage filtering, candidate sorting, active reading, deduplication, and distance threshold control mechanisms, the detection results will suffer from problems such as quantity inflation, category confusion, unstable alarms, and poor positioning assistance.
[0004] Therefore, a more software-based algorithmic identification scheme is needed, which enables the system to perform hierarchical identification of peripheral terminals without relying on complex peripheral devices, and improves the accuracy of model resolution through a scheduled connection and reading mechanism. Summary of the Invention
[0005] Based on this, embodiments of this application provide a terminal device identification method, apparatus, electronic device, and storage medium. By constructing a processing link of "passive scanning identification + candidate management + conditional active reading + RSSI smoothing + distance threshold filtering + multi-dimensional deduplication", it achieves stable detection, category judgment, model refinement, duplication suppression, and result output of surrounding terminals.
[0006] Firstly, a terminal device identification method is provided, the method comprising:
[0007] S1. Create Bluetooth scanning execution thread and connection execution thread, receive Bluetooth Low Energy broadcast data and perform time window rate limiting and traffic splitting according to the media access control address;
[0008] S2. Identify manufacturers based on manufacturer-specific data and local manufacturer mapping library. If the manufacturer field is missing, use media access control address prefix fallback identification and classify the device into target type device and non-target type device.
[0009] S3. Perform hierarchical identification on the target type device. First, perform high-confidence pattern matching based on the length and first byte feature of the manufacturer data to determine the known sub-type. If no match is found, extract the device identifier and compare it with the local model library. If it is still not determined, construct the target type candidate structure and add it to the candidate pool.
[0010] S4. Sort the devices in the candidate pool according to the peak received signal strength indication, and schedule them according to the occurrence frequency and connection constraints, and select priority devices to enter the connection attempt set;
[0011] S5. Initiate a connection to the general attribute configuration file for the selected priority device and read the model characteristic value from the standard device information service;
[0012] S6. Match the obtained model identifier string with the local model mapping library to obtain the specific model name, and write back to the device cache to update the device model and category label;
[0013] S7. Maintain a fixed depth sliding window for the received signal strength indication of each device and output a smooth value using the mean method;
[0014] S8. Perform distance threshold filtering based on the preset distance and received signal strength indication empirical mapping table, and perform consistency deduplication based on device identifier and fallback deduplication based on received signal strength indication similarity, and output the recognition result.
[0015] Optionally, the creation of the Bluetooth scanning execution thread and the connection execution thread, receiving Bluetooth Low Energy broadcast data and performing time-window rate limiting and traffic splitting according to the Media Access Control address includes:
[0016] After the scan callback arrives, it is sent to the scan thread pool for processing. In non-location mode, the same media access control address is processed only once within the preset window. In location mode, only the received signal strength indicator update channel of the target media access control address is retained.
[0017] Optionally, the manufacturer identification based on manufacturer-specific data and a local manufacturer mapping library, and the identification using media access control address prefix fallback if the manufacturer field is missing, includes:
[0018] First, extract the manufacturer ID from the manufacturer-specific data and match it with the local manufacturer mapping library to obtain the manufacturer name. If the manufacturer field is missing, extract the media access control address prefix and compare it with the local media access control mapping library for fallback identification.
[0019] Optionally, the hierarchical identification of the target type device, firstly performing high-confidence pattern matching based on the length and first byte features of the manufacturer data to determine the known sub-types, includes:
[0020] When the length of the manufacturer's data and the first byte meet the first preset condition, it is determined to be the first sub-type; when the length of the manufacturer's data and the first byte meet the second preset condition or the broadcast name contains preset keywords, it is determined to be the second sub-type; when the length of the manufacturer's data and the first byte meet the third preset condition, it is determined to be the general signal type; the target type candidate structure records the peak received signal strength indication, the number of occurrences, the most recent occurrence time, the connectable status, the device information service identifier, and the device reference information.
[0021] Optionally, the step of sorting the devices in the candidate pool according to the peak received signal strength indication and scheduling them based on the frequency of occurrence and connection constraints includes:
[0022] The number of times candidate devices appear is continuously accumulated and sorted according to the peak received signal strength. Based on the constraints of the same device connection throttling, global minimum connection interval, maximum concurrent connection slots, parsing batch limit and connection timeout recovery, the top-ranked devices are selected to enter the connection attempt set.
[0023] Optionally, the step of initiating a connection to the general attribute configuration file for the selected priority device, reading the model feature value from the standard device information service, and matching the obtained model identifier string with the local model mapping library to obtain the specific model name includes:
[0024] After the general attribute configuration file is connected and ready, the model feature value in the standard device information service is read, the obtained model identifier string is matched with the local model mapping library to obtain the specific model name, and the device cache is written back to update the category label; if the read fails, the connection times out, or the device is disconnected, resource release and state cleanup are performed.
[0025] Optionally, the step of maintaining a fixed-depth sliding window for the received signal strength indication of each device and outputting a smooth value using the mean method, as well as performing distance threshold filtering based on a preset distance-to-received signal strength indication empirical mapping table, and performing consistent deduplication based on device identifiers and fallback deduplication based on the similarity of received signal strength indications includes:
[0026] For each device, a fixed-depth sliding window for the received signal strength indication is maintained, and a smooth value is output using the mean method. The distance threshold set by the user is converted into an empirical received signal strength indication threshold table. When the smooth value is lower than the corresponding threshold, the device is filtered. The first level of deduplication is to retain the record with richer information when two different media access control addresses correspond to the same device identifier. The second level of deduplication is to retain a record based on the richness of information when the device identifier cannot be extracted, if the signal strength of both devices is higher than the preset threshold and the difference does not exceed the difference threshold.
[0027] Secondly, a terminal device identification device is provided, the device comprising:
[0028] The scanning and acquisition module is used to create Bluetooth scanning execution threads and connection execution threads, receive Bluetooth Low Energy broadcast data, and perform time window rate limiting and traffic splitting according to the Media Access Control address.
[0029] The device resolution module is used to identify manufacturers based on manufacturer-specific data and the local manufacturer mapping library. If the manufacturer field is missing, it uses the media access control address prefix to fall back to identify the manufacturer and classifies the device into target type devices and non-target type devices.
[0030] The hierarchical identification module is used to perform hierarchical identification of target type devices. First, it performs high-confidence pattern matching based on the length and first byte feature of the manufacturer data to determine the known sub-type. If no match is found, the device identifier is extracted and compared with the local model library. If it is still not determined, a target type candidate structure is constructed and added to the candidate pool.
[0031] The scheduling module is used to sort the devices in the candidate pool according to the peak received signal strength indication, and to schedule them according to the occurrence frequency and connection constraints, selecting priority devices to enter the connection attempt set;
[0032] The active reading module is used to initiate a connection to the general attribute configuration file of the selected priority device and read the model characteristic value from the standard device information service;
[0033] The mapping update module is used to match the obtained model identifier string with the local model mapping library to obtain the specific model name, and write back to the device cache to update the device model and category label;
[0034] The smoothing module is used to maintain a fixed depth sliding window for the received signal strength indication of each device and output a smoothed value using the mean method.
[0035] The data governance module is used to perform distance threshold filtering based on a preset distance and received signal strength indication empirical mapping table, and to perform consistency deduplication based on device identifier and fallback deduplication based on the similarity of received signal strength indication, and output the recognition results.
[0036] Thirdly, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement any of the methods described in the first aspect above.
[0037] Fourthly, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements any of the methods described in the first aspect above.
[0038] The beneficial effects of the technical solutions provided in this application include at least the following:
[0039] (1) More detailed recognition results. For Apple-related devices, the system can further refine the recognition from the generalized Apple brand to AirTag, AirPods or specific models.
[0040] (2) More stable results. Through RSSI smoothing, time window rate limiting and offline cleanup, the interface is less prone to drastic changes due to instantaneous broadcast fluctuations.
[0041] (3) Fewer repetitions. By using a two-layer deduplication strategy of identifier priority and RSSI fallback, the phenomenon of multiple displays on one machine can be significantly reduced.
[0042] (4) Resource consumption is more controllable. Through the candidate pool and connection scheduling strategy, Bluetooth stack congestion caused by disordered connections is avoided.
[0043] (5) Enhanced on-site applicability. Through distance thresholds, whitelists, and location page output mechanisms, it can adapt to different detection distances and different usage scenarios. Attached Figure Description
[0044] To more clearly illustrate the embodiments of this application or the technical solutions in the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are merely exemplary, and those skilled in the art can derive other embodiments based on the provided drawings without creative effort.
[0045] Figure 1 A flowchart illustrating the steps of a terminal device identification method provided in this application embodiment;
[0046] Figure 2 A device block diagram of a terminal device identification method provided in an embodiment of this application;
[0047] Figure 3 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0048] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0049] In the description of this application, the terms "comprising," "having," and any variations thereof are intended to cover non-exclusive inclusion, such as a process, method, apparatus, product, or device that includes a series of steps or units, not necessarily limited to those steps or units that are expressly listed, but may also include other steps or units that are not expressly listed but are inherent to these processes, methods, products, or devices, or steps or units added based on further optimizations conceived in this application.
[0050] The purpose of this application is to provide a software implementation method for a terminal detection device. By constructing a processing link of "passive scanning and recognition + candidate management + conditional active reading + RSSI smoothing + distance threshold filtering + multi-dimensional deduplication", it can achieve stable detection, category judgment, model refinement, duplication suppression and result output of surrounding terminals.
[0051] This application also aims to solve the following technical problems: 1. Improve the recognition accuracy of Apple-like terminals and avoid remaining at the level of generalized brand recognition for a long time; 2. Reduce the repeated display caused by multiple frames, multiple addresses and multiple states of the same device; 3. Suppress the frequent changes in interface and false alarms caused by RSSI jitter; 4. While maintaining scanning continuity, control the number of active connections to avoid system stack congestion and decreased recognition efficiency.
[0052] In this embodiment, the software system is deployed on an Android terminal device. It continuously receives surrounding BLE broadcast data using the system's Bluetooth Low Energy scanning capability. Combined with the local manufacturer mapping database, Apple model mapping database, device category rule base, and whitelist data, the scanning results are analyzed and structured in real time.
[0053] The overall system process includes: broadcast acquisition, manufacturer identification, Apple feature identification, device category determination, candidate caching, connection scheduling, standard service reading, model mapping, RSSI smoothing, distance threshold filtering, duplicate device merging, whitelist annotation, list display, and location page auxiliary output.
[0054] Please refer to Figure 1 The diagram illustrates a flowchart of a terminal device identification method provided in an embodiment of this application. The method may include the following steps:
[0055] S1. Create Bluetooth scanning execution thread and connection execution thread, receive Bluetooth Low Energy broadcast data, and perform time window rate limiting and traffic splitting according to the media access control address.
[0056] This step mainly implements broadcast acquisition and callback routing, specifically:
[0057] After system initialization, a Bluetooth scanning execution thread and a connection execution thread are created. Upon arrival of a scan callback, the latest scan time is first recorded and the result is sent to the scan thread pool for processing. This avoids the main thread directly participating in broadcast parsing and improves throughput in high-frequency callback scenarios.
[0058] In non-location mode, the system first applies time-window rate limiting to the scan results based on MAC address, meaning the same MAC address is processed only once within a preset window to reduce redundant computation caused by repeated broadcasts. Then, it proceeds to the vendor identification and device modeling stage. In location mode, only the RSSI update channel of the target MAC address is retained; other devices are ignored to ensure real-time location page refresh.
[0059] S2. Based on manufacturer-specific data and the local manufacturer mapping library, the manufacturer is identified. If the manufacturer field is missing, the identification is performed by using the media access control address prefix fallback and the device is divided into target type devices and non-target type devices.
[0060] This step mainly implements the manufacturer identification and preliminary classification algorithms:
[0061] The system first extracts the vendor ID from the manufacturer-specific data and maps it to the vendor name via the local company_ids.json file. If the manufacturer field is missing, it then uses the MAC address prefix and company_mac.json for fallback identification. This dual-path identification algorithm improves the coverage of vendor resolution.
[0062] For example, for Apple devices, the system does not directly treat all results as the same type of device, but further enters the Apple-specific parsing branch; for non-Apple devices, it classifies them into "phone, tablet, watch, headphone, terminal" based on manufacturer name, broadcast name and keyword rules, so that the subsequent display and filtering have better structured semantics.
[0063] S3. Perform hierarchical identification on the target type device. First, perform high-confidence pattern matching based on the length and first byte feature of the manufacturer data to determine the known sub-type. If no match is found, extract the device identifier and compare it with the local model library. If it is still not determined, construct the target type candidate structure and add it to the candidate pool.
[0064] Specifically, when the manufacturer data length and the first byte meet the first preset condition, it is determined to be a first sub-type; when the manufacturer data length and the first byte meet the second preset condition or the broadcast name contains a preset keyword, it is determined to be a second sub-type; when the manufacturer data length and the first byte meet the third preset condition, it is determined to be a general signal type. In this step, the first preset condition can be a high-confidence feature matching rule where the manufacturer data length is 27 and the first byte is 0x12; the second preset condition can be a high-confidence feature matching rule where the manufacturer data length is 17 and the first byte is 0x07 or 0x09, and the broadcast name containing a preset keyword is also used as a parallel condition for determining the second sub-type; the third preset condition can be a feature matching rule where the manufacturer data length is 10 and the first byte is 0x16, and when this condition is met, it is determined to be a general signal type.
[0065] This step mainly implements the hierarchical recognition algorithm, specifically:
[0066] For example, a certain type of device identification uses a two-stage algorithm of "passive discrimination followed by active refinement". The first stage identifies high-confidence features from manufacturer data: for example, when the manufacturer data length is 27 and the first byte is 0x12, it is directly identified as an AirTag; when the length is 17 and the first byte is 0x07 or 0x09, or the broadcast name contains AirPods, it is identified as AirPods; when the length is 10 and the first byte is 0x16, it is identified as a general Apple signal.
[0067] If a specific model is not obtained in the first stage, the process proceeds to the second stage. A device identifier, such as iPhone14,2, is extracted from the broadcast manufacturer field, service data, or device name, and then mapped to a friendly model name using the apple.json local model library. If a unique model cannot be determined, it is retained as "Apple" or an "Apple signal" and placed in a candidate queue for further active reading.
[0068] S4. Sort the devices in the candidate pool according to the peak received signal strength indication, and schedule them according to the occurrence frequency and connection constraints, and select priority devices to enter the connection attempt set.
[0069] This step mainly implements the candidate device management and connection scheduling algorithm:
[0070] For devices whose specific model has not been resolved during the scanning phase, the system establishes an AppleCandidate candidate structure, recording its peak RSSI, most recent occurrence time, whether it is connectable, whether the broadcast contains the device information service UUID, the lowercase cache of the broadcast name, and the most recent BleDevice reference.
[0071] The system continuously accumulates the occurrence counts of candidate devices and sorts them by peak RSSI, allowing only the top-ranked candidates to enter the connection attempt set. This strategy avoids initiating connections for all Apple devices simultaneously, reducing the pressure on the Bluetooth protocol stack.
[0072] During connection scheduling, the system introduces multiple constraint mechanisms, including throttling of connections to the same device, global minimum connection interval, maximum concurrent connection slots, parsing batch limits, and connection timeout recycling. Through these mechanisms, the system controls the active reading frequency while maintaining scanning continuity, achieving the effect of "uninterrupted scanning, controllable connections, and gradual parsing convergence."
[0073] S5. Initiate a connection to the general attribute configuration file for the selected priority device and read the model characteristic value from the standard device information service.
[0074] This step mainly implements the active model reading and mapping algorithm:
[0075] Once a candidate device meets the connection requirements, the system initiates a GATT connection and reads the model feature value from the standard device information service after the connection is ready. In a preferred embodiment, the system reads the 2A24 feature under the 180A service, maps the obtained model identifier string to the local Apple model database, and thus further refines "Apple" into a specific model or a specific category.
[0076] Upon successful reading, the system writes the specific model number back to the device cache and updates the category label based on the model name. If the reading fails, the connection times out, or the device disconnects, resource release and state cleanup are performed immediately to prevent invalid connections from occupying system resources for an extended period.
[0077] S6. Match the obtained model identifier string with the local model mapping library to obtain the specific model name, and write back to the device cache to update the device model and category label.
[0078] This step mainly implements the model mapping update and active read fault tolerance mechanism:
[0079] After the general attribute configuration file is connected, the system reads the model characteristic value (e.g., 0x2A24) from the standard device information service (e.g., the 0x180A service). It matches the read model identifier string with the local model mapping library (e.g., apple.json) to obtain the user-friendly specific model name. Subsequently, the system writes the matching result back to the device cache, updating the device's model field and category label for subsequent list display and deduplication comparison.
[0080] If a read fails, a connection times out, or the device disconnects, the system immediately performs resource release and state cleanup, including closing the GATT connection, removing candidate pool references, and releasing Bluetooth protocol stack resources to prevent invalid connections from occupying system resources for a long time.
[0081] S7. Maintain a fixed depth sliding window for the received signal strength indication of each device and output a smooth value using the mean method.
[0082] This step also implements RSSI smoothing and distance threshold filtering algorithms:
[0083] Because BLE broadcasts exhibit significant instantaneous fluctuations, the system maintains a fixed-depth RSSI sliding window for each MAC and outputs smoothed RSSI values using the mean method. Compared to directly using the intensity of a single scan, smoothed values are more beneficial for distance estimation, threshold filtering, and stable interface display.
[0084] The system supports user-defined distance thresholds and converts these thresholds into an RSSI threshold table. In a preferred embodiment, 1 meter to 10 meters correspond to different empirical RSSI thresholds; for example, 1 meter is approximately -40 dBm, 5 meters is approximately -68 dBm, and 10 meters is approximately -79 dBm. When the smoothed RSSI is lower than the threshold corresponding to the current distance threshold, the device will be filtered out and will not proceed to the display or alarm process.
[0085] S8. Perform distance threshold filtering based on the preset distance and received signal strength indication empirical mapping table, and perform consistency deduplication based on device identifier and fallback deduplication based on received signal strength indication similarity, and output the recognition result.
[0086] This step also implements a repetitive device suppression algorithm:
[0087] Duplicate device suppression employs a two-level algorithm. The first level is identifier deduplication: when the system can extract the device identifier from broadcast or active reading, if two different MAC addresses correspond to the same device identifier, they are considered to be the same terminal, and records with richer information are retained in the order of "preferred by parsed specific model, preferred by device information service, and preferred by valid device name".
[0088] The second level is RSSI similarity deduplication: when the device identifier cannot be uniquely extracted, the system compares the RSSI difference for devices with high-intensity signals. If the signal strength of two devices is higher than a preset threshold and the difference does not exceed the differential threshold, they are considered highly likely to be the same device, and the system continues to decide which record to retain based on the richness of device information. Through the "identifier priority, RSSI fallback" approach, the system can effectively compress duplicate results in complex broadcast environments.
[0089] In addition, the method also implements whitelisting, offline cleanup, and result output algorithms:
[0090] The system supports a whitelist mechanism, marking known or trusted devices to prevent them from being mistakenly identified as key targets. During the scanning process, the system maintains the first appearance time, online status, and most recent appearance time for each device; periodic cleanup tasks gradually reduce the RSSI display value of devices that have not appeared for a long time, and remove them from the list once they fall below the deletion threshold.
[0091] On the positioning page, the system maintains a high-frequency RSSI refresh only for the target MAC address, and updates the interface gauges, distance prompts, or prompt tone intensity based on the latest RSSI value, thereby extending the list recognition capability to a directional approximation capability.
[0092] The following are three specific implementations based on the above method:
[0093] Example 1: After the system enters the scanning state, it continuously receives surrounding BLE broadcasts, limits the flow of each MAC address according to the time window, and then performs manufacturer analysis. If it is identified as an Apple manufacturer, it prioritizes the analysis of high-confidence patterns in the manufacturer data and directly identifies the AirTag or AirPods. For Apple devices whose models cannot be directly identified, they are first added to the device list as Apple and simultaneously written into the candidate pool.
[0094] Example 2: After the number of times the devices in the candidate pool have appeared is preset, the system sorts them according to the peak RSSI and selects high-priority devices to enter the active reading stage; after the connection is successful, the system reads the model feature value in the standard device information service, converts it into a specific terminal name through the local model library, and updates the device category and model fields in the list.
[0095] Example 3: The system maintains an RSSI sliding window for all devices and outputs a smoothed RSSI. If the smoothed RSSI is lower than the threshold corresponding to the user-defined distance threshold, it is directly filtered; if two devices have the same device identifier, or their RSSIs are extremely close under high signal strength, merging and deduplication are performed, retaining only the record with more complete information.
[0096] In summary, compared to existing coarse-grained identification schemes that rely solely on single broadcast names or media access control address prefixes, the core innovation of this application lies in constructing a hierarchical identification link oriented towards target device types. This link no longer relies solely on broadcast names for coarse judgment but combines manufacturer fields, service fields, device identifiers, local model libraries, and standard service active reading to form a progressive identification system from passive discrimination to active refinement. Furthermore, by establishing a candidate pool of target type devices to be resolved and sorting and scheduling them according to frequency of occurrence, peak received signal strength indication, and connection restrictions, it balances identification accuracy with... System stability is ensured; a multi-dimensional deduplication algorithm combining device identifier deduplication and received signal strength indication similarity deduplication is employed to effectively address list bloat caused by random addresses, repeated broadcasts, and multi-state frames; furthermore, a configurable distance threshold filtering mechanism links the smoothed received signal strength indication with an empirical threshold table, improving the consistency between detection results and actual field distance perception; in addition, a parallel but controlled operation mechanism for scanning and connection is implemented, utilizing thread separation, connection throttling, concurrent slots, and timeout recycling to reduce the disruption of scanning continuity caused by high-frequency connections, thereby achieving gradual convergence of recognition results while maintaining scanning continuity.
[0097] like Figure 2 This application also provides a terminal device identification device, which may include:
[0098] The scanning and acquisition module is used to create Bluetooth scanning execution threads and connection execution threads, receive Bluetooth Low Energy broadcast data, and perform time window rate limiting and traffic splitting according to the Media Access Control address.
[0099] The device resolution module is used to identify manufacturers based on manufacturer-specific data and the local manufacturer mapping library. If the manufacturer field is missing, it uses the media access control address prefix to fall back to identify the manufacturer and classifies the device into target type devices and non-target type devices.
[0100] The hierarchical identification module is used to perform hierarchical identification of target type devices. First, it performs high-confidence pattern matching based on the length and first byte feature of the manufacturer data to determine the known sub-type. If no match is found, the device identifier is extracted and compared with the local model library. If it is still not determined, a target type candidate structure is constructed and added to the candidate pool.
[0101] The scheduling module is used to sort the devices in the candidate pool according to the peak received signal strength indication, and to schedule them according to the occurrence frequency and connection constraints, selecting priority devices to enter the connection attempt set;
[0102] The active reading module is used to initiate a connection to the general attribute configuration file of the selected priority device and read the model characteristic value from the standard device information service;
[0103] The mapping update module is used to match the obtained model identifier string with the local model mapping library to obtain the specific model name, and write back to the device cache to update the device model and category label;
[0104] The smoothing module is used to maintain a fixed depth sliding window for the received signal strength indication of each device and output a smoothed value using the mean method.
[0105] The data governance module is used to perform distance threshold filtering based on a preset distance and received signal strength indication empirical mapping table, and to perform consistency deduplication based on device identifier and fallback deduplication based on the similarity of received signal strength indication, and output the recognition results.
[0106] The data governance module may also include a business output module, which specifically completes the display of device lists, category tags, whitelist status, location page RSSI push, and audio prompt linkage.
[0107] Specific limitations regarding the terminal device identification device can be found in the limitations of the terminal device identification method described above, and will not be repeated here. Each module in the aforementioned terminal device identification device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0108] In one embodiment, an electronic device is provided, which may be a computer, and its internal structure diagram may be as follows: Figure 3 As shown, the electronic device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for terminal device identification data. The network interface of the computer device is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a terminal device identification method.
[0109] Those skilled in the art will understand that, Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0110] In one embodiment of this application, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the terminal device identification method described above.
[0111] In one embodiment of this application, a computer program product is provided, including a computer program / instructions, which, when executed by a processor, implements the steps of the terminal device identification method described above.
[0112] The computer-readable storage medium and computer program product provided in this embodiment are similar in implementation principle and technical effect to the above method embodiments, and will not be repeated here.
[0113] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods.
[0114] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0115] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A terminal device identification method, characterized in that, The method includes: S1. Create Bluetooth scanning execution thread and connection execution thread, receive Bluetooth Low Energy broadcast data and perform time window rate limiting and traffic splitting according to the media access control address; S2. Identify manufacturers based on manufacturer-specific data and local manufacturer mapping library. If the manufacturer field is missing, use media access control address prefix fallback identification and classify the device into target type device and non-target type device. S3. Perform hierarchical identification on the target type device. First, perform high-confidence pattern matching based on the length and first byte feature of the manufacturer data to determine the known sub-type. If no match is found, extract the device identifier and compare it with the local model library. If it is still not determined, construct the target type candidate structure and add it to the candidate pool. S4. Sort the devices in the candidate pool according to the peak received signal strength indication, and schedule them according to the occurrence frequency and connection constraints, and select priority devices to enter the connection attempt set; S5. Initiate a connection to the general attribute configuration file for the selected priority device and read the model characteristic value from the standard device information service; S6. Match the obtained model identifier string with the local model mapping library to obtain the specific model name, and write back to the device cache to update the device model and category label; S7. Maintain a fixed depth sliding window for the received signal strength indication of each device and output a smooth value using the mean method; S8. Perform distance threshold filtering based on the preset distance and received signal strength indication empirical mapping table, and perform consistency deduplication based on device identifier and fallback deduplication based on received signal strength indication similarity, and output the recognition result.
2. The method according to claim 1, characterized in that, The process of creating Bluetooth scanning and connection execution threads, receiving Bluetooth Low Energy broadcast data, and performing time-window rate limiting and traffic splitting according to the Media Access Control address includes: After the scan callback arrives, it is sent to the scan thread pool for processing. In non-location mode, the same media access control address is processed only once within the preset window. In location mode, only the received signal strength indicator update channel of the target media access control address is retained.
3. The method according to claim 1, characterized in that, The method of identifying manufacturers based on manufacturer-specific data and a local manufacturer mapping library, and identifying manufacturers by using media access control address prefix fallback if the manufacturer field is missing, includes: First, extract the manufacturer ID from the manufacturer-specific data and match it with the local manufacturer mapping library to obtain the manufacturer name. If the manufacturer field is missing, extract the media access control address prefix and compare it with the local media access control mapping library for fallback identification.
4. The method according to claim 1, characterized in that, The hierarchical identification of target type devices first involves high-confidence pattern matching based on the length and first byte features of the manufacturer data to determine known sub-types, including: When the length of the manufacturer's data and the first byte meet the first preset condition, it is determined to be the first sub-type; when the length of the manufacturer's data and the first byte meet the second preset condition or the broadcast name contains preset keywords, it is determined to be the second sub-type; when the length of the manufacturer's data and the first byte meet the third preset condition, it is determined to be the general signal type; the target type candidate structure records the peak received signal strength indication, the number of occurrences, the most recent occurrence time, the connectable status, the device information service identifier, and the device reference information.
5. The method according to claim 1, characterized in that, The process of sorting devices in the candidate pool according to peak received signal strength and scheduling them based on the frequency of occurrence and connection constraints includes: The number of times candidate devices appear is continuously accumulated and sorted according to the peak received signal strength. Based on the constraints of the same device connection throttling, global minimum connection interval, maximum concurrent connection slots, parsing batch limit and connection timeout recovery, the top-ranked devices are selected to enter the connection attempt set.
6. The method according to claim 1, characterized in that, The steps of initiating a connection to the general attribute configuration file for the selected priority device, reading the model feature value from the standard device information service, and matching the obtained model identifier string with the local model mapping library to obtain the specific model name include: After the general attribute configuration file is connected and ready, the model feature value in the standard device information service is read, the obtained model identifier string is matched with the local model mapping library to obtain the specific model name, and the device cache is written back to update the category label; if the read fails, the connection times out, or the device is disconnected, resource release and state cleanup are performed.
7. The method according to claim 1, characterized in that, The process of maintaining a fixed-depth sliding window for the received signal strength indication of each device and outputting a smoothed value using the mean method, as well as performing distance threshold filtering based on a preset distance-to-received signal strength indication empirical mapping table, and performing consistent deduplication based on device identifiers and fallback deduplication based on the similarity of received signal strength indications, includes: For each device, a fixed-depth sliding window for the received signal strength indication is maintained, and a smooth value is output using the mean method. The distance threshold set by the user is converted into an empirical received signal strength indication threshold table. When the smooth value is lower than the corresponding threshold, the device is filtered. The first level of deduplication is to retain the record with richer information when two different media access control addresses correspond to the same device identifier. The second level of deduplication is to retain a record based on the richness of information when the device identifier cannot be extracted, if the signal strength of both devices is higher than the preset threshold and the difference does not exceed the difference threshold.
8. A terminal device identification device, characterized in that, The device includes: The scanning and acquisition module is used to create Bluetooth scanning execution threads and connection execution threads, receive Bluetooth Low Energy broadcast data, and perform time window rate limiting and traffic splitting according to the Media Access Control address. The device resolution module is used to identify manufacturers based on manufacturer-specific data and the local manufacturer mapping library. If the manufacturer field is missing, it uses the media access control address prefix to fall back to identify the manufacturer and classifies the device into target type devices and non-target type devices. The hierarchical identification module is used to perform hierarchical identification of target type devices. First, it performs high-confidence pattern matching based on the length and first byte feature of the manufacturer data to determine the known sub-type. If no match is found, the device identifier is extracted and compared with the local model library. If it is still not determined, a target type candidate structure is constructed and added to the candidate pool. The scheduling module is used to sort the devices in the candidate pool according to the peak received signal strength indication, and to schedule them according to the occurrence frequency and connection constraints, selecting priority devices to enter the connection attempt set; The active reading module is used to initiate a connection to the general attribute configuration file of the selected priority device and read the model characteristic value from the standard device information service; The mapping update module is used to match the obtained model identifier string with the local model mapping library to obtain the specific model name, and write back to the device cache to update the device model and category label; The smoothing module is used to maintain a fixed depth sliding window for the received signal strength indication of each device and output a smoothed value using the mean method. The data governance module is used to perform distance threshold filtering based on a preset distance and received signal strength indication empirical mapping table, and to perform consistency deduplication based on device identifier and fallback deduplication based on the similarity of received signal strength indication, and output the recognition results.
9. An electronic device, characterized in that, It includes a memory and a processor, the memory storing a computer program that, when executed by the processor, implements the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Bluetooth search result display method and device, terminal equipment and storage medium
CN110602671A
Method, system and device for establishing interconnection based on Bluetooth low power consumption protocol, and medium
CN120640435A