NFC working method, NFC device, storage medium and electronic equipment
By introducing different working modes into the NFC chip and processing according to card reading events, the screen is not required to be turned on during NFC swiping, thereby reducing the power consumption of electronic devices and solving the problem of small power equipment short battery life.
Patent Information
- Application Number
- CN202310558657.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-17
- Publication Date
- 2024-11-22
AI Technical Summary
During the NFC operation, especially for electronic devices such as watches and bracelets with smaller battery power, how to reduce power consumption has become an urgent problem.
By introducing the first card simulation mode and the second card simulation mode into the NFC chip, the operating mode is determined based on the card reading event of the external device. In the first card simulation mode, the NFC chip interacts with the external device and saves the interactive information in the chip to avoid lighting the screen; in the second card simulation mode, the NFC chip interacts with the external device and triggers the screen to light up. Display interactive information.
There is no need to light up the screen during NFC card swiping, which significantly reduces the power consumption of electronic devices and extends the battery life, which is especially of great significance for wearable devices with low power.
Smart Images

Figure CN119005228A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to an NFC working method, an NFC device, a storage medium and an electronic device. Background Art
[0002] Currently, NFC (Near Field Communication) technology is widely used in people's lives, such as common subways, buses, UnionPay QuickPass, access control systems, etc. More and more electronic devices such as smart phones, watches, and bracelets have integrated NFC functions. Through these electronic devices, bus cards, subway cards, bank cards, and access control cards can be opened / bound, and functions such as swiping buses, subways, UnionPay POS machines, and access control can be realized through these electronic devices.
[0003] Among the above functions, the physical card copying / binding stage requires the use of NFC's card reading function, that is, reading the physical card information and then writing it into the electronic device. When swiping the card, the NFC card emulation function is needed, that is, simulating the electronic device as a card to interact with card readers such as UnionPay POS machines, for example, to realize transactions.
[0004] For electronic devices such as smartphones, watches, and bracelets, especially wearable devices such as watches and bracelets with small battery power, power consumption has always been an issue that needs to be considered. How to reduce the power consumption of electronic devices during the NFC operation of electronic devices has become an urgent problem to be solved. Summary of the invention
[0005] The embodiments of the present application provide an NFC working method, an NFC device, a storage medium, and an electronic device, which can reduce the power consumption of the electronic device.
[0006] The present application embodiment provides an NFC working method of an electronic device, wherein the electronic device includes an NFC chip, and the NFC working method includes:
[0007] In response to a card reading event of the NFC chip by an external device, determining an operating mode of the NFC chip, wherein the operating mode includes a first card emulation mode and a second card emulation mode;
[0008] If the working mode of the NFC chip is the first card emulation mode, the NFC chip interacts with the external device and stores the interaction information in the NFC chip;
[0009] If the working mode of the NFC chip is the second card emulation mode, the NFC chip interacts with the external device and triggers the screen of the electronic device to light up, and the interaction information of the NFC chip is displayed on the screen.
[0010] The embodiment of the present application further provides an NFC device, which is applied to an electronic device, wherein the electronic device includes an NFC chip, and the NFC device includes:
[0011] a determination module, configured to determine an operating mode of the NFC chip in response to a card reading event of the NFC chip by an external device, wherein the operating mode includes a first card simulation mode and a second card simulation mode;
[0012] a first control module, configured to control the NFC chip to perform information interaction with the external device and store the interaction information in the NFC chip if the working mode of the NFC chip is the first card emulation mode;
[0013] The second control module is used to control the NFC chip to exchange information with the external device if the working mode of the NFC chip is the second card simulation mode, and trigger to light up the screen of the electronic device to display the interaction information of the NFC chip on the screen.
[0014] An embodiment of the present application further provides a storage medium, wherein a computer program is stored in the storage medium. When the computer program is executed on a computer, the computer is enabled to execute the above-mentioned NFC working method.
[0015] An embodiment of the present application also provides an electronic device, which is used to execute the above-mentioned NFC working method.
[0016] The NFC working method provided in the embodiment of the present application includes: in response to the card reading event of the NFC chip by the external device, determining the working mode of the NFC chip; if the working mode of the NFC chip is the first card simulation mode, the NFC chip interacts with the external device and stores the interaction information in the NFC chip; if the working mode of the NFC chip is the second card simulation mode, the NFC chip interacts with the external device and triggers the screen of the electronic device to light up, and displays the interaction information of the NFC chip on the screen. In this method, the electronic device can process the card reading event differently according to the different working modes of the NFC chip. In the whole process of implementing NFC card swiping in the first card simulation mode, there is no need to light up the screen of the electronic device, so the power consumption of the electronic device can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can obtain other drawings based on these drawings without creative work.
[0018] Figure 1 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0019] Figure 2 A schematic diagram of a first flow chart of the NFC working method provided in an embodiment of the present application.
[0020] Figure 3 A first interactive schematic diagram of the NFC working method provided in an embodiment of the present application.
[0021] Figure 4 A second interactive schematic diagram of the NFC working method provided in an embodiment of the present application.
[0022] Figure 5 A schematic diagram of a selection interface of an electronic device provided in an embodiment of the present application.
[0023] Figure 6 A second flow chart of the NFC working method provided in the embodiment of the present application.
[0024] Figure 7 This is a schematic diagram of the first structure of the NFC device provided in the embodiment of the present application.
[0025] Figure 8 This is a schematic diagram of the second structure of the NFC device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0026] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0027] In the description of this application, it should be understood that terms such as "first" and "second" are only used to distinguish similar objects and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features.
[0028] An embodiment of the present application provides an electronic device, which may be a portable device such as a smart phone or a tablet computer, or a wearable device such as a smart watch or a smart bracelet.
[0029] refer to Figure 1 , Figure 1A schematic diagram of the structure of an electronic device 10 provided in an embodiment of the present application. The electronic device 10 includes a main processor (Application Processor, AP) 11, an NFC chip 12, an antenna matching circuit 13 and an NFC antenna 14. AP11 is connected to the NFC chip 12 for communication, for example, communication connection can be achieved through interfaces such as GPIO (General Purpose Input / Output), I2C, and SPI (Serial Peripheral Interface). In addition, the NFC chip 12 can also send an interrupt signal to the AP 11, and the AP 11 can perform corresponding processing according to the interrupt signal. The NFC chip 12, the antenna matching circuit 13, and the NFC antenna 14 are electrically connected in sequence.
[0030] The AP 11, as the main processor of the electronic device 10, can monitor the electronic device 10 as a whole and perform data processing. The NFC chip 12 can receive NFC signals from external devices and process the received NFC signals to achieve NFC communication with external devices, where the external devices can be devices such as bus card readers, subway gates, UnionPay POS machines, access control systems, etc. The antenna matching circuit 13 can be used to perform impedance matching on the NFC antenna 14. The NFC antenna 14 can radiate NFC signals to the outside world and receive NFC signals from the outside world.
[0031] It can be understood that in actual applications, the electronic device 10 may also include components such as a power module and a screen. The power module may be used to supply power to various components of the electronic device 10. For example, the power module is electrically connected to the AP 11, the NFC chip 12, and the screen, and is used to supply power to the AP 11, the NFC chip 12, the screen, and other components. The screen is electrically connected to the AP 11, and the screen may be used to display information, such as displaying interaction information between the NFC chip 12 and an external device, and so on.
[0032] In actual applications, users can bind physical cards such as bus cards, subway cards, bank cards, access cards, etc. to the electronic device 10. For example, the information of the physical card is read out through the NFC chip 12, and then written into the electronic device 10, so that an NFC electronic card corresponding to the physical card is formed in the electronic device 10. After binding, the user can swipe the NFC electronic card in the electronic device 10, so that the functions of the physical card can be realized through the electronic device 10, which provides convenience for the user's life.
[0033] The embodiment of the present application also provides an NFC working method to achieve NFC communication with external devices such as bus card readers, subway gate machines, UnionPay POS machines, access control systems, etc. The NFC working method can be executed by the electronic device 10.
[0034] refer to Figure 2 , Figure 2 A first flow chart of the NFC working method provided in the embodiment of the present application. The NFC working method comprises the following steps:
[0035] 21. In response to a card reading event of the NFC chip by an external device, determine the working mode of the NFC chip.
[0036] In the embodiment of the present application, the NFC chip 12 has two working modes, namely, a first card emulation mode and a second card emulation mode. The first card emulation mode is a low-power card emulation mode, or an "autonomous" card emulation mode; the second card emulation mode is a conventional card emulation mode. The power consumption of the first card emulation mode is lower than that of the second card emulation mode.
[0037] In actual applications, when a user brings the electronic device 10 close to an NFC card reader, such as a bus card reader, subway gate, UnionPay POS machine, access control system or other external device with NFC card reading function, the electronic device 10 enters the NFC field strength area of the external device. At this time, NFC communication is established between the external device and the NFC chip 12, and the external device can read the information in the NFC chip 12, generating a card reading event for the NFC chip 12. It can be understood that the information in the NFC chip 12 can be the information of the NFC electronic card in the electronic device 10, so that the external device can obtain the information of the NFC electronic card.
[0038] When a card reading event is generated for the NFC chip 12, the electronic device 10 responds to the card reading event of the NFC chip by the external device and determines the working mode of the NFC chip 12, that is, determines whether the NFC chip 12 is in the first card emulation mode or the second card emulation mode. Subsequently, different processing can be performed according to different working modes.
[0039] 22. If the working mode of the NFC chip is the first card emulation mode, the NFC chip interacts with the external device and stores the interaction information in the NFC chip.
[0040] If it is determined that the working mode of the NFC chip 12 is the first card simulation mode, the NFC chip 12 interacts with the external device and stores the interaction information in the NFC chip to implement NFC card swiping through the NFC chip 12, such as bus card swiping, bank card swiping, etc.
[0041] For example, if the external device is a bus card reader, the NFC chip 12 can exchange information with the bus card reader to realize the bus card transaction, and store the interactive information related to the bus card transaction in the NFC chip, which can include the transaction amount, the balance before the transaction, the balance after the transaction, the transaction time, etc. For another example, if the external device is a UnionPay POS machine, the NFC chip 12 can exchange information with the UnionPay POS machine to realize the bank card transaction, and store the interactive information related to the bank card transaction in the NFC chip, which can include the transaction merchant, transaction amount, the balance before the transaction, the balance after the transaction, the transaction time, etc.
[0042] It is understandable that the NFC chip 12 may include a memory, which may be used to store interaction information between the NFC chip 12 and an external device. In practical applications, the storage space of the memory may be set to be relatively small.
[0043] Therefore, during the entire process of the NFC chip 12 interacting with the external device to implement NFC card swiping, there is no need to light up the screen of the electronic device 10, thereby reducing power consumption. It is understandable that in actual applications, the power consumption of the screen accounts for a relatively large proportion of the entire electronic device 10, so not lighting up the screen during the entire process of NFC card swiping can greatly reduce the overall power consumption of the electronic device 10, save the power of the electronic device 10, and thus extend the battery life.
[0044] In practical applications, especially for wearable devices such as smart watches and smart bracelets, the wearable devices themselves are usually small in size and the batteries are also small, so the battery power is usually small, for example, the battery power is generally less than 500mAh, and the wearable devices are more sensitive to power consumption. Therefore, when the NFC working method of the embodiment of the present application is applied to wearable devices such as smart watches and smart bracelets, the power consumption that can be saved is very obvious, which is of great significance in practical applications.
[0045] 23. If the working mode of the NFC chip is the second card emulation mode, the NFC chip interacts with the external device and triggers the screen of the electronic device to light up, and the interaction information of the NFC chip is displayed on the screen.
[0046] If it is determined that the working mode of the NFC chip 12 is the second card simulation mode, the NFC chip 12 exchanges information with the external device and triggers the screen of the electronic device 10 to light up, and the interaction information of the NFC chip 12 is displayed on the screen, so as to complete NFC card swiping through the NFC chip 12, such as swiping a bus card or a bank card.
[0047] For example, if the external device is a bus card reader, the NFC chip 12 can exchange information with the bus card reader to realize the bus card transaction, and trigger the screen of the electronic device 10 to light up, and display the interactive information related to the bus card transaction on the screen, which may include the transaction amount, the balance before the transaction, the balance after the transaction, the transaction time, etc. For another example, if the external device is a UnionPay POS machine, the NFC chip 12 can exchange information with the UnionPay POS machine to realize the bank card transaction, and trigger the screen of the electronic device 10 to light up, and display the interactive information related to the bank card transaction on the screen, which may include the transaction merchant, transaction amount, the balance before the transaction, the balance after the transaction, the transaction time, etc.
[0048] Therefore, when the NFC chip 12 interacts with an external device to implement NFC card swiping, the user can intuitively see the relevant information of the card swiping, which brings convenience to the user.
[0049] In some embodiments, when the working mode of the NFC chip 12 is the first card emulation mode, after the NFC chip 12 saves the interaction information with the external device in the NFC chip 12, during the use of the electronic device 10, if the screen of the electronic device 10 is turned on, the AP 11 obtains the interaction information stored in the NFC chip 12 and updates the interaction information to the NFC electronic card corresponding to the above-mentioned card reading event.
[0050] For example, if the card reading event is a bus card reader reading the NFC chip 12, then AP 11 can update the acquired interaction information to the NFC electronic card corresponding to the bus card. For another example, if the card reading event is a UnionPay POS machine reading the NFC chip 12, then AP 11 can update the acquired interaction information to the NFC electronic card corresponding to the bank card. It should be noted that the NFC electronic card is usually associated with the application (APP) of the electronic device 10. For example, the NFC electronic card corresponding to the bank card can be associated with the APP "wallet". Therefore, AP 11 updates the interaction information to the corresponding NFC electronic card, which can also be understood as updating the interaction information to the corresponding APP.
[0051] It is understandable that during the use of the electronic device 10, when the screen of the electronic device 10 is turned on, the screen display content needs to be controlled by the AP 11. For example, when the electronic device 10 receives a message, the AP 11 controls the screen to turn on to display the message content, and the AP 11 is in an awake state at this time. Therefore, at this time, the AP 11 obtains the interaction information stored in the NFC chip 12 and updates the interaction information to the corresponding NFC electronic card, and the power consumption of the electronic device 10 is not increased.
[0052] In some embodiments, after the NFC chip 12 stores the interaction information with the external device in the NFC chip 12, status mark information may be further set in the NFC chip 12, and the status mark information is used to indicate that new interaction information is stored in the NFC chip 12. For example, the status mark information may be information in the form of "balance has changed" or the like.
[0053] During the use of the electronic device 10, when the screen of the electronic device 10 is turned on and the AP 11 reads the status mark information in the NFC chip 12, it obtains the interaction information stored in the NFC chip 12 and updates the interaction information to the NFC electronic card corresponding to the card reading event.
[0054] refer to Figure 3 , Figure 3 The first interactive schematic diagram of the NFC working method provided in the embodiment of the present application. First, an external device reads the NFC chip 12 to generate a card reading event. Then, the NFC chip 12 interacts with the external device, stores the interactive information in the NFC chip 12, and sets the status mark information in the NFC chip 12. Then, when the screen of the electronic device 10 is turned on, the AP 11 reads the status mark information in the NFC chip 12, obtains the interactive information stored in the NFC chip 12, and updates the interactive information to the NFC electronic card corresponding to the card reading event.
[0055] In some embodiments, if it is determined that the working mode of the NFC chip 12 is the second card emulation mode, the NFC chip 12 can report the card reading event to the AP 11 and interact with the external device. When the AP 11 receives the card reading event reported by the NFC chip 12, it controls the screen of the electronic device 10 to light up, and controls the interactive information between the NFC chip 12 and the external device to be displayed on the screen. Therefore, the NFC chip 12 can trigger the screen of the electronic device 10 to light up and display the interactive information.
[0056] refer to Figure 4 , Figure 4 A second interaction diagram of the NFC working method provided in the embodiment of the present application. First, an external device reads the NFC chip 12 to generate a card reading event. Subsequently, the NFC chip 12 reports the card reading event to the AP 11 and interacts with the external device. After receiving the card reading event reported by the NFC chip 12, the AP 11 controls the screen of the electronic device 10 to light up, obtains the interaction information related to the interaction between the NFC chip 12 and the external device, controls the display of the interaction information on the screen, and updates the interaction information to the NFC electronic card corresponding to the card reading event.
[0057] In some embodiments, the electronic device 10 may have multiple NFC electronic cards, for example, NFC electronic cards corresponding to bus cards, subway cards, bank cards, and access control cards. After the AP 11 controls the screen of the electronic device 10 to light up, and before the interactive information of the NFC chip 12 is displayed on the screen, the AP 11 may also control the display of an NFC electronic card selection interface on the screen. For example, referring to Figure 5 , Figure 5 Schematic diagram of the selection interface of the electronic device provided in the embodiment of the present application. In which, taking the electronic device 10 having NFC electronic cards corresponding to bus cards, subway cards, bank cards, and access control cards as an example, the above four NFC electronic cards can be displayed on the screen for the user to select. It should be noted that Figure 5 The examples shown are only examples, and the selection interface may be displayed in other ways in actual applications.
[0058] Subsequently, the user can perform a selection operation on the selection interface, and the electronic device 10 receives the user's selection operation on the selection interface. The selection operation is used to select a target NFC electronic card from multiple NFC electronic cards. For example, if the user selects "bus card", the NFC electronic card corresponding to the bus card is the target NFC electronic card.
[0059] In response to the user's selection operation, the electronic device 10 can control the display of the target NFC electronic card information on the screen, and control the display of the interaction information of the NFC chip 12 on the screen. The target NFC electronic card information may include, for example, the name and balance of the NFC electronic card.
[0060] Therefore, by displaying the selection interface, the user can manually select the desired NFC electronic card to avoid the situation where there are multiple NFC electronic cards and the default NFC electronic card does not correspond to the card reader, resulting in the inability to swipe the NFC card.
[0061] For example, if the external device is a UnionPay POS machine and the current default NFC electronic card is a bus card, then the current NFC electronic card cannot be used for transactions with the UnionPay POS machine. At this time, the user can manually select a bank card as the target NFC electronic card so that NFC card swiping can proceed normally.
[0062] In some embodiments, reference Figure 6 , Figure 6 The second flow chart of the NFC working method provided in the embodiment of the present application. Step 21, in response to the card reading event of the NFC chip by the external device, before determining the working mode of the NFC chip, the following steps are also included:
[0063] 24. Receive the user's electronic card adding operation;
[0064] 25. In response to the electronic card adding operation, a new NFC electronic card is added to the electronic device, and a working mode setting interface is displayed on the screen of the electronic device;
[0065] 26. Receive the user's setting operation on the setting interface;
[0066] 27. In response to the setting operation, the operating mode of the NFC chip is set to the target operating mode.
[0067] In actual applications, when there is only one NFC electronic card in the electronic device 10, the user does not need to manually select the required NFC electronic card when swiping the NFC card, so the NFC chip 12 can be set to the first card emulation mode by default.
[0068] When a user needs to add a new NFC electronic card in the electronic device 10, the user can perform an electronic card adding operation, which is used to add a new NFC electronic card in the electronic device 10. The electronic card adding operation may include one or more operation steps. The electronic device 10 receives the user's electronic card adding operation, and in response to the electronic card adding operation, adds the new NFC electronic card to the electronic device, for example, adds the new NFC electronic card to the corresponding APP.
[0069] At the same time, the electronic device 10 may display a working mode setting interface on the screen. The working mode setting interface is used to set the NFC chip 12 to work in the first card simulation mode or the second card simulation mode. In practical applications, the working mode setting interface may have various forms, such as providing the first card simulation mode and the second card simulation mode for the user to choose, or prompting the user whether to switch the working mode, or prompting the user whether to continue using the current working mode.
[0070] Subsequently, the user can perform a setting operation on the working mode setting interface, and the setting operation is used to set the working mode of the NFC chip 12 to the target working mode of the first card simulation mode and the second card simulation mode. For example, if the user selects the first card simulation mode, then the first card simulation mode is the target working mode. For another example, if the current working mode is the first card simulation mode, and the user confirms to switch the working mode, then the second card simulation mode is the target working mode.
[0071] In response to the setting operation, the electronic device 10 sets the working mode of the NFC chip 12 to the target working mode. For example, if the target working mode is the first card emulation mode, the electronic device 10 sets the working mode of the NFC chip 12 to the first card emulation mode.
[0072] Therefore, when a user adds a new NFC electronic card, the working mode of the NFC chip 12 can be set at the same time, making it more convenient for the user to use.
[0073] In some embodiments, continue to refer to Figure 6 In step 27, after the working mode of the NFC chip is set to the target working mode in response to the setting operation, the following steps are also included:
[0074] 28. Receive the user's work mode switching operation;
[0075] 29. In response to the working mode switching operation, the working mode of the NFC chip is switched from the first card emulation mode to the second card emulation mode, or the working mode of the NFC chip is switched from the second card emulation mode to the first card emulation mode.
[0076] In actual applications, after the user adds a new NFC electronic card and sets the working mode of the NFC chip 12, it may not be convenient to use, and the working mode needs to be switched. At this time, the user can perform a working mode switching operation on the electronic device 10, and the working mode switching operation is used to switch the working mode of the NFC chip 12 from the first card simulation mode to the second card simulation mode, or switch the working mode of the NFC chip 12 from the second card simulation mode to the first card simulation mode.
[0077] The electronic device 10 receives the user's working mode switching operation, and in response to the working mode switching operation, sets the working mode of the NFC chip 12 to the switched working mode, for example, switches the working mode of the NFC chip 12 from the first card emulation mode to the second card emulation mode, or switches the working mode of the NFC chip 12 from the second card emulation mode to the first card emulation mode. In specific implementation, when the electronic device 10 receives the user's working mode switching operation, the AP 11 generates a switching instruction and sends the switching instruction to the NFC chip 12 through the GPIO. After receiving the switching instruction, the NFC chip 12 executes the switching instruction, thereby completing the switching of the working mode.
[0078] Therefore, by switching the working mode, the user can change the working mode of the NFC chip 12 at any time, so that the working mode of the NFC chip 12 is more in line with his own usage habits.
[0079] In specific implementation, the present application is not limited by the execution order of the various steps described. If no conflict occurs, some steps can be performed in other orders or simultaneously.
[0080] As can be seen from the above, the NFC working method provided in the embodiment of the present application includes: in response to the card reading event of the external device to the NFC chip, determining the working mode of the NFC chip; if the working mode of the NFC chip is the first card simulation mode, the NFC chip interacts with the external device and stores the interaction information in the NFC chip; if the working mode of the NFC chip is the second card simulation mode, the NFC chip interacts with the external device and triggers the screen of the electronic device to light up, and displays the interaction information of the NFC chip on the screen. In this method, the electronic device can process the card reading event differently according to the different working modes of the NFC chip. In the whole process of realizing NFC card swiping in the first card simulation mode, there is no need to light up the screen of the electronic device, so the power consumption of the electronic device can be reduced.
[0081] The present application also provides an NFC device, which can be applied to the electronic device 10. Figure 7 , Figure 7 The first structural diagram of the NFC device 30 provided in the embodiment of the present application is as follows. The NFC device 30 includes a determination module 31 , a first control module 32 , and a second control module 33 .
[0082] A determination module 31, configured to determine an operating mode of the NFC chip in response to a card reading event of the NFC chip by an external device, wherein the operating mode includes a first card simulation mode and a second card simulation mode;
[0083] A first control module 32, configured to, if the working mode of the NFC chip is the first card emulation mode, enable the NFC chip to interact with the external device and store the interaction information in the NFC chip;
[0084] The second control module 33 is used for, if the working mode of the NFC chip is the second card emulation mode, the NFC chip interacts with the external device, triggers the screen of the electronic device to light up, and displays the interaction information of the NFC chip on the screen.
[0085] In some embodiments, reference Figure 8 , Figure 8 The second structural diagram of the NFC device 30 provided in the embodiment of the present application. The NFC device 30 also includes a third control module 34, and the third control module 34 is used to:
[0086] Receive the user's electronic card adding operation;
[0087] In response to the electronic card adding operation, a new NFC electronic card is added to the electronic device, and a working mode setting interface is displayed on the screen of the electronic device;
[0088] Receive the user's setting operation on the setting interface;
[0089] In response to the setting operation, the operating mode of the NFC chip is set to the target operating mode.
[0090] In some embodiments, the third control module 34 is further configured to:
[0091] Receive the user's work mode switching operation;
[0092] In response to the working mode switching operation, the working mode of the NFC chip is switched from the first card emulation mode to the second card emulation mode, or the working mode of the NFC chip is switched from the second card emulation mode to the first card emulation mode.
[0093] It can be understood that the specific implementation of each of the above modules can refer to the description in the above NFC working method, which will not be repeated here.
[0094] In specific implementation, the above modules can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same entity or several entities.
[0095] As can be seen from the above, the NFC device 30 provided in the embodiment of the present application determines the working mode of the NFC chip by responding to the card reading event of the external device to the NFC chip through the determination module 31; the first control module 32 is used for, if the working mode of the NFC chip is the first card simulation mode, the NFC chip and the external device to perform information interaction, and the interaction information is stored in the NFC chip; the second control module 33 is used for, if the working mode of the NFC chip is the second card simulation mode, the NFC chip and the external device to perform information interaction, and trigger to light up the screen of the electronic device, and display the interaction information of the NFC chip on the screen. The NFC device 30 provided in the embodiment of the present application can process the card reading event differently according to the different working modes of the NFC chip. In the whole process of realizing NFC card swiping in the first card simulation mode, there is no need to light up the screen of the electronic device, so the power consumption of the electronic device can be reduced.
[0096] An embodiment of the present application further provides a storage medium, in which a computer program is stored. When the computer program is executed on a computer, the computer executes the NFC working method of any of the above embodiments.
[0097] It should be noted that a person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the storage medium may include but is not limited to: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0098] In the description of this application, it should be understood that terms such as "first" and "second" are only used to distinguish similar objects and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features.
[0099] The above is a detailed introduction to the NFC working method, NFC device, storage medium and electronic device provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core ideas of the present application; at the same time, for those skilled in the art, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present application.
Claims
1. An NFC working method of an electronic device, characterized in that: The electronic device includes an NFC chip, and the NFC working method includes: In response to a card reading event of the NFC chip by an external device, determining an operating mode of the NFC chip, wherein the operating mode includes a first card emulation mode and a second card emulation mode; If the working mode of the NFC chip is the first card emulation mode, the NFC chip exchanges information with the external device and stores the interaction information in the NFC chip; If the working mode of the NFC chip is the second card emulation mode, the NFC chip interacts with the external device and triggers the screen of the electronic device to light up, and the interaction information of the NFC chip is displayed on the screen.
2. The NFC working method according to claim 1, characterized in that: The electronic device further comprises a main processor, wherein the main processor is communicatively connected with the NFC chip; After the NFC chip stores the interaction information in the NFC chip, if the screen of the electronic device is turned on, the main processor obtains the interaction information and updates the interaction information to the NFC electronic card corresponding to the card reading event.
3. The NFC working method according to claim 2, characterized in that: After the NFC chip stores the interaction information in the NFC chip, setting status mark information in the NFC chip; If the screen of the electronic device is on and the main processor reads the status mark information, the interaction information is acquired and the interaction information is updated to the NFC electronic card corresponding to the card reading event.
4. The NFC working method according to claim 2, characterized in that: If the working mode of the NFC chip is the second card emulation mode, the NFC chip reports the card reading event to the main processor and performs information exchange with the external device; When the main processor receives the card reading event, it controls the screen of the electronic device to light up, and controls the interaction information of the NFC chip to be displayed on the screen.
5. The NFC working method according to claim 4, characterized in that: The electronic device has a plurality of NFC electronic cards, and after the control lights up the screen of the electronic device and before the control displays the interaction information of the NFC chip on the screen, the control further includes: Controlling display of a selection interface for an NFC electronic card on the screen; receiving a selection operation of the user on the selection interface, wherein the selection operation is used to select a target NFC electronic card from the multiple NFC electronic cards; In response to the selection operation, the information of the target NFC electronic card is controlled to be displayed on the screen, and the interaction information of the NFC chip is controlled to be displayed on the screen.
6. The NFC working method according to any one of claims 1 to 5, characterized in that: Before determining the working mode of the NFC chip in response to a card reading event of the NFC chip by an external device, the NFC working method further includes: Receiving an electronic card adding operation from a user, wherein the electronic card adding operation is used to add a new NFC electronic card to the electronic device; In response to the electronic card adding operation, the new NFC electronic card is added to the electronic device, and a working mode setting interface is displayed on the screen of the electronic device; receiving a setting operation of the user on the setting interface, wherein the setting operation is used to set the working mode of the NFC chip to a target working mode of the first card emulation mode and the second card emulation mode; In response to the setting operation, the operating mode of the NFC chip is set to the target operating mode.
7. The NFC working method according to claim 6, characterized in that: After the operating mode of the NFC chip is set to the target operating mode in response to the setting operation, the NFC operating method further includes: Receiving a working mode switching operation of a user, wherein the working mode switching operation is used to switch the working mode of the NFC chip; In response to the working mode switching operation, the working mode of the NFC chip is switched from the first card emulation mode to the second card emulation mode, or the working mode of the NFC chip is switched from the second card emulation mode to the first card emulation mode.
8. An NFC device, applied to an electronic device, characterized in that: The electronic device comprises an NFC chip, and the NFC device comprises: a determination module, configured to determine an operating mode of the NFC chip in response to a card reading event of the NFC chip by an external device, wherein the operating mode includes a first card simulation mode and a second card simulation mode; A first control module, configured to control the NFC chip to perform information interaction with the external device and store the interaction information in the NFC chip if the working mode of the NFC chip is the first card emulation mode; The second control module is used to control the NFC chip to exchange information with the external device if the working mode of the NFC chip is the second card simulation mode, and trigger to light up the screen of the electronic device to display the interaction information of the NFC chip on the screen.
9. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed on a computer, the computer is enabled to execute the NFC working method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: The electronic device is used to execute the NFC working method according to any one of claims 1 to 7.
