Data transmission method, storage device and electronic device
By setting up a communication identification card storage area in the storage device and converting instructions, the problem of communication identification card space occupation is solved, realizing communication identification and data transmission without physical cards, and promoting the thinner and lighter design of devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUIYI MICROELECTRONICS (SHANGHAI) CO LTD
- Filing Date
- 2025-01-22
- Publication Date
- 2026-07-24
AI Technical Summary
Communication identification cards occupy a large physical space in smart terminal devices, which is not conducive to making the devices thinner and lighter.
By setting up a communication identification card storage area in the storage device, and converting the communication identification card instructions into storage device instructions, the reading and writing of communication identification card data can be realized, reducing the need for physical communication identification cards.
It enables communication identity recognition and data reading and writing without the need for a physical communication identification card, reducing the internal space occupied by the device and promoting its thinner and lighter design.
Smart Images

Figure CN122458006A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of storage technology, and in particular to a data transmission method, storage device, and electronic device. Background Technology
[0002] Smart devices such as smartphones and smartwatches are becoming increasingly thinner and lighter, making internal physical space increasingly precious. The SIM (Subscriber Identification Module) card is a smart card used to store user identity information and communication network authentication information in terminal devices. It is an important component of terminal devices, but the installation of the SIM card requires a large amount of internal physical space, which is not conducive to the thinner and lighter design of terminal devices. Summary of the Invention
[0003] In view of this, it is necessary to provide a data transmission method, a storage device, and an electronic device to solve the problem that the aforementioned communication identification card requires a large physical space in the terminal device, which is not conducive to the thinning and lightening of the terminal device.
[0004] In a first aspect, embodiments of this application provide a data transmission method applied to an electronic device. The method includes: receiving a communication identification card instruction sent by a communication unit of the electronic device, converting the communication identification card instruction into a storage device instruction; obtaining target data from the storage device of the electronic device based on the storage device instruction, converting the target data into response data, and sending the response data to the communication unit.
[0005] In one possible implementation, the communication identification card instruction is an Application Protocol Data Unit (APDU) instruction, and the conversion of the communication identification card instruction into a storage device instruction includes: parsing the APDU instruction to obtain multiple fields of the APDU instruction; obtaining the information unit corresponding to the storage device based on the storage device type, determining the equivalent field in the information unit corresponding to each field of the APDU instruction; and generating the storage device instruction based on the equivalent field in the information unit.
[0006] In one possible implementation, the communication identification card instruction is an APDU instruction, and the step of converting the communication identification card instruction into a storage device instruction includes: converting the APDU instruction into an AT command; parsing the AT command to obtain multiple fields of the AT command; Based on the storage device type, obtain the information unit corresponding to the storage device, determine the equivalent field in the information unit corresponding to each field of the AT command, and generate the storage device instruction based on the equivalent field in the information unit.
[0007] In one possible implementation, if the communication identification card instruction is a read instruction, obtaining target data from the storage device based on the storage device instruction and converting the target data into response data includes: reading the target data from the communication identification card storage area of the storage device based on the storage device instruction; converting the format of the target data into a format recognizable by the communication unit to obtain the response data.
[0008] In one possible implementation, if the communication identification card instruction is a write instruction, obtaining target data from the storage device based on the storage device instruction and converting the target data into response data includes: obtaining a data write result from the communication identification card storage area of the storage device based on the storage device instruction; converting the format of the data write result into a format recognizable by the communication unit to obtain the response data.
[0009] In one possible implementation, if the communication identification card instruction is an authentication instruction, the target data is obtained from the storage device based on the storage device instruction, and the target data is converted into response data, including: receiving authentication data sent by the communication unit; generating authentication response data through the storage device based on the authentication key and the authentication data; and converting the format of the authentication response data into a format recognizable by the communication unit to obtain the response data.
[0010] Secondly, embodiments of this application provide a storage device, the storage device comprising: a controller; a memory including: a communication identification card storage area for storing communication identification card data; and a data storage area for storing user data; the controller is configured to receive storage device instructions, and acquire and send target data from the communication identification card storage area based on the storage device instructions, wherein the storage device instructions are generated by converting communication identification card instructions.
[0011] In one possible implementation, if the communication identification card instruction is a read instruction, the controller reads the target data from the communication identification card storage area based on the storage device instruction.
[0012] In one possible implementation, if the communication identification card instruction is a write instruction, the controller writes data to the communication identification card storage area based on the storage device instruction, and obtains the data write result from the communication identification card storage area.
[0013] In one possible implementation, if the communication identification card instruction is an authentication instruction, the controller receives authentication data, reads the authentication key from the communication identification card storage area, and generates authentication response data based on the authentication key and the authentication data.
[0014] In one possible implementation, if the communication identification card instruction is an authentication instruction, the controller receives authentication data, sends the authentication data to the communication identification card storage area, and receives authentication response data returned by the communication identification card storage area.
[0015] Thirdly, embodiments of this application provide an electronic device, which includes a processor and the aforementioned storage device. The storage device includes a memory for storing instructions, and the processor is used to call the instructions in the memory to cause the electronic device to execute the aforementioned data transmission method.
[0016] The data transmission method, storage device, and electronic device provided in this application embodiment can set up a communication identification card storage area in the storage device for storing communication identification card data. By converting the received communication identification card instructions into storage device instructions that the storage device can recognize, the communication identification card data can be read and written in the communication identification card storage area of the storage device. This eliminates the need for the electronic device to have a communication identification card, thereby reducing the physical space occupied inside the electronic device, reducing the size of the electronic device, and facilitating the thinning and lightening of the electronic device. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0018] Figure 1 A flowchart of a data transmission method provided in an embodiment of this application.
[0019] Figure 2 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application.
[0020] Figure 3 This is a schematic diagram of the hardware structure of an electronic device provided in another embodiment of this application.
[0021] Figure 4 This is a schematic diagram of the hardware structure of a storage device provided in an embodiment of this application.
[0022] Figure 5 This is a schematic diagram of data reading and writing of a storage device provided in an embodiment of this application.
[0023] Figure 6 This is a schematic diagram of data reading and writing of a storage device provided in another embodiment of this application.
[0024] Figure 7This is a schematic diagram of the file structure of a storage device provided in an embodiment of this application.
[0025] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of this application clearer, the application will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0027] It should be noted that in this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and drawings of this application are used to distinguish similar objects, not to describe a specific order or sequence.
[0028] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is being described as an example, illustration, or illustration. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be construed as being better or more advantageous than other embodiments or designs. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0029] Currently, smart terminal devices such as smartphones, smartwatches, and smart home appliances are trending towards thinner and lighter designs. With limited internal physical space, manufacturers aim to eliminate the physical space occupied by communication identification cards (such as regular SIM cards and USIM cards). Although communication identification cards have evolved from full-size SIM cards, mini-SIM cards, micro-SIM cards, and nano-SIM cards to embedded SIM cards (eSIM), their size continues to decrease, but they are still needed as communication identifiers. While virtual SIM cards or cloud SIM cards exist, they cannot function independently and still require a wireless communication network (such as Wi-Fi) to download communication identification card data for authentication, or they may need an additional SIM card to assist in the authentication process.
[0030] There is also a pluggable 5G super SIM card with pins for both SD card and SIM card, which can perform storage and SIM card communication simultaneously. Although the 5G super SIM card combines a storage card and a SIM card, it is essentially just packaging two products together. Whether from the pins or the function, it is still two separate products and does not achieve a true integration of storage card and communication identification card. Furthermore, it still requires a physical SIM card and cannot achieve the goal of reducing or eliminating the size of the SIM card.
[0031] Thus, related technologies typically use physical cards, which, although easy to insert and remove, still occupy physical space; or they use high-capacity communication identification cards that combine SD cards and SIM cards, which not only occupy physical space but also increase the size of the communication identification card to accommodate the combination of the SD card and the communication identification card. Moreover, this combination is only a two-in-one package in form, and in reality, it is still two modules with two sets of pins; or they use virtual SIM cards or cloud SIM cards, but each time the device is turned on, it needs to obtain card information from the server, and communication identity recognition (authentication) also needs to be implemented through the server, making it impossible to achieve communication in the absence of a wireless communication network or ignition card (such as single-SIM single-standby communication products).
[0032] This application provides a data transmission method, storage device, and electronic device that can achieve communication identity recognition (authentication) and reading / writing of communication identification card file information without a physical communication identification card. Furthermore, it eliminates the need for a server to download communication identification card information and for communication identity recognition (authentication) via a server or ignition card. Even without a mobile communication network, it can read communication identification card information and identify the communication identification card and its identity. All information of the communication identification card is stored in the storage device. File reading and communication identity recognition are all achieved by operating the storage device. There is no need to add a PIN for the communication identification card to the storage device, thus integrating the storage device and the communication identification card into one unit. Communication identification information is read and communication identity is recognized through the interface of the storage device, enabling the storage device to not only have its own storage function but also be compatible with all or part of the functions of the communication identification card.
[0033] See Figure 1 The diagram shown is a flowchart of a data transmission method provided in an embodiment of this application. The data transmission method provided in this embodiment is applied to an electronic device. The data transmission method includes the following steps: S101 receives the communication identification card instruction sent by the communication unit and converts the communication identification card instruction into a storage device instruction.
[0034] See Figure 2The diagram shown is a hardware structure schematic of an electronic device according to an embodiment of this application. The electronic device 1 includes, but is not limited to, a storage device 10, an intermediate layer 20, and a communication unit 30. The communication unit 30 includes a baseband module 31 and a communication identification card interface 32. The communication identification card interface 32 is connected to the intermediate layer 20, and the intermediate layer 20 is connected to the storage device 10. The intermediate layer 20 may be a physical layer, data link layer, network layer, etc., that implements a communication protocol.
[0035] In one embodiment of this application, the baseband module 31 is used to generate and send communication identification card instructions to the communication identification card interface 32, the communication identification card interface 32 sends the communication identification card instructions to the intermediate layer 20, and the intermediate layer 20 converts the communication identification card instructions into storage device instructions.
[0036] In one embodiment of this application, the communication identification card instruction is an APDU (Application Protocol Data Unit) instruction. The intermediate layer parses the APDU instruction, obtains multiple fields of the APDU instruction, retrieves the information unit corresponding to the storage device based on the storage device type, determines the equivalent field in the information unit corresponding to each field of the APDU instruction, and generates a storage device instruction based on the equivalent fields in the information unit. The multiple fields of the APDU instruction are shown in Table 1: Table 1 The combinations of APDU instruction structures are shown in Table 2: Table 2 For the APDU command CLA INS P1 P2 P3 Data, CLA indicates the type of communication identification card; for example, the CLA field for a USIM card is 0x00, and the CLA field for a SIM card is 0xA0. INS indicates the command type; for example, if the command type is to read a binary file, the INS field is 0xB0; if the command type is to read a record file, the INS field is 0xB2. P1 and P2 are command parameters, indicating whether the file is read by path or by file ID. P3 indicates the length of the file to be read. For fixed-length record files, the fixed length of each record file is read. If the length of the file read is less than or greater than the fixed length, failure is returned. For variable-length record files, data is returned according to the given length; if the length is greater than the file length, failure is returned.
[0037] In one embodiment of this application, after the intermediate layer receives the APDU instruction sent by the communication unit, it parses the APDU instruction to determine the instruction type. If the instruction type is a read instruction, the intermediate layer converts the APDU read instruction into an instruction in the controller of the storage device. If the storage device is a UFS (Universal Flash Storage) device, it converts it into a read command Read6, Read10, or Read16.
[0038] For example, if the storage device is a UFS device, the corresponding information unit is a UPIU (Universal Flash Storage Protocol Information Unit). The structure of the UPIU instruction is shown in Table 3. Table 3 In UPIU, the equivalent fields for P1 and P2 in APDU commands are LUN, LBA0, LBA1, LBA2, and LBA3. The equivalent field for P3 in APDU commands is Expected Data Transfer Length, and the equivalent field for INS in APDU commands is OPCODE. LUN confirms the reading of files from the communication identification card storage area of the storage device. LBA0~3 are used to obtain the file position offset, and Expected Data Transfer Length is used to obtain the file size. The returned information can be determined according to the Response definition in the UFS protocol. Returning Flag.U or Flag.O confirms whether the read data capacity is correct. Further, depending on whether the sent command is fixed-length or variable-length, it confirms whether the feedback to the communication unit indicates an incorrect length or the returned data capacity based on the length.
[0039] In one embodiment of this application, the write instructions of the communication identification card are 0xDC and 0xD6, which are converted into Write6, Write10 or Write16 in the UPIU information unit.
[0040] In one embodiment of this application, since some files in the communication identification card are read-only and others are readable and writable, the communication identification card storage area can be divided into two areas: one is a permanently write-protected area, where files are read-only and, as specified by the storage protocol, are write-protected (the default is permanently write-protected), and modification is not allowed. After the storage device is manufactured and the communication operator writes the file system, one area of the communication identification card storage area is configured as the permanently write-protected area, disallowing users from writing data. If the electronic device attempts to write data to the permanently write-protected area, a write failure is directly returned. Files in the other area are readable and writable.
[0041] See Figure 3 The diagram shown illustrates the hardware structure of an electronic device according to another embodiment of this application. The electronic device 1 includes, but is not limited to, a storage device 10, an application layer 40, and a communication unit 30. The communication unit 30 includes a baseband module 31, a communication identification card interface 32, a communication identification card processing layer 33, and an AT (Attention) command layer 34. The AT command layer 34 is electrically connected to the application layer 40, and the application layer 40 is electrically connected to the storage device 10. AT commands are a set of command languages used to control and configure compatible modems, allowing users to control the modem's behavior by sending simple text commands. AT commands can be used for various operations such as dialing, hanging up, configuring connection parameters, and querying device status. In another embodiment of this application, Figure 2 The intermediate layer can be contained in the application layer 40.
[0042] In another embodiment of this application, the baseband module 31 generates and sends communication identification card instructions to the communication identification card interface 32. The communication identification card interface 32 sends the communication identification card instructions to the communication identification card processing layer 33. The communication identification card processing layer 33 converts the communication identification card instructions into AT commands and sends the AT commands to the AT command layer 34. The AT command layer 34 sends the AT commands to the application layer 40. The AT commands received by the application layer 40 can be AT+CSIM commands or AT+CRSM commands. AT+CSIM is a general SIM access command, and AT+CRSM is a restricted SIM card access command. The application layer 40 parses the AT commands, obtains multiple fields of the AT commands, obtains the instruction set corresponding to the storage device based on the storage device type, queries the instruction set for the equivalent field corresponding to each field of the AT commands, and generates storage device instructions based on the equivalent field corresponding to each field of the AT commands.
[0043] S102: Based on the storage device instruction, retrieve the target data from the storage device, convert the target data into response data, and send the response data to the communication unit.
[0044] In one embodiment of this application, if the communication identification card instruction is a read instruction, target data is read from the communication identification card storage area of the storage device based on the storage device instruction, and the format of the target data is converted into a format recognizable by the communication unit to obtain response data. After receiving a read instruction for a target file, the storage device determines whether the target file is stored in the communication identification card storage area. If it is determined that the target file is not stored in the communication identification card storage area, target data is generated to indicate that the target file does not exist in the communication identification card storage area. If it is determined that the target file is stored in the communication identification card storage area, the target data is the target file.
[0045] If the communication identification card command is a write command, the data write result is retrieved from the storage area of the communication identification card based on the storage device command. The format of the data write result is converted into a format recognizable by the communication unit to obtain response data. After receiving the write command, the storage device determines whether the target address of the data to be written is located in the permanent write-protected area. If it is determined that the target address of the data to be written is located in the permanent write-protected area, the data write result is determined to be a failure. If it is determined that the target address of the data to be written is not located in the permanent write-protected area, the data write is accepted. If the data write is completed, the data write result is determined to be a success. If there is an abnormality in the data write process, such as the storage space being full and no more data can be written, the data write result is determined to be a failure.
[0046] If the communication identification card instruction is an authentication instruction, the middleware layer receives the authentication instruction and authentication data sent by the communication unit, converts the authentication instruction into a storage device instruction, and sends the corresponding storage device instruction and authentication data to the storage device. The storage device responds to the authentication instruction by generating authentication response data based on the authentication key and authentication data, and returns the authentication response data to the middleware layer. The middleware layer converts the format of the authentication response data and sends it to the communication unit, that is, it converts the format of the authentication response data into a format that the communication unit can recognize, thus obtaining the response data. The communication unit sends the authentication response data to the communication operator's server. The communication operator's server determines whether the authentication was successful based on the authentication response data, and then determines whether to allow the electronic device to access the network.
[0047] In another embodiment of this application, the intermediate layer may also send only the storage device instruction corresponding to the authentication instruction to the storage device. The storage device responds to the storage device instruction corresponding to the authentication instruction by returning the authentication key to the intermediate layer. The intermediate layer generates authentication response data based on the authentication key and authentication data, converts the format of the authentication response data, and sends it to the communication unit.
[0048] In one embodiment of this application, the target data may include SW1SW2 status word information to indicate success or failure. The target data may also include data and 0x9000 (SW1SW2) to indicate success. When reading data from the communication identification card storage area, the storage device returns data and a Response to indicate whether the reading result was successful or failed, and to indicate whether the read data is the same length as the required data. The intermediate layer or application layer converts the data and Response into response data. If a fixed-length file is read, and Flag.0 in the returned Response indicates that the read data is excessive, or Flag.U in the returned Response indicates that the read data is insufficient, then SW1SW2 is returned directly to indicate that the length is incorrect, and no data is returned. If Flag.0 or Flag.U in the returned Response indicates that the read data is normal, then data and 0x9000 are returned to indicate that the data was read successfully. For variable-length files, if Flag.U in the returned Response indicates that the data is insufficient, then SW1SW2 is returned directly to indicate that the length is incorrect. If Flag.0 or Flag.U in the returned Response indicates that the read data is normal, then data and 0x9000 are returned directly. The storage device returns the target data, which is UPIU data, to the middle layer. The middle layer converts the UPIU data into APDU data, thereby converting the target data into response data, and then sends the converted response data to the communication unit. A similar logic can be used for the response data corresponding to the written data, which will not be elaborated here.
[0049] See Figure 4 The diagram shows a hardware structure of a storage device according to an embodiment of this application. The storage device 10 includes, but is not limited to, a controller 11 and a memory 12. The controller 11 includes a front-end interface 111 and a back-end interface 112. The front-end interface 111 is connected to the middleware layer 30 or the application layer 40, and the back-end interface 112 is connected to the memory 12. The memory 12 includes a communication identification card storage area 121 and a data storage area 122. The communication identification card storage area 121 stores communication identification card data, including: International Mobile Subscriber Identity (IMSI), authentication key KI, telephone number, SMS messages, call logs, network information, etc. The data storage area 122 stores user data in the electronic device other than the communication identification card data, such as data from various applications. The storage device 10 can be a UFS device or an EMMC (Embedded Multi Media Card) device.
[0050] In one embodiment of this application, if the communication identification card instruction is a read instruction, the target data is read from the communication identification card storage area of the storage device based on the storage device instruction, the format of the target data is converted into a format that the communication unit can recognize, and response data is obtained.
[0051] If the communication identification card instruction is a write instruction, the data write result is obtained from the communication identification card storage area of the storage device based on the storage device instruction, and the format of the data write result is converted into a format that the communication unit can recognize to obtain the response data.
[0052] If the communication identification card command is an authentication command, it receives the authentication data sent by the communication unit, generates authentication response data based on the authentication key and authentication data through the storage device, and converts the format of the authentication response data into a format that the communication unit can recognize to obtain the response data.
[0053] In another embodiment of this application, the storage device 10 may further include an instruction processing module, which may be located in the controller 11 or be a separate module. When the communication unit needs to write data to the storage device, it can encapsulate the APDU instruction corresponding to the data to be written and the data to be written in a write buffer instruction (write bufferUPIU), and send the write buffer instruction containing the APDU instruction and the data to be written to the storage device. The instruction processing module in the storage device parses the parameters in the received write buffer instruction. When it is determined that the write buffer instruction is used to write data to the memory, it parses and obtains the data to be written in the write buffer instruction, and writes the data to be written to the memory. When the communication unit needs to read data from the storage device, it can encapsulate the APDU instruction corresponding to the data to be read in a read buffer instruction (read buffer UPIU), and send the read buffer instruction containing the APDU instruction to the storage device. The instruction processing module in the storage device parses the parameters in the received read buffer instruction. When it is determined that the read buffer instruction is used to read data from the memory, it parses and obtains the address of the data to be read, and reads the data to be read from the memory based on the address of the data to be read. Both the write buffer instruction and the read buffer instruction are general flash memory storage commands. Thus, if the storage device is equipped with an instruction parsing module, there is no need for the application layer or intermediate layer to perform instruction translation.
[0054] See Figure 5 The diagram shown is a data read / write schematic of a storage device according to an embodiment of this application. During power-on of the storage device, the communication identification card file information in the communication identification card storage area can be directly read into the controller's memory (SRAM), facilitating subsequent reading or updating of the communication identification card file by the electronic device's communication unit. Before the electronic device is powered off or loses power, the communication identification card file information is stored back in the communication identification card storage area. See also... Figure 6The diagram shown is a data read / write schematic of a storage device provided in another embodiment of this application. In another embodiment of this application, the storage device can also be operated in real time, that is, the communication identification card file information in the communication identification card storage area of the storage device can be read and written in real time.
[0055] See Figure 7 The diagram shown illustrates the file structure of a storage device according to an embodiment of this application. In one embodiment, each file in the communication identification card storage area includes attributes and content. The file content capacity can be determined based on the file format (binary file or fixed-length record file, etc.). When reading a file from the storage device through the intermediate layer or application layer, all data in the communication identification card storage area can be read, and then the corresponding file can be determined based on the offset to obtain the file's attributes and content. The location of each file can be fixed, and file information can be obtained by reading a fixed address, or the file location can be indicated by another table.
[0056] In one embodiment of this application, the communication unit sends a communication identification card file attribute acquisition instruction to the intermediate layer through the communication identification card interface. The intermediate layer converts the communication identification card file attribute acquisition instruction into a storage device instruction and sends the storage device instruction to the storage device. The storage device sends the communication identification card file attributes to the intermediate layer. The intermediate layer converts the communication identification card file attributes into corresponding response data and sends the response data to the communication unit.
[0057] In one embodiment of this application, the communication unit sends a communication identification card file acquisition instruction to the intermediate layer through the communication identification card interface. The intermediate layer converts the communication identification card file acquisition instruction into a storage device instruction and sends the storage device instruction to the storage device. The storage device sends the communication identification card file to the intermediate layer. The intermediate layer converts the communication identification card file into corresponding response data and sends the response data to the communication unit.
[0058] In one embodiment of this application, the communication unit sends a communication identification card file write / get instruction to the intermediate layer through the communication identification card interface. The intermediate layer converts the communication identification card file write / get instruction into a storage device instruction and sends the storage device instruction to the storage device. After the storage device completes the writing of the communication identification card file, it sends the communication identification card file writing result to the intermediate layer. The intermediate layer converts the communication identification card file writing result into corresponding response data and sends the response data to the communication unit.
[0059] In one embodiment of this application, the communication unit sends authentication commands and authentication data to the middle layer via a communication identification card interface. The middle layer converts the authentication commands into storage device commands and sends the storage device commands and authentication data to the storage device. The front-end interface of the storage device receives the storage device commands and authentication data and sends them to the back-end interface. The back-end interface sends the storage device commands and authentication data to the communication identification card storage area of the storage device. The communication identification card storage area includes an authentication module. The authentication module calculates the authentication result based on the authentication parameters and authentication data, sends the authentication result to the front-end interface via the back-end interface, and then converts it into response data via the middle layer before sending it to the communication unit. For example, the authentication parameter is a key Ki, and the authentication data is a random number. The authentication module executes a preset algorithm (e.g., the A3 algorithm) on the key and the random number to calculate the authentication response data.
[0060] In another embodiment of this application, the communication unit sends authentication commands and authentication data to the middle layer through the communication identification card interface. The middle layer converts the authentication commands into storage device commands and sends the storage device commands and authentication data to the storage device. The front-end interface of the storage device receives the storage device commands and authentication data and sends the storage device commands to the back-end interface. The back-end interface sends the storage device commands to the communication identification card storage area of the storage device. The authentication module of the communication identification card storage area sends the authentication parameters to the front-end interface through the back-end interface. The front-end interface calculates the authentication result based on the authentication parameters and authentication data, and then converts the authentication result into response data through the middle layer and sends it to the communication unit.
[0061] In one embodiment of this application, authentication parameters (such as authentication keys) can be encrypted or stored in the RPMB (Replay Protected Memory Block) area, and decryption is required when writing or reading authentication parameters.
[0062] In one embodiment of this application, after the electronic device is powered on, all data except authentication parameters in the communication identification card storage area of the storage device can be directly read and saved into the memory of the processor of the electronic device or the controller of the storage device. Registration and communication with the communication network are then performed using the communication identification card data in memory. When updating communication-related files or data, they can be updated first in memory and then periodically updated to the communication identification card storage area of the storage device, or they can be directly updated to the communication identification card storage area. Alternatively, some files or data related to communication network registration can be read into memory at startup, and after successful registration, other files, such as phone books, can be read and updated only when needed.
[0063] In one embodiment of this application, the storage device can extend storage protocol instructions for reading or writing communication identification card data, or it can store the file in a special area without using special instructions, and read the communication identification card data from the storage device in a certain structure and save it in the memory of the electronic device.
[0064] In one embodiment of this application, the STK (SIM Tool Kit) and USAT (USIM Application Toolkit) functions related to the communication identification card can also be implemented by logic in the storage device. This enables the STK to update the communication identification card information (such as the authentication-related International Mobile Subscriber Identity (IMSI)) to enable switching between communication operators, while also implementing the relevant STK functions, such as displaytext and setupmenu.
[0065] In one embodiment of this application, when switching between multiple communication operators, updated data is sent through the application layer or network layer, stored in the communication identification card storage area of the storage device, and the old communication identification card data is marked as invalid. The file system of the communication identification card is reloaded and re-registered to the new communication network, thereby realizing the switching of communication operators.
[0066] See Figure 8 The diagram shown is a structural schematic of an electronic device according to an embodiment of this application. The electronic device 1 includes, but is not limited to, a memory 12, a processor 50, and a computer program stored in the memory 12 and executable on the processor 50. For example, the computer program is a data transmission program. When the processor 50 executes the computer program, it implements the steps in the data transmission method.
[0067] For example, the computer program may be divided into one or more modules / units, which are respectively stored in the memory 12 and executed by the processor 50 to complete this application. The one or more modules / units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device 1.
[0068] Those skilled in the art will understand that the schematic diagram is merely an example of electronic device 1 and does not constitute a limitation on electronic device 1. It may include more or fewer components than shown in the diagram, or combine certain components, or different components. For example, electronic device 1 may also include input / output devices, network access devices, buses, etc.
[0069] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the electronic device 1, connecting all parts of the electronic device 1 via various interfaces and lines.
[0070] The memory can be used to store the firmware program and / or modules / units. The processor implements various functions of the electronic device 1 by running or executing the computer programs and / or modules / units stored in the memory, and by calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device 1, etc. In addition, the memory may include volatile and non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other storage devices.
[0071] If the modules / units integrated in the electronic device 1 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), or a random access memory (RAM).
[0072] The extended content of the specific embodiments of the computer-readable storage medium described in this application is basically the same as the embodiments of the data transmission method described above, and will not be repeated here.
[0073] The data transmission method, storage device, and electronic device provided in this application embodiment can set up a communication identification card storage area in the storage device for storing communication identification card data. By converting the received communication identification card instructions into storage device instructions that the storage device can recognize, the communication identification card data can be read and written in the communication identification card storage area of the storage device. This eliminates the need for the electronic device to have a communication identification card, thereby reducing the physical space occupied inside the electronic device, reducing the size of the electronic device, and facilitating the thinning and lightening of the electronic device.
[0074] It will be apparent to those skilled in the art that this application is not limited to the details of the exemplary embodiments described above, and that this application can be implemented in other specific forms without departing from the spirit or essential characteristics of this application. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of this application is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within this application. No reference numerals in the claims should be construed as limiting the scope of the claims. Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in the apparatus claims may also be implemented by the same unit or device in software or hardware. The terms "first," "second," etc., are used to indicate names and do not indicate any particular order.
[0075] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application and are not intended to limit it. Although this application has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of this application without departing from the spirit and scope of the technical solutions of this application.
Claims
1. A data transmission method applied to electronic devices, characterized in that, The method includes: Receive communication identification card instructions sent by the communication unit of the electronic device, and convert the communication identification card instructions into storage device instructions; Based on the storage device instructions, target data is obtained from the storage device of the electronic device, the target data is converted into response data, and the response data is sent to the communication unit.
2. The data transmission method as described in claim 1, characterized in that, The communication identification card instruction is an Application Protocol Data Unit (APDU) instruction, and the conversion of the communication identification card instruction into a storage device instruction includes: The APDU instruction is parsed to obtain multiple fields of the APDU instruction; Based on the storage device type, obtain the information unit corresponding to the storage device, and determine the equivalent field in the information unit that corresponds to each field of the APDU instruction; The storage device instruction is generated based on the equivalent fields in the information unit.
3. The data transmission method as described in claim 1, characterized in that, The communication identification card instruction is an APDU instruction, and the conversion of the communication identification card instruction into a storage device instruction includes: Convert the APDU instructions into AT commands; The AT command is parsed to obtain multiple fields of the AT command; Based on the storage device type, obtain the information unit corresponding to the storage device, and determine the equivalent field in the information unit that corresponds to each field of the AT command; The storage device instruction is generated based on the equivalent fields in the information unit.
4. The data transmission method as described in claim 2 or 3, characterized in that, If the communication identification card instruction is a read instruction, the target data is retrieved from the storage device based on the storage device instruction, and the target data is converted into response data, including: The target data is read from the communication identification card storage area of the storage device based on the instructions of the storage device. The target data is converted into a format recognizable by the communication unit to obtain the response data.
5. The data transmission method as described in claim 2 or 3, characterized in that, If the communication identification card instruction is a write instruction, the target data is retrieved from the storage device based on the storage device instruction, and the target data is converted into response data, including: Based on the instructions from the storage device, the data write result is obtained from the storage area of the communication identification card of the storage device; The format of the data writing result is converted into a format recognizable by the communication unit to obtain the response data.
6. The data transmission method as described in claim 2 or 3, characterized in that, If the communication identification card instruction is an authentication instruction, the target data is retrieved from the storage device based on the storage device instruction, and the target data is converted into response data, including: The system receives authentication data sent by the communication unit and generates authentication response data based on the authentication key and the authentication data through the storage device. The authentication response data is converted into a format recognizable by the communication unit to obtain the response data.
7. A storage device, characterized in that, The storage device includes: Controller; Memory, including: The communication identification card storage area is used to store the communication identification card data; and Data storage area, used to store user data; The controller is used to receive instructions from the storage device, and to obtain and send target data from the storage area of the communication identification card based on the instructions from the storage device, wherein the instructions from the storage device are generated by converting the instructions from the communication identification card.
8. The storage device as claimed in claim 7, characterized in that, If the communication identification card instruction is a read instruction, the controller reads the target data from the communication identification card storage area based on the storage device instruction.
9. The storage device as claimed in claim 7, characterized in that, If the communication identification card instruction is a write instruction, the controller writes data to the communication identification card storage area based on the storage device instruction, and obtains the data write result from the communication identification card storage area.
10. The storage device as claimed in claim 7, characterized in that, If the communication identification card instruction is an authentication instruction, the controller receives the authentication data, reads the authentication key from the storage area of the communication identification card, and generates authentication response data based on the authentication key and the authentication data.
11. The storage device as claimed in claim 7, characterized in that, If the communication identification card instruction is an authentication instruction, the controller receives the authentication data, sends the authentication data to the communication identification card storage area, and receives the authentication response data returned by the communication identification card storage area.
12. An electronic device, characterized in that, The electronic device includes a processor and a storage device as described in any one of claims 7 to 11, wherein the processor is configured to invoke instructions in the memory of the storage device to cause the electronic device to perform the data transmission method as described in any one of claims 1 to 6.