Disclosure of Invention
The invention aims to provide a power supply method and a power supply device for NFC card equipment, which are used for supplying power to the NFC card equipment.
In order to achieve the above object, an embodiment of the present invention provides a method for supplying power to an NFC card device, where the method includes:
when NFC card equipment is triggered to be powered on in an NFC field transmitted by NFC card reading equipment, state information of the NFC card equipment is acquired, wherein the NFC card equipment is in communication connection with the NFC card reading equipment after the NFC card reading equipment transmits the NFC field;
determining a power supply mode of the NFC card equipment according to the state information of the NFC card equipment;
and adjusting the field intensity of the NFC field according to the determined power supply mode, wherein the NFC field is used for supplying power to the NFC card equipment.
Preferably, the state information of the NFC card device includes a coil voltage of the NFC card device, an NFC supply current, and an operation mode list of the NFC card device, where the operation mode list includes a first operation mode, and the first operation mode includes a first operation voltage and a first operation current;
the determining a power supply mode of the NFC card device according to the state information of the NFC card device, and adjusting the field intensity of the NFC field according to the determined power supply mode include:
when the coil voltage of the NFC card device is less than or equal to the first working voltage or the NFC supply current of the NFC card device is less than or equal to the first working current, sending an instruction for starting a first working mode to the NFC card device, and improving the field intensity of the NFC field to enable the coil voltage of the NFC card device not to be less than the first working voltage and the NFC supply current of the NFC card device not to be less than the first working current;
when the coil voltage of the NFC card equipment is greater than the first working voltage or the NFC supply current of the NFC card equipment is greater than the first working current, sending an instruction for starting a first working mode to the NFC card equipment, and reducing the field intensity of an NFC field to enable the difference value between the coil voltage of the NFC card equipment and the first working voltage to be not greater than a first preset value, and the difference value between the NFC supply current of the NFC card equipment and the first working current to be not greater than a second preset value.
Preferably, the operating mode list includes a second operating mode, the second operating mode includes a second operating voltage and a second operating current, wherein the second operating voltage is not greater than the first operating voltage, and the second operating current is not greater than the first operating current;
the determining a power supply mode of the NFC card device according to the state information of the NFC card device, and adjusting the field intensity of the NFC field according to the determined power supply mode include:
the method comprises the steps of obtaining battery electric quantity of the NFC card reading equipment, sending an instruction for starting a second working mode to the NFC card equipment when the battery electric quantity cannot maintain the operation of the NFC card equipment in the first working mode, improving or reducing the field intensity of an NFC field, enabling the coil voltage of the NFC card equipment not to be smaller than the second working voltage and the NFC power supply current of the NFC card equipment not to be smaller than the second working current, and enabling the difference value between the coil voltage of the NFC card equipment and the second working voltage not to be larger than a first preset value and the difference value between the NFC power supply current of the NFC card equipment and the second working current not to be larger than a second preset value.
Preferably, the acquiring the state information of the NFC card device when the NFC card device triggers power-up in an NFC field transmitted by the NFC card reader device includes:
when the NFC card equipment is triggered to be powered on in the NFC field transmitted by the NFC card reading equipment, the NFC card equipment operates in a low-power-consumption working mode, the NFC card reading equipment establishes communication connection with the NFC card equipment and sends a state information acquiring instruction to the NFC card equipment, and the NFC card equipment detects and returns coil voltage and NFC power supply current of the NFC card equipment and acquires and returns a working mode list of the NFC card equipment.
Preferably, the method further comprises:
receiving a service instruction, and when the service instruction is an instruction related to key operation, selecting a working mode as a first working mode, wherein the working voltage is a first working voltage and the working current is a first working current, otherwise, selecting the working mode as a second working mode, wherein the working voltage is a second working voltage and the working current is a second working current;
and sending an instruction for starting a selected working mode to the NFC card equipment, and increasing or reducing the field intensity of an NFC field to ensure that the coil voltage of the NFC card equipment is not less than the selected working voltage and the NFC supply current of the NFC card equipment is not less than the selected working current, and that the difference value between the coil voltage of the NFC card equipment and the selected working voltage is not more than a first preset value and the difference value between the NFC supply current of the NFC card equipment and the selected working current is not more than a second preset value.
Preferably, after adjusting the field strength of the NFC field according to the determined power supply mode, the method further includes:
recording the received signal strength of the NFC card equipment, and recording as a first signal strength;
and when the received signal strength of the NFC card equipment is smaller than the first signal strength and the difference value of the first signal strength and the second signal strength is not smaller than a third preset value, outputting a prompt signal with a weaker signal.
The embodiment of the invention also provides a device for supplying power to the NFC card equipment, which is characterized by comprising:
the NFC card reading device comprises an acquisition module, a processing module and a control module, wherein the acquisition module is used for acquiring the state information of the NFC card device when the NFC card device triggers to be powered on in an NFC field transmitted by the NFC card reading device to generate induced current;
the determining module is used for determining the power supply mode of the NFC card equipment according to the state information of the NFC card equipment;
and the power supply module is used for adjusting the field intensity of the NFC field according to the determined power supply mode so as to supply power to the NFC card equipment.
The embodiment of the invention also provides computer equipment which comprises a memory and a processor, wherein the memory stores the NFC card equipment power supply program, and the processor is used for realizing the steps of the NFC card equipment power supply method when executing the NFC card equipment power supply program.
The embodiment of the invention also provides a storage medium which is a computer readable storage medium, the computer readable storage medium stores an NFC card equipment power supply program, and the NFC card equipment power supply program is executed by a processor to realize the steps of the NFC card equipment power supply method.
According to the NFC card device power supply method and device, the computer device and the storage medium provided by the embodiment, when the NFC card reading device supplies power to the NFC card device, the power supply mode of the NFC card device is selected according to the acquired state information of the NFC card device, so that the NFC card reading device is controlled to adjust the output voltage to supply power to the NFC card device.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is an application environment diagram of an embodiment of the present invention, as shown in fig. 1, when an NFC card device approaches an NFC card reader or makes contact with the NFC card reader, the NFC card reader transmits an NFC field, the NFC card device is triggered to be powered on, and at this time, a communication channel for information interaction is established between the NFC card device and the NFC card reader. FIG. 2 is a flow chart of an embodiment of the present invention. As shown in fig. 2, the NFC card device power supply method includes the following steps:
s10: and when the NFC card equipment triggers and powers on in an NFC field transmitted by the NFC card reading equipment to generate induced current, acquiring the state information of the NFC card equipment, wherein the NFC card equipment is in communication connection with the NFC card reading equipment after the NFC card reading equipment transmits the NFC field.
The state information of the NFC card device refers to some states or index information of the NFC card device during operation, and the state information of the NFC card device may include information such as a working mode, a chip working voltage, a coil voltage of the NFC card device, an NFC supply current, and/or remaining battery power information.
Specifically, when the NFC card reading device transmits an NFC field and the NFC card device is triggered to power up, the NFC card device generates an induced current and a voltage through the NFC field, and at this time, the NFC card device and the NFC card reading device are in communication connection (i.e., a communication channel is established).
S20: and determining the power supply mode of the NFC card equipment according to the state information of the NFC card equipment.
Specifically, the judgment is performed according to the state information of the NFC card device, so that which power supply mode should be used to supply power to the NFC card device is determined.
S30: and adjusting the field intensity of the NFC field according to the determined power supply mode, wherein the field intensity of the NFC field is used for supplying power to the NFC card equipment.
In this embodiment, each power mode corresponds to a range of output voltages. And the NFC card reader adjusts the field intensity of the NFC field according to the determined power supply mode, so that the induced current of a coil of the NFC card equipment is correspondingly changed, and the NFC card equipment is powered after voltage limiting, voltage conversion and other processing. The above-mentioned power supply for the NFC card device may be power supply for each component (such as a control chip, a display module, a signal receiving module, and the like) in the NFC card device, that is, the NFC card device is supplied with a working voltage.
According to the embodiment, when the NFC card reading device supplies power to the NFC card device, the power supply mode of the NFC card device is selected according to the acquired state information of the NFC card device, so that the NFC card reading device is controlled to adjust the field intensity of an NFC field to supply power to the NFC card device, the NFC card device can complete corresponding functional operation when the electric quantity is too low, and for example, when the electric quantity of an electronic wallet is too low, a transaction can still be completed.
In another embodiment, as shown in fig. 3, the state information of the NFC card device includes a coil voltage of the NFC card device, an NFC supply current, and an operation mode list of the NFC card device, where the operation mode list includes a first operation mode, and the first operation mode includes a first operation voltage and a first operation current; in the above embodiment, determining the power supply mode of the NFC card device according to the state information of the NFC card device, and adjusting the field strength of the NFC field according to the determined power supply mode includes the following steps:
s21: when the coil voltage of the NFC card device is less than or equal to the first working voltage or the NFC supply current of the NFC card device is less than or equal to the first working current, an instruction for starting the first working mode is sent to the NFC card device, the field intensity of an NFC field is improved, the coil voltage of the NFC card device is not less than the first working voltage, and the NFC supply current of the NFC card device is not less than the first working current.
The coil voltage represents the voltage of an induction voltage generated by a coil of the NFC card equipment according to the field intensity of an NFC field output by the NFC card reading equipment; the NFC supply current represents the current magnitude of an induced current generated by a coil of the NFC card device according to the field intensity of the NFC field output by the NFC card reading device. The first operating voltage represents an operating voltage of the NFC card device when the NFC card device operates in the first operating mode. The first operating current represents an operating current of the NFC card device when the NFC card device operates in the first operating mode.
Specifically, in different application scenarios (the application scenarios may be permission acquisition, account registration, or information acquisition, and the specific application functions are related to functions supported by the NFC card device and the NFC card reading device, which are not listed here), the maximum operating voltages required for the NFC card device to operate are different. The coil voltage being less than or equal to the first operating voltage may be that the field intensity of the output NFC field of the NFC card reading device is too small, so that the induced voltage or the induced current generated by the coil of the NFC card device is less than or the operating voltage or the current of the application scenario is less than (specifically, the load of the NFC card device may become large). When the coil voltage of the NFC card device is less than or equal to the first working voltage or the NFC supply current of the NFC card device is less than or equal to the first working current, in order to ensure that the induced voltage generated by the coil voltage of the NFC card device just meets the requirement of the application scene, the situation that the field intensity of the output NFC field of the NFC card device cannot meet the working requirement of the NFC card device and the NFC card device cannot work is avoided, and the power supply mode of the NFC card device is selected to be the first working mode. Specifically, an instruction for starting the first working mode may be sent to the NFC card device, and the field intensity of the NFC field is increased, so that the coil voltage of the NFC card device is not less than the first working voltage, and the NFC supply current of the NFC card device is not less than the first working current, so as to meet the working requirement of the NFC card device.
In addition, the instruction can be sent to the NFC card device, so that after the NFC card device receives the instruction, the operating frequency is reduced to reduce the power consumption of the NFC card device.
S22: when the coil voltage of the NFC card device is greater than the first working voltage or the NFC supply current of the NFC card device is greater than the first working current, an instruction for starting a first working mode is sent to the NFC card device, the field intensity of an NFC field is reduced, the difference value between the coil voltage of the NFC card device and the first working voltage is not greater than a first preset value, and the difference value between the NFC supply current of the NFC card device and the first working current is not greater than a second preset value.
In this step, when the coil voltage of the NFC card device is greater than the first working voltage and the NFC supply current is greater than the first working current, it indicates that the field intensity of the NFC field output by the NFC card device is too large, which causes the induced voltage or induced current of the NFC coil to exceed the working voltage of the application scenario, and to avoid electric quantity waste, the power supply mode of the NFC card device is selected as the first working mode, an instruction for starting the first working mode is sent to the NFC card device, and the field intensity of the NFC field is reduced, so that the difference between the coil voltage of the NFC card device and the first working voltage is not greater than the first preset value, and the difference between the NFC supply current of the NFC card device and the first working current is not greater than the second preset value.
In another embodiment of the present invention, the operation mode list includes a second operation mode, and the second operation mode includes a second operation voltage and a second operation current, wherein the second operation voltage is not greater than the first operation voltage, and the second operation current is not greater than the first operation current, that is, the second operation mode saves more power than the first operation mode.
The steps are as follows: the method comprises the following steps of determining a power supply mode of the NFC card device according to the state information of the NFC card device, and adjusting the field intensity of an NFC field according to the determined power supply mode:
the method comprises the steps of obtaining battery electric quantity of the NFC card reading equipment, sending an instruction for starting a second working mode to the NFC card equipment when the battery electric quantity cannot maintain the operation of the NFC card equipment in the first working mode, and improving or reducing the field intensity of an NFC field, so that the coil voltage of the NFC card equipment is not less than the second working voltage, the NFC power supply current of the NFC card equipment is not less than the second working current, the difference value between the coil voltage of the NFC card equipment and the second working voltage is not more than a first preset value, and the difference value between the NFC power supply current of the NFC card equipment and the second working current is not more than a second preset value.
Specifically, when the battery power cannot maintain the operation of the NFC card device in the first working mode, an instruction for starting the second working mode is sent to the NFC card device, and the field strength of the NFC field is automatically adjusted (i.e., the field strength of the NFC field is increased or decreased), so that the coil voltage of the NFC card device is not less than the second working voltage and the NFC supply current of the NFC card device is not less than the second working current, and the difference between the coil voltage of the NFC card device and the second working voltage is not greater than the first preset value, and the difference between the NFC supply current of the NFC card device and the second working current is not greater than the second preset value.
In another embodiment, in step S10, when the NFC card device triggers power-on in an NFC field transmitted by an NFC card reader device, acquiring state information of the NFC card device includes:
when the NFC card equipment is triggered to be powered on in the NFC field transmitted by the NFC card reading equipment, the NFC card equipment operates in a low-power-consumption working mode, the NFC card reading equipment is in communication connection with the NFC card equipment, and sends a state information acquiring instruction to the NFC card equipment, so that the NFC card equipment detects and returns coil voltage and NFC power supply current of the NFC card equipment, and acquires and returns a working mode list of the NFC card equipment.
In this embodiment, after the NFC card reading device establishes a communication connection with the NFC card device, the NFC card reading device and the NFC card device can perform information interaction. In addition, the operation mode list in the above steps includes the first operation mode and the second operation mode mentioned in the above embodiments, and of course, the operation mode list also includes other operation modes, which are not listed here.
As shown in fig. 4, in another embodiment of the present invention, the NFC card device power supply method further includes the following steps:
s40: and receiving a service instruction, and when the service instruction is an instruction related to key operation, selecting the working mode as a first working mode, the working voltage as a first working voltage and the working current as a first working current, otherwise, selecting the working mode as a second working mode, the working voltage as a second working voltage and the working current as a second working current.
In this step, the service instruction is used to characterize a current application scenario of the user (for example, information reading, key operation, account registration, or the like), and the service instruction may be sent by the NFC card device or generated after the user operates the NFC card reading device, which is not specifically limited herein. The more complex the application scenario (such as key operation and account registration), the larger the electric energy that needs to be consumed by the NFC card device, that is, the larger the requirements for the coil voltage and the NFC power supply current of the NFC card device. And when the service instruction is an instruction which relates to key operation and has larger requirements on working voltage and working current, selecting the working mode as a first working mode, and adjusting the strength of an NFC field output by the NFC card reading equipment to enable the working voltage of the NFC card equipment to be the first working voltage and the working current to be the first working current.
In addition, if the service instruction does not relate to the instruction with smaller requirements on the working voltage and the working current such as key operation (such as information reading or information transmission), the working mode is selected as the second working mode, and the NFC card reading device is enabled to adjust the field intensity of the NFC field, so that the working voltage of the NFC card device is the second working voltage, the working current is the second working current, and the NFC card device is enabled to operate in a more energy-saving mode.
S50: and sending an instruction for starting the selected working mode to the NFC card equipment, and increasing or reducing the field intensity of the NFC field to ensure that the coil voltage of the NFC card equipment is not less than the selected working voltage and the NFC supply current of the NFC card equipment is not less than the selected working current, and the difference value between the coil voltage of the NFC card equipment and the selected working voltage is not more than a first preset value and the difference value between the NFC supply current of the NFC card equipment and the selected working current is not more than a second preset value.
In this step, an instruction for starting the selected operating mode is sent to the NFC card device, and the strength of the NFC field output by the NFC card reading device is automatically adjusted (specifically, the field strength of the NFC field may be increased or decreased), so that the coil voltage of the NFC card device is not less than the selected operating voltage and the NFC supply current of the NFC card device is not less than the selected operating current, and the difference between the coil voltage of the NFC card device and the selected operating voltage is not greater than a first preset value and the difference between the NFC supply current of the NFC card device and the selected operating current is not greater than a second preset value.
As shown in fig. 5, in another embodiment of the present invention, after step S30, that is, after adjusting the field strength of the NFC field according to the determined power supply mode, the method for powering the NFC card device further includes the following steps:
s60: recording the received signal strength of the NFC card equipment, and recording as a first signal strength;
s70: and when the received signal strength of the NFC card equipment is smaller than the first signal strength and the difference value of the first signal strength and the second signal strength is not smaller than a third preset value, outputting a prompt signal with a weaker signal.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
In an embodiment of the present invention, as shown in fig. 6, a NFC card device power supply apparatus is provided, where the NFC card device power supply apparatus corresponds to the NFC card device power supply methods in the foregoing embodiments one to one. As shown in fig. X, the NFC card device power supply apparatus includes an acquisition module 10, a determination module 20, and a power supply module 30. The functional modules are explained in detail as follows:
the acquiring module 10 is configured to acquire state information of the NFC card device when the NFC card device triggers to power up in an NFC field transmitted by the NFC card reading device to generate an induced current;
a determining module 20, configured to determine a power supply mode of the NFC card device according to the state information of the NFC card device;
and the power supply module 30 is configured to adjust a field intensity of an NFC field according to the determined power supply mode, where the NFC field is used to supply power to the NFC card device.
For specific limitations of the NFC card device power supply apparatus, reference may be made to the above limitations of the NFC card device power supply method, which is not described herein again. The modules in the NFC card device power supply apparatus may be wholly or partially implemented by software, hardware, or a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, as shown in fig. 7, a computer device is provided, which includes a memory 71 and a processor 72, where the memory 71 stores an NFC card device power supply program, and the processor 72 is configured to implement the steps of the NFC card device power supply method when executing the NFC card device power supply program.
In one embodiment, a storage medium is provided, and the storage medium is a computer-readable storage medium storing an NFC card device power supply program, and the NFC card device power supply program, when executed by a processor, implements the steps of the NFC card device power supply method described above.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.
While the foregoing is directed to embodiments of the present invention, it will be understood by those skilled in the art that various changes may be made without departing from the spirit and scope of the invention.