Method, device, electronic device and storage medium for detecting card
By using radio frequency chips and radio frequency antennas in electronic devices to detect and judge the card type, the problem of physical cards being damaged in wireless charging environment is solved, and the card security detection and environmental adaptation are realized to avoid damage.
Patent Information
- Application Number
- CN202411966838.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-04
AI Technical Summary
In some usage environments, such as wireless charging environments, physical cards are easily damaged by mistake and cannot be used.
A method and device for detecting a card is provided, which detects whether the card exists through a radio frequency chip and a radio frequency antenna, and determines whether the card is a physical card or a virtual card. If it is determined to be a physical card, the charging signal will be avoided in the wireless charging environment to prevent the card from being damaged.
It effectively avoids the problem of physical cards being damaged in special environments and ensures the security and usability of cards.
Smart Images

Figure CN119761399A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of near field communication technology, and in particular to a method, device, electronic device and storage medium for detecting a card. Background Art
[0002] With the development of intelligent electronic products, near field communication (NFC) functions are widely used in various electronic products, vehicles, etc. NFC modules are mainly used to interact with mobile phones, cards, and keys that support NFC functions.
[0003] Currently, in some specific usage environments, for example, in high-power charging environments such as wireless charging, if a physical card is mistakenly placed in the environment, the physical card may be burned and become unusable. Summary of the invention
[0004] In order to solve the above technical problems, the present disclosure provides a method, device, electronic device and storage medium for detecting a card, which effectively prevents the physical card from being damaged.
[0005] In a first aspect, the present disclosure provides a method for detecting a card, which is applied to an electronic device, and the method includes: detecting whether a card exists; if a card exists, determining whether the card is a physical card or a virtual card.
[0006] In some embodiments, a radio frequency chip and a radio frequency antenna connected to the radio frequency chip are provided in the electronic device; detecting whether a card exists includes: waking up the radio frequency chip and controlling the radio frequency chip to transmit an initial radio frequency signal to the radio frequency antenna; controlling the radio frequency chip to transmit a card-seeking radio frequency signal to the radio frequency antenna; and controlling the radio frequency chip to receive a feedback signal. If the radio frequency chip receives the feedback signal, it is determined that a card exists.
[0007] In some embodiments, determining whether a card is a physical card or a virtual card includes: controlling the RF chip to stop transmitting a card-seeking RF signal to the RF antenna; after a first set time, controlling the RF chip to transmit a card-seeking RF signal to the RF antenna again; controlling the RF chip to receive a feedback signal; comparing whether the two feedback signals are the same, if the two feedback signals are the same, determining that the card is a virtual card, and if the two feedback signals are different, determining that the card is a physical card.
[0008] In some embodiments, determining whether the card is a physical card or a virtual card further includes: adjusting a first set time based on a card-seeking radio frequency signal.
[0009] In some embodiments, a wireless charging chip and a wireless charging antenna connected to the wireless charging chip are provided in the electronic device; the method also includes: if the card is a physical card, controlling the wireless charging chip not to start transmitting a charging signal to the wireless charging antenna or stopping transmitting a charging signal to the wireless charging antenna.
[0010] In some embodiments, the method further includes: if the card is a virtual card, controlling the wireless charging chip to start transmitting a charging signal to the wireless charging antenna or continuing to transmit a charging signal to the wireless charging antenna.
[0011] In a second aspect, the present disclosure also provides a device for detecting a card, which is applied to an electronic device, and the device includes: a detection unit and a judgment unit; the detection unit is used to detect whether a card exists; the judgment unit is used to judge whether the card is a physical card or a virtual card when a card exists.
[0012] In a third aspect, the present disclosure further provides an electronic device, including a processor and a memory storing program instructions, wherein the processor is configured to execute the method for detecting a card as described in the present disclosure when running the program instructions.
[0013] In a fourth aspect, the present disclosure further provides a computer-readable storage medium storing program instructions, which, when executed, enable a computer to execute the method for detecting a card as described in the present disclosure.
[0014] Compared with the prior art, the technical solution provided by the present invention has the following advantages:
[0015] The method for detecting a card provided by the present disclosure can first detect whether there is a card in the surrounding environment. When the presence of the card is detected, it is determined whether the card is a physical card or a virtual card, thereby determining the type of the card. When it is determined that the card is a physical card, the surrounding environment can be changed to avoid the physical card being in a special environment, thereby preventing the physical card from being damaged. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0018] Figure 1 is a structural schematic diagram of an electronic device provided by the present disclosure;
[0019] Figure 2 is a structural schematic diagram of a radio frequency structure provided by the present disclosure;
[0020] Figure 3 It is a flowchart of a method for detecting a card provided by the present disclosure;
[0021] Figure 4 is a flow chart of another method for detecting a card provided by the present disclosure;
[0022] Figure 5 It is a structural schematic diagram of a device for detecting cards provided by the present disclosure. DETAILED DESCRIPTION
[0023] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0024] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0025] In order to be able to understand the features and technical contents of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided through multiple details. However, one or more embodiments can still be implemented without these details. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.
[0026] The terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate for the embodiments of the embodiments of the present disclosure described herein. In addition, the terms "including", "having" and any variations thereof are intended to cover non-exclusive inclusions.
[0027] Unless otherwise stated, the term "plurality" means two or more.
[0028] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B indicates: A or B.
[0029] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.
[0030] The term "correspondence" may refer to an association relationship or a binding relationship. The correspondence between A and B means that there is an association relationship or a binding relationship between A and B.
[0031] Figure 1 is a structural schematic diagram of an electronic device provided by the present disclosure, Figure 2 is a schematic diagram of a radio frequency structure provided by the present disclosure, with reference to Figure 1 and Figure 2 The electronic device includes a microcontroller unit MCU, a radio frequency chip 10, a radio frequency antenna 20 connected to the radio frequency chip 10, a wireless charging chip 30, and a wireless charging antenna 40 connected to the wireless charging chip 30. The microcontroller unit MCU can control the radio frequency chip 10 to transmit a radio frequency signal to the radio frequency antenna 20 connected thereto, so that the radio frequency antenna 20 can form a corresponding radio frequency field according to the radio frequency signal. The microcontroller unit MCU can control the wireless charging chip 30 to transmit a charging signal to the wireless charging antenna 40 connected thereto, so that the wireless charging antenna 40 can form corresponding electromagnetic waves according to the charging signal and transmit them out, and these electromagnetic waves will induce current in the antenna of the receiving device, thereby realizing wireless charging.
[0032] Optionally, in the electronic device, a processing circuit 50 is further provided between the RF chip 10 and the RF antenna 20, and the processing circuit 50 can perform signal processing such as filtering and amplification on the RF signal emitted by the RF chip 10. Optionally, the RF chip 10 can transmit RF signals to the RF antenna 20 through the TX1 port and the TX2 port, and can receive feedback signals through the PXP port.
[0033] Figure 3 is a flow chart of a method for detecting a card provided by the present disclosure, with reference to Figure 3 The present disclosure provides a method for detecting a card, which is applied to an electronic device. The method includes:
[0034] Step S100, detecting whether a card exists.
[0035] Step S200: If a card exists, determine whether the card is a physical card or a virtual card.
[0036] Specifically, the method for detecting a card provided by the embodiment of the present disclosure can first detect whether there is a card in the surrounding environment. When the presence of a card is detected, it is determined whether the card is a physical card or a virtual card, thereby determining the type of the card. When it is determined that the card is a physical card, the surrounding environment can be changed to avoid the physical card being in a special environment, thereby preventing the physical card from being damaged.
[0037] In some optional embodiments, a wireless charging chip and a wireless charging antenna connected to the wireless charging chip are provided in the electronic device; and the method further includes:
[0038] If the card is a physical card, the wireless charging chip is controlled not to start transmitting a charging signal to the wireless charging antenna or to stop transmitting a charging signal to the wireless charging antenna.
[0039] Specifically, when a wireless charging chip and a wireless charging antenna connected to the wireless charging chip are provided in an electronic device, the wireless charging chip can transmit a charging signal to the wireless charging antenna connected thereto, so that the wireless charging antenna can generate corresponding electromagnetic waves according to the charging signal and transmit them out. These electromagnetic waves will induce current in the antenna of the receiving device, thereby realizing wireless charging. Since the wireless charging antenna needs to send high-frequency energy pulse waves during the charging process, if a physical card is mistakenly placed in this environment, the physical card will be burned and cannot be used.
[0040] It should be noted that this embodiment exemplarily shows the research conducted by the inventor based on the problem of damage to the physical card in a wireless charging environment. Similarly, in other embodiments of the present disclosure, in other special environments, when the physical card is damaged, the solution of the above embodiment can also be adopted, and the present disclosure will not go into details here.
[0041] By using the card detection method provided in the embodiment of the present disclosure, when it is confirmed that the card is a physical card, the wireless charging chip is controlled not to start transmitting a charging signal to the wireless charging antenna or to stop transmitting a charging signal to the wireless charging antenna, so as to avoid the physical card being placed in a wireless charging environment, causing the physical card to be burned and unusable.
[0042] In some optional embodiments, the method further includes: if the card is a virtual card, controlling the wireless charging chip to start transmitting a charging signal to the wireless charging antenna or continue transmitting a charging signal to the wireless charging antenna.
[0043] Specifically, when the virtual card is placed in a wireless charging environment, it will not be affected.
[0044] By using the card detection method provided by the embodiment of the present disclosure, when it is confirmed that the card is a virtual card, the wireless charging chip is controlled to start transmitting a charging signal to the wireless charging antenna or continue transmitting a charging signal to the wireless charging antenna, thereby not interrupting the charging process of the corresponding device.
[0045] Figure 4 is a flow chart of another method for detecting a card provided by the present disclosure, with reference to Figure 4 In some optional embodiments, a radio frequency chip and a radio frequency antenna connected to the radio frequency chip are provided in the electronic device;
[0046] Step S100, detecting whether a card exists includes:
[0047] Step S110, waking up the RF chip and controlling the RF chip to transmit an initial RF signal to the RF antenna.
[0048] Specifically, the RF chip can be initialized first, and then awakened, and the RF chip can be controlled to transmit an initial RF signal to the RF antenna, so that the RF antenna can form a corresponding RF field according to the initial RF signal, and the RF field can provide power to the physical card.
[0049] Step S120, controlling the radio frequency chip to transmit a card-seeking radio frequency signal to the radio frequency antenna.
[0050] Specifically, the RF chip is controlled to transmit a card-seeking RF signal to the RF antenna, so that the RF antenna can form a corresponding RF field according to the card-seeking RF signal. If there is a card nearby, the card will generate a feedback signal when it receives the corresponding electromagnetic wave.
[0051] Step S130, controlling the radio frequency chip to receive a feedback signal, and if the radio frequency chip receives the feedback signal, it is determined that there is a card.
[0052] Optionally, the RF chip includes an analog-to-digital conversion module, which can receive the feedback signal and convert the feedback signal into a digital signal.
[0053] Specifically, by controlling the RF chip to transmit a card-seeking RF signal to the RF antenna, whether the card is a physical card or a virtual card, a feedback signal will be sent back. If the RF chip receives the feedback signal, it can be determined that there is a card nearby.
[0054] Continue to refer Figure 4 In some optional embodiments, step S200, determining whether the card is a physical card or a virtual card includes:
[0055] Step S210, controlling the radio frequency chip to stop transmitting the card-seeking radio frequency signal to the radio frequency antenna.
[0056] Specifically, after determining that there is a card nearby, the radio frequency chip is controlled to stop transmitting the card-seeking radio frequency signal to the radio frequency antenna. Accordingly, the radio frequency antenna is closed according to the radio frequency field formed by the card-seeking radio frequency signal.
[0057] Step S220: After the first set time, the RF chip is controlled to transmit a card-seeking RF signal to the RF antenna again.
[0058] Specifically, within the first set time, the control RF chip stops transmitting the card-seeking RF signal to the RF antenna. Thus, the physical card cannot be powered by the RF field. After the first set time, the control RF chip transmits the card-seeking RF signal to the RF antenna again, and the RF antenna forms a corresponding RF field based on the card-seeking RF signal and turns on.
[0059] Optionally, the first set time may be adjusted based on the card-seeking radio frequency signal, that is, the first set time may be adjusted accordingly for different card-seeking radio frequency signals.
[0060] Step S230, controlling the radio frequency chip to receive the feedback signal.
[0061] Step S240, comparing whether the two feedback signals are the same. If the two feedback signals are the same, it is determined that the card is a virtual card. If the two feedback signals are different, it is determined that the card is a physical card.
[0062] Specifically, it is necessary to provide power to the physical card through the radio frequency field. The virtual card is usually set in a mobile device, and the mobile device is provided with a power supply. It is not necessary to provide power to the virtual card through the radio frequency field. Within the first set time, the radio frequency chip is controlled to stop transmitting the card-seeking radio frequency signal to the radio frequency antenna, that is, the radio frequency antenna cannot form a radio frequency field within the first set time. Subsequently, the radio frequency chip is controlled to transmit the card-seeking radio frequency signal to the radio frequency antenna again. The physical card will not immediately resume transmitting the feedback signal as the radio frequency field is restored, while the simulated card will immediately resume transmitting the feedback signal as the radio frequency field is restored, and it will remain the same as the previous feedback signal. At this time, the card can be distinguished as a physical card or a virtual card by comparing whether the two feedback signals are the same. If the two feedback signals are the same, it indicates that the card is a virtual card. If the two feedback signals are different, it indicates that the card is a physical card.
[0063] Figure 5 is a schematic diagram of a card detection device provided by the present disclosure, with reference to Figure 5 , the embodiment of the present disclosure provides a device for detecting a card, which is applied to an electronic device, and the device includes: a detection unit 60 and a judgment unit 70;
[0064] The detection unit 60 is used to detect whether a card exists;
[0065] The determination unit 70 is used to determine whether the card is a physical card or a virtual card when a card exists.
[0066] Specifically, the device for detecting cards provided by the embodiment of the present disclosure can first detect whether there is a card in the surrounding environment. When the presence of the card is detected, it is determined whether the card is a physical card or a virtual card, thereby determining the type of the card. When it is determined that the card is a physical card, the surrounding environment can be changed to avoid the physical card being in a special environment, thereby preventing the physical card from being damaged.
[0067] The embodiment of the present disclosure provides an electronic device, including a processor and a memory. Optionally, the electronic device may also include a communication interface and a bus. The processor, the communication interface, and the memory may communicate with each other through the bus. The communication interface may be used for information transmission. The processor may call the logic instructions in the memory to execute the method for detecting a card in the above embodiment.
[0068] An electronic device using an embodiment of the present disclosure can first detect whether there is a card in the surrounding environment. When the presence of a card is detected, it can determine whether the card is a physical card or a virtual card, thereby determining the type of card. When it is determined that the card is a physical card, the surrounding environment can be changed to avoid the physical card being in a special environment, thereby preventing the physical card from being damaged.
[0069] In some embodiments, the electronic device is a device deployed with a radio frequency chip, a radio frequency antenna connected to the radio frequency chip, a wireless charging chip, and a wireless charging antenna connected to the wireless charging chip, such as a vehicle.
[0070] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.
[0071] The memory, as a computer-readable storage medium, can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor executes the function application and data processing by running the program instructions / modules stored in the memory, that is, the method for detecting the card in the above embodiment is implemented.
[0072] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc.
[0073] In addition, the memory may include a high-speed random access memory and may also include a non-volatile memory.
[0074] This embodiment also provides a computer-readable storage medium storing program instructions, which, when executed, enable a computer to execute the method for detecting a card as described in the present disclosure.
[0075] This embodiment provides a computer program product, which includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the above-mentioned method for detecting a card.
[0076] The computer-readable storage medium mentioned above may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.
[0077] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes.
[0078] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0079] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0080] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
[0081] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for detecting a card, characterized in that: Applied to electronic equipment, the method comprises: Detect if a card exists; If a card exists, determine whether the card is a physical card or a virtual card.
2. The method according to claim 1, characterized in that: The electronic device is provided with a radio frequency chip and a radio frequency antenna connected to the radio frequency chip; The detecting whether a card exists comprises: Waking up the radio frequency chip and controlling the radio frequency chip to transmit an initial radio frequency signal to the radio frequency antenna; Controlling the radio frequency chip to transmit a card-seeking radio frequency signal to the radio frequency antenna; The radio frequency chip is controlled to receive a feedback signal, and if the radio frequency chip receives the feedback signal, it is determined that a card exists.
3. The method according to claim 2, characterized in that The determining whether the card is a physical card or a virtual card includes: Controlling the radio frequency chip to stop transmitting the card-seeking radio frequency signal to the radio frequency antenna; After the first set time, controlling the radio frequency chip to transmit a card-seeking radio frequency signal to the radio frequency antenna again; Controlling the radio frequency chip to receive a feedback signal; Compare whether the two feedback signals are the same. If the two feedback signals are the same, determine that the card is a virtual card; if the two feedback signals are different, determine that the card is a physical card.
4. The method according to claim 3, characterized in that The determining whether the card is a physical card or a virtual card further includes: The first set time is adjusted based on the card-seeking radio frequency signal.
5. The method according to claim 1, characterized in that The electronic device is provided with a wireless charging chip and a wireless charging antenna connected to the wireless charging chip; the method further comprises: If the card is a physical card, the wireless charging chip is controlled not to start transmitting a charging signal to the wireless charging antenna or to stop transmitting a charging signal to the wireless charging antenna.
6. The method according to claim 5, characterized in that Also includes: If the card is a virtual card, the wireless charging chip is controlled to start transmitting a charging signal to the wireless charging antenna or to continue transmitting a charging signal to the wireless charging antenna.
7. A device for detecting a card, characterized in that: Applied to electronic equipment, the device comprises: a detection unit and a judgment unit; The detection unit is used to detect whether a card exists; The determination unit is used to determine whether the card is a physical card or a virtual card when a card exists.
8. An electronic device comprising a processor and a memory storing program instructions, characterized in that: The processor is configured to execute the method for detecting a card according to any one of claims 1 to 6 when running the program instructions.
9. A computer-readable storage medium storing program instructions, characterized in that: When the program instructions are executed, the computer is used to execute the method for detecting a card according to any one of claims 1 to 6.