Near field communication (NFC) service processing method, device, electronic device and storage medium

By implementing NFC service request coordination and hardware abstraction layer interface calls between operating systems in terminal devices, the problem of multiple heterogeneous operating systems sharing NFC modules is solved, and efficient reuse and collaborative control of NFC module resources are achieved.

CN117978210BActive Publication Date: 2024-10-18BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211584210.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-09
Publication Date
2024-10-18
Estimated Expiration
2042-12-09

AI Technical Summary

Technical Problem

On terminal devices that support multiple heterogeneous operating systems, how can multiple heterogeneous operating systems share the hardware capabilities of the same NFC module to avoid redundant and inefficient use of hardware resources.

Method used

The first operating system receives the NFC service processing request from the second operating system, determines and calls the hardware abstraction layer interface that matches the NFC service type, controls the NFC module to perform business processing, and returns the processing results to the corresponding operating system to implement Coordinated management and resource reuse of NFC modules.

Benefits of technology

Under the heterogeneous operating system architecture, each operating system can effectively use NFC modules and reuse hardware capabilities, improving the collaborative control effect of NFC business processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117978210B_ABST
    Figure CN117978210B_ABST
Patent Text Reader

Abstract

The present disclosure proposes a method, device, electronic device and storage medium for processing near field communication NFC services, and relates to the technical field of electronic devices. It includes: a first operating system receives an NFC service processing request sent by a first hardware abstraction layer interface in a second operating system, and the NFC service processing request includes an NFC service type and a target identifier corresponding to the second operating system; based on the first hardware abstraction layer interface, determining a target mode for calling a second hardware abstraction layer interface matching the NFC service type under the first operating system; based on the target mode, calling the second hardware abstraction layer interface to control the NFC module to perform NFC service processing; obtaining the NFC service processing result; and sending the NFC service processing result to the first hardware abstraction layer interface under the second operating system. Thus, under a heterogeneous operating system architecture, each operating system can use the hardware capabilities provided by the NFC module in the electronic device, and thus can effectively reuse the hardware capabilities provided by the NFC module in the electronic device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of electronic devices, and in particular to a method, device, electronic device and storage medium for processing near field communication (NFC) services. Background Art

[0002] With the development of the times, various new operating systems continue to emerge. In order to provide users with a more convenient terminal device experience, multiple heterogeneous operating systems can be compatible in the same terminal device. However, on a terminal device that supports multiple heterogeneous operating systems, there will be scenarios where applications on multiple heterogeneous operating systems use the Near Field Communication (NFC) hardware in the terminal device.

[0003] Therefore, how to enable multiple heterogeneous operating systems in terminal devices to use the same NFC module becomes a key research direction. Summary of the invention

[0004] The present disclosure aims to solve one of the technical problems in the related art at least to some extent.

[0005] The first embodiment of the present disclosure provides a method for processing a near field communication (NFC) service, including:

[0006] The first operating system receives an NFC service processing request sent by the first hardware abstraction layer interface in the second operating system, wherein the NFC service processing request includes an NFC service type and a target identifier corresponding to the second operating system;

[0007] Based on the first hardware abstraction layer interface, determine a target mode for calling a second hardware abstraction layer interface matching the NFC service type under the first operating system;

[0008] Based on the target mode, calling the second hardware abstraction layer interface to control the NFC module to perform NFC service processing;

[0009] Get NFC business processing results;

[0010] The NFC service processing result is sent to the first hardware abstraction layer interface under the second operating system corresponding to the target identifier.

[0011] Optionally, determining, based on the first hardware abstraction layer interface, a target mode of calling a second hardware abstraction layer interface matching the NFC service type under the first operating system includes:

[0012] Query a first mapping table corresponding to the target identifier to determine the NFC service under the first operating system associated with the first hardware abstraction layer interface, wherein the first mapping table contains a mapping relationship between each NFC hardware abstraction layer interface in the second operating system and each NFC service in the first operating system.

[0013] The target mode is determined as calling the second hardware abstraction layer interface through the NFC service.

[0014] Optionally, determining, based on the first hardware abstraction layer interface, a target mode of calling a second hardware abstraction layer interface matching the NFC service type under the first operating system includes:

[0015] Querying a second mapping table corresponding to the target identifier to determine the second hardware abstraction layer interface associated with the first hardware abstraction layer interface, wherein the second mapping table contains a mapping relationship between each NFC hardware abstraction layer interface in the second operating system and each NFC hardware abstraction layer interface in the first operating system;

[0016] The target mode is determined to be directly calling the second hardware abstraction layer interface.

[0017] Optionally, also include:

[0018] When it is detected that the electronic device is started, a corresponding identifier is assigned to each second operating system in the electronic device.

[0019] Optionally, also include:

[0020] When it is detected that a new second operating system is deployed in the electronic device, a corresponding identifier is assigned to the new second operating system.

[0021] Optionally, the NFC service type includes at least one of the following:

[0022] Card emulation service, reader / writer service, and point-to-point communication service.

[0023] The second aspect of the present disclosure provides a device for processing a near field communication (NFC) service, including:

[0024] A receiving module, configured to receive, by the first operating system, an NFC service processing request sent by the first hardware abstraction layer interface in the second operating system, wherein the NFC service processing request includes an NFC service type and a target identifier corresponding to the second operating system;

[0025] a determination module, configured to determine, based on the first hardware abstraction layer interface, a target mode for calling a second hardware abstraction layer interface matching the NFC service type under the first operating system;

[0026] A control module, configured to call the second hardware abstraction layer interface based on the target mode to control the NFC module to perform NFC service processing;

[0027] The acquisition module is used to obtain the NFC service processing results;

[0028] A sending module is used to send the NFC service processing result to the first hardware abstraction layer interface under the second operating system corresponding to the target identifier.

[0029] Optionally, the determining module is specifically used to:

[0030] Query a first mapping table corresponding to the target identifier to determine the NFC service under the first operating system associated with the first hardware abstraction layer interface, wherein the first mapping table contains a mapping relationship between each NFC hardware abstraction layer interface in the second operating system and each NFC service in the first operating system.

[0031] The target mode is determined as calling the second hardware abstraction layer interface through the NFC service.

[0032] Optionally, the determining module is specifically used to:

[0033] Querying a second mapping table corresponding to the target identifier to determine the second hardware abstraction layer interface associated with the first hardware abstraction layer interface, wherein the second mapping table contains a mapping relationship between each NFC hardware abstraction layer interface in the second operating system and each NFC hardware abstraction layer interface in the first operating system;

[0034] The target mode is determined to be directly calling the second hardware abstraction layer interface.

[0035] Optionally, also include:

[0036] The first allocation module is used to allocate a corresponding identifier to each second operating system in the electronic device when it is detected that the electronic device is started.

[0037] Optionally, also include:

[0038] The second allocation module is configured to allocate a corresponding identifier to the new second operating system upon detecting that a new second operating system is deployed in the electronic device.

[0039] Optionally, the NFC service type includes at least one of the following:

[0040] Card emulation service, reader / writer service, and point-to-point communication service.

[0041] The third aspect embodiment of the present disclosure proposes an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the method for processing near field communication (NFC) services proposed in the first aspect embodiment of the present disclosure.

[0042] The fourth aspect embodiment of the present disclosure proposes a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the method for processing the near field communication NFC service proposed in the first aspect embodiment of the present disclosure is implemented.

[0043] The fifth aspect of the present disclosure provides a computer program product, including a computer program. When the computer program is executed by a processor, the computer program implements the steps of the method for processing near field communication (NFC) services as provided in the first aspect of the present disclosure.

[0044] The present disclosure provides a method, device, electronic device and storage medium for processing near field communication (NFC) services, which include the following:

[0045] Beneficial effects:

[0046] In the disclosed embodiment, the first operating system receives an NFC service processing request sent by the first hardware abstraction layer interface in the second operating system, wherein the NFC service processing request includes the NFC service type and the target identifier corresponding to the second operating system, and then determines the target mode of calling the second hardware abstraction layer interface matching the NFC service type under the first operating system based on the first hardware abstraction layer interface, and based on the target mode, calls the second hardware abstraction layer interface to control the NFC module to perform NFC service processing, thereby obtaining the NFC service processing result; and sends the NFC service processing result to the first hardware abstraction layer interface under the second operating system corresponding to the target identifier. Thus, under the heterogeneous operating system architecture, the first operating system coordinates the NFC service processing request sent by each operating system, so that not only each operating system can use the hardware capabilities provided by the NFC module in the electronic device, but also the hardware capabilities provided by the NFC module in the electronic device can be effectively reused.

[0047] Additional aspects and advantages of the present disclosure will be given in part in the following description and in part will be obvious from the following description or learned through practice of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The above and / or additional aspects and advantages of the present disclosure will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0049] Figure 1A schematic diagram of a process of a near field communication (NFC) service processing method provided by an embodiment of the present disclosure;

[0050] Figure 2 A schematic diagram of a process of a near field communication (NFC) service processing method provided by another embodiment of the present disclosure;

[0051] Figure 3 A schematic diagram of a process of a near field communication (NFC) service processing method provided by another embodiment of the present disclosure;

[0052] Figure 4 A schematic diagram of the structure of a device for processing near field communication (NFC) services provided by another embodiment of the present disclosure;

[0053] Figure 5 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0054] Embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.

[0055] In the description of the embodiments of the present disclosure, the term "first operating system" refers to an operating system that serves as a master control in a heterogeneous operating system.

[0056] In the description of the embodiments of the present disclosure, the term "second operating system" refers to an operating system that serves as a slave in a heterogeneous operating system.

[0057] In the description of the embodiments of the present disclosure, the term "NFC service processing request" refers to a request sent by the second operating system to the first operating system, for calling a second hardware abstraction layer interface under the first operating system that matches the NFC service type contained in the NFC service processing request, so that the NFC module processes the NFC service under the second operating system.

[0058] In the description of the embodiments of the present disclosure, the term "NFC service" refers to a service provided in the first operating system to the application deployed thereon, which matches the NFC service type included in the NFC service processing request.

[0059] In the description of the embodiments of the present disclosure, the term "hardware abstraction layer" refers to an interface layer between the operating system kernel and the hardware circuit, and its purpose is to abstract the hardware. It hides the hardware interface details of a specific platform and provides a virtual hardware platform for the operating system, making it hardware-independent and portable on multiple platforms.

[0060] In the description of the embodiments of the present disclosure, the term "first hardware abstraction layer interface" refers to an interface provided in the hardware abstraction layer of the second operating system that matches the NFC service type and controls the NFC module. For example, if the NFC service type is an NFC entry service, the corresponding first target abstraction layer interface may be an interface that can control the NFC module to perform NFC entry-related services. However, since the second operating system runs in the first operating system, there is no NFC module that can provide NFC functionality under the first hardware abstraction layer interface.

[0061] In the description of the embodiments of the present disclosure, the term "second hardware abstraction layer interface" refers to an interface provided in the hardware abstraction layer of the first operating system that matches the NFC service type and controls the NFC module. For example, if the NFC service type is the NFC entry service, the corresponding second target abstraction layer interface may be an interface that can control the NFC module to perform services related to NFC entry.

[0062] The following describes a method, device, electronic device, and storage medium for processing a near field communication (NFC) service according to an embodiment of the present disclosure with reference to the accompanying drawings.

[0063] Figure 1 A schematic diagram of a process of a near field communication (NFC) service provided in an embodiment of the present disclosure.

[0064] The embodiment of the present disclosure takes the method for processing the near field communication NFC service as an example in which the method is configured in a near field communication NFC service processing device. The near field communication NFC service processing device can be applied to any electronic device so that the electronic device can perform the near field communication NFC service processing function.

[0065] An electronic device is a device that sends data to other devices or receives data from other devices via communication facilities. That is to say, the electronic device can be, for example, an electronic device, a computer device, etc. that can establish a network communication connection, and there is no limitation on this.

[0066] The electronic device in the embodiment of the present disclosure includes a heterogeneous operating system. For example, it may include a first operating system as a main operating system, and at least one second operating system as a slave operating system running in the first operating system. For example, a virtual machine may be configured in the first operating system, and the second operating system may run in the virtual machine. The first operating system and the second operating system are heterogeneous operating systems. The number of the second operating systems may be one or more. Some applications may run in each second operating system. The second operating system may cooperate with the first operating system to reuse the capabilities provided by the NFC module of the electronic device.

[0067] like Figure 1 As shown, the method for processing the near field communication NFC service may include the following steps:

[0068] Step 101: A first operating system receives an NFC service processing request sent by a first hardware abstraction layer interface in a second operating system, wherein the NFC service processing request includes an NFC service type and a target identifier corresponding to the second operating system.

[0069] Among them, the NFC business processing request refers to the second operating system dynamically monitoring NFC-related events (for example, if it is monitored that a certain application triggers card reading and writing, card emulation, etc., it can be determined that an NFC-related event is monitored), and then it can be determined that the event requires calling the hardware capabilities provided by the NFC module in the electronic device. The second operating system will send a request to the first operating system for calling the hardware capabilities provided by the NFC module in the electronic device. This request can be called an NFC business processing request.

[0070] It should be noted that, usually, after the NFC module on the electronic device is initialized based on the first operating system, it only provides the first operating system with hardware capabilities related to the NFC module. Therefore, if the application of the second operating system wants to call the hardware capabilities provided by the NFC module in the electronic device to process the NFC service in the second operating system, it needs to first send an NFC service processing request to the first operating system through the first hardware abstraction layer interface, so that the first operating system calls the second hardware abstraction layer interface that matches the NFC service type, thereby providing the application in the second operating system with hardware capabilities related to the NFC module.

[0071] Optionally, the NFC service type includes at least one of the following: a card emulation service, a reader / writer service, and a point-to-point communication service.

[0072] The target identifier may be an identifier of the second operating system that uniquely identifies the sending of the NFC service processing request.

[0073] Optionally, when it is detected that the electronic device is started, a corresponding identifier is assigned to each second operating system in the electronic device. Alternatively, when it is detected that a new second operating system is deployed in the electronic device, a corresponding identifier is assigned to the new second operating system. Thus, when the second operating system sends an NFC service processing request, it can include a corresponding target identifier, so that the first operating system can determine which second operating system sent the NFC service processing request based on the target identifier.

[0074] It should be noted that different second operating systems correspond to different identifiers.

[0075] In the embodiment of the present disclosure, the first operating system may simultaneously receive NFC service processing requests sent by one or more second operating systems, which is not limited in the present disclosure.

[0076] If the first operating system receives an NFC service processing request sent by a second operating system, it can directly respond to and control the NFC service processing request of the second operating system to trigger the hardware capability of calling the positioning component based on the NFC service processing request.

[0077] If the first operating system receives NFC service processing requests sent by multiple second operating systems at the same time, some strategies can be used to collaboratively respond to and control the NFC service processing requests sent by different second operating systems. For example, a suitable response control strategy can be determined based on whether the second operating system currently displays an application interface (i.e., the interface of the application that triggers the NFC service) to collaboratively control the NFC service processing requests of multiple heterogeneous operating systems.

[0078] For example, it is also possible to perform time-sharing response control on multiple NFC business processing requests, so that applications in different second operating systems can use the hardware capabilities of the NFC module in a time-sharing manner, or it is also possible to determine whether to respond to the NFC business processing request or not, or it is also possible to determine whether to delay the response to the NFC business processing request, without any restriction.

[0079] Therefore, in the embodiments of the present disclosure, it supports flexible determination of an appropriate response control strategy for NFC business processing requests, so that under a heterogeneous operating system architecture, if multiple second operating systems send NFC business processing requests at the same time, effective collaborative control of NFC business processing requests of different second operating systems can be achieved, so as to effectively improve the collaborative control effect of NFC business processing requests sent by different second operating systems under the heterogeneous operating system architecture.

[0080] Step 102: Based on the first hardware abstraction layer interface, determine a target mode for calling a second hardware abstraction layer interface matching the NFC service type under the first operating system.

[0081] It should be noted that the various capabilities provided by the NFC module are provided through different interfaces in the hardware abstraction layer in the first operating system after initialization. Therefore, after receiving the NFC service processing request sent by the first hardware abstraction layer interface of the second operating system, the first operating system needs to determine the second hardware abstraction layer interface that matches the NFC service type contained in the NFC service processing request based on the first hardware abstraction layer interface, so as to accurately process different NFC services.

[0082] In some embodiments of the present disclosure, the target method of calling the second hardware abstraction layer interface may include at least one of the following: the first hardware abstraction layer interface may directly call the second hardware abstraction layer interface; the first hardware abstraction layer interface calls the second hardware abstraction layer interface through the NFC service matching the NFC business type under the first operating system. The present disclosure does not limit this.

[0083] Step 103: Based on the target mode, call the second hardware abstraction layer interface to control the NFC module to perform NFC service processing.

[0084] In the embodiment of the present disclosure, after determining the target mode for calling the target abstract layer interface, the target hardware abstract layer interface can be called based on the target mode to control the NFC module to process the NFC service included in the NFC service processing request.

[0085] Step 104: Obtain NFC service processing results.

[0086] In the embodiments of the present disclosure, different NFC service types correspond to different NFC service processing results. For example, the NFC service processing result corresponding to the point-to-point communication service can be communication success or communication failure. The NFC service processing result corresponding to the card emulation service can be card reading and writing success or card reading and writing failure. The present disclosure does not limit this.

[0087] Step 105: Send the NFC service processing result to the first hardware abstraction layer interface under the second operating system corresponding to the target identifier.

[0088] In the embodiment of the present disclosure, after the NFC service processing result is determined, since the NFC service processing request includes a target identifier corresponding to the second operating system that sends the NFC service processing request, the NFC service processing result can be accurately sent to the corresponding second operating system.

[0089] In the disclosed embodiment, the first operating system receives an NFC service processing request sent by the first hardware abstraction layer interface in the second operating system, wherein the NFC service processing request includes the NFC service type and the target identifier corresponding to the second operating system, and then determines the target mode of calling the second hardware abstraction layer interface matching the NFC service type under the first operating system based on the first hardware abstraction layer interface, and based on the target mode, calls the second hardware abstraction layer interface to control the NFC module to perform NFC service processing, thereby obtaining the NFC service processing result; and sends the NFC service processing result to the first hardware abstraction layer interface under the second operating system corresponding to the target identifier. Thus, under the heterogeneous operating system architecture, the first operating system coordinates the NFC service processing request sent by each operating system, so that not only each operating system can use the hardware capabilities provided by the NFC module in the electronic device, but also the hardware capabilities provided by the NFC module in the electronic device can be effectively reused.

[0090] Figure 2 A flowchart of a method for processing a near field communication (NFC) service provided by an embodiment of the present disclosure is shown as follows: Figure 2 As shown, the method for processing the near field communication NFC service may include the following steps:

[0091] Step 201: The first operating system receives an NFC service processing request sent by a first hardware abstraction layer interface in a second operating system, wherein the NFC service processing request includes an NFC service type and a target identifier corresponding to the second operating system.

[0092] Step 202: query a first mapping table corresponding to the target identifier to determine an NFC service under the first operating system associated with the first hardware abstraction layer interface, wherein the first mapping table contains a mapping relationship between each NFC hardware abstraction layer interface in the second operating system and each NFC service in the first operating system.

[0093] The first mapping table may be generated in advance by the first operating system for each second operating system and stored in the first operating system.

[0094] Optionally, when the second operating system is first deployed in the first operating system, a mapping relationship can be established between the hardware abstraction layer interface corresponding to each NFC business type in the second operating system and the NFC service corresponding to each NFC business type in the first operating system, thereby generating a first mapping table. Thus, after the first operating system receives an NFC business processing request sent by the first hardware abstraction layer interface in the second operating system, the NFC service corresponding to the first hardware abstraction layer interface can be determined by querying the first mapping table, thereby calling the second hardware abstraction interface through the NFC service.

[0095] For example, the hardware abstraction layer interface corresponding to the card emulation service under the second operating system is connected to the card emulation service under the first operating system. Therefore, after receiving the NFC service processing request sent by the hardware abstraction layer interface corresponding to the card emulation service in the second operating system, the first operating system sends the NFC service processing request to the card emulation service under the first operating system, and the card emulation service under the first operating system calls the hardware abstraction layer interface corresponding to the card emulation service under the first operating system, thereby controlling the NFC module to process the card emulation service of the second operating system.

[0096] Step 203: Determine the target mode as calling the second hardware abstraction layer interface through the NFC service.

[0097] Step 204: Based on the target mode, call the second hardware abstraction layer interface to control the NFC module to perform NFC service processing.

[0098] Step 205: Obtain NFC service processing results.

[0099] Step 206: Send the NFC service processing result to the first hardware abstraction layer interface under the second operating system corresponding to the target identifier.

[0100] The specific implementation forms of steps 203 to 206 may refer to the detailed descriptions in other embodiments of the present disclosure and will not be described in detail here.

[0101] In the disclosed embodiment, the first operating system receives an NFC service processing request sent by the first hardware abstraction layer interface in the second operating system, wherein the NFC service processing request includes the NFC service type and the target identifier corresponding to the second operating system, then queries the first mapping table corresponding to the target identifier, determines the NFC service under the first operating system associated with the first hardware abstraction layer interface, and then determines the target mode to call the second hardware abstraction layer interface through the NFC service, then based on the target mode, calls the second hardware abstraction layer interface to control the NFC module to perform NFC service processing, and finally obtains the NFC service processing result; and sends the NFC service processing result to the first hardware abstraction layer interface under the second operating system corresponding to the target identifier. Thus, under the heterogeneous operating system architecture, when the first operating system receives the NFC service processing request from the second operating system, based on the first mapping table corresponding to the target identifier of the second operating system, calls the corresponding second hardware abstraction layer interface, so that the NFC module can be accurately called to process the NFC service, so that the NFC hardware capability can be accurately provided to the application in each operating system, thereby effectively reusing the hardware capability provided by the NFC module in the electronic device.

[0102] Figure 3A flowchart of a method for processing a near field communication (NFC) service provided by an embodiment of the present disclosure is shown as follows: Figure 3 As shown, the method for processing the near field communication NFC service may include the following steps:

[0103] Step 301: The first operating system receives an NFC service processing request sent by a first hardware abstraction layer interface in a second operating system, wherein the NFC service processing request includes an NFC service type and a target identifier corresponding to the second operating system.

[0104] Step 302: query a second mapping table corresponding to the target identifier to determine a second hardware abstraction layer interface associated with the first hardware abstraction layer interface, wherein the second mapping table contains a mapping relationship between each NFC hardware abstraction layer interface in the second operating system and each NFC hardware abstraction layer interface in the first operating system.

[0105] The second mapping table may be pre-generated by the first operating system for each second operating system and stored in the first operating system.

[0106] Optionally, when the second operating system is first deployed in the first operating system, a mapping relationship can be established between the hardware abstraction layer interface corresponding to each NFC service type in the second operating system and the hardware abstraction layer interface corresponding to each NFC service type in the first operating system, thereby generating a first mapping table. Thus, after the first operating system receives an NFC service processing request sent by the first hardware abstraction layer interface in the second operating system, the second hardware abstraction interface corresponding to the first hardware abstraction layer interface can be determined by querying the second mapping table, thereby determining that the target method is to directly call the second hardware abstraction layer interface.

[0107] For example, the first hardware abstraction layer interface corresponding to the card emulation service under the second operating system is connected to the second hardware abstraction layer interface corresponding to the card emulation service under the first operating system. Therefore, after receiving the NFC service processing request sent by the second hardware abstraction layer interface corresponding to the card emulation service in the second operating system, the first operating system can directly call the second hardware abstraction layer interface corresponding to the card emulation service under the first operating system, thereby controlling the NFC module to process the card emulation service of the second operating system.

[0108] Step 303: determine that the target mode is to directly call the second hardware abstraction layer interface.

[0109] Step 304: Based on the target mode, call the second hardware abstraction layer interface to control the NFC module to perform NFC service processing.

[0110] Step 305: Obtain NFC service processing results.

[0111] Step 306: Send the NFC service processing result to the first hardware abstraction layer interface under the second operating system corresponding to the target identifier.

[0112] The specific implementation forms of steps 304 to 306 may refer to the detailed descriptions in other embodiments of the present disclosure and will not be described in detail here.

[0113] In the disclosed embodiment, the first operating system receives an NFC service processing request sent by the first hardware abstraction layer interface in the second operating system, wherein the NFC service processing request includes the NFC service type and the target identifier corresponding to the second operating system, then queries the second mapping table corresponding to the target identifier, determines the second hardware abstraction layer interface associated with the first hardware abstraction layer interface, and then determines the target mode to directly call the second hardware abstraction layer interface, then based on the target mode, calls the second hardware abstraction layer interface to control the NFC module to perform NFC service processing, and finally obtains the NFC service processing result; and sends the NFC service processing result to the first hardware abstraction layer interface under the second operating system corresponding to the target identifier. Thus, under the heterogeneous operating system architecture, when the first operating system receives the NFC service processing request from the second operating system, based on the second mapping table corresponding to the target identifier of the second operating system, directly calls the corresponding second hardware abstraction layer interface, so that the NFC module can be quickly and accurately called to process the NFC service, and the application programs in multiple heterogeneous operating systems use the NFC hardware capabilities, thereby effectively reusing the hardware capabilities provided by the NFC module in the electronic device.

[0114] In order to implement the above embodiment, the present disclosure also proposes a device for processing a near field communication (NFC) service.

[0115] Figure 4 A schematic diagram of the structure of a device for processing near field communication (NFC) services provided in an embodiment of the present disclosure.

[0116] like Figure 4 As shown, the near field communication NFC service processing device 400 may include:

[0117] The receiving module 410 is used for the first operating system to receive the NFC service processing request sent by the first hardware abstraction layer interface in the second operating system, wherein the NFC service processing request includes the NFC service type and the target identifier corresponding to the second operating system;

[0118] A determination module 420 is used to determine a target mode of calling a second hardware abstraction layer interface matching the NFC service type under the first operating system based on the first hardware abstraction layer interface;

[0119] The control module 430 is used to call the second hardware abstraction layer interface based on the target mode to control the NFC module to perform NFC service processing;

[0120] The acquisition module 440 is used to obtain the NFC service processing result;

[0121] The sending module 450 is used to send the NFC service processing result to the first hardware abstraction layer interface under the second operating system corresponding to the target identifier.

[0122] Optionally, the determination module 420 is specifically configured to:

[0123] Query a first mapping table corresponding to the target identifier to determine an NFC service under the first operating system associated with the first hardware abstraction layer interface, wherein the first mapping table includes a mapping relationship between each NFC hardware abstraction layer interface in the second operating system and each NFC service in the first operating system.

[0124] The target method is to call the second hardware abstraction layer interface through the NFC service.

[0125] Optionally, the determination module 420 is specifically configured to:

[0126] Querying a second mapping table corresponding to the target identifier to determine a second hardware abstraction layer interface associated with the first hardware abstraction layer interface, wherein the second mapping table includes a mapping relationship between each NFC hardware abstraction layer interface in the second operating system and each NFC hardware abstraction layer interface in the first operating system;

[0127] The target mode is determined to be directly calling the second hardware abstraction layer interface.

[0128] Optionally, also include:

[0129] The first allocation module is used to allocate a corresponding identifier to each second operating system in the electronic device when it is detected that the electronic device is started.

[0130] Optionally, also include:

[0131] The second allocation module is used to allocate a corresponding identifier to the new second operating system upon detecting that a new second operating system is deployed in the electronic device.

[0132] Optionally, the NFC service type includes at least one of the following:

[0133] Card emulation service, reader / writer service, and point-to-point communication service.

[0134] The functions and specific implementation principles of the above modules in the embodiments of the present disclosure can be referred to the above method embodiments, and will not be repeated here.

[0135] The processing device of the near field communication NFC service of the embodiment of the present disclosure first receives the NFC service processing request sent by the first hardware abstraction layer interface in the second operating system by the first operating system, wherein the NFC service processing request includes the NFC service type and the target identifier corresponding to the second operating system, and then determines the target mode of calling the second hardware abstraction layer interface matching the NFC service type under the first operating system based on the first hardware abstraction layer interface, and based on the target mode, calls the second hardware abstraction layer interface to control the NFC module to perform NFC service processing, and then obtains the NFC service processing result; and sends the NFC service processing result to the first hardware abstraction layer interface under the second operating system corresponding to the target identifier. Thus, under the heterogeneous operating system architecture, the first operating system coordinates the processing of the NFC service processing request sent by each operating system, so that not only each operating system can use the hardware capabilities provided by the NFC module in the electronic device, but also the hardware capabilities provided by the NFC module in the electronic device can be effectively reused.

[0136] In order to implement the above embodiments, the present disclosure further proposes an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the method for processing near field communication (NFC) services proposed in the above embodiments of the present disclosure.

[0137] In order to implement the above embodiments, the present disclosure further proposes a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the method for processing the near field communication NFC service proposed in the above embodiments of the present disclosure is implemented.

[0138] In order to implement the above embodiments, the present disclosure further proposes a computer program product, including a computer program, which, when executed by a processor, implements the steps of the method for processing near field communication (NFC) services proposed in the above embodiments of the present disclosure.

[0139] Figure 5 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown. Figure 5 The electronic device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0140] like Figure 5 As shown, the electronic device 12 is in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).

[0141] The bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnection (PCI) bus.

[0142] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.

[0143] The memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5 not shown, usually called a "hard drive"). Although Figure 5 Not shown in the figure, a disk drive for reading and writing a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing a removable non-volatile optical disk (e.g., a compact disc read only memory (CD-ROM), a digital versatile disc read only memory (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the various embodiments of the present disclosure.

[0144] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described in the present disclosure.

[0145] The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 12, and / or may communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the electronic device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0146] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the methods mentioned in the above embodiments.

[0147] The technical solution disclosed in the present invention is that the first operating system receives the NFC service processing request sent by the first hardware abstraction layer interface in the second operating system, wherein the NFC service processing request includes the NFC service type and the target identifier corresponding to the second operating system, and then based on the first hardware abstraction layer interface, determines the target mode of calling the second hardware abstraction layer interface matching the NFC service type under the first operating system, and based on the target mode, calls the second hardware abstraction layer interface to control the NFC module to perform NFC service processing, and then obtains the NFC service processing result; and sends the NFC service processing result to the first hardware abstraction layer interface under the second operating system corresponding to the target identifier. Thus, under the heterogeneous operating system architecture, the first operating system coordinates the NFC service processing request sent by each operating system, so that not only each operating system can use the hardware capabilities provided by the NFC module in the electronic device, but also the hardware capabilities provided by the NFC module in the electronic device can be effectively reused.

[0148] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0149] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, "plurality" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0150] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present disclosure includes additional implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present disclosure belong.

[0151] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0152] It should be understood that the various parts of the present disclosure can be implemented in hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0153] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0154] In addition, each functional unit in each embodiment of the present disclosure may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0155] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present disclosure have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations of the present disclosure. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present disclosure.

Claims

1. A method for processing a near field communication (NFC) service, characterized in that: include: The first operating system receives an NFC service processing request sent by the first hardware abstraction layer interface in the second operating system, wherein the NFC service processing request includes an NFC service type and a target identifier corresponding to the second operating system; Based on the first hardware abstraction layer interface, determine a target mode for calling a second hardware abstraction layer interface matching the NFC service type under the first operating system; Based on the target mode, calling the second hardware abstraction layer interface to control the NFC module to perform NFC service processing; Get NFC business processing results; Sending the NFC service processing result to the first hardware abstraction layer interface under the second operating system corresponding to the target identifier; The determining, based on the first hardware abstraction layer interface, of a target mode for calling a second hardware abstraction layer interface matching the NFC service type under the first operating system includes: Querying a first mapping table corresponding to the target identifier to determine an NFC service under the first operating system associated with the first hardware abstraction layer interface, wherein the first mapping table contains a mapping relationship between each NFC hardware abstraction layer interface in the second operating system and each NFC service in the first operating system; determining the target mode is to call the second hardware abstraction layer interface through the NFC service; Alternatively, query a second mapping table corresponding to the target identifier to determine the second hardware abstraction layer interface associated with the first hardware abstraction layer interface, wherein the second mapping table contains a mapping relationship between each NFC hardware abstraction layer interface in the second operating system and each NFC hardware abstraction layer interface in the first operating system; determine that the target mode is to directly call the second hardware abstraction layer interface.

2. The method according to claim 1, characterized in that: Also includes: When it is detected that the electronic device is started, a corresponding identifier is assigned to each second operating system in the electronic device.

3. The method according to claim 1, characterized in that Also includes: When it is detected that a new second operating system is deployed in the electronic device, a corresponding identifier is allocated to the new second operating system.

4. The method according to any one of claims 1 to 3, characterized in that: The NFC service type includes at least one of the following: Card emulation service, reader / writer service, and point-to-point communication service.

5. A device for processing near field communication (NFC) services, characterized in that: include: A receiving module, configured to receive, by the first operating system, an NFC service processing request sent by the first hardware abstraction layer interface in the second operating system, wherein the NFC service processing request includes an NFC service type and a target identifier corresponding to the second operating system; a determination module, configured to determine, based on the first hardware abstraction layer interface, a target mode for calling a second hardware abstraction layer interface matching the NFC service type under the first operating system; A control module, configured to call the second hardware abstraction layer interface based on the target mode to control the NFC module to perform NFC service processing; The acquisition module is used to obtain the NFC service processing results; A sending module, used to send the NFC service processing result to the first hardware abstraction layer interface under the second operating system corresponding to the target identifier; The determining module is used to: Querying a first mapping table corresponding to the target identifier to determine an NFC service under the first operating system associated with the first hardware abstraction layer interface, wherein the first mapping table contains a mapping relationship between each NFC hardware abstraction layer interface in the second operating system and each NFC service in the first operating system; determining the target mode is to call the second hardware abstraction layer interface through the NFC service; Alternatively, query a second mapping table corresponding to the target identifier to determine the second hardware abstraction layer interface associated with the first hardware abstraction layer interface, wherein the second mapping table contains a mapping relationship between each NFC hardware abstraction layer interface in the second operating system and each NFC hardware abstraction layer interface in the first operating system; determine that the target mode is to directly call the second hardware abstraction layer interface.

6. The device according to claim 5, characterized in that Also includes: The first allocation module is used to allocate a corresponding identifier to each second operating system in the electronic device when it is detected that the electronic device is started.

7. The device according to claim 5, characterized in that Also includes: The second allocation module is used to allocate a corresponding identifier to the new second operating system when it is detected that a new second operating system is deployed in the electronic device.

8. The device according to any one of claims 5 to 7, characterized in that: The NFC service type includes at least one of the following: Card emulation service, reader / writer service, and point-to-point communication service.

9. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the program, the method for processing the near field communication (NFC) service as claimed in any one of claims 1 to 4 is implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for processing a near field communication (NFC) service as claimed in any one of claims 1 to 4 is implemented.

11. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the steps of the method for processing a near field communication (NFC) service as claimed in any one of claims 1 to 4.

Citation Information

Patent Citations

  • NFC data interaction method and device, electronic equipment, and storage medium

    CN113626224A

  • NFC data transmission method and device, electronic equipment and storage medium

    CN113840271A