CN116361865B - Access method and electronic equipment - Google Patents

Access method and electronic equipment Download PDF

Info

Publication number
CN116361865B
CN116361865B CN202310190442.6A CN202310190442A CN116361865B CN 116361865 B CN116361865 B CN 116361865B CN 202310190442 A CN202310190442 A CN 202310190442A CN 116361865 B CN116361865 B CN 116361865B
Authority
CN
China
Prior art keywords
security
chip
channel
target program
application
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310190442.6A
Other languages
Chinese (zh)
Other versions
CN116361865A (en
Inventor
穆鹏成
孟宇
王志明
郭鹏宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202310190442.6A priority Critical patent/CN116361865B/en
Publication of CN116361865A publication Critical patent/CN116361865A/en
Application granted granted Critical
Publication of CN116361865B publication Critical patent/CN116361865B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/71Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Telephone Function (AREA)

Abstract

The application discloses an access method and electronic equipment, relates to the field of terminals, and is used for avoiding that a security chip is in an idle state for a long time in the process of accessing the security chip by occupying a channel, so that the power consumption of the electronic equipment is reduced. The method is applied to electronic equipment comprising a security chip, an NFC chip and a target program, wherein the target program accesses the security chip by occupying a channel. The method comprises the following steps: determining whether the security chip is in an idle state according to the times of receiving target information sent by the NFC chip in a preset time period, wherein the target information is used for indicating that the security chip is in the idle state; if the security chip is in the non-standby state, determining whether the target program is in an abnormal state and determining whether the target program occupies a channel; if the target program is determined to be in an abnormal state and the target program is determined to occupy the channel, the target program is restored to a normal state, and the target program in the normal state is used for releasing the channel.

Description

Access method and electronic equipment
Technical Field
The present application relates to the field of terminals, and in particular, to an access method and an electronic device.
Background
When using the near field communication (near field communication, NFC) functionality of the electronic device, applications related to the near field communication functionality, or near field communication services, may access a Secure Element (SE) by creating a secure element service-occupied channel. After the access is completed, the release channel is serviced through the secure element.
If after occupying the channel, the application freezes or the secure element service is killed, the channel cannot be released, so that the secure chip is in an unreliated state. If the security chip is in an unreliated state for a long period of time, power consumption of the electronic device may be increased.
Disclosure of Invention
The application provides an access method and electronic equipment, which are used for avoiding the security chip from being in an idle state for a long time in the process of accessing the security chip by occupying a channel, so that the power consumption of the electronic equipment is reduced.
In order to achieve the above purpose, the present application adopts the following technical scheme:
in a first aspect, an access method is provided, applied to an electronic device, where the electronic device includes a security chip, an NFC chip, and a target program, and the target program accesses the security chip by occupying a channel; the method comprises the following steps: determining whether the security chip is in an idle state according to the times of receiving target information sent by the NFC chip in a preset time period, wherein the target information is used for indicating that the security chip is in the idle state; if the security chip is in the non-standby state, determining whether the target program is in an abnormal state and determining whether the target program occupies a channel; if the target program is determined to be in an abnormal state and the target program is determined to occupy the channel, the target program is restored to a normal state, and the target program in the normal state is used for releasing the channel.
By adopting the access method provided by the application, the standby state of the security chip is monitored by counting the times of the security chip in the non-standby state of the security chip sent by the NFC chip in the process that the security chip is accessed by the target program through the occupied channel. Once the safety chip is monitored to be in the non-standby state, the reason that the safety chip is in the non-standby state is determined, so that the problem that the safety chip is in the non-standby state is solved. If the target program is abnormal after occupying the channel, and the security chip is in an unreliated state, the target program is restored to a normal state. The target program restored to the normal state can be used to release the channel, thereby enabling the security chip to be in a standby state and further reducing the power consumption of the electronic device.
In one possible implementation, the target program is a security application. The target program being in an abnormal state includes the secure application being frozen. Restoring the target program to a normal state is thawing the secure application.
After the security application is frozen, the security application does not occupy CPU resources and only occupies memory resources. This results in the security application not being able to perform the operation of releasing the channel. The thawed security application can continue to pass through the security unit service release channel, so that the security chip is in a standby state, and the power consumption of the electronic equipment is reduced.
In a possible implementation manner, the electronic device further comprises a management service, and the management service is used for storing current state information of the security application. If the current state information of the security application is queried in the management service to be in a frozen state, determining that the security application is frozen.
The management service is used to store current state information of an application in the electronic device, and also used to switch the current state of the application by updating the current state information of the application, thereby freezing the application, or thawing the application.
In one possible implementation, the above-mentioned object program serves the security element. The target program being in an abnormal state includes the secure element service being killed. Restoring the target program to a normal state serves the recreating of the secure element.
The security element service is killed after occupying the channel, which directly results in the channel not being released. At this time, the security element service may be recreated.
In one possible implementation, if the secure element service is not found in memory, it is determined that the secure element service is killed.
The created service is typically stored in memory. If the secure element service is not found in memory after the secure element service is created and before the secure element service is not turned off, it may be indicated that the secure element service is killed.
In one possible implementation, if a value of a BIT (BIT) for identifying a channel is queried in a system attribute of the electronic device as a target preset value, determining that the target program occupies the channel.
In a second aspect, there is provided an electronic device comprising a processor, a memory, an NFC chip and a secure chip, the memory storing instructions which, when executed by the processor, perform a method according to the first aspect and any of its embodiments, the NFC chip being in communication with the secure chip.
In a third aspect, there is provided a computer readable storage medium comprising instructions which, when run on an electronic device, cause the electronic device to perform the method of the first aspect and any implementation thereof.
In a fourth aspect, there is provided a computer program product comprising instructions which, when run on an electronic device as described above, cause the electronic device to perform the method of the first aspect and any of its embodiments.
In a fifth aspect, a chip system is provided, the chip system comprising a processor for supporting an electronic device to implement the functions referred to in the first aspect above. In one possible design, the electronic device may further include interface circuitry that may be used to receive signals from other devices (e.g., memory) or to send signals to other devices (e.g., a communication interface). The system-on-chip may include a chip, and may also include other discrete devices.
The technical effects of the second to fifth aspects are referred to the technical effects of the first aspect and any of its embodiments and are not repeated here.
Drawings
Fig. 1 is a schematic flow chart of a security application accessing a security chip according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 3 is a schematic diagram of a software architecture of an electronic device according to an embodiment of the present application;
fig. 4 is a flow chart of an access method according to an embodiment of the present application;
fig. 5 is a schematic diagram of interface display when switching security applications according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a chip system according to an embodiment of the present application.
Detailed Description
The terms "first," "second," and the like in the embodiments of the present application are used for the purpose of distinguishing between similar features and not necessarily for the purpose of indicating a relative importance, quantity, order, or the like.
The terms "exemplary" or "such as" and the like, as used in connection with embodiments of the present application, are intended to be exemplary, or descriptive. Any embodiment or design described herein as "exemplary" or "for example" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
The terms "coupled" and "connected" in connection with embodiments of the present application are to be construed broadly, and may refer, for example, to a physical direct connection, or to an indirect connection via electronic devices, such as, for example, a connection via electrical resistance, inductance, capacitance, or other electronic devices.
Some concepts related to the present application will be described first.
Near field communication (near field communication, NFC) is a contactless identification and interconnection technology. The electronic equipment with the near field communication function can exchange data under the condition of being close to each other, so that the functions of mobile payment, electronic ticketing, identity recognition and the like are realized.
A Secure Element (SE) for securing data. The security unit may store data of smart cards such as bank cards, traffic cards, access cards, etc. The security element may have a variety of integrated forms in the electronic device, such as an embedded security element (embedded secure element, ESE), also known as an embedded security chip.
The electronic device supporting the NFC function comprises a security chip and an NFC chip. The secure chip is physically connected with the NFC chip, and the secure chip communicates with the outside through the NFC chip. In the process of using the NFC function of the electronic device to perform mobile payment, identity recognition, card simulation, etc., a security application (such as a wallet application, an access card application, etc.) in the electronic device, or an NFC service may access the security chip.
In one scenario, the security application may access the security chip when a smart card (e.g., access card, traffic card, bank card, etc.) is added to the security application of the electronic device, or when a balance of the smart card that has been added to the security application is queried.
In another scenario, the NFC service in the electronic device accesses the secure chip when the electronic device approaches the card swiping device without opening the secure application.
The secure application accesses the secure chip in the same way as the NFC service accesses the secure chip. The general flow of the secure application accessing the secure chip will be described briefly below with reference to fig. 1 by taking the secure application accessing the secure chip as an example.
S101, the security application creates a security element service.
The secure application may create a secure element service for accessing the secure chip by invoking a secure element service (SEService) interface function of the secure element service (secure element service, SEService) class. The security element service includes an interface function to be called in the process of accessing the security chip. For example, the interface function may include: an open channel (open channel) interface function for occupying a channel, an open session (open session) interface function for establishing a session, and the like.
S102, the security application acquires information of the security chip.
The security application may call a secure element service (SEService) class get-security-chip-information (get readers) interface function through the secure element service to obtain information of the secure chip in the electronic device.
S103, the security application establishes a session of the security chip.
The security application may establish a session of the security chip by invoking an open session (open session) interface function for establishing the session in a reader class for reading the character stream through the security element service.
S104, the security application occupies the channel of the session.
The security application may invoke an open channel (open channel) interface function for occupying a channel in a session (session) class for saving user information through a security element service, occupying a channel of the session.
S105, the security application determines whether the channel is successfully occupied.
S106, under the condition that the channel is successfully occupied, the security application sends an application processing data unit (application processing data unit, APDU) instruction to the security chip through the channel.
The content of the APDU instruction is related to the purpose of the security application to access the security chip, i.e. the traffic currently being executed by the security application. For example, the security application accesses the security chip in order to inquire about the balance of a designated smart card added in the security chip, and the APDU command is a command to read the balance of the designated smart card.
Under the condition that the channel occupation fails, the security application may directly execute S110, that is, call a shutdown (shutdown) interface function for closing the security element service (SEService) through the security element service, directly close the security element service, and end the access flow.
S107, the security application receives feedback information sent by the security chip.
After receiving the APDU instruction, the security chip executes corresponding operation according to the APDU instruction, and sends feedback information to the security application according to the execution result. The feedback information is used to indicate whether the security chip successfully executes the APDU instruction.
S108, releasing the channel by the security application.
Whether the feedback information indicates that the security chip successfully executes the APDU command or does not successfully execute the APDU command, after receiving the feedback information, the security application invokes a Channel (Channel) interface function for releasing a Channel in a Channel (Channel) class for functions such as reading, writing, connecting and the like through the security unit service, and releases the Channel.
S109, the security application closes the session.
The security application invokes a close Session interface function for ending the Session in a reader class for reading the character stream through the secure element service, closing the Session.
S110, the security application closes the security unit service.
The security application may call a shutdown (shutdown) interface function of a security element service (service) class through the security element service, close the security element service, and end the access flow.
The process of the security application accessing the security chip can be known that the security application occupies the channel by creating the security unit service, and sends the APDU command related to the access purpose to the security chip through the channel, and after the security chip executes the APDU command, the security application releases the channel through the security unit service. Before the secure application releases the channel, the channel cannot be released if the secure application freezes or the secure element service is killed. Failure of the channel to release can result in the security chip being in an unreliated state. If the security chip is in an unreliated state for a long period of time, power consumption of the electronic device may be increased.
Similarly, the NFC service also accesses the secure chip by creating a secure element service occupying channel, and if the secure element service is killed during the access, the channel cannot be released, which results in that the secure chip cannot stand by, thereby increasing the power consumption of the electronic device.
In order to solve the above problems, the related art is implemented in the following manner:
in the case where the security chip is in an unreliated state due to the security application being frozen after occupying the channel, the user may manually restart the security application to restore the security chip to the standby state. The restarted secure application will recreate the secure element service to release the channel, thereby putting the secure chip in standby. However, if the user does not manually restart the secure application, the secure chip may remain in an unreliated state.
When the security chip is in an idle state due to the fact that the security unit service is killed after occupying the channel, the security unit service can be applied for the keep-alive time when the security unit service occupies the channel, namely, the security unit service is not allowed to be killed within a period of time after the channel is occupied. However, the security element service may be killed before the keep-alive time is applied. That is, this does not ensure that the security element service is not killed.
Based on the above-mentioned problems, the embodiments of the present application provide an access method for automatically monitoring a standby state of a security chip in a process of accessing the security chip through an occupied channel. Once it is monitored that the secure chip may be in an unreliated state, the reason why the secure chip may be in an unreliated state is determined. If the security application is the security application, or the security element service is abnormal after occupying the channel, so that the security chip is in an idle state, the security application is actively restored to a normal state, or the security element service is actively restored to the normal state. The security application restored to the normal state, or the security element service may be used to release the channel, thereby putting the security chip in a standby state, and further reducing the power consumption of the electronic device. That is, the access method provided in the embodiment of the present application is to automatically monitor the standby state of the security chip, and after determining that the security chip is in the non-standby state, actively analyze the reason why the security chip is in the non-standby state, and actively restore the security chip to the standby state. The whole process can be completed in a short time, user intervention is not needed, and the method is more general and more convenient and faster.
The electronic device may be a device with near field communication functionality, and the electronic device may be mobile or stationary. The electronic device may be deployed on land (e.g., indoor or outdoor, hand-held or vehicle-mounted, etc.), on water (e.g., ship, etc.), or in the air (e.g., aircraft, balloon, etc.). The electronic device may be referred to as a User Equipment (UE), an access terminal, a terminal unit, a subscriber unit (subscriber unit), a terminal station, a Mobile Station (MS), a mobile station, a terminal agent, a terminal apparatus, or the like. For example, the electronic device may be a cell phone, tablet computer, notebook computer, etc. The embodiment of the application is not limited to the specific type and structure of the electronic device. One possible configuration of the electronic device is described below.
Taking an electronic device as an example of a mobile phone, fig. 2 illustrates one possible architecture of an electronic device 200. The electronic device 200 may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (universal serial bus, USB) interface 230, a power management module 240, a battery 241, a wireless charging coil 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an ear-piece interface 270D, a sensor module 280, keys 290, a motor 291, an indicator 292, a camera 293, a display 294, a user identification module (subscriber identification module, SIM) card interface 295, a security chip 296, and an NFC chip 297, among others.
The sensor module 280 may include, among other things, a pressure sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.
It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the electronic device 200. In other embodiments of the present application, electronic device 200 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 210 may include one or more processing units such as, for example: the processor 210 may be a field programmable gate array (field programmable gate array, FPGA), an application specific integrated circuit (application specific integrated circuit, ASIC), a system on chip (SoC), a central processing unit (central processing unit, CPU), an application processor (application processor, AP), a network processor (network processor, NP), a digital signal processor (digital signal processor, DSP), a micro control unit (micro controller unit, MCU), a programmable logic device (programmable logic device, PLD), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a baseband processor, and a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors. For example, the processor 210 may be an application processor AP. Alternatively, the processor 210 may be integrated in a system on chip (SoC). Alternatively, the processor 210 may be integrated in an integrated circuit (integrated circuit, IC) chip. The processor 210 may include an Analog Front End (AFE) and a micro-controller unit (MCU) in an IC chip.
The controller may be a neural hub and a command center of the electronic device 200, among others. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 210 for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. The memory may hold instructions or data that the processor 210 has just used or recycled. If the processor 210 needs to reuse the instruction or data, it may be called directly from the memory. Repeated accesses are avoided and the latency of the processor 210 is reduced, thereby improving the efficiency of the system.
In some embodiments, processor 210 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a USB interface, among others.
It should be understood that the connection relationship between the modules illustrated in the embodiment of the present invention is only illustrative, and does not limit the structure of the electronic device 200. In other embodiments of the present application, the electronic device 200 may also use different interfacing manners, or a combination of multiple interfacing manners, as in the above embodiments.
The power management module 240 is configured to receive a charging input from a charger. The charger may be a wireless charger (such as a wireless charging base of the electronic device 200 or other devices capable of wirelessly charging the electronic device 200), or may be a wired charger. For example, the power management module 240 may receive a charging input of a wired charger through the USB interface 230. The power management module 240 may receive wireless charging input through a wireless charging coil 242 of the electronic device.
The power management module 240 may also supply power to the electronic device while charging the battery 241. The power management module 240 receives input from the battery 241 to power the processor 210, the internal memory 221, the external memory interface 220, the display 294, the camera 293, the wireless communication module 260, and the like. The power management module 240 may also be configured to monitor parameters of the battery 241 such as battery capacity, battery cycle times, battery health (leakage, impedance), etc. In other embodiments, the power management module 240 may also be disposed in the processor 210.
The wireless communication function of the electronic device 200 may be implemented by the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 200 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 250 may provide a solution for wireless communication including 2G/3G/4G/5G, etc., applied on the electronic device 200. The wireless communication module 260 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), frequency modulation (frequency modulation, FM), near field communication, infrared (IR), etc., as applied on the electronic device 200. In some embodiments, antenna 1 and mobile communication module 250 of electronic device 200 are coupled, and antenna 2 and wireless communication module 260 are coupled, such that electronic device 200 may communicate with a network and other devices via wireless communication techniques.
The electronic device 200 implements display functions through a GPU, a display screen 294, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 210 may include one or more GPUs that execute program instructions to generate or change display information.
The display 294 is used to display images, videos, and the like. The display 294 includes a display panel. In some embodiments, the electronic device 200 may include 1 or N display screens 294, N being a positive integer greater than 1.
The electronic device 200 may implement a photographing function through an ISP, a camera 293, a video codec, a GPU, a display screen 294, an application processor, and the like. The ISP is used to process the data fed back by the camera 293. In some embodiments, the ISP may be provided in the camera 293. The camera 293 is used to capture still images or video. In some embodiments, the electronic device may include 1 or N cameras 293, N being a positive integer greater than 1. Exemplary cameras of embodiments of the present application include a wide angle camera and a main camera.
The external memory interface 220 may be used to connect external memory cards, such as Micro SanDisk (Micro SD) cards, to enable expansion of the memory capabilities of the electronic device 200. The external memory card communicates with the processor 210 through an external memory interface 220 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
Internal memory 221 may be used to store computer executable program code that includes instructions. The processor 210 executes various functional applications of the electronic device 200 and data processing by executing instructions stored in the internal memory 221. In addition, the internal memory 221 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like.
The memory to which embodiments of the present application relate may be volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The nonvolatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an electrically Erasable EPROM (EEPROM), or a flash memory. The volatile memory may be random access memory (random access memory, RAM) which acts as an external cache. By way of example, and not limitation, many forms of RAM are available, such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous DRAM (SLDRAM), and direct memory bus RAM (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
The electronic device 200 may implement audio functions through an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an ear-headphone interface 270D, an application processor, and the like. Such as music playing, recording, etc.
The audio module 270 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. In some embodiments, the audio module 270 may be disposed in the processor 210, or some functional modules of the audio module 270 may be disposed in the processor 210. Speaker 270A, also referred to as a "horn," is used to convert audio electrical signals into sound signals. A receiver 270B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal. Microphone 270C, also referred to as a "microphone" or "microphone," is used to convert sound signals into electrical signals. The electronic device 200 may be provided with at least one microphone 270C. The earphone interface 270D is for connecting a wired earphone. Earphone interface 270D may be USB interface 230 or a 3.5mm open mobile terminal platform (open mobile terminal platform, OMTP) standard interface, american cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
Keys 290 include a power on key, a volume key, etc. The keys 290 may be mechanical keys. Or may be a touch key. The electronic device 200 may receive key inputs, generating key signal inputs related to user settings and function controls of the electronic device 200. The motor 291 may generate a vibration alert. The motor 291 may be used for incoming call vibration alerting or for touch vibration feedback. The indicator 292 may be an indicator light, which may be used to indicate a state of charge, a change in power, or an indication message, missed call, notification, etc. The SIM card interface 295 is for interfacing with a SIM card. The SIM card may be inserted into the SIM card interface 295 or removed from the SIM card interface 295 to enable contact and separation from the electronic device 200. The electronic device 200 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 295 may support a Nano SIN (Nano SIM) card, micro SIM (Micro SIM) card, SIM card, etc. In some embodiments, the electronic device 200 employs an embedded SIM (eSIM) card, which may be embedded in the electronic device 200 and not separable from the electronic device 200.
The security chip 296 is used for storing data of smart cards such as bank cards, traffic cards, access cards, etc., and protecting data security. The NFC chip 297 has a near field communication function, and supports wireless data transmission between electronic devices. Communication between the security chip 296 and the NFC chip 297 is via an inter-chip proprietary protocol. In one aspect, the security chip 296 may transmit signals with the antenna through the NFC chip 297, read contactless card signals external to the electronic device, and perform data processing. On the other hand, the security chip 296 may communicate with applications or services in the electronic device through the NFC chip 297 and perform data processing. The NFC chip 297 may be integrated with the security chip 296, i.e., the security chip 296 may be an embedded security chip.
The processor 210 executes the access method provided in the embodiment of the present application by executing programs, instructions stored in the internal memory 221. The programs executed by processor 210 may be based on an operating system, e.g. Windows (Windows) operating system, etc. As shown in fig. 3, the program running on processor 210 is based onFor example, programs run by processor 210 are layered by function and may include an application layer, a framework layer, a kernel layer, and a hardware layer.
The application layer may include security applications (e.g., wallet applications, access card applications, etc.) associated with near field communication functions for invoking services in the framework layer (e.g., security element services as referred to below) to access hardware in the hardware layer (e.g., security chips as referred to below).
The framework layer is used to provide system resource services, application programming interfaces (application programming interface, APIs), to secure applications in the application layer. The system resource service may include an NFC service, a secure element service, and the like. The NFC service may be used to invoke a secure element service to access hardware in the hardware layer (secure chips as referred to below); the NFC service is further configured to determine, according to target information reported by hardware (an NFC chip referred to below) in the hardware layer, whether the hardware (a security chip referred to below) in the hardware layer is in an unreliated state; NFC services are also used to restore hardware in a hardware layer (security chip as referred to below) to a standby state when the hardware is in an unreliated state.
The kernel layer includes an Operating System (OS) kernel. The operating system kernel is used for managing the processes, the memory, the driving program, the file system and the network system of the system.
The hardware layer may include an NFC chip and a secure chip, the secure chip in communication with the NFC chip, the NFC chip also in communication with the NFC service in the framework layer. Specifically, once the secure chip is in the non-standby state, the NFC chip may report, to the NFC service, the target information that the secure chip is in the non-standby state.
Specifically, as shown in fig. 4, the access method provided in the embodiment of the present application may include:
s401, the NFC chip sends target information to NFC service.
Before the target program occupies the channel, the security chip is in a standby state; after the target program occupies the channel, the security chip is in an idle state; after the target program releases the channel, the security chip is restored to the standby state. That is, the security chip is always in an unreliated state during a period from the channel occupied by the target program to the channel released by the target program.
After the target program occupies the channel for a period of time (the duration of the period of time is related to the type, the setting and the like of the security chip), if the channel is not released yet, the security chip can send target information that the security chip is not standby to the NFC service through the NFC chip.
S402, the NFC service determines whether the security chip is in an unreliability state according to the times of receiving the target information in a preset time period.
The NFC service may determine whether the secure chip may be in an unreliated state according to whether the number of times the target information is received within a preset period exceeds a threshold.
In one embodiment, if the number of times the NFC service receives the target information within the preset period of time does not exceed the threshold value, the NFC service determines that the secure chip is in a standby state.
The reason why the number of times the NFC service receives the target information within the preset period of time does not exceed the threshold value may be that: the target program is in a normal state, but the target program is still occupying a channel because the process of accessing the secure chip by the target program is not finished, so that the secure chip is in an idle state, and the NFC chip sends target information to the NFC service. When the process of accessing the security chip by the target program is finished, the NFC chip does not send the target information to the NFC service.
In another embodiment, if the number of times the NFC service receives the target information exceeds the threshold value within the preset period of time, the NFC service may determine that the secure chip is in an unreliated state.
S403, if the security chip is in the non-standby state, the NFC service determines whether the target program is in an abnormal state, and determines whether the target program occupies a channel.
The following two reasons may cause the NFC service to determine that the security chip is in an idle state: on the one hand, the target program may be in an abnormal state, and the target program occupies the channel, so that the channel cannot be released. On the other hand, the target program may be in a normal state, but since the process of accessing the secure chip by the target program is not ended within the preset time period, the target program occupies the channel for the preset time period. Therefore, the NFC service needs to determine a specific cause that causes the secure chip to be in the non-standby state after determining that the secure chip is in the non-standby state.
Alternatively, the object program may include at least one of a security element service and a security application.
In one embodiment, the target program may include a secure element service. In accessing the secure chip through the occupied channel, it is first necessary to create a secure element service, then occupy the channel through the secure element service, and release the channel through the secure element service after the access is completed. At this time, the NFC service determining whether the target program is in an abnormal state may be that the NFC service determines whether the secure element service is killed and whether the secure element service occupies a channel. If the secure element service is killed, the operation of releasing the channel cannot be performed, resulting in the channel being occupied all the time.
For example, the NFC service may determine whether the secure element service is killed based on whether the secure element service can be queried in the memory of the electronic device. The created service is typically stored in memory. During the time before the secure element service is not turned off after the secure element service is created, if the secure element service is not found in the memory, it may indicate that the secure element service is killed. Otherwise, the security element is not killed.
In another embodiment, the target program may include a security application. At this time, the NFC service determining whether the target program is in an abnormal state may be that the NFC service determines whether the secure application is frozen. In the process that the security application accesses the security chip, if the security application is frozen, the security application does not occupy CPU resources and only occupies memory resources, so that the operation of releasing the channel cannot be executed. After the secure application is thawed, the secure application may continue to perform operations to release the channel through the secure element service.
For example, the NFC service may determine whether the security application is frozen based on current state information (e.g., frozen state or unfrozen state) of the security application queried in the management service of the electronic device. The management service is used for storing current state information of an application in the electronic device and is also used for switching the current state of the application by updating the current state information of the application.
If the application is switched from the foreground of the electronic device to the background of the electronic device for a longer period of time, the management service updates the current state information of the application to a frozen state, so that the application is frozen. When the management service updates the current state information of the application to a defrosting state, namely, the application is defrosted, the application is reproducibly switched to a foreground of the electronic equipment for display.
Assuming the electronic device is a mobile phone, the security application is a wallet application. When a traffic card is added to the wallet application, as shown in fig. 5 a, the cell phone 500 displays an add traffic card interface 501 of the wallet application. The add traffic card interface 501 includes an icon 502 of a bus card to be added, a select control 503 of a recharge amount, and the like. In response to the switch operation (the slide-up operation), as shown in fig. 5B, the mobile phone 500 switches from the wallet-applied add-on traffic card interface 501 to the home page interface 504 of the mobile phone 500. If the wallet application is switched to the background for a long time, i.e., the wallet application is not displayed on the cell phone interface for a long time, the management service freezes the wallet application. When the management service thaws the wallet application, the wallet application is again switched to the cell phone interface for display, as shown in fig. 5C, the cell phone 500 redisplays the add traffic card interface 501 of the wallet application.
And in the process of accessing the security chip, occupying the channel and releasing the channel through the security unit service. A channel may be identified by a BIT. The channel is occupied or released and may be embodied by setting the value of the bit. For example, after the channel is occupied, the secure element service may set the value of the bit used to identify the channel to a first preset value (e.g., 1). After the channel is released, the secure element service will set the value of the bit identifying the channel to a second predetermined value (e.g., 0).
Assuming that there are M channels in the electronic device (M is a positive integer), then M bits are required to identify the occupancy of the channels. Taking m=4 as an example, the occupation situation of each channel is described in a truth table in brief.
TABLE 1
Channel number BIT3 BIT2 BIT1 BIT0
0 0 0 0 1
1 0 0 1 0
2 0 1 0 0
3 1 0 0 0
As can be seen from table 1, the first channel (channel number 0) is identified by BIT0, when the first channel is occupied, BIT0 is set to 1, and when the first channel is released, BIT0 is set to 0; the second channel (channel number 1) is identified by BIT1, when the second channel is occupied, BIT1 is set to 1, and when the second channel is released, BIT1 is set to 0; the third channel (channel number 2) is identified by BIT2, when the third channel is occupied, the value of BIT2 is set to 1, and when the third channel is released, the value of BIT2 is set to 0; the fourth channel (channel number 3) is identified by BIT3, and when the fourth channel is occupied, BIT3 is set to 1, and when the fourth channel is released, BIT3 is set to 0.
The security element service is also used to store the occupancy of the individual channels in the system properties (systempership) of the electronic device. For example, the secure element service stores the occupancy of the channel in a system attribute of the electronic device by calling a set system attributes (set) interface function.
When the NFC service needs to determine whether the target program occupies a channel, a system attribute (system properties. Get) interface function may be called, and whether the value of the bit for identifying each channel is a target preset value (e.g., a first preset value) is queried in the system attribute to determine whether the target program occupies a channel. And if the value of the bit used for identifying the channel is inquired in the system attribute of the electronic equipment as a target preset value, determining that the channel is occupied by the target program.
S404, if the target program is in an abnormal state and the target program occupies a channel, the NFC service resumes the target program to a normal state.
If it is determined that the reason that the security chip is in the non-standby state is that the target program is in an abnormal state, the target program cannot release the channel after occupying the channel, and the NFC service can restore the target program to a normal state. The target program, which returns to the normal state, can release the channel.
Optionally, if the secure application is frozen after occupying the channel, the NFC service restores the target program to a normal state as follows: the NFC service request management service updates the current state information of the security application to a defrosting state, and enables the security application to be restored to the defrosting state. As shown in fig. 5C, the thawed security application is redisplayed on the display interface of the electronic device. The defreezed security application will perform the operation of releasing the channel through the security element service.
Optionally, if the secure element service is killed after occupying the channel, the NFC service resumes the target program to a normal state as follows: the NFC service recreates the secure element service. The recreated secure element service may continue to perform operations to release the channel.
S405, if the security chip is in a standby state, or the target program is in a normal state and the target program occupies a channel, the NFC service sets the number of times of receiving the target information in a preset time period as an initial value.
In one embodiment, if the NFC service determines that the secure chip is in the standby state according to the number of times the target information is received in the preset period of time, the NFC service sets the number of times the target information is received in the preset period of time as an initial value.
In another embodiment, if the target program is in a normal state and the target program occupies a channel, it is indicated that the access process has not been completed. In this case, after waiting for the end of the current access procedure, the NFC service sets the number of times of receiving the target information in the preset period as an initial value.
As shown in fig. 6, the embodiment of the application further provides a chip system. The chip system 600 includes at least one processor 601 and at least one interface circuit 602. The at least one processor 601 and the at least one interface circuit 602 may be interconnected by wires. The processor 601 is configured to support the electronic device to implement the steps of the method embodiments described above, such as the method shown in fig. 4, and the at least one interface circuit 602 is configured to receive signals from other devices (e.g., memory) or to transmit signals to other devices (e.g., communication interfaces). The system-on-chip may include a chip, and may also include other discrete devices.
Embodiments also provide a computer-readable storage medium comprising instructions that, when executed on an electronic device as described above, cause the electronic device to perform the steps of the method embodiments described above, for example, performing the method shown in fig. 4.
Embodiments of the present application also provide a computer program product comprising instructions which, when run on an electronic device as described above, cause the electronic device to perform the steps of the method embodiments described above, for example, performing the method shown in fig. 4.
Technical effects concerning the chip system, the computer-readable storage medium, the computer program product refer to the technical effects of the previous method embodiments.
It should be understood that, in various embodiments of the present application, the sequence numbers of the foregoing processes do not mean the order of execution, and the order of execution of the processes should be determined by the functions and internal logic thereof, and should not constitute any limitation on the implementation process of the embodiments of the present application.
Those of ordinary skill in the art will appreciate that the various illustrative modules and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described system, apparatus and module may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, e.g., the division of the modules is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple modules or components may be combined or integrated into another device, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interface, indirect coupling or communication connection of devices or modules, electrical, mechanical, or other form.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physically separate, i.e., may be located in one device, or may be distributed over multiple devices. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in each embodiment of the present application may be integrated in one device, or each module may exist alone physically, or two or more modules may be integrated in one device.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using a software program, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in accordance with embodiments of the present application are produced in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device including one or more servers, data centers, etc. that can be integrated with the medium. The usable medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a Solid State Disk (SSD)), or the like.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (6)

1. An access method is characterized by being applied to electronic equipment, wherein the electronic equipment comprises a security chip, an NFC chip and a target program, and the target program accesses the security chip by occupying a channel; the target program comprises at least one of a security application and a security element service; the method comprises the following steps:
determining whether the security chip is in an idle state or not according to the times of receiving target information sent by the NFC chip in a preset time period, wherein the target information is sent to the NFC chip by the security chip and is used for indicating that the security chip is in the idle state;
if the security chip is in an unreliability state, determining whether the target program is in an abnormal state and determining whether the target program occupies the channel;
If the target program is determined to be in an abnormal state and the target program is determined to occupy the channel, restoring the target program to a normal state, wherein the target program in the normal state is used for releasing the channel;
wherein the target program being in an abnormal state includes: at least one of the security application being frozen and the security element service being killed; the restoring the target program to the normal state includes: at least one of thawing the secure application, and recreating the secure element service.
2. The method of claim 1, wherein the electronic device further comprises a management service for storing current state information of the secure application;
and if the current state information of the security application is queried in the management service to be in a frozen state, determining that the security application is frozen.
3. A method according to claim 1 or 2, characterized by determining that the secure element service is killed if the secure element service is not found in the memory of the electronic device.
4. The method according to claim 1 or 2, characterized in that if it is queried in a system property of an electronic device that a value of a bit for identifying the channel is a target preset value, it is determined that the target program occupies the channel.
5. An electronic device comprising a processor, a memory, an NFC chip, and a secure chip, the memory storing instructions that, when executed by the processor, perform the method of any of claims 1-4, the secure chip being in communication with the NFC chip.
6. A computer readable storage medium comprising instructions which, when executed on an electronic device, cause the electronic device to perform the method of any of claims 1-4.
CN202310190442.6A 2023-02-22 2023-02-22 Access method and electronic equipment Active CN116361865B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310190442.6A CN116361865B (en) 2023-02-22 2023-02-22 Access method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310190442.6A CN116361865B (en) 2023-02-22 2023-02-22 Access method and electronic equipment

Publications (2)

Publication Number Publication Date
CN116361865A CN116361865A (en) 2023-06-30
CN116361865B true CN116361865B (en) 2024-04-02

Family

ID=86940633

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310190442.6A Active CN116361865B (en) 2023-02-22 2023-02-22 Access method and electronic equipment

Country Status (1)

Country Link
CN (1) CN116361865B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104471600A (en) * 2014-04-01 2015-03-25 华为终端有限公司 Safety unit management method and terminal
CN104485982A (en) * 2014-11-20 2015-04-01 广东欧珀移动通信有限公司 Intelligent accessory-based NFC (near field communication) method and system
CN107766751A (en) * 2016-08-18 2018-03-06 中国移动通信有限公司研究院 A kind of access control method, device, electronic equipment and safety chip
CN115114612A (en) * 2022-04-06 2022-09-27 北京百度网讯科技有限公司 Access processing method, device, electronic equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111132283B (en) * 2019-11-11 2021-06-29 华为技术有限公司 Power consumption control method and equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104471600A (en) * 2014-04-01 2015-03-25 华为终端有限公司 Safety unit management method and terminal
CN104485982A (en) * 2014-11-20 2015-04-01 广东欧珀移动通信有限公司 Intelligent accessory-based NFC (near field communication) method and system
CN107766751A (en) * 2016-08-18 2018-03-06 中国移动通信有限公司研究院 A kind of access control method, device, electronic equipment and safety chip
CN115114612A (en) * 2022-04-06 2022-09-27 北京百度网讯科技有限公司 Access processing method, device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN116361865A (en) 2023-06-30

Similar Documents

Publication Publication Date Title
US9538445B2 (en) Communication method and apparatus for electronic device in mobile communication system
WO2021185105A1 (en) Method for switching between sim card and esim card, and electronic device
KR20160023065A (en) Method and apparatus for selecting at least one communication method
KR20150065410A (en) Access point connection method of electronic apparatus and electronic appparatus thereof
CN107533530B (en) Electronic device operating method and electronic device supporting the same
EP4283826A1 (en) Charging circuit, charging control method and electronic device
CN112639675B (en) Method for dynamically modulating frequency of internal memory and electronic equipment
US20150063337A1 (en) Method for controlling transmission speed and electronic device thereof
CN116054870B (en) Wireless communication circuit, bluetooth communication switching method and electronic equipment
CN116231815B (en) Method for controlling charging and electronic equipment
CN116361865B (en) Access method and electronic equipment
CN113282361B (en) Window processing method and electronic equipment
CN105657691A (en) Mobile terminal and data sharing method of double-chip system thereof
CN116737358B (en) Memory refreshing method and electronic equipment
CN114916054A (en) Communication method, device and terminal equipment
CN116744226B (en) Electronic fence data acquisition method and electronic equipment
CN115826771B (en) Input method switching method and electronic equipment
CN116737356A (en) Memory management method and electronic equipment
CN113767676B (en) Bandwidth configuration method, device, user equipment, base station and storage medium
CN115551117B (en) PDN connection method and communication system
CN116243850B (en) Memory management method and electronic equipment
CN116048678B (en) Word cut-off detection method, device and system
CN116056016A (en) Prototype information reporting method and electronic equipment
CN117440060B (en) Communication conversion device, electronic equipment, system and method
CN116048351A (en) Screen capturing method and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant