Data interaction method, terminal, storage medium and computer program product
By stopping the sending of card search request commands after receiving the card search response command from the target tag, the problem of increased terminal power consumption caused by NFC communication is solved, achieving the effect of reducing power consumption and improving communication efficiency.
Patent Information
- Application Number
- CN202410511529.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-26
- Publication Date
- 2025-10-28
AI Technical Summary
In existing technologies, continuous activation of NFC communication leads to increased terminal power consumption. How can we reduce terminal power consumption while ensuring the normal use of NFC functionality?
The terminal sends a card search request instruction, and stops sending the card search request instruction after receiving the card search response instruction from the target tag, so as to avoid continuously searching for other tags and reduce power consumption.
By stopping the sending of card search request commands, the power consumption of the terminal is reduced, and the power consumption of maintaining the communication connection is reduced when the communication connection is disconnected from the target tag, thereby improving communication efficiency.
Smart Images

Figure CN120857232A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of communications, and more particularly to a data interaction method, a terminal, a storage medium, and a computer program product. Background Technology
[0002] Due to the convenience and security of short-range wireless communication technologies, an increasing number of terminals are using these technologies for data interaction. Near Field Communication (NFC) is widely used in various scenarios such as smart tags, mobile payments, identity verification, and access control. However, the continuous activation of NFC communication during data interaction leads to increased power consumption. Therefore, reducing power consumption while ensuring normal NFC functionality has become a challenge that needs to be overcome. Summary of the Invention
[0003] To overcome the problems existing in related technologies, this disclosure provides a data interaction method, terminal, storage medium, and computer program product that can reduce the power consumption of the terminal.
[0004] According to a first aspect of the present disclosure, a data interaction method is provided, comprising:
[0005] Send a card search request command; the card search request command is used to discover the target tag;
[0006] Receive the card search response instruction returned by the target tag based on the card search request instruction;
[0007] Upon receiving the card search response instruction, the sending of the card search request instruction is stopped.
[0008] In some embodiments, stopping the sending of the card search request instruction after receiving the card search response instruction includes:
[0009] Upon receiving the card search response command, a read command is sent; the read command is used to read the tag information of the target tag;
[0010] If a read response instruction is received from the target tag based on the read instruction within a preset time period, the sending of the card search request instruction shall be stopped; or,
[0011] If the read response instruction is not received within the preset time period, the sending of the card search request instruction will be stopped.
[0012] In some embodiments, the method further comprises:
[0013] The target topic is obtained by parsing the tag information carried in the received read response command;
[0014] Based on the target topic, output query information; the query information is used to ask whether to switch the current topic;
[0015] In response to the switching instruction returned in response to the query information, the current topic is switched to the target topic.
[0016] In some embodiments, the method further comprises:
[0017] In response to the sustain instruction returned in response to the query information, the current topic is maintained and displayed.
[0018] In some embodiments, sending the card search request instruction includes:
[0019] When the terminal is installed in a housing with the target tag, the card search request command is sent through the terminal's near-field communication module.
[0020] In some embodiments, the method further comprises:
[0021] If the magnetic field strength detected by the magnetic field detection module of the terminal is greater than a preset strength threshold, it is determined that the terminal is installed in the housing; or,
[0022] If the distance detection module of the terminal detects that the distance between the terminal and the housing is less than a preset distance threshold, it determines that the terminal is installed in the housing.
[0023] In some embodiments, the method further comprises:
[0024] If the terminal is not installed in a housing with the target tag, determine whether the card search request command is being sent.
[0025] If the card search request command is being sent, then stop sending the card search request command.
[0026] According to a second aspect of the present disclosure, a terminal is provided, comprising:
[0027] A sending module is configured to send a card search request command; the card search request command is used to discover the target tag.
[0028] The receiving module is configured to receive a card search response instruction returned by the target tag based on the card search request instruction;
[0029] The control module is configured to stop sending the card search request command after receiving the card search response command.
[0030] According to a third aspect of the present disclosure, a terminal is provided, comprising:
[0031] processor;
[0032] Memory used to store computer programs or instructions;
[0033] The processor executes the computer program or instructions to implement the steps of the data interaction method described in the first aspect above.
[0034] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, the storage medium storing a computer program or instructions, characterized in that, when the computer program or instructions in the storage medium are executed by a processor, the steps of the data interaction method described in the first aspect are implemented.
[0035] According to a fifth aspect of the present disclosure, a computer program product is provided, wherein when the computer program or instructions are executed by a processor, the steps of the data interaction method described in the first aspect are implemented.
[0036] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:
[0037] In this embodiment, the terminal sends a card-finding request command and then receives a card-finding response command returned by the target tag based on the card-finding request command. After receiving the card-finding response command, the terminal stops sending card-finding request commands. Therefore, on the one hand, the terminal in this embodiment can find the target tag based on the card-finding request command. After receiving the card-finding response command returned by the target tag, it has discovered the target tag and laid the communication foundation for subsequent reading of the target tag. On the other hand, the data interaction method in this embodiment does not need to continue sending card-finding request commands after the terminal receives the card-finding response command, thus reducing the terminal's power consumption. Furthermore, the terminal does not need to send a sleep command to the target tag to control the target tag to sleep, thereby disconnecting the communication connection with the target tag. In this embodiment, by stopping sending card-finding request commands, the terminal stops continuously searching for or discovering the target tag, enabling the terminal and the target tag to disconnect the communication connection after data interaction, further reducing the power consumption of maintaining a communication connection between the terminal and the target tag.
[0038] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. Attached Figure Description
[0039] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0040] Figure 1 This is a flowchart illustrating a data interaction method according to an exemplary embodiment.
[0041] Figure 2 This is a schematic diagram illustrating the NFC operating mode of a terminal according to an exemplary embodiment.
[0042] Figure 3 This is a flowchart illustrating a data interaction method according to an exemplary embodiment.
[0043] Figure 4 This is a schematic diagram illustrating the interaction between a user, a terminal, and a target tag according to an exemplary embodiment.
[0044] Figure 5 This is a structural block diagram of a terminal according to an exemplary embodiment. Figure 1 .
[0045] Figure 6 This is a structural block diagram of a terminal according to an exemplary embodiment. Figure 2 . Detailed Implementation
[0046] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of data interaction methods, terminals, storage media, and computer program products consistent with some aspects of this disclosure as detailed in the appended claims.
[0047] In some related technologies, to enable the NFC reader to read information from other NFC tags while communicating with them, a data interaction method for terminals and NFC tags has been proposed: The terminal sends a card-finding request command; upon receiving the card-finding request command, the housing with the NFC tag sends a card-finding response command to the terminal; after receiving the card-finding response command from the NFC tag, the terminal determines that the housing has switched from being inactive (false) to being inactive (true) and reads the tag information of the NFC tag on the housing; after reading the tag information, the terminal stops reading and sends a card-finding request command to determine whether the housing remains inactive; if the terminal determines that it is continuously installed on the housing based on the card-finding response command sent by the housing, it continues to send card-finding request commands, cyclically determining whether the housing is inactive; if the terminal does not receive a card-finding response command from the NFC tag, it determines that the housing has switched from being inactive to being inactive, and then continues to send card-finding request commands.
[0048] Understandably, in order to read information from other NFC tags when the terminal is mounted on the terminal casing, the terminal continues to send a card search request command to identify other NFC tags even after the tag information of the first NFC tag has been read. Thus, the current technology continuously sends card search request commands, increasing the terminal's power consumption.
[0049] In other related technologies, when the terminal is detected to be installed on the housing, the terminal establishes a connection with the NFC tag built into the housing. After the data interaction between the terminal and the NFC tag is completed, the terminal sends a tag sleep command to the NFC tag. The tag sleep command is used to trigger the built-in timer of the NFC tag. When the countdown of the timer ends, the NFC tag enters sleep mode, thereby ending the communication connection between the terminal and the NFC tag.
[0050] Understandably, existing technologies increase the power consumption of terminal-NFC tag interaction by sending tag sleep commands to NFC tags or triggering the built-in timer of NFC tags through commands.
[0051] Based on this, this disclosure proposes a data interaction method that can reduce the power consumption of the terminal. Figure 1 This is a flowchart illustrating a data interaction method according to an exemplary embodiment. For example... Figure 1 As shown, the data interaction method includes the following steps:
[0052] S101. Send a card search request command; the card search request command is used to find the target tag;
[0053] S102, Receive the card search response instruction returned by the target tag based on the card search request instruction;
[0054] S103. After receiving the card search response instruction, stop sending the card search request instruction.
[0055] In this embodiment of the disclosure, the above-described data interaction method can be applied in scenarios where a terminal interacts with a target tag. For example, the terminal is a payment terminal (such as a cash register), and the target tag is a payment card. After the payment terminal detects a payment card, it can stop sending card-finding request instructions to search for other payment cards. Alternatively, the terminal can be a goods scanner, and the target tag is a goods tag. After the goods scanner finds a goods tag, it can stop sending card-finding request instructions to search for other goods tags. This embodiment of the disclosure does not impose any limitations on this approach.
[0056] The aforementioned data interaction method can also be applied in scenarios such as switching themes or wireless charging via target tags. For example, when the terminal needs to switch the current theme, it sends a card search request command to find a casing with a target tag, the tag information of which includes the target theme; when the terminal needs to wirelessly charge, it sends a card search request command to find a wireless charging dock with a target tag, the tag information of which includes wireless charging information.
[0057] The terminal may also include mobile phones, tablets, or wearable electronic devices (such as smart bracelets or smartwatches), and this disclosure does not limit this.
[0058] The target label may include a chip, an antenna, and packaging materials. The chip integrates a processor, memory, and communication interface for executing instructions, storing data, and transmitting and receiving digital signals; the antenna transmits and receives wireless signals for communication with the terminal; and the packaging materials protect the chip and antenna. Thus, the target label can be placed in different locations according to actual needs. For example, the target label can be affixed as a sticker to a smart home device; it can also be integrated as a label module into other terminals.
[0059] It should be noted that the terminal and the target tag can interact based on short-range communication technology. For example, the terminal can interact with the target tag based on technologies such as NFC, Bluetooth, or the ZigBee protocol, and this disclosure does not limit this.
[0060] For example, NFC technology involves the interaction between an NFC tag and an NFC reader. When the NFC tag is within the communication range of the NFC reader, the NFC reader can read the information of the NFC tag.
[0061] An NFC reader can be implemented using an NFC chip, which includes two operating modes: listen mode and polling mode. For example, each working cycle of an NFC chip can include a listen cycle of approximately 300 milliseconds (corresponding to listen mode) and a polling cycle of approximately 20 milliseconds (corresponding to polling mode). Listen mode is the card emulation mode of the NFC chip, while polling mode includes the NFC chip's point-to-point (P2P) mode and reader mode. When the terminal's NFC chip is in polling mode, it periodically sends card search request commands to locate NFC target tags around the terminal.
[0062] In step S101, the terminal broadcasts a card search request command, which is used to search for and find the target tag within a preset range of the terminal.
[0063] In this embodiment of the disclosure, the card search request instruction includes a request type, device identification information, or communication parameters (such as communication rate, modulation method, etc.). Here, the card search request instruction can be a standard card search request instruction or a proprietary card search request instruction; this embodiment of the disclosure does not impose any limitations.
[0064] The standard card search request command includes the NFC-based standard card search request (REQ) command, which is a command defined by the NFC protocol. Different NFC protocols correspond to different card search request commands; for example, there may be standard card search request commands such as REQA / B / F / V. Different standard card search request commands use different radio frequency identification communication standards. The terminal periodically polls and sends standard card search request commands such as REQA / B / F / V via radio frequency signals to detect whether various NFC tags are nearby. Private card search request commands involve modifying the terminal's software protocol, such as adding the terminal's identity information to the software protocol, so that the private card search request command carries the reader's identity information to distinguish it from the standard card search request command.
[0065] It should be noted that NFC tags include standard tags and silent tags. Silent tags are in a silent state by default and only respond when they receive a specific proprietary card search request command. When the terminal sends a standard card search request command according to the software protocol, the silent tag does not respond; when the terminal device sends a proprietary card search request command according to the modified software protocol, the standard tag does not respond.
[0066] Understandably, in one embodiment, when a terminal issues a card search request command, there may be multiple tags to be responded to within a preset range. If the card search request command is a private card search request command, and one of the tags to be responded to is a private tag while the others are standard tags, then the tag to be responded to as the private tag is the target tag. The target tag will return a first card search response command based on the private card search request command. In another embodiment, when a terminal issues a card search request command, and if the card search request command is a standard card search request command, and one of the tags to be responded to is a standard tag while the others are private tags, then the tag to be responded to as the standard tag is the target tag. The target tag will return a second card search response command based on the standard card search request command.
[0067] In step S102, the terminal receives a card search response instruction returned by the target tag based on the card search request instruction, indicating that the terminal has found the corresponding target tag and will conduct subsequent communication with the target tag.
[0068] In this embodiment of the disclosure, the card search response instruction includes the identifier of the target tag, supported communication protocols, or other relevant response information. After receiving the card search response instruction, the terminal can confirm the identity of the target tag based on the identifier in the card search response instruction and understand the parameters required to communicate with the target tag. Then, the terminal and the target tag can establish a connection based on the communication parameters.
[0069] It is understandable that the terminal and the target tag interact based on the card search request command and the card search response command, which enables the terminal to identify the target tag and establish communication.
[0070] In step S103, after receiving the card search response instruction sent by the target tag, the terminal stops sending the card search request instruction corresponding to the target tag in polling mode.
[0071] It is understandable that since the terminal has already established communication with the target tag upon receiving the card search response command from the target tag, it does not need to continue sending card search request commands to find other NFC tags and communicate with them. Therefore, this embodiment of the present disclosure stops sending card search request commands only after confirming that the terminal has found the target tag, thus ensuring that subsequent communication between the terminal and the target tag is not affected.
[0072] Furthermore, compared to existing technologies that continuously send card search request commands after the terminal reads the tag information of the NFC tag to determine whether the target tag is still in place, this embodiment adds an NFC-X working phase within the polling cycle. That is, during the NFC-X working phase, the terminal sends a card search request command corresponding to the target tag, and stops sending the card search request command after receiving a card search response command for the target tag. This reduces the power consumption of the terminal without affecting the communication between the terminal and the target tag.
[0073] In this embodiment of the disclosure, after receiving the card search response instruction sent by the target tag, the terminal can also send other communication instructions based on communication needs. For example, in one embodiment, after receiving the card search response instruction sent by the target tag, the terminal can send an activation instruction to the target tag. The activation instruction is used to activate the target tag. After receiving the activation instruction, the target tag returns an activation response instruction. The activation response instruction is used to confirm that the target tag has been activated, and the activation of the target tag indicates that the target tag allows the terminal to read the tag information of the target tag. In another embodiment, after receiving the card search response instruction sent by the target tag, the terminal can send a read instruction to the target tag. The read instruction is used to read the tag information of the target tag. After receiving the read instruction, the target tag returns a read response instruction. The read response instruction is used by the terminal to read the tag information within the target tag.
[0074] It should be noted that the terminal stopping sending the card search request instruction after receiving the card search response instruction sent by the target tag includes: the terminal stopping sending the card search request instruction after receiving the card search response instruction sent by the target tag and after sending the activation instruction; or, the terminal stopping sending the card search request instruction after receiving the card search response instruction sent by the target tag and after sending the read instruction. This disclosure embodiment does not impose any limitations on either of these.
[0075] In this embodiment, the terminal sends a card-finding request command and then receives a card-finding response command returned by the target tag based on the card-finding request command. After receiving the card-finding response command, the terminal stops sending card-finding request commands. Therefore, on the one hand, the terminal in this embodiment can find the target tag based on the card-finding request command. After receiving the card-finding response command from the target tag, it has discovered the target tag and laid the communication foundation for subsequent reading of the target tag. On the other hand, the data interaction method in this embodiment does not need to continue sending card-finding request commands after the terminal receives the card-finding response command, thus reducing the terminal's power consumption. Furthermore, the terminal does not need to send a sleep command to the target tag to control the target tag to sleep, thereby disconnecting the communication connection with the target tag. In this embodiment, by stopping sending card-finding request commands, the terminal stops continuously searching for or discovering the target tag, enabling the terminal and the target tag to disconnect the communication connection after data interaction, further reducing the power consumption of maintaining a communication connection between the terminal and the target tag.
[0076] In some embodiments, after receiving a card search response instruction, stopping the sending of a card search request instruction includes:
[0077] After receiving the card search response command, a read command is sent; the read command is used to read the tag information of the target tag;
[0078] If a read response command based on the read command is received from the target tag within a preset time period, the sending of the card search request command will stop; or,
[0079] If no read response instruction is received within the preset time period, the sending of the card search request instruction will be stopped.
[0080] In this embodiment of the disclosure, after receiving the card search response command, the terminal only sends a read command to the target tag after confirming that the target tag has been found. This allows for more targeted acquisition of the target tag's tag information.
[0081] The tag information of the target tag may include a tag identifier, tag type, related data (target topic, etc.) or security information. The tag identifier is the identifier of the target tag and is used to distinguish different tags; the tag type describes the category or purpose to which the target tag belongs, such as a product tag, a name tag, etc.; related data includes data fields such as text and numbers; security information may include information such as encryption keys and access permissions to improve the confidentiality and integrity of the target tag.
[0082] In this embodiment of the present disclosure, if a read response instruction is received from the target tag based on the read instruction within a preset time period, it indicates that the terminal can start reading the tag information in the target tag. At this time, the card search request instruction is stopped, indicating that the terminal does not need to search for other tags during the process of reading the tag information of the target tag, thereby reducing the power consumption of the terminal.
[0083] Alternatively, if no read response command is received from the target tag based on the read command within a preset time period, it means that the terminal has found the target tag, but cannot read the tag information in the target tag. At this time, the terminal stops sending the card search request command. This means that even if the terminal has found the target tag but cannot read the tag information in the target tag, it will not search for other tags, which also reduces the power consumption of the terminal.
[0084] The preset duration can be set according to actual conditions, and this embodiment does not impose any limitations on it. For example, the preset duration is set to a range of 2 to 5 seconds.
[0085] It should be noted that if no read response instruction is received from the target tag within the preset time period, it could be that the target tag does not return a read response instruction based on the read instruction, or that the terminal disconnects the communication connection with the target tag within the preset time period. This disclosure does not limit this.
[0086] In this embodiment of the present disclosure, if the terminal receives a read response instruction from the target tag within a preset time period, it stops sending a card search request instruction, which can reduce the overhead of the terminal communicating with other tags and reduce the power consumption of the terminal. On the other hand, if the terminal does not receive a read response instruction from the target tag within a preset time period, it also stops sending a card search request instruction, which can reduce the waste of communication resources caused by communication timeout or interruption between the terminal and the target tag and reduce the power consumption of the terminal.
[0087] Understandably, after the terminal locates the target tag, it also needs to read the tag information carried by the target tag and perform business processing based on the tag information. This business processing may include custom themes or wireless charging, etc.
[0088] For example, in some embodiments, when the tag information includes wireless charging information and the service processing includes wireless charging, the data interaction method further includes: parsing the wireless charging information carried in the received read response command to obtain information such as charging anti-counterfeiting indication or charging parameters (such as charging rate, charging power); the terminal interacts with the charging device where the target tag is located based on the wireless charging information so that the terminal can charge.
[0089] In other embodiments, when the tag information includes a target topic and the business processing includes a customized topic, the data interaction method further includes:
[0090] The target topic is obtained by parsing the tag information carried in the received read response command;
[0091] Based on the target topic, output a query message; the query message is used to ask whether to switch the current topic.
[0092] In response to a switching instruction returned in response to a query, switch the current topic to the target topic.
[0093] In this embodiment of the disclosure, the tag information carried by the response command includes the target theme, which includes theme fonts, wallpapers, ringtones, etc.
[0094] The terminal's parsing of the received tag information includes: verifying the integrity of the received tag information; converting the tag information into a data format that the terminal can process; filtering the content in the tag information to select information related to the target topic; and storing the parsing results in the terminal's internal memory.
[0095] In this embodiment of the disclosure, after determining the target topic, the terminal generates a query message. The query message can be presented in text or voice form, and is used to ask the user whether they need to switch the current topic to the target topic. For example, the terminal can display a message on its screen: "Switch topic?" or provide a voice prompt.
[0096] It should be noted that users can respond to the query information according to the actual situation. If a user chooses to switch the current topic, they can return the switching instruction through terminal operations, such as clicking a button, touching the screen, or issuing a voice command. The terminal will then execute the topic switching operation based on the switching instruction returned by the user in response to the query information.
[0097] Switching the current theme to the target theme includes updating the interface layout of the terminal display screen, changing the theme color, or replacing the background image, etc., and this disclosure does not limit this.
[0098] In this embodiment of the disclosure, the terminal obtains the target topic by parsing the tag information, generates query information based on the target topic, and switches the current topic to the target topic based on the returned switching instruction, thereby improving the convenience and efficiency of topic switching on the terminal and enhancing the user experience.
[0099] In some embodiments, users may also respond to queries based on the actual situation, choosing to maintain the current topic. Exemplarily, the data interaction method further includes:
[0100] In response to the maintain command returned in response to the query information, the current topic is maintained.
[0101] In this embodiment of the disclosure, if the user chooses to maintain the current topic, when the terminal asks the user whether they need to switch the current topic to the target topic based on the query information, the user can click the "Maintain Current Topic" button or give a voice instruction to maintain the current topic to return a maintain command. The terminal maintains the display of the current topic based on the user's maintain command returned from the query information.
[0102] In this way, the terminal operates based on user feedback, maintaining the current theme when the user does not need to switch themes. This improves the terminal's flexibility in responding to whether to switch the current theme, enabling the terminal to better adapt to the needs and preferences of different users and further enhance the user experience.
[0103] In some embodiments, sending a card search request instruction includes:
[0104] When the terminal is installed in a housing with a target tag, a card search request command is sent through the terminal's near-field communication module.
[0105] In this embodiment of the present disclosure, when the tag information of the target tag includes the target topic and the current topic needs to be switched, the terminal controls the near-field communication module to send a card search request command to find the target tag within the near-field communication range of the terminal; or, when the tag information of the target tag includes wireless charging information and the terminal needs to perform wireless charging, the terminal controls the near-field communication module to send a card search request command to find the target tag within the near-field communication range of the terminal.
[0106] The aforementioned housing can be the back cover or protective case of the terminal, or it can be the housing of a wireless charging dock; this disclosure does not limit this. The target tag can be an NFC tag pre-attached inside or outside the housing. The target tag contains tag information for communication with the terminal.
[0107] It should be noted that the terminal is equipped with a near-field communication module, which can be an NFC chip, an integrated circuit, or a combination of circuits and components, etc., and this disclosure does not limit this. The near-field communication module has at least NFC card reader functionality and may also have card emulation functionality to simulate NFC tags.
[0108] For example, when the near-field communication module has NFC card reader functionality, the near-field communication module has tag reading and writing capabilities, and has a sending port and a receiving port, and has the ability to send and receive signals, and can send card search request commands, reading commands, etc.
[0109] The near-field communication module sends a card search request command in a polling cycle according to the working period, so that the tag information of the target tag can be read.
[0110] In this embodiment, the terminal and the target tag communicate using near-field communication (NFC) technology, which simplifies steps such as manual information input by the user. The user can complete the pairing and identification process simply by installing the terminal on the housing. Specifically, the terminal sends a card-finding request command through its NFC module. With the terminal installed on the housing containing the target tag, rapid pairing and identification between the terminal and the target tag can be achieved, simplifying the operation process.
[0111] In some embodiments, the terminal can determine whether it is installed in the housing based on different detection modules. The data interaction method further includes:
[0112] If the magnetic field strength detected by the terminal's magnetic field detection module is greater than a preset strength threshold, it is determined that the terminal is installed in the housing; or,
[0113] If the distance detection module of the terminal detects that the distance between the terminal and the housing is less than a preset distance threshold, it determines that the terminal is installed in the housing.
[0114] In this embodiment of the disclosure, determining that the terminal is installed on the housing includes: a magnetic field detection module continuously or periodically detecting the magnetic field strength around the terminal; comparing the detected magnetic field strength with a preset strength threshold; and if the detected magnetic field strength is greater than the preset strength threshold, determining that the terminal has been installed on the housing. Here, the change in magnetic field strength can be caused by a magnetic component built into the housing, and the distance between the magnetic component and the terminal is inversely proportional to the magnetic field strength detected by the terminal. For example, the smaller the distance between the magnetic component and the terminal, the greater the magnetic field strength detected by the terminal.
[0115] The magnetic field detection module may include a Hall sensor for detecting the magnetic field strength around the terminal.
[0116] In this embodiment of the disclosure, determining that the terminal is installed on the housing further includes: a distance detection module detecting the distance from the terminal to the housing; comparing the detected distance with a distance threshold; and if the detected distance is less than a preset distance threshold, determining that the terminal has been installed on the housing.
[0117] It should be noted that the distance detection module detects the distance between the terminal and the housing by: sending signals to the area around the terminal, and calculating the distance between the terminal and the housing based on the time interval between the received return signal and the sent signal, as well as the speed of the sent and received signals.
[0118] The distance detection module may include an infrared rangefinder or an ultrasonic generator, that is, the transmitted signal may be infrared and the received signal may be infrared; or the transmitted signal may be ultrasonic and the received signal may also be ultrasonic. This disclosure does not limit this.
[0119] In this embodiment, a magnetic field detection module or a distance detection module is used to determine whether the terminal is installed on the housing, improving the accuracy of the determination that the terminal is installed on the housing. Furthermore, to ensure that the terminal is subsequently installed on a housing with a target tag, a card-finding request command is sent via the terminal's near-field communication module, making the timing of communication between the terminal and the target tag more accurate and improving the communication efficiency between the terminal and the target tag.
[0120] In some embodiments, if the magnetic field strength detected by the terminal's magnetic field detection module is less than or equal to a preset strength threshold, it is determined that the terminal is not installed in the housing; or, if the terminal's distance detection module detects that the distance from the terminal to the housing is greater than or equal to a preset distance threshold, it is determined that the terminal is not installed in the housing. The data interaction method further includes:
[0121] If the terminal is not installed in a housing with a target tag, determine whether a card search request command is being sent.
[0122] If a card search request command is being sent, then stop sending the card search request command.
[0123] In this embodiment of the disclosure, when the terminal is not installed on a housing with a target tag, the terminal determines whether it is currently sending a card search request command. Here, the terminal determines whether it is currently sending a card search request command by: checking the working status of the near-field communication module, confirming whether the near-field communication module is in an active state and sending a card search request command; if the near-field communication module is sending a card search request command, then recording the active state of the near-field communication module and triggering a stop mechanism.
[0124] It should be noted that stopping the sending of the card search request command can be achieved by the terminal sending a stop command to the near-field communication module, and the near-field communication module responding to the stop command by stopping the sending of the card search request command; or by the terminal sending a standby command or a shutdown command to the near-field communication module, and the near-field communication module responding to the standby command by entering standby mode or responding to the shutdown command by ceasing to work.
[0125] In this embodiment of the disclosure, by determining the working status of the near-field communication module before the terminal is installed on a housing with a target tag, the terminal stops sending the card search request command even when it is sending the card search request command. This enables the terminal to stop sending the card search request command in various scenarios, further reducing the power consumption of the terminal.
[0126] To better understand the data interaction methods in one or more of the above embodiments, examples of embodiments of this disclosure are as follows:
[0127] Figure 2 This is a schematic diagram illustrating the NFC operating mode of a terminal according to an exemplary embodiment. Figure 2 As shown, the terminal's NFC working modes include listening mode and polling mode.
[0128] In the polling mode, NFC-A indicates that the terminal communicates based on the NFC-A standard (backward compatible to ISO / IEC 14443A); NFC-B indicates that the terminal communicates based on the NFC-B standard (backward compatible to ISO / IEC 14443B); NFC-F indicates that the terminal communicates based on the NFC-F standard (backward compatible to JISX 6319-4); NFC-V indicates that the terminal communicates based on the NFC-V standard (backward compatible to ISO15693); and NFC-X indicates that the terminal communicates based on the NFC-X protocol.
[0129] In this embodiment of the disclosure, an NFC-X working phase is added within the polling cycle. Specifically, during the NFC-X working phase, the terminal sends a card-finding request command corresponding to the target tag based on the NFC-X protocol to discover the target tag. After receiving a card-finding response command from the target tag based on the card-finding request command, the terminal stops sending card-finding request commands. In other embodiments, the NFC-X working phase may further include: sending a read command after receiving a card-finding response command; and after receiving a read response command from the target tag based on the read command, the terminal reads the tag information of the target tag.
[0130] It's important to note that different NFC protocols correspond to different NFC card search request commands, such as REQA / B / F / V. These NFC card search request commands are defined by industry standards. The terminal's near-field communication module software protocol can be modified to include the NFC-X protocol's corresponding card search request command. This involves adding the NFC module's identity information to the original NFC card search request command in the software protocol. Furthermore, by switching the target tag to silent mode and enabling it to recognize the terminal's NFC module's identity information, the target tag will only respond to card search request commands sent by the terminal that has been modified to include the NFC-X protocol's corresponding card search request command. It will not respond to card search request commands from other terminals.
[0131] For example, the terminal's casing is equipped with a target tag. This target tag may not support the NFC-A / B / F / V standard protocol, but only the NFC-X protocol. The target tag stores tag information, which may include NFC Data Exchange Format (NDEF) information. Terminals that only support the NFC-A / B / F / V standard protocol but not the NFC-X protocol cannot recognize target tags that only support the NFC-X protocol. Furthermore, terminals that only support the NFC-X protocol do not need to go through NFC-A / B / F / V polling, resulting in shorter target tag discovery time and higher efficiency in data interaction with the target tag.
[0132] Based on this, this disclosure proposes a data interaction method for use in a terminal. Figure 3 This is a flowchart illustrating a data interaction method according to an exemplary embodiment. Figure 3 As shown, the data interaction method includes the following steps:
[0133] S201. Detect the magnetic field strength around the terminal using a Hall sensor;
[0134] S202. Determine whether the magnetic field strength is greater than the preset strength threshold; if yes, proceed to step S203; if no, proceed to step S206.
[0135] S203, Send a card search request command;
[0136] S204. After receiving the card search response command, send a read command;
[0137] S205. Determine whether a read response command has been received within 2 seconds; if yes, proceed to steps S207 and S208; if no, proceed to step S208.
[0138] S206. Determine whether the terminal is sending a card search request command; if yes, proceed to step S208; if no, proceed to step S212.
[0139] S207. Parse and read the tag information carried by the response command to obtain the target topic;
[0140] S208, Stop sending card search request commands;
[0141] S209. Determine whether to switch the current theme to the target theme; if yes, proceed to step S210; if no, proceed to step S211.
[0142] S210. Switch the current theme to the target theme;
[0143] S211, Maintain the current theme;
[0144] S212, End.
[0145] In this embodiment of the disclosure, data interaction between the terminal and the target tag can be used to switch the current theme of the terminal. The process of data interaction between the terminal and the target tag is as follows. Figure 4 This is a schematic diagram illustrating the interaction between a user, a terminal, and a target tag according to an exemplary embodiment. For example... Figure 4 As shown, the interaction between the user, the terminal, and the target tag includes the following steps:
[0146] S301. The terminal sends a card search request command to the target tag;
[0147] S302, The target tag sends a card search response command to the terminal based on the card search request command returned;
[0148] S303, The terminal sends a read command to the target tag;
[0149] S304. If the terminal receives a read response instruction returned by the target tag based on the read instruction within a preset time period, it shall stop sending the card search request instruction.
[0150] S305. The target tag sends a read response command to the terminal based on the read command returned;
[0151] S306. The terminal parses the tag information carried in the received read response command to obtain the target topic;
[0152] S307. The terminal outputs an inquiry message to the user;
[0153] S308. The user sends a switching command to the terminal in response to the query information.
[0154] S309. The terminal switches the current theme to the target theme based on the switching command.
[0155] In this embodiment of the present disclosure, the terminal sends a card search request command and receives a card search response command returned by the target tag based on the card search request command. After receiving the card search response command, the terminal stops sending card search request commands, which can reduce the power consumption of the terminal and stop the terminal from continuously searching for or finding the target tag. This enables the terminal and the target tag to disconnect the communication connection after data interaction, further reducing the power consumption caused by the terminal maintaining a communication connection with the target tag and improving the efficiency of communication between the terminal and the target tag.
[0156] Furthermore, in this embodiment of the present disclosure, by determining whether the terminal receives a read response instruction returned by the target tag based on the read instruction within a preset time period, the terminal can intelligently control the timing of stopping the sending of the card search request instruction, effectively reducing the terminal's power consumption, improving the working efficiency of the terminal's near-field communication module in polling mode, and extending the terminal's battery life.
[0157] Furthermore, after the terminal interacts with the tag information, it outputs query information to the user based on the target topic and switches the current topic to the target topic based on the switching command. This enables the terminal to switch between different target topics based on different tag information, taking into account the user's usage needs and thus improving the user experience.
[0158] Figure 5 This is a structural block diagram of a terminal according to an exemplary embodiment. Figure 1 .like Figure 5 As shown, terminal 1000 mainly includes:
[0159] Sending module 1001 is configured to send a card search request command; the card search request command is used to discover the target tag.
[0160] The receiving module 1002 is configured to receive a card search response instruction returned by the target tag based on the card search request instruction;
[0161] The control module 1003 is configured to stop sending card search request commands after receiving a card search response command.
[0162] In some embodiments, the control module is further configured to send a reading instruction after receiving a card search response instruction; the reading instruction is used to read the tag information of the target tag; if a reading response instruction is received from the target tag based on the reading instruction within a preset time period, the sending of the card search request instruction is stopped; or, if a reading response instruction is not received within a preset time period, the sending of the card search request instruction is stopped.
[0163] In some embodiments, the terminal further includes:
[0164] The parsing module is configured to parse the tag information carried by the received read response command to obtain the target topic;
[0165] The query module is configured to output query information based on the target topic; the query information is used to ask whether to switch the current topic.
[0166] Switch module, configured to switch the current topic to the target topic in response to a switching command returned in response to a query message.
[0167] In some embodiments, the terminal further includes:
[0168] The sustain module is configured to maintain the display of the current topic in response to sustain instructions returned in response to query information.
[0169] In some embodiments, the sending module is further configured to send a card search request command via the terminal's near-field communication module when the terminal is mounted on a housing with a target tag.
[0170] In some embodiments, the terminal further includes:
[0171] The module is configured to determine that the terminal is installed in the housing if the magnetic field strength detected by the terminal's magnetic field detection module is greater than a preset strength threshold; or, if the terminal's distance detection module detects that the distance between the terminal and the housing is less than a preset distance threshold, the terminal is installed in the housing.
[0172] In some embodiments, the terminal further includes:
[0173] The judgment module is configured to determine whether a card search request command is being sent when the terminal is not installed in a housing with a target tag.
[0174] The stop module is configured to stop sending card search request commands if a card search request command is being sent.
[0175] Regarding the terminal in the above embodiments, the specific methods by which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated here.
[0176] Figure 6 This is a structural block diagram of a terminal according to an exemplary embodiment. Figure 2 For example, terminal 600 can be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.
[0177] Reference Figure 6 The terminal 600 may include one or more of the following components: processing component 602, memory 604, power supply component 606, multimedia component 608, audio component 610, input / output (I / O) interface 612, sensor component 614, and communication component 616.
[0178] Processing component 602 typically controls the overall operation of terminal 600, such as operations associated with at least one of display, telephone call, data communication, camera operation, and recording operation. Processing component 602 may include one or more processors 620 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 602 may include one or more modules to facilitate interaction between processing component 602 and other components. For example, processing component 602 may include a multimedia module to facilitate interaction between multimedia component 608 and processing component 602.
[0179] Memory 604 is configured to store various types of data to support operation on terminal 600. Examples of such data include at least one of the following: instructions for any application or method operating on terminal 600, contact data, phonebook data, messages, pictures, and videos. Memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0180] Power supply component 606 provides power to various components of terminal 600. Power supply component 606 may include at least one of the following: a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to terminal 600.
[0181] Multimedia component 608 includes a screen that provides an output interface between terminal 600 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a Touch Panel, the screen may be implemented as a touchscreen to receive input signals from the user. The Touch Panel includes one or more touch sensors to sense touches, swipes, and gestures on the Touch Panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 608 includes a front-facing camera and / or a rear-facing camera. When terminal 600 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0182] Audio component 610 is configured to output and / or input audio signals. For example, audio component 610 includes a microphone (MIC) configured to receive external audio signals when terminal 600 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 604 or transmitted via communication component 616. In some embodiments, audio component 610 also includes a speaker for outputting audio signals.
[0183] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, and buttons. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0184] Sensor assembly 614 includes one or more sensors for providing state assessments of various aspects of terminal 600. For example, sensor assembly 614 may detect the on / off state of terminal 600, the relative positioning of components such as the display and keypad of terminal 600, changes in position of terminal 600 or one of its components, the presence or absence of user contact with terminal 600, orientation or acceleration / deceleration of terminal 600, and temperature changes of terminal 600. Sensor assembly 614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 614 may also include an optical sensor, such as a complementary metal-oxide-semiconductor (CMOS) or charge-coupled device (CCD) image sensor, for use in imaging applications. In some embodiments, sensor assembly 614 may also include, but is not limited to, at least one of the following: an accelerometer, a gyroscope, a magnetometer, a pressure sensor, and a temperature sensor.
[0185] Communication component 616 is configured to facilitate wired or wireless communication between terminal 600 and other devices. Terminal 600 can access wireless networks based on communication standards, such as Wi-Fi, 4G, 5G, or combinations thereof. In one exemplary embodiment, communication component 616 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 616 also includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID), Infrared Data Association (IrDA), Ultra Wide Band (UWB), Bluetooth (BT), and other technologies.
[0186] In an exemplary embodiment, terminal 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components.
[0187] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including executable instructions or a computer program, which can be executed by a processor 620 of a terminal 600 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, floppy disk, and optical data storage device, etc.
[0188] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by the processor of a mobile terminal, enables the mobile terminal to perform any of the data interaction methods described in the embodiments of this disclosure. For example, the method includes: sending a card-finding request instruction; the card-finding request instruction being used to discover a target tag; receiving a card-finding response instruction returned by the target tag based on the card-finding request instruction; and stopping sending the card-finding request instruction after receiving the card-finding response instruction.
[0189] This disclosure provides a computer program product comprising a computer program or executable instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer program or executable instructions from the computer-readable storage medium and executes the computer program or executable instructions, causing the computer device to perform any of the data interaction methods described in this disclosure.
[0190] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.
[0191] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A data interaction method, characterized in that, include: Send a card retrieval request command; The card search request command is used to discover the target tag; Receive the card search response instruction returned by the target tag based on the card search request instruction; Upon receiving the card search response instruction, the sending of the card search request instruction is stopped.
2. The data interaction method according to claim 1, characterized in that, The step of stopping sending the card search request instruction after receiving the card search response instruction includes: Upon receiving the card search response command, a read command is sent; the read command is used to read the tag information of the target tag; If a read response instruction is received from the target tag based on the read instruction within a preset time period, the sending of the card search request instruction shall be stopped; or, If the read response instruction is not received within the preset time period, the sending of the card search request instruction will be stopped.
3. The data interaction method according to claim 2, characterized in that, The method further includes: The target topic is obtained by parsing the tag information carried in the received read response command; Based on the target topic, output query information; the query information is used to ask whether to switch the current topic; In response to the switching instruction returned in response to the query information, the current topic is switched to the target topic.
4. The data interaction method according to claim 3, characterized in that, The method further includes: In response to the sustain instruction returned in response to the query information, the current topic is maintained and displayed.
5. The data interaction method according to any one of claims 1 to 4, characterized in that, The sending of the card search request instruction includes: When the terminal is installed in a housing with the target tag, the card search request command is sent through the terminal's near-field communication module.
6. The data interaction method according to claim 5, characterized in that, The method further includes: If the magnetic field strength detected by the magnetic field detection module of the terminal is greater than a preset strength threshold, it is determined that the terminal is installed in the housing; or, If the distance detection module of the terminal detects that the distance between the terminal and the housing is less than a preset distance threshold, it determines that the terminal is installed in the housing.
7. The data interaction method according to any one of claims 1 to 4, characterized in that, The method further includes: If the terminal is not installed in a housing with the target tag, determine whether the card search request command is being sent. If the card search request command is being sent, then stop sending the card search request command.
8. A terminal, characterized in that, include: The sending module is configured to send a card search request command; The card search request command is used to discover the target tag; The receiving module is configured to receive a card search response instruction returned by the target tag based on the card search request instruction; The control module is configured to stop sending the card search request command after receiving the card search response command.
9. A terminal, characterized in that, include: processor; Memory used to store computer programs or instructions; The processor executes the computer program or instructions to implement the steps of the data interaction method according to any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium storing a computer program or instructions, characterized in that, When the computer program or instructions in the storage medium are executed by a processor, the steps of the data interaction method according to any one of claims 1 to 7 are implemented.
11. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by the processor, they implement the steps of the data interaction method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method and system for reading resident identification card and resident identification card reading device
CN106375302A
Data interaction method and device based on NFC
CN115442780A
Method for discovering a plurality of NFC-B devices by a NFC-B reader and corresponding NFC-B reader
EP2942874A1