Card binding method, terminal equipment and computer readable storage medium
By using public and private keys to encrypt and decrypt the hash value of SIM card information in the terminal device, a secure and simplified device-card binding is achieved, solving the problems of poor user experience and high maintenance costs in the existing technology, and ensuring the normal operation and security of the device.
Patent Information
- Application Number
- CN202510879297.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2025-09-05
AI Technical Summary
The existing device-SIM binding method relies on the operator, which makes it easy for users to accidentally trigger the protection mechanism when changing SIM cards, affecting the normal operation of the device, resulting in a poor user experience, high maintenance costs and safety risks.
By obtaining the SIM card information in the terminal device to generate signature information, and using the public key and private key for encryption and decryption, the hash value is compared to determine the SIM card binding, avoiding firmware updates and operator dependence, and ensuring binding security.
It simplifies the machine-card binding process, reduces maintenance costs, improves user experience, ensures the normal operation and security of the equipment, and avoids operator dependence.
Smart Images

Figure CN120602944A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communications, and in particular to a machine-card binding method, terminal equipment, and a computer-readable storage medium. Background Art
[0002] The Subscriber Identity Module (SIM) card is typically bound to a terminal device in the following manner: After the terminal device is first registered with the network, the operator will bind the device's International Mobile Equipment Identity (IMEI) to the current SIM card identity information. When the device's SIM card is replaced, the operator will detect that the binding relationship has changed for the communication device and immediately trigger protection restrictions, preventing access. This binding method is completely dependent on the operator. If the user accidentally replaces the SIM card, the operator's protection mechanism will be mistakenly triggered, causing the device to malfunction, affecting usage and resulting in a poor user experience.
[0003] Therefore, it is necessary to study a machine-card binding method to solve the problem of poor user experience. Summary of the Invention
[0004] The embodiment of the present application provides a machine-card binding method, which solves the problem of poor user experience.
[0005] In a first aspect, an embodiment of the present application provides a machine-card binding method, which is applied to a terminal device, including: obtaining first signature information corresponding to the card information of a first user identity identification module SIM card, the first signature information being stored in a data storage area of the terminal device, the first SIM card being the SIM card expected to be bound to the terminal device, the first signature information being obtained by encrypting a first hash value using a private key, the first hash value being obtained based on the card information of the first SIM card; decrypting the first signature information using a public key to obtain the first hash value, the public key corresponding to the private key; obtaining the card information of a second SIM card in the terminal device; determining a second hash value based on the card information of the second SIM card; and determining that the second SIM card is successfully bound to the terminal device when the first hash value is consistent with the second hash value.
[0006] In an embodiment of the present application, by comparing the first hash value and the second hash value, when the first hash value and the second hash value are consistent, it is determined that the second SIM card is successfully bound to the terminal device. There is no need to update or re-burn the firmware containing the SIM card information in the terminal device, thereby reducing the maintenance cost of the terminal device and improving maintainability. The operator's protection mechanism will not be triggered, and the terminal device will not malfunction. While ensuring the security of the machine-card binding, the terminal device can verify the second SIM card by itself, thereby realizing the binding of the terminal device and the SIM card, avoiding dependence on the operator, simplifying the machine-card binding process, and thus improving the user experience.
[0007] In a possible implementation, when the first hash value is inconsistent with the second hash value, it is determined that binding of the second SIM card to the terminal device fails.
[0008] In this implementation, a discrepancy between the first and second hash values indicates that the second SIM card is not the intended first SIM card for the terminal device, and therefore the terminal device cannot be bound to the second SIM card. Without modifying the intended first SIM card, the device-card binding is unique, ensuring the security of the device-card binding. In one possible implementation, before obtaining the first signature information corresponding to the card information of the first user identity module SIM card, the method also includes: obtaining the public key and a third hash value corresponding to the public key, the third hash value being stored in a one-time programmable memory of the terminal device; determining a fourth hash value based on the public key; and determining that the public key verification has passed when the third hash value is consistent with the fourth hash value.
[0009] If the third hash value is inconsistent with the fourth hash value, it is determined that the public key verification fails. Optionally, after determining that the public key verification fails, the terminal device fails to start up.
[0010] In this implementation, before obtaining the first signature information corresponding to the first SIM card's card information, the public key is verified by comparing the third and fourth hash values. A match between the third and fourth hash values indicates that the public key has not been tampered with, and the public key verification has passed. This ensures the correctness of the public key and further ensures the security of the device-card binding.
[0011] In one possible implementation, after determining that the public key verification has passed, the method further includes: obtaining second signature information corresponding to the firmware installed in the terminal device; decrypting the second signature information using the public key to obtain a fifth hash value; determining a sixth hash value based on the firmware; and when the fifth hash value is consistent with the sixth hash value, executing the step of obtaining the first signature information corresponding to the card information of the first SIM card.
[0012] If the fifth hash value is inconsistent with the sixth hash value, the firmware verification fails. Optionally, after determining that the firmware verification fails, the terminal device fails to start up.
[0013] In this implementation, after determining that the public key verification has passed, the firmware in the terminal device is verified by comparing the fifth hash value and the sixth hash value. The fifth hash value is consistent with the sixth hash value, indicating that the firmware has not been tampered with, and the firmware verification has passed, and then it is verified whether the second SIM card is the first SIM card expected to be bound to the terminal device. By verifying the firmware, the firmware can be prevented from being illegally tampered with. For example, if the firmware of the terminal device is replaced by a hacker with firmware that does not verify the information of the second SIM card, the terminal device can replace the SIM card at will. This application verifies the firmware, thereby ensuring that the firmware of the terminal device will not be illegally tampered with, and at the same time improves the security of the machine-card binding.
[0014] In a possible implementation, during the upgrade of the terminal device, the data in the data storage area is prohibited from being modified.
[0015] In this implementation, during the terminal device upgrade process, the firmware in the terminal device will be updated and re-burned into the terminal device. However, the data in the data storage area will not be modified during the terminal device upgrade process. Storing the first signature information in the data storage area can, on the one hand, avoid the situation where modifying the first signature information when storing it in the firmware would result in a firmware update and re-burning, thereby simplifying the device-card binding process. On the other hand, the data in the data storage area will not be modified during the terminal device upgrade process, which can improve the security of the first signature information.
[0016] In a second aspect, an embodiment of the present application provides a signature method, which is applied to a control device, and the method includes: obtaining card information of a first user identity identification module SIM card; determining a first hash value based on the card information of the first SIM card; encrypting the first hash value using a private key to obtain first signature information; storing the first signature information in a data storage area of a terminal device, and the data in the data storage area is prohibited from being modified during the upgrade of the terminal device.
[0017] In this embodiment of the present application, the control device obtains first signature information based on the card information and private key of the first SIM card, and stores (or writes) the first signature information to a data storage area. This allows authorized personnel, such as users, to change the SIM card binding information of a terminal device without having to update or re-burn the terminal device's firmware, thereby simplifying the device-card binding process and making maintenance more convenient.
[0018] In a third aspect, an embodiment of the present application provides a terminal device, the terminal device including an acquisition module and a processing module, the acquisition module being configured to: obtain first signature information corresponding to card information of a first user identity identification module SIM card, the first signature information being stored in a data storage area of the terminal device, the first SIM card being the SIM card expected to be bound to the terminal device, the first signature information being obtained by encrypting a first hash value using a private key, the first hash value being obtained based on the card information of the first SIM card; and obtain card information of a second SIM card in the terminal device; The processing module is configured to: decrypt the first signature information using a public key to obtain a first hash value, where the public key corresponds to the private key; determine a second hash value based on the card information of the second SIM card; and determine that the second SIM card is successfully bound to the terminal device when the first hash value is consistent with the second hash value.
[0019] In a fourth aspect, an embodiment of the present application provides an electronic device, which includes a transceiver, a processor and a memory, wherein the transceiver is used to receive data, the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute some or all of the steps described in the first aspect or the second aspect of this embodiment.
[0020] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores instructions. When the computer-readable storage medium is run on a computer, some or all of the steps described in the first aspect or the second aspect of this embodiment are executed.
[0021] In a sixth aspect, an embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed, some or all of the steps described in the first aspect or the second aspect of this embodiment are executed. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings required for use in the embodiments of the present invention will be described below.
[0023] Figure 1aThis is a flow chart of a method for binding a device to a card provided in an embodiment of the present application; Figure 1b Schematic diagram of the process of public key and firmware verification method provided in the embodiment of the present application; Figure 2 This is a flow chart of another method for binding a device to a card provided in an embodiment of the present application; Figure 3 This is a flow chart of another method for binding a device to a card provided in an embodiment of the present application; Figure 4 This is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application; Figure 5 This is another structural diagram of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0025] The terms "first," "second," and the like in the specification and claims of this application and the accompanying drawings are used to distinguish between different objects, not to describe a particular order. Furthermore, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.
[0026] References to "embodiments" in this application mean that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described in this application may be combined with other embodiments.
[0027] Currently, there are two common methods for binding a terminal device (the terminal device in this application may be a communication device) and a SIM card: (1) Dependence on the operator. After the terminal device is first registered with the network, the operator will bind the terminal device's IMEI number to the card information of the current SIM card. When the terminal device replaces the SIM card, the operator will detect the change in the binding relationship of the terminal device and immediately trigger the protection mechanism to prevent the replaced SIM card from accessing.
[0028] The above binding method (1) is completely dependent on the operator. If the SIM card bound to the terminal device needs to be replaced, it is necessary to apply to the operator, and the operator will replace the bound SIM card, which is extremely inconvenient for subsequent maintenance. If the user accidentally changes the SIM card, it will mistakenly trigger the operator's protection mechanism, causing the terminal device to malfunction and unable to conduct business normally, resulting in a poor user experience.
[0029] (2) Replace the firmware in the terminal device and re-burn the replaced firmware into the terminal device. The terminal device's firmware integrates the card information of the SIM card. After the terminal device is started, it will determine whether the card information of the SIM card in the current terminal device (i.e., the information of the SIM card currently inserted in the terminal device) is consistent with the information integrated in the firmware. If they are inconsistent, the terminal device cannot use the current SIM card. If you want to use the SIM card in the current terminal device, you need to replace the SIM card information integrated in the firmware (i.e., update the firmware version), and then re-burn the updated firmware into the terminal device.
[0030] In the above binding method (2), if the SIM card bound to the terminal device is replaced, the corresponding firmware version needs to be updated and re-burned, which will result in high maintenance costs. Since the machine-card binding in this method is implemented by the firmware inside the terminal device, if a hacker uses the new SIM card information to replace the original SIM information area in the firmware, the purpose of changing the card without perception can be achieved. In addition, hackers can also obtain firmware that does not verify the new SIM card through special means. After burning this firmware to the terminal device, the terminal device can easily replace the SIM card. In other words, the above binding method (2) has security risks.
[0031] In view of this, an embodiment of the present application provides a machine-card binding method, which can improve user experience.
[0032] First, the nouns involved in the embodiments of the present application are introduced.
[0033] The terminal device in this application can be a communication device, such as an Internet of Things device. This terminal device uses a carrier's contract plan and must be bound to a SIM card during use, preventing arbitrarily changing the SIM card, or for security reasons. Examples include point-of-sale terminals (POS), automatic teller machines (ATMs), asset trackers, and portable Wi-Fi devices.
[0034] The control device in this application is the host computer of the terminal device, for example, a computer.
[0035] A SIM card is a smart card used in terminal devices. Terminal devices use this card to communicate with operators to achieve mobile communication functions.
[0036] Firmware is a program stored in the non-volatile memory of a terminal device, such as Flash Memory, Erasable Read-Only Memory (EROM), or Erasable Programmable Read-Only Memory (EPROM). Firmware, as used in this application, is the software that performs the most basic, low-level functions of a terminal device.
[0037] The methods provided in the embodiments of this application can be applied in the following scenarios: In some specialized industries, to ensure the security of data and funds, terminal devices must be bound to a SIM card, and users cannot freely change SIM cards. This applies to banking, for example. Alternatively, operators may provide specialized services for terminal devices to meet specific business needs. These devices use the operator's contract packages, and to protect the operator's interests, the terminal device must be bound to a SIM card. Examples include automotive asset trackers and portable Wi-Fi devices (such as the L716P MIFI portable Wi-Fi device). For example, based on business needs, the asset tracker may be restricted to using a SIM card agreed with the operator. The operator may provide the asset tracker with a SIM card with a fixed data limit of 1000GB for one year. Any excess data usage will be billed separately. The operator binds the asset tracker to this SIM card, and users cannot freely change the SIM card.
[0038] The following is an introduction to the method provided in the embodiments of the present application.
[0039] See Figure 1a , Figure 1aThis is a flow chart of a method for binding a device to a card provided in an embodiment of the present application. The description of the terminal device involved in the embodiment of the present application can be referred to the above description and will not be repeated here. The method for binding a device to a card includes: 101. Obtain first signature information corresponding to card information of a first SIM card.
[0040] The above-mentioned first signature information is determined by the control device based on the card information of the first SIM card, and then the control device stores (or writes) the first signature information in the data storage area of the terminal device. The terminal device obtains the first signature information corresponding to the card information of the first SIM card from the data storage area. The data in the data storage area is prohibited from being modified during the upgrade process of the terminal device. For example, the data storage area is the production data area in the terminal device, and the data in the production data area will not be modified (or erased) during the upgrade process of the terminal device such as the whole package upgrade and the firmware wireless upgrade (Firmware Over-The-Air, FOTA). In the embodiment of the present application, by storing the first signature information in the data storage area, the security and reliability of the first signature information can be improved, and the first signature information will not be modified during the upgrade process of the terminal device.
[0041] The first SIM card is the SIM card that the terminal device is intended to be bound to. The card information of the first SIM card is an identification code that can identify the first SIM card. For example, the card information can be the integrated circuit card identifier (ICCID) of the first SIM card, which consists of 20 characters.
[0042] Before the terminal device executes step 101, the control device uses a hash function (or hash function) to process the card information of the first SIM card to obtain a first hash value (or hash value). In other words, after the card information of the first SIM card is input into the hash function, the output result is the first hash value. The hash function is pre-agreed upon by the control device and the terminal device. The control device then uses the private key to encrypt the first hash value to obtain the first signature information (or digital signature). The control device then stores the first signature information in the data storage area of the terminal device. For example, the hash function can be MD5, SHA-1, SHA-3 or other functions. By signing the card information of the first SIM card, the security of the first SIM card information is improved. For an explanation of the first signature information generation process, please refer to the following description. Figure 2 The description will not be detailed here.
[0043] 102. Use the public key to decrypt the first signature information to obtain a first hash value.
[0044] The public key corresponds to the private key in step 101. That is, the private key in step 101 is used to encrypt the first hash value to obtain the first signature information, and correspondingly, the public key can decrypt the first signature information to obtain the first hash value. The private key in step 101 and the public key form a key pair.
[0045] 103. Obtain card information of the second SIM card in the terminal device.
[0046] Optionally, the second SIM card is the SIM card currently inserted into the terminal device. In other words, the second SIM card is the SIM card that the terminal device intends to use. The terminal device obtains corresponding card information by reading the second SIM card. For example, the card information may be the ICCID of the second SIM card.
[0047] 104. Determine a second hash value according to the card information of the second SIM card.
[0048] The terminal device processes the second SIM card information using the same hash function as in step 101 to obtain a second hash value.
[0049] 105. When the first hash value is consistent with the second hash value, it is determined that the second SIM card is successfully bound to the terminal device.
[0050] If the first hash value matches the second hash value, it indicates that the second SIM card is the intended first SIM card for the terminal device, thus confirming that the second SIM card is successfully bound to the terminal device. If the first hash value matches the second hash value, it indicates that the second SIM card is not the intended first SIM card for the terminal device, and the terminal device blocks the second SIM card from being bound, confirming that the binding of the second SIM card to the terminal device has failed. This prevents terminal devices using contract plans from arbitrarily replacing SIM cards, protecting the interests of middlemen or card vendors.
[0051] The above steps 101 to 105 can be executed by a terminal device.
[0052] In the embodiment of the present application, by comparing the first hash value and the second hash value, it is verified whether the second SIM card is the first SIM card expected to be bound to the terminal device. When the first hash value is consistent with the second hash value, it is confirmed that the second SIM card is successfully bound. There is no need to re-burn the firmware containing the SIM card information in the terminal device, which can reduce the maintenance cost of the terminal device and improve maintainability. The operator's protection mechanism will not be triggered, and the terminal device will not malfunction. In this way, while ensuring the security of the machine-card binding, the terminal device can verify the second SIM card by itself, thereby realizing the binding of the terminal device and the SIM card, avoiding dependence on the operator, simplifying the machine-card binding process, and thus improving the user experience.
[0053] In one possible implementation, see Figure 1b , Figure 1b 1 is a flow chart of a method for verifying a public key and firmware provided by an embodiment of the present application. Before the terminal device executes step 101, the terminal device also verifies the public key and firmware. The method includes: 1001. Obtain a public key and a third hash value corresponding to the public key. The third hash value is stored in a one-time programmable memory (OTP) of the terminal device; that is, the third hash value cannot be modified. For example, the third hash value is stored in an electronic fuse (eFuse) area. The third hash value is obtained by processing the public key using the same hash function as in step 101 and is pre-stored in the OTP memory of the terminal device. Alternatively, the public key is stored in the terminal device's firmware.
[0054] 1002. Determine a fourth hash value according to the public key.
[0055] The terminal device processes the public key to obtain a fourth hash value using the same hash function as in step 101. The public key in this step is the public key obtained by the terminal device from the firmware.
[0056] 1003. When the third hash value is consistent with the fourth hash value, determine that the public key verification passes.
[0057] If the third hash value and the fourth hash value are inconsistent, it is determined that the public key verification has failed. Optionally, after the public key verification fails, the terminal device fails to start (or shuts down). In this embodiment of the present application, the public key is verified by comparing the third hash value and the fourth hash value, thereby preventing tampering with the public key during storage. This ensures the correctness of the public key and further improves the security of device-card binding.
[0058] Optionally, after determining that the public key verification passes, the terminal device executes step 101.
[0059] Optionally, after determining that the public key verification passes, the device-card binding method further includes: 1004. Obtain second signature information corresponding to the firmware installed in the terminal device.
[0060] Optionally, the second signature information is stored in the firmware of the terminal device. The second signature information is obtained by the terminal device encrypting the fifth hash value using the private key corresponding to the public key in step 1003, and the fifth hash value is obtained by the terminal device processing the firmware using a hash function.
[0061] 1005. Use the public key to decrypt the second signature information to obtain a fifth hash value.
[0062] The terminal device uses the public key verified in step 1003 to decrypt the second signature information to obtain a fifth hash value.
[0063] 1006. Determine a sixth hash value according to the firmware.
[0064] The terminal device processes the firmware using the same hash function as in step 1004 to obtain a sixth hash value.
[0065] 1007. When the fifth hash value is consistent with the sixth hash value, execute the step of obtaining first signature information corresponding to the card information of the first SIM card.
[0066] If the fifth hash value is consistent with the sixth hash value, it indicates that the firmware has not been tampered with and the firmware verification passes. The terminal device then executes step 101. If the fifth hash value is inconsistent with the sixth hash value, it indicates that the firmware has been tampered with and the firmware verification fails. Optionally, after confirming that the firmware verification fails, the terminal device fails to boot. In this embodiment of the present application, by comparing the fifth hash value with the sixth hash value to verify the firmware, it is possible to prevent the firmware from being illegally tampered with. This ensures the correctness of the firmware and further improves the security of the device-card binding.
[0067] See Figure 2 , Figure 2 This is a flow chart of another method for binding a device to a card provided in an embodiment of the present application. The control device in the embodiment of the present application can be a host computer of a terminal device, such as a computer. The control device establishes a connection with the terminal device, and the functions of the control device include reading data from the terminal device and updating or modifying the data in the terminal device. The signing method includes the following steps: 201. Obtain card information of a first SIM card.
[0068] Optionally, the first SIM card may be a SIM card initially inserted into the terminal device during factory setup, and the control device obtains the card information of the first SIM card by reading the SIM card. Alternatively, the card information of the first SIM card is manually input into the control device, and accordingly, the control device obtains the card information of the first SIM card.
[0069] 202. Determine a first hash value according to card information of a first SIM card.
[0070] The control device uses a hash function (or hash function) pre-agreed with the terminal device to process the card information of the first SIM card to obtain a first hash value (or first hash value). The first hash function can be MD5, SHA-1, SHA-3, or other functions.
[0071] 203. Use the private key to encrypt the first hash value to obtain first signature information.
[0072] The above private key corresponds to the public key. Optionally, this pair of keys is pre-agreed between the control device and the terminal device.
[0073] 204. Store the first signature information in a data storage area of the terminal device.
[0074] The description of the data storage area can be found in the description of step 101 above and will not be detailed here. For example, the control device uses an AT command to store the first signature information in the data storage area. For example, the following command is used: "AT+GSIMSIG()=first signature information" to store the first signature information in the data storage area.
[0075] If the terminal device needs to replace the bound SIM card, after the terminal device is connected to the control device, the control device will store the signature information corresponding to the new SIM card that needs to be replaced in the data storage area of the terminal device. Then, after the terminal device is restarted, the signature information corresponding to the new SIM card is successfully stored in the data storage area.
[0076] The above steps 201 to 204 may be executed by a control device.
[0077] In an embodiment of the present application, the control device generates a first signature information and stores the first signature information in the terminal device. The SIM card information to be bound to the terminal device is stored in the data storage area of the terminal device in the form of the first signature information, and the data in the data storage area cannot be modified at will. This ensures the security and reliability of the first signature information, and also enables authorized personnel such as users, production lines, after-sales, card dealers, and intermediaries to independently change the SIM card binding information of the terminal device, simplifying the machine-card binding process and making maintenance more convenient. The related services of the terminal device will not be affected, thereby improving the user experience.
[0078] See Figure 3 , Figure 3 This is a flow chart of another method for binding a device to a card provided in an embodiment of the present application. After clicking Start on the terminal device, the terminal device performs the following steps: 301. Obtain a public key and a third hash value corresponding to the public key, and determine a fourth hash value based on the public key.
[0079] In one possible implementation, before step 301, the terminal device needs to determine whether the terminal device contains a public key and a third hash value corresponding to the public key. For example, if the public key or the third hash value is not present, the terminal device obtains the public key and the third hash value corresponding to the public key through interaction with the user, stores the public key in firmware, and stores the third hash value in a one-time programmable memory.
[0080] For other descriptions of this step, please refer to the above descriptions of steps 1001 and 1002, which will not be repeated here.
[0081] 302. Determine whether the third hash value is consistent with the fourth hash value. If so, proceed to step 303; if not, proceed to step 305.
[0082] For a detailed description of this step, please refer to the above description of step 1003, which will not be repeated here.
[0083] 303. Obtain second signature information corresponding to the firmware installed in the terminal device, decrypt the second signature information using the public key to obtain a fifth hash value, and determine a sixth hash value based on the firmware.
[0084] For detailed description of this step, please refer to the above description of steps 1004, 1005, and 1006, which will not be repeated here.
[0085] 304. Determine whether the fifth hash value is consistent with the sixth hash value. If so, proceed to step 306; if not, proceed to step 305.
[0086] For a detailed description of this step, please refer to the above description of step 1007, which will not be repeated here.
[0087] 305. The terminal device failed to start.
[0088] 306. Obtain first signature information corresponding to the card information of the first SIM card, decrypt the first signature information using the public key to obtain a first hash value, obtain card information of the second SIM card in the terminal device, and determine a second hash value based on the card information of the second SIM card.
[0089] For a detailed description of this step, please refer to the above description of steps 101, 102, 103, and 104, which will not be repeated here.
[0090] 307. Determine whether the first hash value is consistent with the second hash value. If so, proceed to step 309; if not, proceed to step 308.
[0091] For the description of this step, please refer to the description of step 105 above, which will not be repeated here.
[0092] 308. Determine that binding of the second SIM card to the terminal device fails.
[0093] Optionally, after determining that the second SIM card fails to be bound to the terminal device, the terminal device starts an abnormal protection process, the terminal device can be turned on normally but cannot access the Internet (ie, connect to the network), or the terminal device is directly shut down.
[0094] 309. Determine whether the second SIM card is successfully bound to the terminal device.
[0095] Optionally, after determining that the second SIM card is successfully bound to the terminal device, the terminal device can be powered on normally and access the Internet normally, and the second SIM card can work normally and carry out services normally.
[0096] The following describes the device provided in the embodiments of the present application.
[0097] The present application divides the functional modules of the device according to the above method embodiment. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in this application is schematic and is only a logical function division. There may be other division methods in actual implementation. The following will be combined with Figures 4 and 5 The device of the embodiment of the present application is described in detail.
[0098] See Figure 4 , Figure 4 This is a schematic diagram of the structure of the terminal device provided in the embodiment of the present application. Figure 3 As shown, the terminal device 400 includes a processing module 401 and an acquisition module 402. The acquisition module 402 is used to obtain the first signature information and the card information of the second SIM card, and the processing module 401 is used to decrypt the first signature information using the public key to obtain a first hash value, determine the second hash value based on the card information of the second SIM card, and determine whether the second SIM card is successfully bound to the terminal device.
[0099] In some embodiments of the present application, the apparatus may be used to execute the actions performed by the terminal device in the above method embodiments. In this case, the apparatus may be the device itself, or a chip or functional module configurable in the device. Acquisition module 402 is used to execute operations related to acquiring information or data in the above method embodiments, and processing module 401 is used to execute operations related to processing by the terminal device in the above method embodiments.
[0100] Optionally, in the above embodiment, the above device may further include a storage module, which may be used to store instructions and / or data, and the processing module 401 may read the instructions and / or data in the storage module so that the device implements the above method embodiment.
[0101] It should be understood that the module division within the aforementioned device is merely a division of logical functions. Each function may correspond to a functional module, or two or more functions may be integrated into a single functional module. In actual implementation, all or some of the modules may be integrated into a single physical entity, or distributed across different physical entities. Furthermore, the aforementioned functional modules may be implemented in hardware, software, or a combination of hardware and software.
[0102] See Figure 5 , Figure 5 This is another structural diagram of the terminal device provided in the embodiment of the present application. Figure 5 As shown, the terminal device 500 includes one or more processors 502 and a transceiver 501.
[0103] In some embodiments of the present application, the terminal device 500 may be used to execute the steps or methods or functions of the first aspect of the above method embodiment, such as the processor 502 may be used to execute the following steps: Figure 4 The functions or steps implemented by the processing module 401 shown in FIG. 5 are as follows: Figure 4 The functions or steps implemented by the acquisition module 402 are shown in FIG. Figure 4 Or the method embodiments shown above will not be described in detail here.
[0104] The following Figure 5 The device shown is a terminal device for illustration.
[0105] exist Figure 5 In various implementations of the terminal device shown, the transceiver may include a receiver and a transmitter, wherein the receiver is configured to perform a receiving function (or operation) and the transmitter is configured to perform a transmitting function (or operation). The transceiver is configured to communicate with other devices / apparatuses via a transmission medium.
[0106] Optionally, terminal device 500 may further include one or more memories 503 for storing program instructions and / or data. Memory 503 is coupled to processor 502. Processor 502 may operate in conjunction with memory 503. Processor 502 may execute program instructions stored in memory 503. Optionally, at least one of the one or more memories may be included in the processor.
[0107] The specific connection medium between the transceiver 501, the processor 502 and the memory 503 is not limited in the embodiment of the present application. Figure 5 The transceiver 501, the processor 502 and the memory 503 are connected via a bus 504. Figure 5 The connections between the other components are shown in bold lines, which are only for illustration and are not intended to be limiting. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0108] In the embodiments of the present application, the processor may be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc., and may implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of the present application may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor, etc.
[0109] In the embodiments of the present application, the memory may include, but is not limited to, non-volatile memories such as hard disk drives (HDDs) or solid-state drives (SSDs), random access memories (RAMs), erasable programmable read-only memories (EPROMs), read-only memories (ROMs), or compact disc read-only memories (CD-ROMs), etc. The memory is any storage medium that can be used to carry or store program code in the form of instructions or data structures and can be read and / or written by a computer (such as the terminal device shown in this application), but is not limited to this. The memory in the embodiments of the present application may also be a circuit or any other device that can implement a storage function, used to store program instructions and / or data.
[0110] The processor 502 is primarily used to process communication protocols and communication data, control the entire terminal device, execute software programs, and process software program data. The memory 503 is primarily used to store software programs and data. The transceiver 501 may include a control circuit and an antenna. The control circuit is primarily used to convert baseband signals into radio frequency signals and process radio frequency signals. The antenna is primarily used to transmit and receive radio frequency signals in the form of electromagnetic waves. Input and output devices, such as a touch screen, display, and keyboard, are primarily used to receive user input and output data to the user.
[0111] When the terminal device is powered on, the processor 502 can read the software program in the memory 503, interpret and execute the instructions of the software program, and process the data of the software program. When data needs to be transmitted wirelessly, the processor 502 performs baseband processing on the data to be transmitted and outputs the baseband signal to the radio frequency circuit. The radio frequency circuit performs radio frequency processing on the baseband signal and transmits the radio frequency signal to the outside in the form of electromagnetic waves via the antenna. When data is sent to the terminal device, the radio frequency circuit receives the radio frequency signal via the antenna, converts the radio frequency signal into a baseband signal, and outputs the baseband signal to the processor 502. The processor 502 converts the baseband signal into data and processes the data.
[0112] In another implementation, the RF circuit and antenna may be arranged independently of the processor performing baseband processing. For example, in a distributed scenario, the RF circuit and antenna may be arranged remotely from the terminal device.
[0113] The terminal device shown in the embodiment of the present application may also have Figure 5 The embodiments of the present application do not limit the number of components and the like. The methods executed by the processor and transceiver shown above are only examples, and the specific steps executed by the processor and transceiver can refer to the methods described above.
[0114] The above is a detailed introduction to the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. At the same time, for those skilled in the art, according to the idea of the present application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for binding a machine and a card, characterized in that: The method is applied to a terminal device, and the method includes: Obtaining first signature information corresponding to card information of a first subscriber identity module (SIM) card, where the first signature information is stored in a data storage area of the terminal device, the first SIM card is a SIM card expected to be bound to the terminal device, and the first signature information is obtained by encrypting a first hash value using a private key, where the first hash value is obtained based on the card information of the first SIM card; Decrypting the first signature information using a public key to obtain the first hash value, where the public key corresponds to the private key; Obtaining card information of a second SIM card in the terminal device; determining a second hash value according to the card information of the second SIM card; When the first hash value is consistent with the second hash value, it is determined that the second SIM card is successfully bound to the terminal device.
2. The method according to claim 1, characterized in that The method further comprises: When the first hash value is inconsistent with the second hash value, it is determined that the binding between the second SIM card and the terminal device fails.
3. The method according to claim 1 or 2, characterized in that Before obtaining the first signature information corresponding to the card information of the first user identity module SIM card, the method further includes: Obtaining the public key and a third hash value corresponding to the public key, wherein the third hash value is stored in a one-time programmable memory of the terminal device; determining a fourth hash value based on the public key; When the third hash value is consistent with the fourth hash value, it is determined that the public key verification passes.
4. The method according to claim 3, characterized in that After determining that the public key verification passes, the method further includes: Obtaining second signature information corresponding to the firmware installed in the terminal device; Decrypting the second signature information using the public key to obtain a fifth hash value; determining a sixth hash value based on the firmware; When the fifth hash value is consistent with the sixth hash value, the step of obtaining the first signature information corresponding to the card information of the first SIM card is performed.
5. The method according to any one of claims 1 to 4, characterized in that During the upgrade of the terminal device, the data in the data storage area is prohibited from being modified.
6. A method for binding a machine and a card, characterized in that: The method is applied to a control device, and the method includes: Obtaining card information of a first user identity module SIM card; Determining a first hash value according to the card information of the first SIM card; Encrypting the first hash value using a private key to obtain first signature information; The first signature information is stored in a data storage area of the terminal device, and the data in the data storage area is prohibited from being modified during the upgrade of the terminal device.
7. A terminal device, characterized in that: The terminal device includes an acquisition module and a processing module. The acquisition module is used to: Obtaining first signature information corresponding to card information of a first subscriber identity module (SIM) card, where the first signature information is stored in a data storage area of the terminal device, the first SIM card is a SIM card expected to be bound to the terminal device, and the first signature information is obtained by encrypting a first hash value using a private key, where the first hash value is obtained based on the card information of the first SIM card; Obtaining card information of a second SIM card in the terminal device; The processing module is used for: Decrypting the first signature information using a public key to obtain a first hash value, where the public key corresponds to the private key; determining a second hash value according to the card information of the second SIM card; When the first hash value is consistent with the second hash value, it is determined that the second SIM card is successfully bound to the terminal device.
8. An electronic device, characterized in that: The method comprises a transceiver, a processor and a memory, wherein the transceiver is used to receive data, the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores instructions, which, when executed on a computer, enable the method according to any one of claims 1 to 6 to be executed.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed, the method according to any one of claims 1 to 6 is performed.