Accessory recognition method and apparatus, and storage medium

By using a magnetic strength detection element in an electronic device to detect the magnetic field strength of accessories and matching it with an index table, the problems of high hardware resource costs and information security are solved, achieving low-cost, high-efficiency accessory identification and information hiding.

WO2026031023A1PCT designated stage Publication Date: 2026-02-12AAC ACOUSTIC TECH (SHENZHEN) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/110550
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2026-02-12

AI Technical Summary

Technical Problem

Existing accessory identification methods require high hardware resource costs and are not conducive to ensuring accessory information security.

Method used

The magnetic field strength in the accessory is detected by a magnetic strength detection element, the target magnetic strength characterization data is generated, and it is matched with a preset accessory index table to determine the accessory identification information. The magnetic strength detection element is integrated into the electronic device, and the accessory is equipped with a magnetic component.

Benefits of technology

It hides accessory identification information, ensuring information security while saving hardware resource costs and space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024110550_12022026_PF_FP_ABST
    Figure CN2024110550_12022026_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are an accessory recognition method and apparatus, and a storage medium. The method comprises: when it is detected that a target accessory is located at a preset target position of an electronic apparatus, generating target magnetic-field intensity characterization data on the basis of a magnetic-field intensity measurement element and in response to the magnetic-field intensity of a magnetic assembly in the target accessory; matching the target magnetic-field intensity characterization data with a preset accessory index table; and determining accessory identification information, which corresponds to a magnetic-field intensity characterization data range obtained after matching, to be identification information of the target accessory. By means of implementing the solution of the present application, the magnetic-field intensity of a magnetic assembly in a target accessory is measured to obtain magnetic-field intensity characterization data, and identification information of the target accessory can then be obtained by means of looking up a table on the basis of the magnetic-field intensity characterization data. Therefore, identification information of accessories can be hidden, which is conducive to guaranteeing the security of accessory information; moreover, it is not necessary to provide numerous measurement devices, thereby reducing the space occupied by hardware and facilitating the reduction in the hardware resource cost.
Need to check novelty before this filing date? Find Prior Art

Description

Accessory identification method and device and storage medium TECHNICAL FIELD

[0001] The present application relates to the technical field of electronics, and in particular to an accessory identification method and device and storage medium. BACKGROUND

[0002] In recent years, various electronic products have become increasingly functional, and the types of accessories produced to realize various functions have also increased. In order to better adapt to individual differences of different types of accessories, it is necessary to understand the relevant information of each accessory. In related technologies, accessory-related information is usually identified by adding a two-dimensional code or a bar code to the accessory, or by adding an NFC (RFID) tag to the accessory. An electronic device reads the two-dimensional code or bar code information through a camera or a scanner to identify the accessory, or the electronic device installs an NFC (RFID) card reader to read the accessory information. The two-dimensional code identification method requires the use of a camera or a scanner, which occupies a large amount of resources and requires high system resources. Moreover, the two-dimensional code / bar code of the accessory is exposed and can be easily copied and stolen. The NFC (RFID) tag reading method requires a certain antenna size area for both the electronic device and the accessory. Moreover, the card reader on the electronic device is relatively expensive, and the card reader consumes a large amount of power when it is turned on for a long time. If the card reader is not used for a long time, it may affect the user experience when it is turned on again. TECHNICAL PROBLEM

[0003] The main purpose of the present application is to provide an accessory identification method, device and storage medium, which at least solves the problem of high hardware resource cost or difficulty in ensuring the security of accessory information in related art accessory identification methods. TECHNICAL SOLUTION

[0004] To achieve the above purpose, the first aspect of the present application provides an accessory identification method applied to an electronic device, wherein the electronic device is provided with a magnetic strength detection element. The accessory identification method comprises the following steps: when it is detected that a target accessory is located at a preset target position of the electronic device, generating target magnetic strength representation data based on the magnetic strength detection element responding to the magnetic field strength of a magnetic component in the target accessory; wherein the magnetic strength representation data comprises voltage data; matching the target magnetic strength representation data with a preset accessory index table; wherein the accessory index table comprises a mapping relationship between a magnetic strength representation data range and accessory identification information; and determining the accessory identification information corresponding to the matched magnetic strength representation data range as the identification information of the target accessory.

[0005] The second aspect of the present application provides a accessory identification device, applied to an electronic device, the electronic device is provided with a magnetic intensity detection element, the accessory identification device comprises: a generation module, configured to generate target magnetic intensity characteristic data based on the magnetic intensity detection element responding to the magnetic field intensity of a magnetic component in a target accessory when it is detected that the target accessory is located at a preset target position of the electronic device; wherein the magnetic intensity characteristic data comprises voltage data; a matching module, configured to match the target magnetic intensity characteristic data with a preset accessory index table; wherein the accessory index table comprises a mapping relationship between a magnetic intensity characteristic data range and accessory identification information; and a determination module, configured to determine the accessory identification information corresponding to the matched magnetic intensity characteristic data range as the identification information of the target accessory.

[0006] The third aspect of the present application provides an electronic device, comprising a memory and a processor, wherein the processor is configured to execute a computer program stored in the memory, and when the processor executes the computer program, each step of the accessory identification method provided in the first aspect of the present application is implemented.

[0007] The fourth aspect of the present application provides a computer readable storage medium, having a computer program stored thereon, and when the computer program is executed by a processor, each step of the accessory identification method provided in the first aspect of the present application is implemented. Advantages

[0008] As can be seen from the above, according to the accessory identification method, device and storage medium provided by the present application, when it is detected that a target accessory is located at a preset target position of an electronic device, target magnetic intensity characteristic data is generated based on the magnetic intensity detection element responding to the magnetic field intensity of a magnetic component in the target accessory; wherein the magnetic intensity characteristic data comprises voltage data; the target magnetic intensity characteristic data is matched with a preset accessory index table; wherein the accessory index table comprises a mapping relationship between a magnetic intensity characteristic data range and accessory identification information; and the accessory identification information corresponding to the matched magnetic intensity characteristic data range is determined as the identification information of the target accessory. Through the implementation of the present application, the magnetic field intensity of the magnetic component in the accessory is detected to obtain the corresponding magnetic intensity characteristic data, and then the identification information of the accessory can be obtained by looking up the table according to the magnetic intensity characteristic data, so that the identification method can hide the identification information of the accessory, which is beneficial to ensuring the security of the accessory information, and compared with the related art, it does not require excessive hardware resources, only the electronic device is provided with a magnetic intensity detection element and the accessory is provided with a magnetic component, thereby effectively saving the hardware resource cost. BRIEF DESCRIPTION OF DRAWINGS

[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed in the embodiments or prior art description. Obviously, the drawings in the following description only constitute some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.

[0010] Fig. 1 is a schematic diagram of the basic flow of the accessory identification method provided by an embodiment of the present application;

[0011] Fig. 2 is a schematic diagram of the detailed flow of the accessory identification method provided by an embodiment of the present application;

[0012] Fig. 3 is a schematic diagram of a magnetic field detection principle provided by an embodiment of the present application;

[0013] Fig. 4 is a schematic diagram of a first accessory identification provided by an embodiment of the present application;

[0014] Fig. 5 is a schematic diagram of a second accessory identification provided by an embodiment of the present application;

[0015] Fig. 6 is a schematic diagram of a third accessory identification provided by an embodiment of the present application;

[0016] Fig. 7 is a schematic diagram of the module of an accessory identification device provided by an embodiment of the present application;

[0017] Fig. 8 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Embodiments of the present application

[0018] In order to make the purposes, features and advantages of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application will be described clearly and completely below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0019] In addition, the terms "first" and "second" are only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features limited by "first" and "second" can explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise specifically limited.

[0020] In order to solve the problem of high hardware resource cost or difficulty in ensuring the safety of accessory information in the related art accessory identification method, the first embodiment of the present application provides an accessory identification method applied to an electronic device, the electronic device is provided with a magnetic strength detection element, which can be an element integrated in the electronic device itself or an element additionally installed during detection, and the magnetic strength detection element can be a Hall sensor or other sensor with a magnetic field strength detection function. The present embodiment takes a linear Hall sensor as an example for description. As shown in FIG. 1, the basic flowchart of the accessory identification method provided by the present embodiment includes steps 101 to 103:

[0021] In step 101, when it is detected that the target accessory is located at a preset target position of the electronic device, target magnetic strength representation data is generated based on the magnetic field strength of the magnetic component in the target accessory responding to the magnetic strength detection element.

[0022] Specifically, the embodiment performs accessory recognition based on magnetic field strength detection. A linear Hall sensor can be used to detect the magnetic field strength. As shown in FIG. 2, when the position of the magnet 10 changes, the Hall sensor 20 detects a change in the magnetic field strength, and the output magnetic strength characteristic data also changes accordingly. Thus, a magnetic component such as a magnet can be arranged in different accessories, so that when different accessories are located at the set position of the electronic device, the distance between the magnetic component in the different accessories and the linear Hall sensor or the relative position of the linear Hall sensor is different, so that the linear Hall sensor can output different magnetic strength characteristic data, which can be voltage data or current data, etc. The embodiment takes voltage data as an example for illustration. For example, as shown in FIG. 3, if the magnet 10 in the first accessory 1 is located to the left of the linear Hall sensor 20 of the electronic device 2, and the distance between the magnet 10 and the linear Hall sensor 20 is 2 mm, the linear Hall sensor 20 detects that the magnetic field strength is -2.5 GS, and outputs a voltage value of 500 mV. For the second accessory 3 in FIG. 4, the magnet 10 is located above the linear Hall sensor 20 of the electronic device 2, and the distance between the magnet 10 and the linear Hall sensor 20 is 0 mm, so the linear Hall sensor 20 detects that the magnetic field strength is 0 GS, and outputs a voltage value of 1500 mV. For the third accessory 4 in FIG. 5, the magnet 10 is located to the right of the linear Hall sensor 20 of the electronic device 2, and the distance between the magnet 10 and the linear Hall sensor 20 is 3 mm, so the linear Hall sensor 20 detects that the magnetic field strength is 3 GS, and outputs a voltage value of 3000 mV. The linear Hall sensor can be integrated with an analog-to-digital converter (ADC), so that the voltage value representing the magnetic field strength can be directly obtained. If the ADC is not integrated, the digital voltage data obtained by the ADC can be converted.

[0023] In some embodiments of the embodiment, before the magnetic strength detection element generates the target magnetic strength characteristic data based on the magnetic field strength of the magnetic component in the target accessory, the method further includes: detecting the magnetic field strength of the magnetic component in the target accessory in real time based on the magnetic strength detection element to obtain corresponding first voltage data; and if the first voltage data is within a preset voltage threshold range, determining that the target accessory is located at the preset target position of the electronic device.

[0024] Specifically, in the embodiment, a fixed position is provided on the electronic device, and when detection is needed, the target accessory is placed on the fixed position, so that different accessories have the same reference point. In the embodiment, the linear Hall sensor is used to detect whether each accessory is in the fixed position. The magnetic field strength of each magnet in the accessory used in the related scene when the accessory is in the fixed position is detected in advance, and a corresponding voltage value is output, so that a voltage threshold range is obtained. When accessory recognition is needed, the magnetic field strength of the magnet in the target accessory is detected in real time, and when the voltage value representing the magnetic field strength is in the voltage threshold range, it is determined that the target accessory is in the preset fixed position of the electronic device. Meanwhile, in the embodiment, the magnetic strength representation data obtained when the target accessory is in the fixed position is matched subsequently, and is matched with the voltage threshold range. The target magnetic strength representation data that does not belong to the target magnetic strength representation data is filtered out, so that the accuracy of the subsequent matching data can be improved.

[0025] In some other embodiments of the present embodiment, before the magnetic strength detection element generates the target magnetic strength representation data in response to the magnetic field strength of the magnetic component in the target accessory, the method further includes: detecting the magnetic field strength of the reference magnetic component in the reference accessory in the target position based on the magnetic strength detection element to obtain reference magnetic strength representation data; and if the reference magnetic strength representation data meets the magnetic strength representation data range associated with the reference magnetic component, performing the operation of generating the target magnetic strength representation data in response to the magnetic field strength of the magnetic component in the target accessory based on the magnetic strength detection element.

[0026] Specifically, in the embodiment, in order to ensure the accuracy and reliability of the detected magnetic strength representation data, the linear Hall sensor can be calibrated before magnetic strength detection, that is, a reference accessory is selected, the magnetic strength of the reference magnetic component in the reference accessory is detected based on the linear Hall sensor, and then the output reference magnetic strength representation data is matched with the magnetic strength representation data range associated with the reference magnetic component. If the reference magnetic strength representation data is in the magnetic strength representation data range, it is determined that the calibration is successful, and the subsequent operation of generating the target magnetic strength representation data in response to the magnetic field strength of the magnetic component in the target accessory can be performed.

[0027] Further, in some embodiments of the present embodiment, when the number of target magnetic strength representation data is multiple, the magnetic strength detection element generates the target magnetic strength representation data in response to the magnetic field strength of the magnetic component in the target accessory, including: detecting the magnetic field strength of the magnetic component in the target accessory when the target accessory is in different directions based on the magnetic strength detection element to obtain multiple target magnetic strength representation data; and / or, according to a preset detection number, and based on the magnetic strength detection element, detecting the magnetic field strength of the magnetic component in the target accessory when the target accessory is in the same direction to obtain multiple target magnetic strength representation data.

[0028] Specifically, in the embodiment, when the target accessory is in the preset fixed position, the detected magnetic strength characteristic data can be one or more, i.e., one detection based on the linear Hall sensor can obtain one magnetic strength characteristic data; and in order to improve the accuracy of detection, multiple detections can be performed to obtain multiple magnetic strength characteristic data, wherein, when multiple magnetic strength characteristic data are needed, the magnetic strength of the magnetic component in the same orientation can be detected a preset number of times based on the linear Hall sensor, or the magnetic strength of the magnetic component can be detected from multiple orientations, or the two methods can be combined for detection, wherein the target accessory in multiple orientations is in the preset fixed position, i.e., the target accessory can be rotated by a preset angle.

[0029] Step 102, matching the target magnetic strength characteristic data with the preset accessory index table.

[0030] Specifically, in the embodiment, when the target accessory is in the preset fixed position, the detected magnetic strength characteristic data can be one or more, i.e., one detection based on the linear Hall sensor can obtain one magnetic strength characteristic data; and in order to improve the accuracy of detection, multiple detections can be performed to obtain multiple magnetic strength characteristic data, wherein, when multiple magnetic strength characteristic data are needed, the magnetic strength of the magnetic component in the same orientation can be detected a preset number of times based on the linear Hall sensor, or the magnetic strength of the magnetic component can be detected from multiple orientations, or the two methods can be combined for detection, wherein the target accessory in multiple orientations is in the preset fixed position, i.e., the target accessory can be rotated by a preset angle.

[0031] In some embodiments of the embodiment, when the number of target magnetic strength characteristic data is multiple, matching the target magnetic strength characteristic data with the preset accessory index table comprises: screening the multiple target voltage data to obtain multiple first target voltage data; calculating the mean of the multiple first target voltage data to obtain second target voltage data; and matching the second target voltage data with the preset accessory index table.

[0032] Specifically, in the embodiment, when the number of target magnetic strength characteristic data obtained when the target accessory is in the preset fixed position of the electronic device is multiple, the obtained magnetic strength characteristic data can be screened to select a preset number of target magnetic strength characteristic data or to select target magnetic strength characteristic data with high reference, and then the first target magnetic strength characteristic data obtained by screening is subjected to mean calculation to obtain second target magnetic strength characteristic data, and finally the second target magnetic strength characteristic data is queried in the preset accessory index table; or, each first target magnetic strength characteristic data obtained by screening can be directly matched with the accessory index table, and the magnetic strength characteristic data range with the highest occurrence frequency in the matching result is used as the reference.

[0033] Further, in some embodiments of the present embodiment, the plurality of target voltage data is filtered to obtain a plurality of first target voltage data, including: calculating the sum of absolute values of differences between each target voltage data and the remaining target voltage data to obtain a plurality of sum of absolute values; comparing each sum of absolute values with a preset threshold value respectively; if there is a target sum of absolute values greater than the threshold value, the corresponding target voltage data is removed to obtain a plurality of first target voltage data.

[0034] Specifically, in the present embodiment, in order to ensure the referenceability of the mean value calculation result, data in the plurality of target magnetic strength characteristic data that is greatly different from other target magnetic strength characteristic data can be filtered out. For example, each target magnetic strength characteristic data is subtracted from the remaining target magnetic strength characteristic data, then the absolute values of each difference value corresponding to each target magnetic strength characteristic data are summed to obtain a plurality of sum of difference absolute values, then each sum of difference absolute values is compared with a pre-set threshold value, and finally the target magnetic strength characteristic data corresponding to the sum of difference absolute values greater than the threshold value is removed; or the target magnetic strength characteristic data corresponding to the maximum sum of difference absolute values in the plurality of sum of difference absolute values is removed.

[0035] Further, in some other embodiments of the present embodiment, after the target magnetic strength characteristic data is matched with the preset accessory index table, it further includes: if the target magnetic strength characteristic data does not match the corresponding magnetic strength characteristic data range in the accessory index table, outputting prompt information that the target accessory is in an abnormal state.

[0036] Specifically, in the present embodiment, if the corresponding magnetic strength characteristic data range is not matched in the accessory index table, it indicates that the accessory can be damaged or the detected magnetic strength characteristic data is abnormal (such as being interfered by other magnetic objects, etc.), and the prompt information that the accessory is in an abnormal state can be outputted to remind the relevant personnel to perform abnormal troubleshooting.

[0037] Step 103, determining the accessory identification information corresponding to the matched magnetic strength characteristic data range as the identification information of the target accessory.

[0038] Specifically, in the embodiment, when the magnetic field strength characteristic data detected according to the target accessory located at the fixed position of the electronic device matches the corresponding magnetic field strength characteristic data range in the accessory index table, the accessory identification information corresponding to the magnetic field strength characteristic data range is determined as the identification information of the target accessory. For example, when the magnetic field strength characteristic data range [1498, 1502] is matched in the accessory index table according to the voltage value 1500 mV, it is determined that the target accessory is the second accessory. Similarly, any connected normal accessory can be identified according to different voltage values. Thus, the accessory identification method based on magnetic field strength detection provided in the embodiment can detect whether an accessory is connected and identify different types of accessories. Moreover, the magnetic field strength detection element and the magnetic component can be hidden and installed, so that the accessory-related information cannot be easily stolen, which is beneficial to ensure the safety of the accessory information. Meanwhile, the hardware implementation of the identification method is simple, and only needs to set the magnetic field strength detection element on the electronic device side and the magnetic component on the accessory side, so the overall cost is low and too much volume is not occupied. Furthermore, the judgment accuracy of the magnetic detection element such as the Hall sensor is high (up to + / - 0.05 mm), so the identification of multiple accessories can be realized in a small size.

[0039] Based on the technical solution of the embodiment of the application, when it is detected that the target accessory is located at the preset target position of the electronic device, the target magnetic field strength characteristic data is generated based on the magnetic field strength of the magnetic component in the target accessory responding to the magnetic field strength detection element. The target magnetic field strength characteristic data includes voltage data. The target magnetic field strength characteristic data is matched with the preset accessory index table. The accessory index table includes the mapping relationship between the magnetic field strength characteristic data range and the accessory identification information. The accessory identification information corresponding to the matched magnetic field strength characteristic data range is determined as the identification information of the target accessory. Through the implementation of the solution of the application, the magnetic field strength of the magnetic component in the accessory is detected to obtain the corresponding magnetic field strength characteristic data, and then the identification information of the accessory is obtained by looking up the table according to the magnetic field strength characteristic data. Thus, the identification method can hide the identification information of the accessory, which is beneficial to ensure the safety of the accessory information. Meanwhile, compared with the related art, the identification method does not need too many hardware resources, only needs to install the magnetic field strength detection element on the electronic device and the magnetic component on the accessory, so the hardware resource cost is effectively saved.

[0040] The method in FIG. 6 is a refined accessory identification method provided by an embodiment of the application. The accessory identification method includes:

[0041] Step 601: Real-time detection of the magnetic field strength of the magnetic component in the target accessory to obtain the corresponding first magnetic field strength characteristic data.

[0042] Step 602: If the first magnetic field strength characteristic data is in the preset threshold range, it is determined that the target accessory is located at the preset target position of the electronic device.

[0043] Step 603, generating a plurality of second magnetic strength characterization data in response to the magnetic field strength of the magnetic component in the target accessory;

[0044] Step 604, screening the plurality of second magnetic strength characterization data to obtain a plurality of third magnetic strength characterization data;

[0045] Step 605, calculating the mean of the plurality of third target magnetic strength characterization data to obtain target magnetic strength characterization data;

[0046] Step 606, matching the target magnetic strength characterization data with a preset accessory index table;

[0047] Step 607, determining the accessory identification information corresponding to the matched magnetic strength characterization data range as the identification information of the target accessory.

[0048] It should be understood that the size of the serial number of each step in the embodiment does not mean the order of execution of the steps, and the execution order of each step should be determined by its function and inherent logic, and should not constitute the only limitation on the implementation process of the embodiment of the application.

[0049] Based on the above technical solutions of the embodiment of the application, by detecting the magnetic field strength of the magnetic component in the target accessory in real time, when the voltage value representing the magnetic field strength is within the preset voltage threshold range, it is determined that the target accessory is in the preset fixed position of the electronic device, a plurality of voltage values detected when the target accessory is in the fixed position are obtained, the obtained voltage values are screened to select a preset number of target voltage values or select target voltage values with high reference, then the target voltage values obtained by screening are subjected to mean value calculation, and finally the target voltage mean value is queried in the preset accessory index table. If the corresponding voltage range is matched in the accessory index table, the accessory identification information corresponding to the voltage range can be determined as the identification information of the target accessory. Through the implementation of the application, it can be detected whether the accessory is connected, and different types of accessories can be identified. Since the magnetic strength detection element and the magnetic component can be hidden and installed, the accessory related information cannot be easily stolen, which is beneficial to ensure the safety of the accessory information. At the same time, the hardware implementation of the identification method is simple, only the magnetic strength detection element needs to be arranged on the electronic device side and the magnetic component needs to be arranged on the accessory side, the overall cost is low, and too much volume is not occupied. Furthermore, the judgment accuracy of the magnetic detection element such as the Hall sensor is high, and a plurality of accessories can be identified in a small size.

[0050] FIG. 7 is a kind of accessory identification device provided by an embodiment of the application, applied to electronic device, and the accessory identification device mainly includes:

[0051] The generating module 701 is configured to generate target magnetic strength characteristic data based on the magnetic strength detection element responding to the magnetic field strength of the magnetic component in the target accessory when it is detected that the target accessory is located at the preset target position of the electronic device; wherein the magnetic strength characteristic data comprises voltage data.

[0052] The matching module 702 is configured to match the target magnetic strength characteristic data with a preset accessory index table; wherein the accessory index table comprises a mapping relationship between a magnetic strength characteristic data range and accessory identification information.

[0053] The determining module 703 is configured to determine the accessory identification information corresponding to the matched magnetic strength characteristic data range as the identification information of the target accessory.

[0054] In some embodiments of the present embodiment, before performing the function of generating target magnetic strength characteristic data based on the magnetic strength detection element responding to the magnetic field strength of the magnetic component in the target accessory, the generating module is further configured to: detect the magnetic field strength of the magnetic component in the target accessory based on the magnetic strength detection element in real time to obtain corresponding first voltage data; and if the first voltage data is within a preset voltage threshold range, determine that the target accessory is located at the preset target position of the electronic device.

[0055] In some other embodiments of the present embodiment, before performing the function of generating target magnetic strength characteristic data based on the magnetic strength detection element responding to the magnetic field strength of the magnetic component in the target accessory, the generating module is further configured to: detect the magnetic field strength of the reference magnetic component in the reference accessory at the target position based on the magnetic strength detection element to obtain reference magnetic strength characteristic data; and if the reference magnetic strength characteristic data satisfies the magnetic strength characteristic data range associated with the reference magnetic component, perform the generation of target magnetic strength characteristic data responding to the magnetic field strength of the magnetic component in the target accessory.

[0056] Further, in some embodiments of the present embodiment, the number of target magnetic strength characteristic data is multiple, and the generating module is specifically configured to: detect the magnetic field strength of the magnetic component in the target accessory when the target accessory is at different orientations based on the magnetic strength detection element to obtain multiple target magnetic strength characteristic data; and / or, according to a preset detection number, detect the magnetic field strength of the magnetic component in the target accessory at the same orientation to obtain multiple target magnetic strength characteristic data.

[0057] In some embodiments of the present embodiment, when the number of target magnetic strength characteristic data is multiple, the matching module is specifically configured to: screen the multiple target voltage data to obtain multiple first target voltage data; calculate the mean value of the multiple first target voltage data to obtain second target voltage data; and match the second target voltage data with the preset accessory index table.

[0058] Further, in some embodiments of the present embodiment, when the matching module performs the function of screening the plurality of target voltage data to obtain the plurality of first target voltage data, it is specifically configured to: calculate the sum of absolute values of the difference between each target voltage data and the remaining target voltage data to obtain a plurality of absolute value sums; compare each absolute value sum with a preset threshold value respectively; if there is a target absolute value sum greater than the threshold value, the corresponding target voltage data is removed to obtain the plurality of first target voltage data.

[0059] Further, in some embodiments of the present embodiment, the accessory identification device further comprises: an output module configured to output prompt information that the target accessory is in an abnormal state if the target magnetic strength characteristic data does not match the corresponding magnetic strength characteristic data range in the accessory index table.

[0060] It should be noted that the accessory identification method in the foregoing embodiments can be implemented based on the accessory identification device provided in the present embodiment. For the convenience and brevity of description, the specific working process of the accessory identification device described in the present embodiment can be referred to the corresponding process in the foregoing method embodiments, which will not be described herein.

[0061] Based on the technical solutions of the foregoing embodiments of the present application, when it is detected that the target accessory is located at the preset target position of the electronic device, the target magnetic strength characteristic data is generated based on the magnetic field intensity of the magnetic component in the target accessory responding to the magnetic strength detection element; wherein the magnetic strength characteristic data comprises voltage data; the target magnetic strength characteristic data is matched with the preset accessory index table; wherein the accessory index table comprises a mapping relationship between the magnetic strength characteristic data range and the accessory identification information; the accessory identification information corresponding to the matched magnetic strength characteristic data range is determined as the identification information of the target accessory. Through the implementation of the present application, the magnetic field intensity of the magnetic component in the accessory is detected to obtain the corresponding magnetic strength characteristic data, and then the identification information of the accessory can be obtained by looking up the table according to the magnetic strength characteristic data. Therefore, the identification method can hide the identification information of the accessory, which is beneficial to ensuring the security of the accessory information. Compared with the related art, the present application does not require excessive hardware resources, but only needs the electronic device to be installed with the magnetic strength detection element and the accessory to be installed with the magnetic component, thereby effectively saving the hardware resource cost.

[0062] FIG. 8 is a structural schematic diagram of an electronic device according to an embodiment of the present application, which can be used to implement the accessory identification method in the foregoing embodiments, and mainly comprises:

[0063] The memory 801, the processor 802 and the computer program 803 stored on the memory 801 and executable on the processor 802 are connected by communication. When the processor 802 executes the computer program 803, the method in the foregoing embodiments is implemented. The number of processors can be one or more. The electronic device can be a mobile phone, a computer, a household appliance, etc., and the corresponding accessories can be earphones, chargers, motors, etc.

[0064] The memory 801 can be a high-speed random access memory (RAM) or a non-volatile memory such as a disk memory. The memory 801 is used to store executable program codes, and the processor 802 is coupled with the memory 801.

[0065] Further, the embodiments of the present application also provide a computer readable storage medium, which can be arranged in the electronic device, and the computer readable storage medium can be the memory in the embodiment shown in FIG. 8.

[0066] The computer readable storage medium stores a computer program, and the program is executed by the processor to implement the accessory identification method in the foregoing embodiments. Further, the computer readable storage medium can also be a U disk, a mobile hard disk, a read-only memory (ROM), a RAM, a magnetic disk or an optical disk, and various media that can store program codes.

[0067] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and actual implementation can have another division manner, for example, a plurality of modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed modules can be indirect coupling or communication connection through some interfaces, devices or modules, and can be electrical, mechanical or other forms.

[0068] The modules described as separate components can or can not be physically separated, and the components displayed as modules can or can not be physical modules, that is, they can be located in one place, or can be distributed on a plurality of network modules. According to actual needs, some or all of the modules can be selected to achieve the purpose of the embodiment scheme.

[0069] In addition, each function module in each embodiment of the present application can be integrated in one processing module, or each module can be physically present alone, or two or more modules can be integrated in one module. The integrated module can be realized in the form of hardware or in the form of a software function module.

[0070] When the integrated module is realized in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application, essentially or the part that contributes to the prior art, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a readable storage medium, including a number of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods in each embodiment of the present application. The aforementioned readable storage medium includes various media that can store program codes, such as a U disk, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.

[0071] It should be noted that, for each method embodiment described above, in order to simplify the description, each method embodiment is described as a combination of a series of actions, but those skilled in the art should know that the present application is not limited by the order of the actions described, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.

[0072] In the above embodiments, the description of each embodiment has its own emphasis, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.

[0073] The above is the description of the accessory identification method, device and storage medium provided by the present application. For those skilled in the art, according to the idea of the embodiments of the present application, there will be changes in the specific implementation and application range. In conclusion, the content of the specification should not be understood as a limitation of the present application.

Claims

1. A method of identifying a fitting, characterized by, The accessory identification method is applied to an electronic device provided with a magnetic strength detection element, and comprises the following steps: When it is detected that a target accessory is located at a preset target position of the electronic device, target magnetic strength characteristic data is generated based on a magnetic field strength of a magnetic component in the target accessory responding to the magnetic strength detection element; wherein the magnetic strength characteristic data comprises voltage data; The target magnetic strength characteristic data is matched with a preset accessory index table; wherein the accessory index table comprises a mapping relationship between a magnetic strength characteristic data range and accessory identification information; Accessory identification information corresponding to the matched magnetic strength characteristic data range is determined as identification information of the target accessory.

2. The fitting identification method according to claim 1, characterized by, Before the target magnetic strength characteristic data is generated based on the magnetic field strength of the magnetic component in the target accessory responding to the magnetic strength detection element, the following steps are further included: The magnetic field strength of the magnetic component in the target accessory is detected in real time based on the magnetic strength detection element, and corresponding first voltage data is obtained; If the first voltage data is within a preset voltage threshold range, it is determined that the target accessory is located at the preset target position of the electronic device.

3. The fitting identification method of claim 1, wherein After the target magnetic strength characteristic data is matched with the preset accessory index table, the following steps are further included: If the target magnetic strength characteristic data does not match corresponding magnetic strength characteristic data range in the accessory index table, prompt information that the target accessory is in an abnormal state is output.

4. The fitting identification method according to claim 1, characterized by, The number of the target magnetic strength characteristic data is multiple, and the matching of the target magnetic strength characteristic data with the preset accessory index table comprises the following steps: The multiple target voltage data is screened to obtain multiple first target voltage data; The mean value of the multiple first target voltage data is calculated to obtain second target voltage data; The second target voltage data is matched with the preset accessory index table.

5. The fitting identification method according to claim 4, characterized by, The multiple target voltage data is screened to obtain multiple first target voltage data, comprising the following steps: The sum of absolute values of the difference between each target voltage data and the remaining target voltage data is calculated to obtain multiple absolute value sums; Each absolute value sum is compared with a preset threshold value respectively; If there is a target absolute value sum greater than the threshold value, the corresponding target voltage data is removed to obtain multiple first target voltage data.

6. The method of claim 4, wherein The magnetic strength detection element comprises a Hall sensor, and the target magnetic strength characteristic data is generated based on the magnetic field strength of the magnetic component in the target accessory responding to the magnetic strength detection element, comprising the following steps: The magnetic field strength of the magnetic component in the target accessory when the target accessory is in different orientations is detected based on the Hall sensor to obtain multiple target magnetic strength characteristic data; And / or, according to a preset detection number, the magnetic field strength of the magnetic component in the target accessory in the same orientation is detected based on the Hall sensor to obtain multiple target magnetic strength characteristic data.

7. The method of identifying an accessory according to any one of claims 1 to 6, wherein, Before the target magnetic strength characteristic data is generated based on the magnetic field strength of the magnetic component in the target accessory responding to the magnetic strength detection element, the following steps are further included: The magnetic field strength of a reference magnetic component in a reference accessory located at the target position is detected based on the magnetic strength detection element to obtain reference magnetic strength characteristic data; If the reference magnetic strength characteristic data satisfies the magnetic strength characteristic data range associated with the reference magnetic component, the target magnetic strength characteristic data is generated based on the magnetic field strength of the magnetic component in the target accessory detected by the magnetic strength detection element.

8. An accessory identification apparatus, characterized by, The accessory identification device is applied to an electronic device provided with a magnetic strength detection element, and includes: A generation module is configured to generate target magnetic strength characteristic data based on the magnetic field strength of the magnetic component in the target accessory detected by the magnetic strength detection element when it is detected that the target accessory is located at a preset target position of the electronic device, wherein the magnetic strength characteristic data includes voltage data. A matching module is configured to match the target magnetic strength characteristic data with a preset accessory index table, wherein the accessory index table includes a mapping relationship between the magnetic strength characteristic data range and accessory identification information. A determination module is configured to determine the accessory identification information corresponding to the matched magnetic strength characteristic data range as the identification information of the target accessory.

9. An electronic device, comprising: The accessory identification device includes a memory and a processor, wherein: The processor is configured to execute a computer program stored in the memory. The processor, when executing the computer program, implements the steps of the accessory identification method in any one of claims 1 to 7.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the accessory identification method in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Card swiping guide area determination method and device and card reader

    CN109918955A

  • Seabed target detection method and device, computer equipment and storage medium

    CN118426059A

  • Control system and control method for vehicle Anti-theft

    US20160189457A1

  • Method and apparatus for table accessory detection

    US20210169721A1