Cross-platform NFC data interaction method, device, electronic equipment and system

By building a cross-platform NFC data interaction system, the differences in NFC implementation methods and security issues on different platforms have been resolved, achieving consistency, security, and convenience in cross-platform NFC data interaction and improving user experience.

CN120980491APending Publication Date: 2025-11-18SHENZHEN GREEN CONNECTION TECH CO LTD

Patent Information

Application Number
CN202510954226.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-10
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

Existing NFC technology is implemented differently on different platforms, resulting in a fragmented user experience and relatively weak security mechanisms, posing data security risks.

Method used

By building a cross-platform NFC data interaction system, determining the NFC interaction mode, configuring interaction parameters and functional components, performing secure read and write operations, and feeding back to the user interface, the system provides standard data reading, streaming data reading, and data writing modes, thereby achieving consistency and security in cross-platform NFC data interaction.

Benefits of technology

It improves the convenience, flexibility, versatility and reliability of cross-platform NFC data interaction, reduces the risk of data tampering, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120980491A_ABST
    Figure CN120980491A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of communication, and discloses a cross-platform NFC data interaction method, device, electronic equipment and system, and the method comprises the steps: determining a matched NFC interaction mode when the electronic equipment and NAS equipment are in an NFC communication range and an NFC interaction instruction is detected; the NFC interaction mode comprises a standard data reading mode, a streaming data reading mode or a data writing mode; configuring interaction parameters and functional components required by the NFC interaction mode on an operation platform of the electronic equipment; based on the interaction parameter and the functional component, executing a safe read-write operation corresponding to the NFC interaction mode for the detected NFC tag to obtain a safe read-write result; the safe read-write operation comprises a safe verification operation and a data read-write operation; and feeding back the safe read-write result to the user interface. Therefore, the convenience and the reliability of cross-platform NFC data interaction can be improved by implementing the method and the device, so that the use experience of a user on an NFC function is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of communication technology, in particular to a cross-platform NFC data interaction method, device, electronic equipment and system. BACKGROUND

[0002] NFC (Near Field Communication) is a short-range wireless communication technology, which realizes wireless data transmission between devices through electromagnetic induction, and has the advantages of short distance, low power consumption and fast connection. Therefore, NFC technology is widely used in interactive scenarios such as mobile payment, identity authentication, device pairing and information sharing, thereby providing users with diversified and convenient data interaction functions.

[0003] However, in actual application, the implementation of NFC on different platforms is different, and the NFC functions provided by different platforms are different, for example: the API (Application Programming Interface) used by Android and iOS to process NFC data is different, and the NFC functions provided by Android and iOS also have some differences, which is not convenient for cross-platform processing of NFC data, and is easy to cause the user experience to be split; and the security mechanism provided by the existing NFC data interaction scheme is relatively weak, and there is a data security risk.

[0004] Therefore, it is particularly important to propose a technical solution that can improve the convenience and reliability of cross-platform NFC data interaction, thereby facilitating the improvement of user experience for NFC functions. SUMMARY

[0005] The present application provides a cross-platform NFC data interaction method, device, electronic equipment and system, which can improve the convenience and reliability of cross-platform NFC data interaction, thereby facilitating the improvement of user experience for NFC functions.

[0006] In order to solve the above technical problems, the first aspect of the present application discloses a cross-platform NFC data interaction method, which is applied to an electronic equipment, the electronic equipment is installed with an application program, the electronic equipment is in communication connection with a network attached storage device with NFC function, and the electronic equipment can access the network attached storage device through the application program; wherein the application program realizes the NFC data interaction function through a pre-constructed NFC interaction system, and the method comprises: When the electronic device and the network-attached storage device are within NFC communication range and an NFC interaction command is detected, an NFC interaction mode matching the NFC interaction command is determined; the NFC interaction mode includes a data reading mode or a data writing mode; the data reading mode includes a standard data reading mode or a streaming data reading mode. When the NFC interaction mode is any of the data reading modes, the reading parameters and reading method corresponding to the NFC interaction mode are determined based on the application layer corresponding to the NFC interaction system, and are used as the interaction parameters required by the NFC interaction mode; the reading method includes synchronous reading method or asynchronous reading method; When the NFC interaction mode is the data writing mode, the writing parameters and the data to be written corresponding to the NFC interaction mode are determined based on the application layer corresponding to the NFC interaction system, and are used as the interaction parameters required for the NFC interaction mode. Detect whether the current operating environment of the NFC interaction system meets the interaction conditions corresponding to the NFC interaction mode; When it is detected that the current operating environment of the NFC interaction system meets the interaction conditions corresponding to the NFC interaction mode, based on the platform bridging layer corresponding to the NFC interaction system and according to the platform type of the operating platform corresponding to the electronic device, the functional components required for the NFC interaction mode on the operating platform are configured. Based on the interaction parameters and the functional components, a secure read / write operation corresponding to the NFC interaction mode is performed on the detected NFC tag to obtain a secure read / write result; the secure read / write operation includes a security verification operation and a data read / write operation; the data read / write operation includes a data reading operation and / or a data writing operation; The secure read / write results are fed back to the user interface corresponding to the NFC interactive system.

[0007] A second aspect of this invention discloses a cross-platform NFC data interaction device, which is applied in an electronic device. The electronic device has an application installed and is communicatively connected to a network-attached storage device (NATSDS) with NFC functionality. The electronic device can access the NATSDS through the application. The application implements NFC data interaction functionality through a pre-built NFC interaction system, and the device includes: The determination module is used to determine an NFC interaction mode that matches the NFC interaction command when the electronic device and the network-attached storage device are within NFC communication range and an NFC interaction command is detected; the NFC interaction mode includes a data reading mode or a data writing mode; the data reading mode includes a standard data reading mode or a streaming data reading mode. The configuration module is used to determine the reading parameters and reading method corresponding to the NFC interaction mode based on the application layer corresponding to the NFC interaction system when the NFC interaction mode is any of the data reading modes, as the interaction parameters required for the NFC interaction mode; the reading method includes synchronous reading mode or asynchronous reading mode; when the NFC interaction mode is the data writing mode, it determines the writing parameters and data to be written corresponding to the NFC interaction mode based on the application layer corresponding to the NFC interaction system, as the interaction parameters required for the NFC interaction mode; it detects whether the current operating environment of the NFC interaction system meets the interaction conditions corresponding to the NFC interaction mode; when it is detected that the current operating environment of the NFC interaction system meets the interaction conditions corresponding to the NFC interaction mode, it configures the functional components required for the NFC interaction mode on the operating platform based on the platform bridging layer corresponding to the NFC interaction system and according to the platform type of the operating platform corresponding to the electronic device; The secure read / write module is used to perform secure read / write operations corresponding to the NFC interaction mode on the detected NFC tag based on the interaction parameters and the functional components, and obtain secure read / write results; the secure read / write operations include security verification operations and data read / write operations; the data read / write operations include data reading operations and / or data writing operations; The result feedback module is used to feed back the secure read / write result to the user interface corresponding to the NFC interactive system.

[0008] A third aspect of the present invention discloses an electronic device, the electronic device comprising: Memory containing executable program code; A processor coupled to the memory; The processor calls the executable program code stored in the memory to execute some or all of the steps of the cross-platform NFC data interaction method disclosed in the first aspect of the present invention.

[0009] The fourth aspect of the present invention discloses a cross-platform NFC data interaction system, the system comprising a cross-platform NFC data interaction device as disclosed in the second aspect of the present invention, and a network-attached storage device communicatively connected to the cross-platform NFC data interaction device; wherein the cross-platform NFC data interaction device performs data interaction operations on detected NFC tags according to the cross-platform NFC data interaction method as disclosed in the first aspect of the present invention. or, The system includes an electronic device as disclosed in the third aspect of the present invention, and a network-attached storage device communicatively connected to the electronic device; wherein the electronic device performs data interaction operations on the detected NFC tag in accordance with the cross-platform NFC data interaction method disclosed in the first aspect of the present invention.

[0010] The fifth aspect of the present invention discloses a computer storage medium storing computer instructions, which, when invoked, are used to execute some or all of the steps of the cross-platform NFC data interaction method disclosed in the first aspect of the present invention.

[0011] Compared with the prior art, the present invention has the following beneficial effects: Implementing this invention enables the determination of the NFC interaction mode corresponding to the detected NFC interaction command, configuration of the required interaction parameters and functional components on the operating platform of the electronic device, and execution of secure read / write operations on the NFC tag based on the interaction parameters and functional components. The secure read / write results are then fed back to the corresponding user interface of the NFC interaction system. This allows for the abstraction of cross-platform NFC data interaction processing functions through the NFC interaction system, achieving consistency in NFC interaction operations across different operating platforms, thereby improving the convenience and flexibility of cross-platform NFC data interaction. Furthermore, by providing three interaction modes—standard data reading mode, streaming data reading mode, and data writing mode—compared to the single interaction mode of existing technologies, this expands the application scenarios of NFC data interaction while providing users with more diverse NFC data interaction methods, thus improving the versatility of cross-platform NFC data interaction. Finally, by performing security verification operations simultaneously with data reading and writing, the reliability of the NFC tag and the NFC data interaction process is improved, reducing security risks such as data tampering during NFC tag interaction, thereby enhancing the overall performance of NFC data interaction. This ensures data security and improves the user experience of NFC functionality. Furthermore, if the NFC interaction mode is a data reading mode, the application layer of the NFC interaction system determines the corresponding reading parameters and methods as the required interaction parameters. If the NFC interaction mode is a data writing mode, the application layer determines the corresponding writing parameters and the data to be written as the interaction parameters. Then, when the current operating environment of the NFC interaction system meets the interaction conditions corresponding to the NFC interaction mode, the platform bridging layer of the NFC interaction system configures the required functional components for the NFC interaction mode on the operating platform according to the platform type of the electronic device. This allows for the determination of different interaction parameters based on different NFC interaction modes, improving the accuracy of determining the required interaction parameters for NFC data interaction. Additionally, by verifying whether the current operating environment meets the standards before configuring the required functional components for NFC data interaction based on the operating platform type, the execution accuracy of the configuration operation and the determination accuracy of the functional components for NFC data interaction are improved, which in turn improves the reliability of NFC data interaction function configuration and, consequently, the execution reliability of subsequent NFC data interaction operations. Attached Figure Description

[0012] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 This is a flowchart illustrating a cross-platform NFC data interaction method disclosed in an embodiment of the present invention; Figure 2 This is a flowchart illustrating another cross-platform NFC data interaction method disclosed in an embodiment of the present invention; Figure 3 This is a schematic diagram of the architecture of a multi-mode NFC data interaction system based on Flutter disclosed in an embodiment of the present invention; Figure 4 This is a flowchart illustrating another cross-platform NFC data interaction method disclosed in an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of a cross-platform NFC data interaction device disclosed in an embodiment of the present invention; Figure 6 This is a schematic diagram of another cross-platform NFC data interaction device disclosed in an embodiment of the present invention; Figure 7 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of the present invention; Figure 8 This is a schematic diagram of the structure of a cross-platform NFC data interaction system disclosed in an embodiment of the present invention; Figure 9 This is a schematic diagram of another cross-platform NFC data interaction system disclosed in an embodiment of the present invention. Detailed Implementation

[0014] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0015] Example 1 Please see Figure 1 , Figure 1 This is a flowchart illustrating a cross-platform NFC data interaction method disclosed in an embodiment of the present invention. Wherein, Figure 1The described cross-platform NFC data interaction method can be applied to a cross-platform NFC data interaction device, which may include one of an NFC data interaction device, an NFC data interaction terminal, an NFC data interaction system, and a server. The server can be a local server or a cloud server, and this embodiment of the invention is not limited thereto. The method can also be applied to an electronic device, which has an application installed and is communicatively connected to a network-attached storage device with NFC functionality. The electronic device can access the network-attached storage device through the application. Furthermore, the application can implement NFC data interaction functionality through a pre-built NFC interaction system, and this embodiment of the invention is not limited thereto. For example, the NFC interaction system can be a Flutter-based multi-mode NFC data interaction system, and the system architecture of the Flutter-based multi-mode NFC data interaction system can be found in [reference needed]. Figure 3 , Figure 3 This is a schematic diagram of the architecture of a multi-mode NFC data interaction system based on Flutter disclosed in an embodiment of the present invention, such as... Figure 3 As shown, the NFC data interaction system may include an application layer, a core service layer, a security layer, a platform bridging layer, and a data layer; however, this embodiment of the invention does not impose limitations. Figure 1 As shown, this cross-platform NFC data interaction method may include the following operations: 101. When the electronic device and the network-attached storage device are within NFC communication range and an NFC interaction command is detected, determine the NFC interaction mode that matches the NFC interaction command.

[0016] In this embodiment of the invention, optionally, the NFC interaction command may include an NFC read command or an NFC write command; further optionally, the NFC read command may include a standard data read command or a streaming data read command, which is not limited in this embodiment of the invention; further optionally, the NFC interaction command may be generated by the user through the NFC interaction system. For example, it may be generated by the user triggering interactive components such as buttons, options, and input boxes on the user interface corresponding to the NFC interaction system, or by the user triggering interactive gestures on the NFC interaction system. For example, the user triggers a specific option on the user interface to start a continuous listening mode, thereby generating a streaming data read command, which is not limited in this embodiment of the invention.

[0017] In this embodiment of the invention, the NFC interaction mode includes a data reading mode or a data writing mode; the data reading mode includes a standard data reading mode or a streaming data reading mode; wherein, the standard data reading mode is used to read the tag data of a single NFC tag; the streaming data reading mode is used to read the tag data of multiple NFC tags; and the data writing mode is used to write the data to be written corresponding to the NFC interaction command to the NFC tag.

[0018] 102. When the NFC interaction mode is any data reading mode, the reading parameters and reading method corresponding to the NFC interaction mode are determined based on the application layer corresponding to the NFC interaction system, and are used as the interaction parameters required for the NFC interaction mode.

[0019] In this embodiment of the invention, the reading method includes synchronous reading or asynchronous reading.

[0020] In this embodiment of the invention, optionally, when the NFC interaction mode is the standard data reading mode, the reading parameters may include a tag type filter and / or a callback function; when the NFC interaction mode is the streaming data reading mode, the reading parameters may include a tag type filter and / or a listening processing strategy.

[0021] 103. When the NFC interaction mode is the data writing mode, the writing parameters and the data to be written corresponding to the NFC interaction mode are determined based on the application layer corresponding to the NFC interaction system, and are used as the interaction parameters required for the NFC interaction mode.

[0022] In this embodiment of the invention, optionally, when the NFC interaction mode is the data writing mode, the writing parameters may include the data writing format and / or the data writing length, which are not limited in this embodiment of the invention; optionally, the data to be written may be the input data received by the user interface, wherein, for example, the data to be written may include one or more of text data, URL (Uniform Resource Locator) links, contact information and other formatted data, which are not limited in this embodiment of the invention.

[0023] 104. Check whether the current operating environment of the NFC interaction system meets the interaction conditions corresponding to the NFC interaction mode.

[0024] 105. When it is detected that the current operating environment of the NFC interaction system meets the interaction conditions corresponding to the NFC interaction mode, based on the platform bridging layer corresponding to the NFC interaction system, the functional components required for the NFC interaction mode on the operating platform are configured according to the platform type of the operating platform corresponding to the electronic device.

[0025] In this embodiment of the invention, the operating platform corresponding to the electronic device can be an operating system or other types of platforms; for example, the operating platform can be an Android platform or an iOS platform, or a Web platform, and this embodiment of the invention does not limit it.

[0026] 106. Based on the interaction parameters and functional components, perform the secure read and write operations corresponding to the NFC interaction mode for the detected NFC tag, and obtain the secure read and write results.

[0027] In this embodiment of the invention, secure read / write operations include secure verification operations and data read / write operations; data read / write operations include data reading operations and / or data writing operations.

[0028] 107. Feedback the secure read / write results to the corresponding user interface of the NFC interactive system.

[0029] As can be seen, the method described in the embodiments of the present invention can determine the NFC interaction mode corresponding to the detected NFC interaction command, configure the required interaction parameters and functional components on the operating platform of the electronic device, perform secure read and write operations on the NFC tag based on the interaction parameters and functional components, obtain secure read and write results, and feed back the secure read and write results to the user interface corresponding to the NFC interaction system. It can abstractly realize cross-platform NFC data interaction processing functions through the NFC interaction system, thereby achieving consistency of NFC interaction operations on different operating platforms, which is beneficial to improving the convenience and flexibility of cross-platform NFC data interaction. Furthermore, by providing three interaction modes—standard data reading mode, streaming data reading mode, and data writing mode—compared to the single interaction mode of the prior art, it can expand the application scenarios of NFC data interaction while providing users with more diversified NFC data interaction methods, thus improving the versatility of cross-platform NFC data interaction. Finally, by performing security verification operations simultaneously with data reading and writing, it can improve the reliability of the NFC tag and the NFC data interaction process, reducing security risks such as data tampering during NFC tag interaction, thereby improving the overall reliability of NFC data interaction. FC data interaction enhances data security, thereby improving the user experience of NFC functionality. Furthermore, if the NFC interaction mode is a data reading mode, the application layer of the NFC interaction system determines the corresponding reading parameters and methods as the required interaction parameters. If the NFC interaction mode is a data writing mode, the application layer determines the corresponding writing parameters and the data to be written as the interaction parameters. Then, when the current operating environment of the NFC interaction system meets the interaction conditions corresponding to the NFC interaction mode, the platform bridging layer of the NFC interaction system configures the required functional components for the NFC interaction mode on the operating platform according to the platform type of the electronic device. This allows for the determination of different interaction parameters based on different NFC interaction modes, improving the accuracy of determining the required interaction parameters for NFC data interaction. Additionally, verifying whether the current operating environment conforms to the standard before configuring the required functional components for NFC data interaction based on the operating platform type improves the execution accuracy of the configuration operations and the accuracy of component determination, thus enhancing the reliability of NFC data interaction function configuration and consequently improving the execution reliability of subsequent NFC data interaction operations.

[0030] In an optional embodiment, the method may further include the following operations: When the NFC interaction system starts, it loads the system resources and configuration files corresponding to the NFC interaction system; initializes the Flutter engine and renders the environment; and configures the state manager corresponding to the NFC interaction system.

[0031] As can be seen, this optional embodiment can improve the execution efficiency and reliability of subsequent NFC interaction system initialization operations by starting the resources, configuration files, Flutter engine, and state manager of the NFC interaction system when it starts up.

[0032] In an optional embodiment, the method may further include the following operations: Before detecting the presence of NFC interaction commands, the NFC configuration information corresponding to the electronic device is checked; Based on the NFC configuration information, determine the NFC function configuration level of the electronic device; the NFC function configuration level includes one of the following: NFC function unavailable level, NFC function restricted level, and NFC function complete level. Based on the NFC configuration information, perform the initialization operation of the functional modules that match the NFC function configuration level; Initialize the core system components corresponding to the NFC interaction system and register the NFC event listener corresponding to the NFC interaction system to complete the initialization operation of the NFC interaction system.

[0033] Optionally, before detecting the NFC configuration information corresponding to the electronic device, the NFC capability detection component (e.g., UGNFCCapabilityDetector) can be activated first; further optionally, the NFC capability detection component can be one of the components in the platform bridging layer corresponding to the NFC interaction system, which is not limited in this embodiment of the invention.

[0034] Optionally, detecting the NFC configuration information corresponding to the electronic device may include the following operations: Based on the NFC capability detection component, the first detection result is obtained by detecting whether the electronic device is equipped with an NFC chip, and / or the second detection result is obtained by detecting whether the operating platform corresponding to the electronic device supports NFC function and / or the API (Application Programming Interface) version currently required for NFC function, and / or the third detection result is obtained by detecting whether the NFC interaction system is equipped with the platform permissions required for NFC interaction function. The detected configuration detection result is determined as the NFC configuration information corresponding to the electronic device; wherein, the configuration detection result includes at least one of the first detection result, the second detection result and the third detection result mentioned above.

[0035] This allows for a more comprehensive detection of the NFC capabilities of electronic devices, which helps improve the accuracy of NFC interaction function activation.

[0036] Among them, the NFC function unavailable level indicates that the NFC-related hardware in the electronic device is missing or the operating platform of the electronic device does not support the NFC function; the NFC function limited level indicates that the operating platform of the electronic device does not support some NFC functions; and the NFC function complete level indicates that the electronic device has complete NFC interaction functions.

[0037] Optionally, based on the NFC configuration information, perform functional module initialization operations that match the NFC function configuration level, which may include the following operations: When the NFC function configuration level is NFC function unavailable, all NFC interaction functions corresponding to the NFC interaction system are disabled, and a prompt message is displayed on the user interface corresponding to the NFC interaction system. This prompt message indicates that the electronic device does not support the NFC function. When the NFC function configuration level is NFC function restricted level, the intelligent degradation mode of the NFC interaction system is enabled to disable NFC interaction functions that are not supported by the electronic device and initialize the functional components corresponding to the NFC interaction functions supported by the electronic device according to the NFC configuration information. When the NFC function configuration level is NFC full level, initialize all functional components corresponding to the NFC interaction functions of the NFC interaction system, and configure the NFC interaction system with the best performance parameters.

[0038] By initializing different functional components in the NFC interactive system according to different NFC function configuration levels, the initialization flexibility and accuracy of NFC functional components can be improved, which is conducive to improving the operating efficiency of the NFC interactive system.

[0039] Optionally, initializing the core system components corresponding to the NFC interaction system may include the following operations: Based on the pre-defined dependency order, initialize the NFC service unified interface and related components in the core service layer of the NFC interaction system. Configure the platform bridging layer corresponding to the NFC interaction system according to the operating platform of the electronic device; Initialize the security layer corresponding to the NFC interaction system and load the encryption keys and security policies required for this security layer; Initialize the data layer corresponding to the NFC interaction system, and construct the data model and storage system corresponding to the data layer.

[0040] Optionally, registering an NFC event listener for the NFC interaction system may include the following operations: Register the global NFC event listener corresponding to the NFC interaction system; Configure the front-end distribution system for the NFC interaction system; Configure the lifecycle event handlers corresponding to the NFC interaction system to manage the sessions corresponding to the NFC interaction system; Initialize the error handling pipeline corresponding to the NFC interaction system.

[0041] This improves the initialization comprehensiveness of the NFC interaction system, which is conducive to providing more comprehensive and reliable NFC interaction functions.

[0042] As can be seen, this optional embodiment can detect the NFC configuration information of the electronic device before detecting the NFC interaction command, and determine the corresponding NFC function configuration level of the electronic device based on the NFC configuration information. It then performs the initialization operation of the functional module matching the NFC function configuration level, initializes the core system components corresponding to the NFC interaction system, and registers the NFC event listener to complete the initialization of the NFC interaction system. By analyzing the NFC configuration of the electronic device, it can perform the corresponding NFC function module initialization operation, improving the accuracy of the analysis of the NFC function configuration of the electronic device while increasing the flexibility and accuracy of the initialization of the NFC function module. This is beneficial to improving the initialization efficiency of the NFC interaction system and facilitating the provision of more reliable NFC interaction functions in the future.

[0043] In an optional embodiment, detecting whether the current operating environment of the NFC interaction system meets the interaction conditions corresponding to the NFC interaction mode may include the following operations: When the NFC interaction mode is data reading mode, it checks whether the current operating environment of the NFC interaction system allows the data reading operation to be performed; when it is detected that the current operating environment of the NFC interaction system allows the data reading operation to be performed, it determines that the current operating environment meets the interaction conditions corresponding to the NFC interaction mode. When the NFC interaction mode is data write mode, it checks whether the current operating environment of the NFC interaction system supports data write operations; when it is detected that the current operating environment of the NFC interaction system supports data write operations, it determines that the current operating environment meets the interaction conditions corresponding to the NFC interaction mode.

[0044] For example, when the running platform is iOS, it can be checked whether the iOS version is higher than iOS 13. If the iOS version is higher than iOS 13, then write operations are supported.

[0045] In an optional embodiment, optionally, after step 105, the method may further include the following operations: When the NFC interaction mode is the standard data reading mode, the read method in the NFC service unified interface (e.g., UGNFCService.read() method) can be called to start the reading process corresponding to the standard data reading mode; When the NFC interaction mode is streaming data reading mode, the data stream start method in the NFC service unified interface (e.g., UGNFCService.startStream() method) can be called to start the reading process corresponding to the streaming data reading mode; When the NFC interaction mode is data writing mode, the write method in the NFC service unified interface (e.g., UGNFCService.write() method) can be called to start the writing process.

[0046] As can be seen, this optional embodiment can also call the process initiation method pre-set in the NFC service unified interface according to different NFC interaction modes, which can improve the cross-platform calling flexibility of NFC data interaction process and improve the standardization of NFC data interaction process, which is conducive to improving NFC data interaction efficiency.

[0047] In an optional embodiment, the platform bridging layer corresponding to the NFC interaction system may be configured with the functional components required for the NFC interaction mode on the operating platform according to the platform type of the electronic device's operating platform. This may include the following operations: When the NFC interaction mode is the standard data reading mode, if the platform type is the first platform type, the platform bridging layer corresponding to the NFC interaction system configures the NFC adapter to reading mode, registers the NFC event handler, and starts the foreground scheduling system; if the platform type is the second platform type, the platform bridging layer configures the NFC reading session. When the NFC interaction mode is streaming data reading mode, the streaming data manager corresponding to the NFC interaction system is initialized. If the platform type is the first platform type, the platform bridging layer configures the reader mode and starts the background receiving system. If the platform type is the second platform type, the platform bridging layer configures the NFC reading session sequence. When the NFC interaction mode is data write mode, if the platform type is the first platform type, the platform bridging layer configures the NFC adapter to write mode and configures the write callback function and error handler; if the platform type is the second platform type, the platform bridging layer configures the NFC write session.

[0048] For example, the first platform type can be the Android platform, and the second platform type can be the iOS platform.

[0049] Optionally, when configuring functional components, on the second platform type operating platform, custom prompt text can also be set to adjust the display of system pop-ups. This embodiment of the invention does not impose any limitations.

[0050] For example, when the NFC interaction mode is the standard data reading mode, the NFC event processor can be an Intent processor, and the Intent processor can be used to process tag events such as tag discovery events generated after an NFC tag is detected; the NFC reading session can be NFCNDEFReaderSession or NFCTagReaderSession, wherein the session timeout and expiration policy of the NFC reading session can be configured, which is not limited in this embodiment of the invention; when the NFC interaction mode is the streaming data reading mode, configuring the reader mode can specifically be using enableReaderMode; when the NFC interaction mode is the data writing mode, the NFC writing session can be NFCNDEFReaderSession, which is not limited in this embodiment of the invention.

[0051] Optionally, initializing the streaming data manager corresponding to the NFC interaction system may include the following operations: Create a streaming data manager in the core service layer corresponding to the NFC interaction system and initialize the NFC data stream; Configure the data buffering strategy and event propagation mechanism for the streaming data manager; Create a subscription system corresponding to the streaming data manager, and allow multiple components in the NFC interaction system to subscribe to tag events as subscribers.

[0052] Optionally, when the NFC interaction mode is streaming data reading mode, the NFC interaction system is controlled to enter a low-power continuous listening state after configuring the required functional components for the NFC interaction mode on the platform bridging layer corresponding to the NFC interaction system, based on the platform type of the electronic device's operating platform.

[0053] As can be seen, this optional embodiment can also configure the required functional components through the platform bridging layer corresponding to the NFC interaction system under different NFC interaction modes and different platform types. It can separate cross-platform logic and the specific implementation of configuration functional components on different platforms through abstract platform APIs. While reducing development costs and system maintenance complexity, it is conducive to maintaining the consistency of the operations required for NFC data interaction on different platforms based on APIs, thereby improving the configuration flexibility and efficiency of the functional components required for NFC interaction.

[0054] Example 2 Please see Figure 2 , Figure 2 This is a flowchart illustrating a cross-platform NFC data interaction method disclosed in an embodiment of the present invention. Wherein, Figure 2 The described cross-platform NFC data interaction method can be applied to a cross-platform NFC data interaction device, which may include one of an NFC data interaction device, an NFC data interaction terminal, an NFC data interaction system, and a server. The server can be a local server or a cloud server, and this embodiment of the invention is not limited thereto. The method can also be applied to an electronic device, which has an application installed and is communicatively connected to a network-attached storage device with NFC functionality. The electronic device can access the network-attached storage device through the application. Furthermore, the application can implement NFC data interaction functionality through a pre-built NFC interaction system, and this embodiment of the invention is not limited thereto. For example, the NFC interaction system can be a Flutter-based multi-mode NFC data interaction system, and the system architecture of the Flutter-based multi-mode NFC data interaction system can be found in [reference needed]. Figure 3 , Figure 3 This is a schematic diagram of the architecture of a multi-mode NFC data interaction system based on Flutter disclosed in an embodiment of the present invention, such as... Figure 3 As shown, the NFC data interaction system may include an application layer, a core service layer, a security layer, a platform bridging layer, and a data layer; however, this embodiment of the invention does not impose limitations. Figure 2 As shown, this cross-platform NFC data interaction method may include the following operations: 201. When the electronic device and the network-attached storage device are within NFC communication range and an NFC interaction command is detected, determine the NFC interaction mode that matches the NFC interaction command.

[0055] In this embodiment of the invention, the NFC interaction mode includes a data reading mode or a data writing mode; the data reading mode includes a standard data reading mode or a streaming data reading mode.

[0056] 202. When the NFC interaction mode is any data reading mode, the reading parameters and reading method corresponding to the NFC interaction mode are determined based on the application layer corresponding to the NFC interaction system, and are used as the interaction parameters required for the NFC interaction mode.

[0057] In this embodiment of the invention, the reading method includes synchronous reading or asynchronous reading.

[0058] 203. When the NFC interaction mode is the data writing mode, the writing parameters and the data to be written corresponding to the NFC interaction mode are determined based on the application layer corresponding to the NFC interaction system, and are used as the interaction parameters required for the NFC interaction mode.

[0059] 204. Check whether the current operating environment of the NFC interaction system meets the interaction conditions corresponding to the NFC interaction mode.

[0060] 205. When it is detected that the current operating environment of the NFC interaction system meets the interaction conditions corresponding to the NFC interaction mode, based on the platform bridging layer corresponding to the NFC interaction system, the functional components required for the NFC interaction mode on the operating platform are configured according to the platform type of the operating platform corresponding to the electronic device.

[0061] 206. When the platform's native interface detects any NFC tag, it triggers the corresponding native tag event of the platform and converts the native tag event into a target tag event through the platform bridging layer of the NFC interaction system.

[0062] In this embodiment of the invention, the target tag event is a native tag event in a target format; wherein, the target format is a unified event object format / data format pre-defined by the platform bridging layer corresponding to the NFC interaction system; for example, the triggered native tag event can be a tag discovery event, which is not limited in this embodiment of the invention; optionally, more specifically, step 203 may include the following operations: After the NFC interaction system enters the waiting state, when the platform's native interface detects any NFC tag, it triggers the corresponding native tag event of the platform and transmits the native tag event to the platform bridging layer corresponding to the NFC interaction system through a callback function, so that the platform bridging layer can convert the native tag event into the target tag event.

[0063] 207. After detecting the target tag event, perform a security verification operation on the NFC tag and obtain the security verification result.

[0064] 208. When the security verification result is used to indicate that the interactive function is allowed, based on the interactive parameters and functional components, perform the data read and write operation corresponding to the NFC interactive mode for the NFC tag to obtain the data read and write result.

[0065] In this embodiment of the invention, secure read / write operations include secure verification operations and data read / write operations; data read / write operations include data reading operations and / or data writing operations.

[0066] 209. Feedback the secure read / write results to the corresponding user interface of the NFC interactive system.

[0067] In this embodiment of the invention, the secure read / write result includes the security verification result and the data read / write result.

[0068] In this embodiment of the invention, for other detailed descriptions of steps 201-205 and step 209, please refer to the detailed descriptions of steps 101-105 and step 107 in Embodiment 1. These will not be repeated in this embodiment of the invention.

[0069] As can be seen, the method described in the embodiments of the present invention can determine the NFC interaction mode corresponding to the detected NFC interaction command, configure the required interaction parameters and functional components on the operating platform of the electronic device, perform secure read and write operations on the NFC tag based on the interaction parameters and functional components, obtain secure read and write results, and feed back the secure read and write results to the user interface corresponding to the NFC interaction system. It can abstractly realize cross-platform NFC data interaction processing functions through the NFC interaction system, thereby achieving consistency of NFC interaction operations on different operating platforms, which is beneficial to improving the convenience and flexibility of cross-platform NFC data interaction. Furthermore, by providing three interaction modes—standard data reading mode, streaming data reading mode, and data writing mode—compared to the single interaction mode of the prior art, it can expand the application scenarios of NFC data interaction while providing users with more diversified NFC data interaction methods, thus improving the versatility of cross-platform NFC data interaction. Finally, by performing security verification operations simultaneously with data reading and writing, it can improve the reliability of the NFC tag and the NFC data interaction process, reducing security risks such as data tampering during NFC tag interaction, thereby improving the overall reliability of NFC data interaction. FC data interaction enhances data security, thereby improving the user experience of NFC functionality. Furthermore, if the NFC interaction mode is a data reading mode, the application layer of the NFC interaction system determines the corresponding reading parameters and methods as the required interaction parameters. If the NFC interaction mode is a data writing mode, the application layer determines the corresponding writing parameters and the data to be written as the interaction parameters. Then, when the current operating environment of the NFC interaction system meets the interaction conditions corresponding to the NFC interaction mode, the platform bridging layer of the NFC interaction system configures the required functional components for the NFC interaction mode on the operating platform according to the platform type of the electronic device. This allows for the determination of different interaction parameters based on different NFC interaction modes, improving the accuracy of determining the required interaction parameters for NFC data interaction. Additionally, verifying whether the current operating environment conforms to the standard before configuring the required functional components for NFC data interaction based on the operating platform type improves the execution accuracy of the configuration operations and the accuracy of component determination, thus enhancing the reliability of NFC data interaction function configuration and consequently improving the execution reliability of subsequent NFC data interaction operations.Furthermore, upon detecting an NFC tag, a native tag event can be triggered and converted into a tag event in the target format for security verification of the NFC tag. If the security verification result indicates that the interactive function is allowed, data reading and writing of the NFC tag can be performed based on the interaction parameters and functional components. This enables unified format processing of cross-platform NFC event data through the platform bridging layer, which helps improve the processing efficiency of cross-platform NFC interactive data. In addition, the security verification operation improves the reliability and security of NFC tags that require interaction, thereby improving the reliability and security of NFC data interaction operations, reducing security risks in the NFC data interaction process, and enhancing the user experience of NFC functions.

[0070] In an optional embodiment, performing a security verification operation on the NFC tag to obtain a security verification result may include the following operations: Read the basic information of the NFC tag, and perform a trusted authentication operation on the NFC tag based on the basic information to obtain the first authentication result; Perform a data integrity verification operation on the NFC tag to obtain a second verification result; Determine the security requirement level corresponding to the NFC interaction mode; When the security requirement level is higher than or equal to the preset security level, an advanced security verification operation is performed on the NFC tag based on the pre-set challenge response mechanism to obtain a third verification result; The determined preliminary verification results are processed for security decision-making to obtain security verification results; wherein the preliminary verification results include at least one of the first verification results, the second verification results, and the third verification results.

[0071] Optionally, the tag basic information may include one or more of the following: the NFC tag's unique identifier (UID), tag type, and tag manufacturer.

[0072] Optionally, based on the tag's basic information, a trusted authentication operation is performed on the NFC tag to obtain a first authentication result, which may include the following operations: Determine whether the UID of the NFC tag is in the trusted tag database, and / or determine whether the tag type of the NFC tag is a preset tag type, and / or determine whether the NFC tag belongs to a known counterfeit tag, obtain the first judgment result, and determine the first judgment result as the first verification result.

[0073] Optionally, performing a data integrity verification operation on the NFC tag to obtain a second verification result may include the following operations: Determine whether the data format and data structure of the data recorded in the NFC tag are correct, and / or determine whether the digital signature corresponding to the NFC tag is valid, and / or determine whether there are traces of data tampering in the NFC tag, to obtain a second judgment result; and / or perform a data verification operation on the NFC tag to obtain a data verification result; determine the second judgment result and / or the data verification result as the second verification result.

[0074] Optionally, based on a pre-defined challenge-response mechanism, an advanced security verification operation is performed on the NFC tag to obtain a third verification result, which may include the following operations: Generate random challenge data and write the random challenge data into the NFC tag; Read the response information from the NFC tag based on the preset key; The third verification result is obtained by verifying whether the above response information is consistent with the expected response information generated based on the preset algorithm.

[0075] Furthermore, the method may also include the following operation: when the above response information is consistent with the expected response information, a secure session is established, which can be used for subsequent data transmission with the NFC tag to avoid replay attacks.

[0076] As can be seen, this optional embodiment can perform a trusted authentication operation on the NFC tag based on the tag's basic information to obtain a first verification result, perform a data integrity verification operation on the NFC tag to obtain a second verification result, and when the security requirement level corresponding to the NFC interaction mode is higher than or equal to a preset security level, perform an advanced security verification operation on the NFC tag based on a pre-set challenge response mechanism to obtain a third verification result. By combining the above verification results, a security decision is made to obtain a security verification result. This multi-verification approach improves the reliability of security verification, thereby enhancing the accuracy of the security verification result obtained by combining multiple security verifications for security decision-making. This, in turn, improves the reliability of enabling the NFC interaction function, thereby improving the reliability of subsequent data read / write operations.

[0077] In this optional embodiment, the method may also include the following operations: Determine whether any one of the initial verification results can be used to indicate that the verification passed; When it is determined that all verification results in the preliminary verification results are used to indicate that the verification has passed, the security verification result is determined to indicate that all NFC interaction functions are allowed to be enabled. When it is determined that at least one verification result in the preliminary verification results indicates that the verification failed and the remaining verification results indicate that the verification passed, the security verification result is determined to indicate that multiple limited NFC interaction functions are allowed to be enabled. When it is determined that all verification results in the preliminary verification results are used to indicate that the verification failed, the security verification results are determined to indicate that all NFC interaction functions are disabled, and the security event is recorded.

[0078] The security verification result indicates that enabling interactive functions may include enabling all NFC interactive functions or enabling multiple limited NFC interactive functions. Further, optionally, in subsequent data read / write operations, only the data read / write steps corresponding to the functional components of the enabled NFC interactive functions may be executed. This embodiment of the invention does not impose any limitations.

[0079] As can be seen, this optional embodiment can also determine that all NFC interaction functions are allowed to be enabled when all verification results in the preliminary verification results pass, determine that some NFC interaction functions are allowed to be enabled when some verification results in the preliminary verification results pass, and determine that NFC interaction functions are disabled when all verification results in the preliminary verification results fail. Based on the results of multiple security verifications, it can improve the accuracy of determining security verification results and the accuracy of enabling NFC interaction functions, thereby improving the execution accuracy of NFC read and write operations and the reliability of NFC data interaction.

[0080] In another alternative embodiment, the method may further include the following operations: Record all security operations and the decision-making process information corresponding to each security operation; wherein, security operations include at least one of security verification operations, security decision operations, and data encryption operations; When an anomaly is detected in any safety operation, a classification and statistical operation is performed on the anomaly to obtain the anomaly classification results and anomaly statistical results. The aforementioned security operations, along with the corresponding decision-making process information, anomaly classification results, and anomaly statistics, are recorded in the security event log of the NFC interaction system. This security event log is used for subsequent security analysis and auditing of the data interaction process.

[0081] Optionally, emergency security response measures may be taken when a serious security anomaly is detected in the anomaly classification results.

[0082] As can be seen, this optional embodiment can also record all security operations throughout the entire process, and classify and statistically analyze abnormal situations when they are detected, and record the above content in the security event log. This helps to improve the accuracy of subsequent security analysis of the NFC data interaction process, thereby facilitating more efficient maintenance of the NFC interaction system and improving the user experience of NFC functions.

[0083] In another optional embodiment, based on the interaction parameters and functional components, data read / write operations corresponding to the NFC interaction mode are performed on the NFC tag to obtain the data read / write results, which may include the following operations: When the NFC interaction mode is the standard data reading mode, the reading strategy for the NFC tag is determined according to the tag type of the identified NFC tag. According to the reading strategy, based on the interaction parameters and functional components, a data reading operation is performed on the NFC tag to obtain the tag data of the NFC tag, which is used as the data reading result; wherein, the tag data includes the unique identifier of the NFC tag and the content data of the NFC tag.

[0084] When the NFC interaction mode is the standard data reading mode, the data read / write results include the data reading results.

[0085] Optionally, the method may also include the following operations: when the content data includes special format data, parse the special format data to obtain parsed data, and format the parsed data to obtain parsed data in the target format.

[0086] For example, the special format data can be NDEF (NFC Data Exchange Format) data, or other special format data, and this embodiment of the invention does not limit it.

[0087] Optionally, the method may also include the following operations: when the content data includes encrypted data, decrypting the encrypted data based on a preset key to obtain decrypted data, and formatting the decrypted data to obtain decrypted data in the target format.

[0088] Optionally, the method may also include the following operations: recording special security markers (e.g., digital signatures, timestamps, serial numbers, etc.) and control bits in the content data.

[0089] As can be seen, this optional embodiment can also determine the reading strategy for the NFC tag based on the tag type of the identified NFC tag when the NFC interaction mode is the standard data reading mode, and perform data reading operation on the NFC tag based on the reading strategy, interaction parameters and functional components to obtain the tag data of the NFC tag as the data reading result. This can improve the data reading efficiency and accuracy of a single NFC tag, thereby helping to improve the accuracy of data reading and writing results.

[0090] In another optional embodiment, based on the interaction parameters and functional components, data read / write operations corresponding to the NFC interaction mode are performed on the NFC tag to obtain the data read / write results, which may include the following operations: When the NFC interaction mode is streaming data reading mode, under the listening state corresponding to the streaming data reading mode, a data reading operation is performed on the NFC tag based on the interaction parameters and functional components to obtain the tag data of the NFC tag as the data reading result; The data read event corresponding to the generated tag data; Based on the NFC data stream strategy corresponding to the NFC interaction system, the data reading event is pushed to at least one data stream subscriber corresponding to the NFC interaction command to obtain the data push result. Maintain the listening state corresponding to the streaming data reading mode to continuously monitor subsequent detected NFC tags; When the NFC interaction mode is streaming data reading mode, the data read and write results include streaming data reading results, which include data reading results and data push results corresponding to at least one NFC tag.

[0091] Optionally, after pushing the data read event to at least one data stream subscriber corresponding to the NFC interaction command based on the NFC data stream strategy corresponding to the NFC interaction system and obtaining the data push result, the method may further include the following operations: For each data stream subscriber, the subscriber receives the aforementioned data read event and performs data read processing operations on the aforementioned data read event; wherein, the data read processing operations may include one or more combinations of event transformation operations, real-time data display operations, and data statistics and analysis operations; wherein, the event transformation operation is used to perform format conversion and / or data extraction on the data recorded in the data read event.

[0092] Further optionally, the data stream subscriber receiving the aforementioned read data events can specifically be as follows: when an event filtering condition corresponding to the data stream subscriber is detected, the data stream subscriber only receives read data events that satisfy the event filtering condition.

[0093] Optionally, the method may also include the following operation: when an operation error and / or operation exception is detected during the data reading operation of the NFC tag, a special type of read data event corresponding to the operation error and / or operation exception is generated so that the NFC data stream is not interrupted due to the exception.

[0094] Optionally, the method may also include the following operations: when a termination streaming command is detected, terminating the listening state corresponding to the streaming data reading mode, clearing resources and listeners related to the streaming data reading mode in the NFC interaction system, controlling the NFC interaction system to enter a normal power consumption state, and notifying all data stream subscribers that the NFC data stream has been turned off.

[0095] As can be seen, this optional embodiment can also perform data reading operations on NFC tags based on interaction parameters and functional components when the NFC interaction mode is streaming data reading mode, under the listening state corresponding to the streaming data reading mode, to obtain the tag data of the NFC tag as the data reading result, and push the reading data event corresponding to the tag data to the corresponding data stream subscriber based on the NFC data stream strategy to obtain the data push result, and continue to maintain the listening state corresponding to the streaming data reading mode to continuously listen for subsequently detected NFC tags. This can improve the data reading efficiency and accuracy of multiple NFC tags, thereby improving the data interaction efficiency of multiple NFC tags, as well as the push efficiency and accuracy of streaming tag data, thereby improving the processing efficiency of streaming tag data by data stream subscribers.

[0096] In another optional embodiment, based on the interaction parameters and functional components, data read / write operations corresponding to the NFC interaction mode are performed on the NFC tag to obtain the data read / write results, which may include the following operations: When the NFC interaction mode is data writing mode, check whether the NFC tag meets the preset writing conditions; When the NFC tag is detected to meet the writing conditions, a data writing operation is performed on the NFC tag based on the interaction parameters and functional components; After completing the data writing operation, a data reading operation is performed on the NFC tag to obtain the data reading result; Compare the data read results with the data to be written in the interaction parameters to obtain the data comparison results; When the data comparison result is used to indicate that the data is consistent, the data write status corresponding to the data write operation is determined as a write success status; When the NFC interaction mode is data writing mode, the data read and write results include the data writing results, which at least include the data writing status.

[0097] Optionally, detecting whether the NFC tag meets the preset write conditions can include the following operations: Check whether the data format of the NFC tag matches the data format to be written and whether the available data capacity of the NFC tag is greater than or equal to the length of the data to be written. When the data format of the NFC tag is detected to match the data format to be written and the available data capacity of the NFC tag is greater than or equal to the length of the data to be written, it is determined that the NFC tag meets the writing conditions. When it is detected that the data format of the NFC tag does not match the write data format or the available data capacity of the NFC tag is less than the write data length, it is determined that the NFC tag does not meet the write conditions.

[0098] Optionally, based on interaction parameters and functional components, performing data writing operations on NFC tags may include the following operations: The data to be written in the interaction parameters is processed securely to obtain secure data to be written. The secure processing includes at least one of the following: formatting, encryption, adding digital signature, data verification, and data integrity verification. The secure data to be written conforms to the tag data specification corresponding to the NFC tag. Based on the write parameters and functional components, secure data to be written is written to the NFC tag.

[0099] Optionally, the encryption algorithm used for encryption processing can be the AES-256 standard encryption algorithm or other types of encryption algorithms; this embodiment of the invention does not limit the specific encryption algorithm used.

[0100] By performing security processing on the data to be written before writing, the security of the data to be written and the compatibility between the data to be written and the NFC tag can be improved, which is beneficial to improving the security and reliability of data writing.

[0101] Optionally, the method may also include the following operations: when the data comparison result is used to indicate data inconsistency, the data write status corresponding to the data write operation is determined to be a write failure status, and an automatic retry mechanism is started to re-execute the above data write operation.

[0102] As can be seen, this optional embodiment can also perform a data writing operation on the NFC tag based on the interaction parameters and functional components when the NFC interaction mode is in data writing mode, if the NFC tag is detected to meet the writing conditions. After the data writing is completed, a data reading operation is performed on the NFC tag to obtain the data reading result. The data reading result is compared with the data to be written in the interaction parameters. If the data comparison result indicates that the data is consistent, the data writing status corresponding to the data writing operation is determined as a successful writing status. This can realize a data verification before writing and a confirmation mechanism after writing, which is beneficial to improving the execution reliability of the data writing operation and improving the validity and accuracy of the data after the NFC tag is written, thereby improving the reliability of NFC data interaction.

[0103] In yet another optional embodiment, feeding back the secure read / write result to the user interface corresponding to the NFC interactive system may include the following operations: Based on the operation result model corresponding to the NFC interaction system, a secure read and write result object corresponding to the secure read and write result is constructed; wherein, the secure read and write result object records one or more combinations of the following: the unique identifier corresponding to the NFC tag, the data read and write result, the operation status, the security verification result, and the error message; The secure read / write result object is fed back to the application layer of the NFC interaction system, and the secure read / write result object is displayed on the user interface of the NFC interaction system.

[0104] The user interface belongs to the application layer mentioned above.

[0105] Optionally, when the NFC interaction mode is data reading mode, the secure read / write result can be fed back to the application layer corresponding to the NFC interaction system through asynchronous feedback; wherein, the above-mentioned asynchronous feedback method may include Promise asynchronous processing method or callback method, and the embodiments of the present invention are not limited thereto.

[0106] As can be seen, this optional embodiment can also construct a secure read / write result object corresponding to the secure read / write result based on the operation result model corresponding to the NFC interaction system, and feed the secure read / write result object back to the application layer corresponding to the NFC interaction system to display the aforementioned secure read / write result object on the user interface. This can improve the standardization and accuracy of the construction of the secure read / write result object, thereby improving the accuracy and efficiency of the feedback of the secure read / write result, and further enabling users to understand the NFC data interaction result more efficiently and clearly, thus improving the user's experience with NFC data interaction.

[0107] In this embodiment of the invention, for example, the cross-platform NFC data interaction method can be applied to, for example, Figure 3 The Flutter-based multi-mode NFC data interaction system shown includes an application layer, a core service layer, a security layer, a platform bridging layer, and a data layer. Specifically: 1. The application layer is the top layer of the system and can directly interact with the user. The application layer can include: UGNFCApp (application entry point), UGNFCController (controller), and UGNFCView (view layer). Among them, UGNFCApp (application entry point) is the entry point of the entire NFC data interaction system, responsible for initializing the system environment, configuration, and coordination of components at each layer. UGNFCController (controller) is used to handle all business logic, and is the bridge connecting the user interface and the underlying services. It can receive user operation requests, call the corresponding services to complete the tasks, and update the view display results. UGNFCView (view layer) provides the user interface, displays the status, results, and prompts of NFC operations, and can collect user input. It can also include multiple view components such as a tag reading interface, a data writing form, and an operation result display. 2. The core service layer is the central hub of the system, providing all NFC-related functionalities. This core service layer may include UGNFCService (Unified NFC Service Interface), UGNFCReader (Tag Reading Service), UGNFCWriter (Tag Writing Service), and UGNFCStreamManager (Streaming Data Manager). UGNFCService serves as the unified entry point for the core service layer, providing standardized APIs for upper layers to call, shielding them from underlying implementation details. UGNFCReader (Tag Reading Service) is responsible for all NFC tag reading-related operations and supports multiple tag type recognition (NDEF, MIFARE, FeliCa). The system offers both synchronous and asynchronous reading modes, and also includes built-in tag data parsing and format conversion functions; UGNFCWriter (tag writing service) is responsible for all NFC tag writing-related operations and supports writing multiple data formats (plain text, URL, smart poster, etc.), provides an intelligent writing mode, automatically matches the tag type and the best writing method, and also implements pre-writing data verification and post-writing confirmation mechanisms; UGNFCStreamManager (streaming data manager) is used to manage continuous NFC data streams, enabling real-time tag monitoring, and provides a Stream-based API, supports multi-subscriber mode, optimizes data buffering and transmission, ensures real-time performance, and also implements intelligent power management to reduce battery consumption from continuous monitoring; 3. The security layer is the system's protective barrier, responsible for all functions related to NFC data security. The security layer can include UGNFCSecurity (security service), UGNFCEncryptor (encryption service), and UGNFCAuthenticator (authentication service). UGNFCSecurity serves as the unified entry point for security functions, coordinating the work of various security components. UGNFCEncryptor provides an implementation of the AES-256 standard encryption algorithm, manages the generation, storage, and rotation of encryption keys, supports dynamic key derivation based on tag IDs, and provides a data signature verification mechanism to ensure data integrity. UGNFCAuthenticator verifies the authenticity of NFC tags, prevents counterfeit tags, implements two-way authentication based on a challenge-response mechanism, maintains a whitelist and blacklist of trusted tags, and provides security event logging and analysis functions. 4. The platform bridging layer is crucial for connecting Flutter and the native platform, handling all platform-specific implementation details. This layer can include UGNFCPlatformBridge (platform bridging service), AndroidNFCBridge (Android platform bridging), IOSNFCBridge (iOS platform bridging), and UGNFCCapabilityDetector. UGNFCPlatformBridge is a unified platform adaptation interface that automatically selects the appropriate platform bridging implementation based on the runtime environment. AndroidNFCBridge encapsulates the Android NFC API (NfcAdapter, NfcManager, etc.), handling Android-specific permission requests and system settings, optimizing the Android platform's foreground distribution system and Intent handling, and supporting Android-specific HCE (Host Card Emulation) functionality. IOSNFCBridge encapsulates the iOS... The CoreNFC framework optimizes the iOS system pop-up experience, provides custom prompt text, implements iOS platform-specific session management and lifecycle handling, handles iOS platform functional limitations, and provides degradation strategies; UGNFCCapabilityDetector is used to detect the current device's NFC hardware support, identify the operating system version and NFC API availability, collect platform-specific functional limitation information, provide the upper layer with a device capability profile, and guide functional adaptation. 5. The data layer manages all data models and storage related to NFC operations. This layer may include UGNFCDataRepository (data warehouse), UGNFCTagModel (tag data model), and UGNFCErrorHandler (error handler). UGNFCDataRepository serves as the central data manager, coordinating the storage, retrieval, and transformation of various data types. UGNFCTagModel stores basic tag information (ID, type, capacity, etc.), standardizes data representation for different tag types, provides data serialization and deserialization functions, and supports tag history and metadata management. UGNFCOperationResult encapsulates the results of various NFC operations, including operation status, result data, and error information, and supports chained result processing and transformation, providing standardized error codes and descriptions. UGNFCErrorHandler centrally manages and handles various anomalies in NFC operations, classifies and prioritizes errors, provides error recovery suggestions and automatic retry mechanisms, collects error statistics, and optimizes system reliability.

[0108] The cross-platform NFC data interaction method using the aforementioned NFC data interaction system offers the following advantages: A clear five-layer architecture is constructed through layered design, achieving separation of concerns, with each layer focusing on specific responsibilities, facilitating maintenance and expansion; the abstracted platform bridging layer completely separates cross-platform logic from platform-specific implementations, ensuring API consistency; an independent security layer design guarantees the security of NFC operations, providing comprehensive data protection; the core service layer supports multiple operating modes to meet the needs of different scenarios; capability detectors and intelligent degradation strategies ensure the system provides optimal usability on different devices, achieving intelligent adaptation to different operating platforms and electronic devices; and the modular design makes the system easily expandable, allowing for the addition of new tag type support or security mechanisms.

[0109] Furthermore, when this cross-platform NFC data interaction method can be applied to, for example... Figure 3 When using the Flutter-based multi-mode NFC data interaction system shown, the operation flow of this method can be found in [reference needed]. Figure 4 , Figure 4 This is a flowchart illustrating another cross-platform NFC data interaction method disclosed in an embodiment of the present invention. Figure 4 As shown, the method may include the following steps: 1. Initialization process: (1) Application starts; (2) Call UGNFCCapabilityDetector to detect the device's NFC capability: If NFC is unavailable: display a prompt message and disable NFC function; If NFC is available but limited: enable smart degradation mode; If NFC is fully available: enable all functions; (3) Initialize UGNFCService and related components; (4) Register NFC event listener; 2. Standard reading mode process: (1) The user triggers the NFC reading operation; (2) UGNFCController calls the UGNFCService.read() method; (3) UGNFCPlatformBridge selects the corresponding implementation according to the current platform: Android: directly calls the native NFC reading API; iOS: handles the system pop-up and calls the native NFC reading API; (4) NFC tag data is read; (5) Data integrity and authenticity are verified through UGNFCSecurity; (6) The processing result is returned to the application layer; 3. Streaming Reading Mode Process: (1) User triggers continuous NFC listening; (2) UGNFCController calls UGNFCService.startStream() method; (3) UGNFCStreamManager creates NFC data stream; (4) System enters continuous listening state; (5) Whenever an NFC tag is detected: read tag data, push to the listener through data stream, and continue listening for new tags; (6) User calls stopstream() method to stop listening; 4. Write mode process: (1) The user triggers the NFC write operation and provides data; (2) UGNFCController calls the UGNFCService.write() method; (3) UGNFCSecurity encrypts the data; (4) UGNFCPlatformBridge selects the corresponding implementation according to the current platform: Android: directly calls the native NFC write API; iOS: checks the platform support, and returns an error if it is not supported; (5) executes the write operation; (6) verifies the write result; (7) returns the operation status to the application layer; 5. Security verification process: (1) NFC tag is detected; (2) The tag's unique identifier and encrypted data are read; (3) UGNFGAuthenticator verifies the tag's identity: checks whether the tag's unique ID is in the trusted list; verifies whether the encrypted signature is valid; (4) If the verification is successful, the tag data is decrypted and processed; (5) If the verification fails, a security warning is returned.

[0110] Example 3 Please see Figure 5, Figure 5 This is a schematic diagram of the structure of a cross-platform NFC data interaction device disclosed in an embodiment of the present invention. Figure 5 The described cross-platform NFC data interaction device may include one of an NFC data interaction device, an NFC data interaction terminal, an NFC data interaction system, and a server, wherein the server can be a local server or a cloud server, and this embodiment of the invention is not limited thereto. The device can be applied to an electronic device, which has an application installed thereon and is communicatively connected to a network-attached storage device with NFC functionality. The electronic device can access the network-attached storage device through the application. Furthermore, the application can implement NFC data interaction functionality through a pre-built NFC interaction system, and this embodiment of the invention is not limited thereto. For example, the NFC interaction system can be a Flutter-based multi-mode NFC data interaction system, and the system architecture of the Flutter-based multi-mode NFC data interaction system can be found in [reference needed]. Figure 3 , Figure 3 This is a schematic diagram of the architecture of a multi-mode NFC data interaction system based on Flutter disclosed in an embodiment of the present invention, such as... Figure 3 As shown, the NFC data interaction system may include an application layer, a core service layer, a security layer, a platform bridging layer, and a data layer; however, this embodiment of the invention does not impose limitations. Figure 5 As shown, the cross-platform NFC data interaction device 30 may include: The determining module 301 is used to determine the NFC interaction mode that matches the NFC interaction command when the electronic device and the network-attached storage device are within the NFC communication range and an NFC interaction command is detected; the NFC interaction mode includes a data reading mode or a data writing mode; the data reading mode includes a standard data reading mode or a streaming data reading mode. The configuration module 302 is used to determine the reading parameters and reading method corresponding to the NFC interaction mode based on the application layer of the NFC interaction system when the NFC interaction mode is any data reading mode, as the interaction parameters required for the NFC interaction mode; the reading method includes synchronous reading mode or asynchronous reading mode; when the NFC interaction mode is data writing mode, it determines the writing parameters and data to be written based on the application layer of the NFC interaction system, as the interaction parameters required for the NFC interaction mode; it detects whether the current operating environment of the NFC interaction system meets the interaction conditions corresponding to the NFC interaction mode; when it is detected that the current operating environment of the NFC interaction system meets the interaction conditions corresponding to the NFC interaction mode, it configures the functional components required for the NFC interaction mode on the operating platform based on the platform bridging layer of the NFC interaction system and the platform type of the operating platform corresponding to the electronic device; The secure read / write module 303 is used to perform secure read / write operations corresponding to the NFC interaction mode on the detected NFC tag based on interaction parameters and functional components, and to obtain secure read / write results; the secure read / write operations include security verification operations and data read / write operations; the data read / write operations include data reading operations and / or data writing operations. The result feedback module 304 is used to feed back the secure read / write results to the corresponding user interface of the NFC interactive system.

[0111] As can be seen, the apparatus described in the embodiments of the present invention can determine the NFC interaction mode corresponding to the NFC interaction command when an NFC interaction command is detected, configure the required interaction parameters and functional components on the operating platform of the electronic device, perform secure read and write operations on the NFC tag based on the interaction parameters and functional components, obtain secure read and write results, and feed back the secure read and write results to the user interface corresponding to the NFC interaction system. It can achieve cross-platform NFC data interaction processing functions through the abstraction of the NFC interaction system, thereby achieving consistency of NFC interaction operations on different operating platforms, which is beneficial to improving the convenience and flexibility of cross-platform NFC data interaction. Furthermore, by providing three interaction modes—standard data reading mode, streaming data reading mode, and data writing mode—compared to the single interaction mode of the prior art, it can expand the application scenarios of NFC data interaction while providing users with more diversified NFC data interaction methods, thus improving the versatility of cross-platform NFC data interaction. Finally, by performing security verification operations simultaneously with data reading and writing, it can improve the reliability of the NFC tag and the reliability of the NFC data interaction process, reducing security risks such as data tampering during NFC tag interaction, thereby improving the overall reliability of NFC data interaction. FC data interaction enhances data security, thereby improving the user experience of NFC functionality. Furthermore, if the NFC interaction mode is a data reading mode, the application layer of the NFC interaction system determines the corresponding reading parameters and methods as the required interaction parameters. If the NFC interaction mode is a data writing mode, the application layer determines the corresponding writing parameters and the data to be written as the interaction parameters. Then, when the current operating environment of the NFC interaction system meets the interaction conditions corresponding to the NFC interaction mode, the platform bridging layer of the NFC interaction system configures the required functional components for the NFC interaction mode on the operating platform according to the platform type of the electronic device. This allows for the determination of different interaction parameters based on different NFC interaction modes, improving the accuracy of determining the required interaction parameters for NFC data interaction. Additionally, verifying whether the current operating environment conforms to the standard before configuring the required functional components for NFC data interaction based on the operating platform type improves the execution accuracy of the configuration operations and the accuracy of component determination, thus enhancing the reliability of NFC data interaction function configuration and consequently improving the execution reliability of subsequent NFC data interaction operations.

[0112] In an optional embodiment, such as Figure 6 As shown, the device may further include: The detection module 305 is used to detect the NFC configuration information of the electronic device before detecting whether an NFC interaction command exists; The determining module 301 is also used to determine the NFC function configuration level corresponding to the electronic device based on the NFC configuration information; the NFC function configuration level includes one of the following: NFC function unavailable level, NFC function restricted level, and NFC function complete level; The initialization module 306 is used to perform functional module initialization operations that match the NFC function configuration level according to the NFC configuration information; initialize the core system components corresponding to the NFC interaction system, and register the NFC event listener corresponding to the NFC interaction system to complete the initialization operation of the NFC interaction system.

[0113] As can be seen, the apparatus described in this optional embodiment can detect the NFC configuration information of the electronic device before detecting the NFC interaction command, and determine the NFC function configuration level of the electronic device according to the NFC configuration information. It then performs the initialization operation of the functional module matching the NFC function configuration level, initializes the core system components corresponding to the NFC interaction system, and registers the NFC event listener to complete the initialization of the NFC interaction system. By analyzing the NFC configuration of the electronic device, it can perform the initialization operation of the corresponding NFC functional module, improving the accuracy of the analysis of the NFC function configuration of the electronic device while increasing the flexibility and accuracy of the initialization of the NFC functional module. This is beneficial to improving the initialization efficiency of the NFC interaction system and facilitating the provision of more reliable NFC interaction functions in the future.

[0114] In this optional embodiment, the configuration module 302, based on the platform bridging layer corresponding to the NFC interaction system, configures the specific method of the functional components required for the NFC interaction mode on the operating platform according to the platform type of the operating platform corresponding to the electronic device. This may include: When the NFC interaction mode is the standard data reading mode, if the platform type is the first platform type, the platform bridging layer corresponding to the NFC interaction system configures the NFC adapter to reading mode, registers the NFC event handler, and starts the foreground scheduling system; if the platform type is the second platform type, the platform bridging layer configures the NFC reading session. When the NFC interaction mode is streaming data reading mode, the streaming data manager corresponding to the NFC interaction system is initialized. If the platform type is the first platform type, the platform bridging layer configures the reader mode and starts the background receiving system. If the platform type is the second platform type, the platform bridging layer configures the NFC reading session sequence. When the NFC interaction mode is data write mode, if the platform type is the first platform type, the platform bridging layer configures the NFC adapter to write mode and configures the write callback function and error handler; if the platform type is the second platform type, the platform bridging layer configures the NFC write session.

[0115] As can be seen, the device described in this optional embodiment can also configure the required functional components through the platform bridging layer corresponding to the NFC interaction system in different NFC interaction modes and different platform types. It can separate cross-platform logic and the specific implementation of configuration functional components on different platforms through abstract platform APIs. This can reduce development costs and system maintenance complexity, while facilitating the consistency of operations required for NFC data interaction on different platforms based on APIs, thereby improving the configuration flexibility and efficiency of the functional components required for NFC interaction.

[0116] In another optional embodiment, the secure read / write module 303 performs a secure read / write operation corresponding to the NFC interaction mode on the detected NFC tag based on interaction parameters and functional components. The specific method for obtaining the secure read / write result may include: When the platform's native interface detects any NFC tag, it triggers the corresponding native tag event of the platform and converts the native tag event into a target tag event through the platform bridging layer of the NFC interaction system; the target tag event is a native tag event in the target format. After detecting the target tag event, a security verification operation is performed on the NFC tag to obtain the security verification result; When the security verification result is used to indicate that the interactive function is allowed, based on the interactive parameters and functional components, the data read and write operation corresponding to the NFC interactive mode is performed on the NFC tag to obtain the data read and write result. The secure read / write results include security verification results and data read / write results.

[0117] As can be seen, the apparatus described in this optional embodiment can trigger a native tag event and convert the event into a tag event of the target format when an NFC tag is detected, so as to perform security verification processing on the NFC tag. If the security verification result indicates that the interaction function is allowed, then data reading and writing are performed on the NFC tag based on the interaction parameters and functional components. It can perform unified format processing of cross-platform NFC event data through the platform bridging layer, which is beneficial to improving the processing efficiency of cross-platform NFC interaction data. In addition, through the security verification operation, the reliability and security of NFC tags that need to be interacted are improved, which is beneficial to improving the reliability and security of NFC data interaction operations, thereby reducing the security risks of the NFC data interaction process and improving the user's experience of using NFC functions.

[0118] In this optional embodiment, the specific method by which the secure read / write module 303 performs a security verification operation on the NFC tag and obtains the security verification result may include: Read the basic information of the NFC tag, and perform a trusted authentication operation on the NFC tag based on the basic information to obtain the first authentication result; Perform a data integrity verification operation on the NFC tag to obtain a second verification result; Determine the security requirement level corresponding to the NFC interaction mode; When the security requirement level is higher than or equal to the preset security level, an advanced security verification operation is performed on the NFC tag based on the pre-set challenge response mechanism to obtain a third verification result; The determined preliminary verification results are processed for security decision-making to obtain security verification results; wherein the preliminary verification results include at least one of the first verification results, the second verification results, and the third verification results.

[0119] As can be seen, the apparatus described in this optional embodiment can also perform a trusted authentication operation on the NFC tag based on the tag's basic information to obtain a first verification result, perform a data integrity verification operation on the NFC tag to obtain a second verification result, and when the security requirement level corresponding to the NFC interaction mode is higher than or equal to a preset security level, perform an advanced security verification operation on the NFC tag based on a pre-set challenge response mechanism to obtain a third verification result. By combining the above verification results, a security decision is made to obtain a security verification result. This multi-verification approach improves the reliability of security verification, thereby enhancing the accuracy of the security verification result obtained by combining multiple security verifications for security decision-making. This, in turn, improves the reliability of enabling the NFC interaction function, thereby increasing the reliability of subsequent data read / write operations.

[0120] In this optional embodiment, the specific method by which the secure read / write module 303 performs data read / write operations corresponding to the NFC interaction mode for the NFC tag based on interaction parameters and functional components to obtain the data read / write results may include: When the NFC interaction mode is streaming data reading mode, under the listening state corresponding to the streaming data reading mode, a data reading operation is performed on the NFC tag based on the interaction parameters and functional components to obtain the tag data of the NFC tag as the data reading result; The data read event corresponding to the generated tag data; Based on the NFC data stream strategy corresponding to the NFC interaction system, the data reading event is pushed to at least one data stream subscriber corresponding to the NFC interaction command to obtain the data push result. Maintain the listening state corresponding to the streaming data reading mode to continuously monitor subsequent detected NFC tags; When the NFC interaction mode is streaming data reading mode, the data read and write results include streaming data reading results, which include data reading results and data push results corresponding to at least one NFC tag.

[0121] As can be seen, the apparatus described in this optional embodiment can also perform data reading operations on NFC tags based on interaction parameters and functional components when the NFC interaction mode is streaming data reading mode and in the listening state corresponding to the streaming data reading mode, to obtain the tag data of the NFC tag as the data reading result, and push the reading data event corresponding to the tag data to the corresponding data stream subscriber based on the NFC data stream strategy to obtain the data push result, and continue to maintain the listening state corresponding to the streaming data reading mode to continuously listen for subsequently detected NFC tags. This can improve the data reading efficiency and accuracy of multiple NFC tags, thereby improving the data interaction efficiency of multiple NFC tags, and improving the push efficiency and accuracy of streaming tag data, thereby improving the processing efficiency of streaming tag data by data stream subscribers.

[0122] Example 4 Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of the present invention. For example... Figure 7 As shown, the electronic device 40 may include: Memory 401 storing executable program code; Processor 402 coupled to memory 401; The processor 402 calls the executable program code stored in the memory 401 to execute some or all of the steps in the cross-platform NFC data interaction method described in Embodiment 1 or Embodiment 2 of the present invention.

[0123] Example 5 This invention discloses a cross-platform NFC data interaction system. Please refer to... Figure 8 , Figure 8 This is a schematic diagram of the structure of a cross-platform NFC data interaction system disclosed in an embodiment of the present invention. Figure 8 As shown, the cross-platform NFC data interaction system includes the cross-platform NFC data interaction device 30 described in Embodiment 3 of the present invention, and a network-attached storage device 50 communicatively connected to the cross-platform NFC data interaction device 30; wherein, the cross-platform NFC data interaction device 30 performs data interaction operations on the detected NFC tag according to the cross-platform NFC data interaction method described in Embodiment 1 or Embodiment 2 of the present invention; or, In this embodiment of the invention, as another optional implementation, please refer to [link / reference needed]. Figure 9 , Figure 9 This is a schematic diagram of another cross-platform NFC data interaction system disclosed in an embodiment of the present invention. Figure 9 As shown, the cross-platform NFC data interaction system includes an electronic device 40 as described in Embodiment 4 of the present invention, and a network-attached storage device 50 communicatively connected to the electronic device 40; wherein, the electronic device 40 performs data interaction operations on the detected NFC tag according to the cross-platform NFC data interaction method described in Embodiment 1 or Embodiment 2 of the present invention.

[0124] Example 6 This invention discloses a computer storage medium storing computer instructions. When these computer instructions are invoked, they are used to execute some or all of the steps in the cross-platform NFC data interaction method described in Embodiment 1 or Embodiment 2 of this invention.

[0125] Example 7 This invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to perform some or all of the steps in the cross-platform NFC data interaction method described in Embodiment 1 or Embodiment 2.

[0126] The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0127] Finally, it should be noted that the cross-platform NFC data interaction method, apparatus, electronic device, and system disclosed in the embodiments of the present invention are merely preferred embodiments of the present invention and are only used to illustrate the technical solutions of the present invention, not to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A cross-platform NFC data interaction method, characterized in that, The method is applied to an electronic device, which has an application installed and is communicatively connected to a network-attached storage device (NATSDS) with NFC functionality. The electronic device can access the NATSDS through the application. The application implements NFC data interaction functionality through a pre-built NFC interaction system, and the method includes: When the electronic device and the network-attached storage device are within NFC communication range and an NFC interaction command is detected, an NFC interaction mode matching the NFC interaction command is determined; the NFC interaction mode includes a data reading mode or a data writing mode; the data reading mode includes a standard data reading mode or a streaming data reading mode. When the NFC interaction mode is any of the data reading modes, the reading parameters and reading method corresponding to the NFC interaction mode are determined based on the application layer corresponding to the NFC interaction system, and are used as the interaction parameters required by the NFC interaction mode; the reading method includes synchronous reading method or asynchronous reading method; When the NFC interaction mode is the data writing mode, the writing parameters and the data to be written corresponding to the NFC interaction mode are determined based on the application layer corresponding to the NFC interaction system, and are used as the interaction parameters required for the NFC interaction mode. Detect whether the current operating environment of the NFC interaction system meets the interaction conditions corresponding to the NFC interaction mode; When it is detected that the current operating environment of the NFC interaction system meets the interaction conditions corresponding to the NFC interaction mode, based on the platform bridging layer corresponding to the NFC interaction system and according to the platform type of the operating platform corresponding to the electronic device, the functional components required for the NFC interaction mode on the operating platform are configured. Based on the interaction parameters and the functional components, a secure read / write operation corresponding to the NFC interaction mode is performed on the detected NFC tag to obtain a secure read / write result; the secure read / write operation includes a security verification operation and a data read / write operation; the data read / write operation includes a data reading operation and / or a data writing operation; The secure read / write results are fed back to the user interface corresponding to the NFC interactive system.

2. The cross-platform NFC data interaction method according to claim 1, characterized in that, The method further includes: Before detecting whether the NFC interaction command exists, the NFC configuration information corresponding to the electronic device is detected; Based on the NFC configuration information, the NFC function configuration level corresponding to the electronic device is determined; the NFC function configuration level includes one of the following: NFC function unavailable level, NFC function restricted level, and NFC function complete level; Based on the NFC configuration information, perform the initialization operation of the functional modules that match the NFC function configuration level; The core system components corresponding to the NFC interaction system are initialized, and the NFC event listener corresponding to the NFC interaction system is registered to complete the initialization operation of the NFC interaction system.

3. The cross-platform NFC data interaction method according to claim 1, characterized in that, The platform bridging layer based on the NFC interaction system configures the functional components required for the NFC interaction mode on the operating platform according to the platform type of the operating platform corresponding to the electronic device, including: When the NFC interaction mode is the standard data reading mode, if the platform type is the first platform type, the platform bridging layer corresponding to the NFC interaction system configures the NFC adapter to reading mode, registers the NFC event handler, and starts the foreground scheduling system; if the platform type is the second platform type, the platform bridging layer configures the NFC reading session. When the NFC interaction mode is the streaming data reading mode, the streaming data manager corresponding to the NFC interaction system is initialized. If the platform type is the first platform type, the platform bridging layer configures the reader mode and starts the background receiving system. If the platform type is the second platform type, the platform bridging layer configures the NFC reading session sequence. When the NFC interaction mode is the data writing mode, if the platform type is the first platform type, the platform bridging layer configures the NFC adapter to write mode and configures the write callback function and error handler; if the platform type is the second platform type, the platform bridging layer configures the NFC write session.

4. The cross-platform NFC data interaction method according to any one of claims 1-3, characterized in that, Based on the interaction parameters and the functional components, the process of performing a secure read / write operation corresponding to the NFC interaction mode on the detected NFC tag to obtain a secure read / write result includes: When the platform's native interface detects any of the NFC tags, it triggers a native tag event corresponding to the platform, and converts the native tag event into a target tag event through the platform bridging layer corresponding to the NFC interaction system; the target tag event is a native tag event in a target format. After detecting the target tag event, a security verification operation is performed on the NFC tag to obtain a security verification result; When the security verification result is used to indicate that the interactive function is allowed to be enabled, based on the interactive parameters and the functional components, the data read and write operation corresponding to the NFC interactive mode is performed on the NFC tag to obtain the data read and write result. The secure read / write results include the security verification results and the data read / write results.

5. The cross-platform NFC data interaction method according to claim 4, characterized in that, The step of performing a security verification operation on the NFC tag to obtain a security verification result includes: Read the basic information of the NFC tag, and perform a trusted authentication operation on the NFC tag based on the basic information to obtain a first authentication result; Perform a data integrity verification operation on the NFC tag to obtain a second verification result; Determine the security requirement level corresponding to the NFC interaction mode; When the security requirement level is higher than or equal to the preset security level, an advanced security verification operation is performed on the NFC tag based on a pre-set challenge response mechanism to obtain a third verification result; The determined preliminary verification results are processed for security decision-making to obtain security verification results; wherein, the preliminary verification results include at least one of the first verification results, the second verification results, and the third verification results.

6. The cross-platform NFC data interaction method according to claim 4, characterized in that, The step of performing data read / write operations corresponding to the NFC interaction mode on the NFC tag based on the interaction parameters and the functional components, and obtaining data read / write results, includes: When the NFC interaction mode is the streaming data reading mode, in the listening state corresponding to the streaming data reading mode, based on the interaction parameters and the functional components, the data reading operation is performed on the NFC tag to obtain the tag data of the NFC tag as the data reading result; Generate a read data event corresponding to the tag data; Based on the NFC data stream strategy corresponding to the NFC interaction system, the data reading event is pushed to at least one data stream subscriber corresponding to the NFC interaction command to obtain the data push result; Maintain the listening state corresponding to the streaming data reading mode to continuously monitor subsequently detected NFC tags; When the NFC interaction mode is the streaming data reading mode, the data read / write result includes the streaming data reading result, which includes at least one data reading result and the data push result corresponding to the NFC tag.

7. A cross-platform NFC data interaction device, characterized in that, The device is used in an electronic device, which has an application installed. The electronic device is communicatively connected to a network-attached storage device (NATSDS) with NFC functionality. The electronic device can access the NATSDS through the application. The application implements NFC data interaction functionality through a pre-built NFC interaction system. The device includes: The determination module is used to determine an NFC interaction mode that matches the NFC interaction command when the electronic device and the network-attached storage device are within NFC communication range and an NFC interaction command is detected; the NFC interaction mode includes a data reading mode or a data writing mode; the data reading mode includes a standard data reading mode or a streaming data reading mode. The configuration module is used to determine the reading parameters and reading method corresponding to the NFC interaction mode based on the application layer corresponding to the NFC interaction system when the NFC interaction mode is any of the data reading modes, as the interaction parameters required for the NFC interaction mode; the reading method includes synchronous reading mode or asynchronous reading mode; when the NFC interaction mode is the data writing mode, it determines the writing parameters and data to be written corresponding to the NFC interaction mode based on the application layer corresponding to the NFC interaction system, as the interaction parameters required for the NFC interaction mode; it detects whether the current operating environment of the NFC interaction system meets the interaction conditions corresponding to the NFC interaction mode; when it is detected that the current operating environment of the NFC interaction system meets the interaction conditions corresponding to the NFC interaction mode, it configures the functional components required for the NFC interaction mode on the operating platform based on the platform bridging layer corresponding to the NFC interaction system and according to the platform type of the operating platform corresponding to the electronic device; The secure read / write module is used to perform secure read / write operations corresponding to the NFC interaction mode on the detected NFC tag based on the interaction parameters and the functional components, and obtain secure read / write results; the secure read / write operations include security verification operations and data read / write operations; the data read / write operations include data reading operations and / or data writing operations; The result feedback module is used to feed back the secure read / write result to the user interface corresponding to the NFC interactive system.

8. An electronic device, characterized in that, The electronic device includes: Memory containing executable program code; A processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the cross-platform NFC data interaction method as described in any one of claims 1-6.

9. A cross-platform NFC data interaction system, characterized in that, The system includes a cross-platform NFC data interaction device as described in claim 7, and a network-attached storage device communicatively connected to the cross-platform NFC data interaction device; wherein the cross-platform NFC data interaction device performs a data interaction operation on a detected NFC tag according to the cross-platform NFC data interaction method as described in any one of claims 1-6. or, The system includes the electronic device as described in claim 8, and a network-attached storage device communicatively connected to the electronic device; wherein the electronic device performs a data interaction operation on the detected NFC tag according to the cross-platform NFC data interaction method as described in any one of claims 1-6.

10. A computer storage medium, characterized in that, The computer storage medium stores computer instructions, which, when invoked, are used to execute the cross-platform NFC data interaction method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Method and device for realizing functions in application program, electronic equipment and storage medium

    CN113094123A

  • USB card reader compatible with Windows and Android systems and system

    CN118363902A

  • Data interaction and performance optimization method and system based on Web NFC

    CN118690764A

  • Safe card reading system and method in intelligent terminal

    CN119005221A

Cited By

  • Vehicle-mounted NFC service system and method, vehicle and equipment

    CN121174124A