Model acquisition method and device, model deployment method and device, electronic equipment, server, medium and computer program product
By using chip key encryption technology in large models, the security problem of large models when deploying them in user electronic devices is solved, ensuring that model files can only be used on authorized devices, achieving higher security and privacy protection.
Patent Information
- Application Number
- CN202411386523.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2024-12-31
AI Technical Summary
When deploying large models in users’ electronic devices, there is a risk of low security, which is easily stolen by attackers and cannot effectively protect user privacy.
The model key is encrypted through the chip key of the electronic device, so that the model can only be used in the electronic device corresponding to the chip, and if the chip is not broken, the model files deployed in the electronic device cannot be extracted and Misuse. The specific implementation method includes the server generating a second key, encrypting it using the chip public key of the electronic device, obtaining the first key, and then sending the encrypted model file and key to the electronic device. The electronic device uses the chip private key to decrypt it and obtaining it. Decrypted model file.
Improves the security of the model when deploying it in the user's electronic devices, ensures that the model files can only be used on authorized devices, prevents unauthorized extraction and theft, and enhances the protection of user privacy.
Smart Images

Figure CN119227110A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of artificial intelligence technology, and specifically relates to a model acquisition method, a model deployment method, a device, an electronic device, a server, a medium and a computer program product. Background Art
[0002] With the development of big models, their functions are becoming more and more powerful, and their applications are becoming more and more extensive. Usually, big models are deployed in cloud servers. When users use big model services, they need to upload their personal data to the cloud servers to obtain the corresponding big model processing results. However, uploading users' personal data may cause users' privacy concerns.
[0003] In order to alleviate users' privacy concerns, the big model can be deployed directly in the user's electronic device. When the user needs to use the big model, the electronic device can directly call the big model, thereby obtaining the corresponding big model processing results without uploading the user's personal data.
[0004] However, as a key asset of the big model service provider, if the big model is deployed in the user's electronic device, it is easy to be stolen by attackers, such as directly copying the big model file from the electronic device storage space, or reading the big model file in the big model service application through a malicious application on the same electronic device. As a result, the security of the model when deployed in the user's electronic device is low. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a model acquisition method, a model deployment method, an apparatus, an electronic device, a server, a medium and a computer program product, which can improve the security of the model when it is deployed in a user's electronic device.
[0006] In a first aspect, an embodiment of the present application provides a model acquisition method, the method comprising: an electronic device acquires an encrypted model file and a first key corresponding to the encrypted model file; the electronic device uses a chip private key of a first chip to decrypt the first key to obtain a second key; the electronic device uses the second key to decrypt the encrypted model file to obtain a decrypted model file.
[0007] In a second aspect, an embodiment of the present application provides a model deployment method, which includes: a server generates a second key, which is used to decrypt a model file; the server uses the chip public key of a first chip of an electronic device to encrypt the second key to obtain a first key; the server sends the encrypted model file and the first key corresponding to the encrypted model file to the electronic device.
[0008] In a third aspect, an embodiment of the present application provides a model acquisition device, which includes: an acquisition module and a decryption module; the acquisition module is used to obtain an encrypted model file and a first key corresponding to the encrypted model file; the decryption module is used to use the chip private key of the first chip to decrypt the first key obtained by the acquisition module to obtain a second key; the decryption module is also used to use the second key to decrypt the encrypted model file to obtain a decrypted model file.
[0009] In a fourth aspect, an embodiment of the present application provides a model deployment device, which includes: a generation module, an encryption module and a sending module; the generation module is used to generate a second key, and the second key is used to decrypt the model file; the encryption module is used to use the chip public key of the first chip of the electronic device to encrypt the second key generated by the generation module to obtain a first key; the sending module is used to send the encrypted model file and the first key corresponding to the encrypted model file to the electronic device.
[0010] In a fifth aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
[0011] In a sixth aspect, an embodiment of the present application provides a server, comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method described in the second aspect are implemented.
[0012] In a seventh aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect or the second aspect are implemented.
[0013] In an eighth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect or the second aspect.
[0014] In a ninth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect or the second aspect.
[0015] In an embodiment of the present application, the server generates a second key, and the second key is used to decrypt the model file; the server uses the chip public key of the first chip of the electronic device to encrypt the second key to obtain the first key; the server sends the encrypted model file and the first key corresponding to the encrypted model file to the electronic device; thereby the electronic device can obtain the encrypted model file and the first key corresponding to the encrypted model file; the electronic device uses the chip private key of the first chip to decrypt the first key to obtain the second key; the electronic device uses the second key to decrypt the encrypted model file to obtain the decrypted model file. Through this scheme, the model key can be encrypted by the chip key of the electronic device, so that the model can only be used in the electronic device corresponding to the chip. Moreover, if the chip of the electronic device is not hacked, the model file deployed in the electronic device cannot be extracted and stolen. In this way, the security of the model when deployed in the user's electronic device is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 is a schematic diagram of a system architecture of an electronic device provided in an embodiment of the present application;
[0017] Figure 2 This is one of the flow charts of a model acquisition method provided in an embodiment of the present application;
[0018] Figure 3 This is the second flowchart of a model acquisition method provided in an embodiment of the present application;
[0019] Figure 4 This is the third flowchart of a model acquisition method provided in an embodiment of the present application;
[0020] Figure 5 It is one of the flow charts of a model deployment method provided in an embodiment of the present application;
[0021] Figure 6 It is a flow chart of a model acquisition method and a model deployment method provided in an embodiment of the present application;
[0022] Figure 7 is a structural schematic diagram of a model acquisition device provided in an embodiment of the present application;
[0023] Figure 8 It is a structural schematic diagram of a model deployment device provided in an embodiment of the present application;
[0024] Fig. 9 This is one of the hardware structure diagrams of an electronic device provided in an embodiment of the present application;
[0025] Fig.10 This is a second schematic diagram of a hardware structure of an electronic device provided in an embodiment of the present application;
[0026] Fig.11 It is a schematic diagram of the hardware structure of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0028] The terms "first", "second", etc. in the specification of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0029] The terms "at least one (item)", "at least one of" and the like in the specification of the present application refer to any one, any two or a combination of more than two of the objects contained therein. For example, at least one (item) of a, b, and c can be represented by: "a", "b", "c", "a and b", "a and c", "b and c" and "a, b and c", where a, b, and c can be single or multiple. Similarly, "at least two (items)" refers to two or more, and its meaning is similar to that of "at least one (item)". The logo in the present application is text, symbol, image, etc. used to indicate information, and logos or other containers can be used as carriers for displaying information, including but not limited to text logos, image logos, symbol logos, etc.
[0030] The model acquisition method, model deployment method, device, electronic device, server, medium and computer program product provided in the embodiments of the present application are described in detail below with reference to specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0031] The model acquisition method, model deployment method, device, electronic device, server, medium and computer program product provided in the embodiments of the present application can be applicable to scenarios in which the model is deployed in an electronic device.
[0032] When the model is deployed in an electronic device, it is easier for an attacker to steal the model. For example, an attacker can directly copy a large model file from the storage space of the electronic device; or an attacker can use a malicious application on the same device to unauthorize the model file and read the model file in the application that provides the model service.
[0033] It is understandable that after obtaining the model file, the attacker can directly integrate the model file into his own application, or integrate it into his own application after fine-tuning it, avoiding the need to train a large model with data from scratch and reducing costs.
[0034] Currently, security measures deployed in electronic devices include the following two categories:
[0035] The first type is to add a watermark to the model file. This method usually adds a watermark to the model to prove the ownership of the model file. However, this method usually proves the ownership of the model file by tracing the data of images, videos, texts, etc. after the model file has been stolen on a large scale, and it cannot protect the model file in real time.
[0036] The second category is to enhance system security. Electronic devices can isolate business resources through virtual machines to prevent data deployed on the same physical device from being stolen. However, electronic devices usually have poor stability when running applications that consume a lot of resources, and virtualization technology cannot support the graphics processing unit (GPU) and accelerated processing unit (APU) required to call the model to run. Hardware acceleration modules, such as hardware acceleration modules, therefore, this type of method cannot provide good technical support for deploying models on the electronic device side.
[0037] The model acquisition method, model deployment method, device, electronic device, server, medium and computer program product provided in the embodiments of the present application can encrypt the model key through the chip key of the electronic device, so that the model can only be used in the electronic device corresponding to the chip. Moreover, if the chip of the electronic device is not hacked, the model file deployed in the electronic device cannot be extracted and stolen. In this way, the security of the model when deployed in the user's electronic device is improved.
[0038] In the present application embodiment, Figure 1 As shown, the chip layer in the electronic device may include GPU, Neural Processing Unit (NPU) and other related hardware, which can be used for model operation. Among them, the security chip in the electronic device usually corresponds to a secure storage space for storing the root certificate.
[0039] In some embodiments of the present application, the device private key of the electronic device may also be stored in the chip of the electronic device. For example, the device private key may be stored in a system on chip (SoC), and the device private key is strongly bound to the electronic device and cannot be changed once burned into the electronic device.
[0040] In addition, if Figure 1 As shown, in addition to the electronic device side, there are four entities, namely the signature certificate issuer, the large model supplier, the electronic device manufacturer, and the chip manufacturer. Among them, the signature certificate issuer is a recognized issuer of signature certificates, and the certificate it issues can prove that the certificate is valid and can prove the identity of the certificate owner. The large model supplier, electronic device manufacturer, and chip manufacturer all need to send a certificate application to the certificate issuer to obtain a certificate that meets the requirements for issuing the next level of certificate. The certificate can contain a public key, and the corresponding private key is kept by the certificate owner.
[0041] It is understandable that after the large model supplier, electronic device manufacturer or chip manufacturer obtains a certificate that meets the requirements for issuing the next level certificate, other manufacturers or suppliers can verify whether the certificate issued by the large model supplier, electronic device manufacturer or chip manufacturer is issued by the certificate issuer. If it is issued by the certificate issuer, it can be proved that the certificate is valid.
[0042] The execution subject of the model acquisition method provided in the embodiment of the present application may be a model acquisition device. Exemplarily, the model acquisition device may be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The model acquisition method provided in the embodiment of the present application will be exemplarily described below using an electronic device as an example.
[0043] The present application embodiment provides a model acquisition method. Figure 2 A flow chart of a model acquisition method provided by an embodiment of the present application is shown, and the method can be applied to electronic devices. Figure 2 As shown, the model acquisition method provided in the embodiment of the present application may include the following steps 201 to 203.
[0044] Step 201: The electronic device obtains an encrypted model file and a first key corresponding to the encrypted model file.
[0045] In some embodiments of the present application, the encrypted model file may be a model file in an electronic device that is not called.
[0046] It is understandable that the model file is in an encrypted state when not being called, which can better protect the security of the model in the electronic device.
[0047] In some embodiments of the present application, the above-mentioned model file may be a model file of an application that provides model services.
[0048] In some embodiments of the present application, the first key may be a key for decrypting an encrypted model file.
[0049] In some embodiments of the present application, the encrypted model file and the first key may be issued by a server or stored in an electronic device. The embodiments of the present application are not specifically limited.
[0050] It is understandable that when a user wants to download an application that provides a model service, the electronic device can send a model download request to the server, thereby obtaining the model file sent by the server. Moreover, after obtaining the model file sent by the server, the electronic device can store the encrypted model file and the first key for the next call.
[0051] In some embodiments of the present application, the first key may be an encrypted symmetric key.
[0052] Step 202: The electronic device uses the chip private key of the first chip to decrypt the first key to obtain the second key.
[0053] In some embodiments of the present application, the first chip may be a chip of an electronic device.
[0054] In some embodiments of the present application, in order to place the decryption process of the model file in a trusted execution environment, the first chip may be a security chip in an electronic device.
[0055] It is understandable that, since security chips generally have higher security features, security chips can effectively block attacks from the operating system.
[0056] In some embodiments of the present application, the chip private key of the above-mentioned first chip can be used to negotiate with the server corresponding to the large model supplier the symmetric key used to decrypt the model file, so that when the encrypted model file is called, the model file can be decrypted by the chip private key of the first chip and handed over to the NPU for execution.
[0057] It is understandable that since the chip private key will not flow out of the chip, the security of the model file can be greatly improved by associating the key corresponding to the model file with the chip private key.
[0058] In some embodiments of the present application, the second key may be a symmetric key.
[0059] In some embodiments of the present application, the electronic device can pass the encrypted model file, the first key and the root certificate of the large model supplier to the first chip by calling a specific interface. Thus, after verifying that the root certificate of the large model supplier is valid, the first chip can use the chip private key of the chip to decrypt the first key and obtain the second key.
[0060] In some embodiments of the present application, the above-mentioned specific interface may be an interface of the first chip.
[0061] In some embodiments of the present application, the above-mentioned specific interface may be a hardware interface of the first chip to enhance the isolation of data transmission.
[0062] It can be understood that by calling a specific interface to transmit data, data falsification can be avoided, further improving the security of the model file.
[0063] In some embodiments of the present application, the electronic device may establish a secure connection with a large model supplier server after sending a model download request, thereby obtaining a root certificate of the large model supplier.
[0064] In some embodiments of the present application, the electronic device may determine whether the root certificate of the large model supplier is valid by determining whether the root certificate of the large model supplier is issued by the signing certificate issuer.
[0065] It should be noted that if the root certificate of a large model supplier is valid, it can indicate that the model file from the large model supplier is complete and credible.
[0066] Specifically, the electronic device may verify the root certificate of the large model supplier using the public key of the signing certificate issuer.
[0067] It can be understood that if the electronic device determines that the root certificate of the large model supplier is issued by the signing certificate issuer, the electronic device can determine that the root certificate of the large model supplier is valid.
[0068] Step 203: The electronic device uses the second key to decrypt the encrypted model file to obtain a decrypted model file.
[0069] In some embodiments of the present application, after obtaining the second key, the electronic device may decrypt the encrypted model file to obtain a decrypted model file, that is, a plaintext model file.
[0070] In some embodiments of the present application, after obtaining a plaintext model file, the electronic device can load the plaintext model file into a secure GPU or NPU for execution.
[0071] It is understandable that since the key used to decrypt the model file is bound to a specific electronic device, even if an attacker obtains the encrypted model file, he cannot load it into another device for operation.
[0072] The model acquisition method provided in the embodiment of the present application can encrypt the model key through the chip key of the electronic device, so that the model can only be used in the electronic device corresponding to the chip. In addition, if the chip of the electronic device is not hacked, the model file deployed in the electronic device cannot be extracted and stolen. In this way, the security of the model when deployed in the user's electronic device is improved.
[0073] In some embodiments of the present application, Figure 2 ,like Figure 3 As shown, before the above step 201, the model acquisition method provided in the embodiment of the present application may further include the following steps 204 and 205, and the above step 201 may include the following step 201a.
[0074] Step 204: The electronic device generates a first random number signature according to the chip private key of the first chip of the electronic device and the first random number.
[0075] Wherein, the first random number comes from the server.
[0076] In some embodiments of the present application, the first random number may be used for authentication and authorization between the electronic device and the server.
[0077] In some embodiments of the present application, the server may sign the first random number using the server private key and then send the signed first random number to the electronic device.
[0078] In some embodiments of the present application, Figure 3 ,like Figure 4 As shown, the above step 204 may include the following step 204a.
[0079] Step 204a: The electronic device calls the first interface of the first chip, and uses the chip private key of the first chip to sign the first random number to obtain a first random number signature.
[0080] In some embodiments of the present application, the first interface may be a specific interface of the first chip, and the specific interface may be used to sign a specific random number using a chip private key of the first chip.
[0081] In some embodiments of the present application, the above-mentioned first interface may only receive signature requests from a trusted execution environment (TEE), but not accept signature requests from a rich execution environment (REE), so as to ensure the security of the model file.
[0082] In some embodiments of the present application, the first interface can be used only to accept random numbers and sign with the private key stored in the security chip, and feedback the signature; and to verify whether the received signature can be associated with the root certificate corresponding to the issuer of the signature certificate. In other words, the first interface only performs the above two operations and cannot receive code changes, thereby further ensuring the security of the model file.
[0083] In some embodiments of the present application, when the electronic device calls the first interface of the first chip, the REE may first call the trusted applications (TA) in the TEE, and then the TA calls the first interface of the first chip. In this way, it can be ensured that the calling process of the first interface of the first chip is always under the TEE.
[0084] In this way, by signing the first random number using the chip private key of the first chip through a specific chip interface, the security of the signature can be guaranteed, ensuring that the signature will not be forged, thereby improving the security of the model when deployed in the user's electronic device.
[0085] Step 205: The electronic device sends the chip certificate of the first chip and the first random number signature to the server.
[0086] The chip certificate of the first chip may include a chip public key, and the chip public key may be used to generate the first key.
[0087] In some embodiments of the present application, the electronic device may send the chip certificate of the first chip to the server, so that the server can extract the chip public key of the first chip from the chip certificate of the first chip, and thus can use the chip public key of the first chip to encrypt the symmetric key (i.e., the second key) that meets the security requirements to obtain the first key.
[0088] Step 201a: The electronic device receives the encrypted model file and the first key from the server.
[0089] In some embodiments of the present application, after obtaining the first key, the server may use the server private key to sign the first key and send it to the electronic device through a secure channel between the server and the electronic device.
[0090] In some embodiments of the present application, after obtaining the second key, the server may also use the second key to encrypt the model file to obtain an encrypted model file.
[0091] In some embodiments of the present application, the server may package the first key and the encrypted model file together and send them to the electronic device, or may package them separately and send them to the electronic device. This embodiment of the present application is not specifically limited.
[0092] In this way, the key used to decrypt the model file is encrypted by the chip private key of the chip in the electronic device, and the chip private key and the key are bound, so that the encrypted model file cannot be cracked unless the chip of the electronic device is hacked, thereby improving the security of the model when it is deployed in the user's electronic device.
[0093] In some embodiments of the present application, before the above step 204, the model acquisition method provided in the embodiment of the present application may further include the following steps 206 to 208, and the above step 204 may further include the following step 204b.
[0094] Step 206: The electronic device sends a second random number and a first certificate to the server.
[0095] The first certificate may be a device certificate of the electronic device.
[0096] In some embodiments of the present application, the second random number may be used by the server to verify the validity of the device certificate of the electronic device.
[0097] In some embodiments of the present application, the electronic device may send the device certificate to the server so that the server can verify the device that needs to download the model file.
[0098] In some embodiments of the present application, the second random number may be a random number signed by the electronic device using a device private key.
[0099] Step 207: The electronic device receives the first random number and the second random number signature from the server.
[0100] Step 208: The electronic device determines whether the first random number comes from the server based on the first random number, the second random number signature, and the root certificate corresponding to the server.
[0101] In some embodiments of the present application, the root certificate corresponding to the above-mentioned server may be a root certificate of a large model supplier.
[0102] In some embodiments of the present application, the electronic device can obtain the root certificate of the large model provider when establishing a secure channel between the electronic device and the server.
[0103] In some embodiments of the present application, the electronic device can extract the server public key in the root certificate corresponding to the server, and use the server public key to decrypt the second random number signature from the server. It can be understood that when the data obtained by decrypting the second random number signature is consistent with the first random number, the electronic device determines that the first random number comes from the server; when the data obtained by decrypting the second random number signature is inconsistent with the first random number, it determines that the first random number does not come from the server.
[0104] It is understandable that the first random number coming from the server may indicate that the first random number authentication is successful, and the electronic device may continue the authentication process to obtain the required model file from the server.
[0105] Step 204b: When the electronic device determines that the first random number comes from the server, the electronic device signs the first random number using the chip private key of the first chip of the electronic device to obtain a first random number signature.
[0106] In some embodiments of the present application, after obtaining the first random number signature, the electronic device may send the first random number signature and the chip certificate of the first chip to the server, so that the server can obtain the first key based on the public key in the chip certificate.
[0107] In this way, the chip certificate of the chip is sent to the server only after verifying that the random number in the authentication process comes from the server, thereby preventing the authentication information from being forged and improving the security of the model when it is deployed in the user's electronic device.
[0108] The execution subject of the model deployment method provided in the embodiment of the present application may be a model deployment device. Exemplarily, the model deployment device may be a server, or a component in the server, such as an integrated circuit or a chip. The model deployment method provided in the embodiment of the present application will be exemplarily described below using an electronic device as an example.
[0109] The present application embodiment provides a model deployment method. Figure 5 A flow chart of a model deployment method provided by an embodiment of the present application is shown, and the method can be applied to a server. Figure 5 As shown, the model deployment method provided in the embodiment of the present application may include the following steps 301 to 303.
[0110] Step 301: The server generates a second key.
[0111] The second key can be used to decrypt the model file.
[0112] In some embodiments of the present application, the second key may be a symmetric key generated by the server and meeting security requirements.
[0113] Exemplarily, the second key may be a 256-bit symmetric key.
[0114] Step 302: The server uses the chip public key of the first chip of the electronic device to encrypt the second key to obtain the first key.
[0115] Step 303: The server sends the encrypted model file and the first key corresponding to the encrypted model file to the electronic device.
[0116] It should be noted that, for the detailed description of the above steps 301 to 302, reference may be made to the relevant description of the above steps 201 to 208. To avoid repetition, they will not be described again here.
[0117] The model deployment method provided in the embodiment of the present application can encrypt the model key through the chip key of the electronic device, so that the model can only be used in the electronic device corresponding to the chip. In addition, if the chip of the electronic device is not hacked, the model file deployed in the electronic device cannot be extracted and stolen. In this way, the security of the model when deployed in the user's electronic device is improved.
[0118] In some embodiments of the present application, before the above step 301, the model deployment method provided in the embodiment of the present application may further include the following steps 304 and 305, and the above step 301 may include the following step 301a.
[0119] Step 304: The server receives a chip certificate and a first random number signature from a first chip of the electronic device.
[0120] Step 305: The server determines whether the chip certificate of the first chip is valid based on the root certificate corresponding to the first chip.
[0121] Step 301a: When the chip certificate of the first chip is valid, the server generates a second key.
[0122] In some embodiments of the present application, the server can extract the chip public key from the chip certificate of the first chip, and verify whether the root certificate of the chip is issued by the issuer of the signature certificate through the chip public key. If it is determined that the root certificate of the chip is issued by the issuer of the signature certificate, it is determined that the chip certificate of the first chip is valid, thereby generating a second key.
[0123] It should be noted that, for the detailed description of the above steps 304, 305 and 301a, reference may be made to the relevant description of the above steps 201 to 208. To avoid repetition, they will not be described again here.
[0124] In this way, the key used to decrypt the model file is encrypted by the chip private key of the chip in the electronic device, and the chip private key and the key are bound, so that the encrypted model file cannot be cracked unless the chip of the electronic device is hacked, thereby improving the security of the model when it is deployed in the user's electronic device.
[0125] In some embodiments of the present application, before the above step 304, the model deployment method provided by the embodiment of the present application may also include the following steps 306 to 309.
[0126] Step 306: The server receives the second random number and the first certificate from the electronic device.
[0127] The first certificate may be a device certificate of the electronic device.
[0128] Step 307: The server determines whether the first certificate is valid based on the root certificate corresponding to the electronic device.
[0129] Step 308: When the first certificate is valid, the server generates a first random number, and signs the second random number using the server's private key to obtain a second random number signature.
[0130] Step 309: The server sends the first random number and the second random number signature to the electronic device.
[0131] It should be noted that, for the detailed description of the above steps 306 to 309, reference may be made to the relevant description of the above steps 201 to 208. To avoid repetition, they will not be described again here.
[0132] In this way, the chip certificate of the chip is sent to the server only after verifying that the random number in the authentication process comes from the server, thereby preventing the authentication information from being forged and improving the security of the model when it is deployed in the user's electronic device.
[0133] Each of the above-mentioned method embodiments, or various possible implementation methods in each method embodiment can be executed separately, or any two or more of them can be executed in combination with each other. The specific implementation method can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.
[0134] The following is an illustrative example of the model acquisition method and model deployment method provided in the embodiments of the present application.
[0135] like Figure 6As shown, taking the first chip as a security chip, the signature certificate issuer corresponds to the first server, the large model supplier (i.e., the server that executes the model deployment method) corresponds to the second server, the electronic device manufacturer corresponds to the third server, and the security chip manufacturer corresponds to the fourth server as an example, the model acquisition method and the model deployment method may include the following steps 401 to 411.
[0136] Step 401: The root certificate of the first server for issuing its own certificate is Root_Cert_CA.
[0137] Step 402: The second server sends a certificate request to the first server, and the second server returns the large model supplier root certificate Root_Cert_Model.
[0138] It can be understood that the root certificate Root_Cert_Model of the large model supplier meets the requirements for issuing the next level certificate, and the corresponding private key is kept in the hands of the large model supplier.
[0139] Step 403: The third server sends a certificate request to the first server, and the second server returns the electronic device manufacturer's root certificate Root_Cert_Manufacture.
[0140] It is understandable that the electronic equipment manufacturer's root certificate Root_Cert_Manufacture meets the requirements for issuing the next level certificate, and the corresponding private key is kept in the hands of the electronic equipment manufacturer.
[0141] Step 404: The fourth server sends a certificate request to the first server, and the first server returns the root certificate Root_Cert_Chip of the security chip manufacturer.
[0142] It is understandable that the security chip manufacturer's root certificate Root_Cert_Chip meets the requirements for issuing the next level certificate.
[0143] In some embodiments of the present application, the security chip manufacturer needs to burn the security chip manufacturer's root certificate Root_Cert_Chip during the chip production process. The corresponding private key can be kept in the hands of the chip manufacturer, and the certificate Cert_Chip and private key of each chip can be kept in the secure storage space of the chip, and the certificate can be associated with Root_Cert_CA (i.e., the root certificate of the certificate issuer) through the root certificate of the security chip manufacturer.
[0144] In some embodiments of the present application, when an electronic device is produced, the electronic device manufacturer can burn the device's private key into the secure storage space of the device's chip, and use the electronic device's root certificate to issue a certificate for the private key, generate a corresponding device certificate Cert_Phone, and store the certificate in the device's operating system.
[0145] It can be understood that the above-mentioned device certificate Cert_Phone is the first certificate.
[0146] Step 405, the electronic device downloads the large model, verifies whether the Root_Cert_Model is valid, establishes a secure channel with the second server, and sends Cert_Phone including a random number A to the second server.
[0147] Among them, when the user wants to download an application with a large model, the electronic device can first verify whether the certificate Root_Cert_Model of the large model supplier can be associated with the root certificate Root_Cert_CA of the certificate issuer, and establish a secure channel with the cloud of the large model supplier, and use the device's own private key to sign the random number A, and send the corresponding certificate Cert_Phone to the second server.
[0148] Step 406: The second server verifies whether Cert_Phone comes from Root_Cert_Manufacture.
[0149] In other words, the large model supplier can verify whether the device certificate Cert_Phone can be linked to the root certificate Root_Cert_Manufacture of the upstream mobile phone production and the root certificate Root_Cert_CA of the certificate issuer, and confirm whether the certificate comes from a specific electronic device manufacturer. Then, the electronic device can send a random number signed with its own private key to the electronic device, and sign the random number received from the electronic device with its own private key and send it to the device together.
[0150] In some embodiments of the present application, when Cert_Phone determines that it comes from Root_Cert_Manufacture, the second server signs the random number A and sends the random number B.
[0151] It is understandable that the random number A may be a second random number. After the second server signs the random number A, it may obtain a signature of the random number A, that is, a second random number signature.
[0152] The random number B mentioned above is the first random number.
[0153] Step 407: The electronic device calls a specific interface of the security chip, verifies the Root_Cert_Model, and signs the random number B.
[0154] It is understandable that after the electronic device signs the random number B, a signature of the random number B can be obtained, that is, the first random number signature.
[0155] It can be understood that the electronic device can use the random number B, random number signature and root certificate of the large model supplier provided by the large model supplier to verify that the random number signature comes from the large model supplier, and when the root certificate of the large model supplier (Root_Cert_Model) and the root certificate of the certificate issuing unit (Root_Cert_CA) are bound, call the chip private key burned in the security chip, sign the random number B signed by the large model supplier, and reply to the large model supplier together with the chip certificate of the device.
[0156] Step 408: The second server verifies Cert_Chip and the random number signature B, generates a second key, and encrypts the second key using the Cert_Chip public key to obtain the first key; at the same time, the model file is encrypting using the second key to obtain an encrypted model file.
[0157] In some embodiments of the present application, the large model supplier (i.e., the second server) verifies the random number signature from the security chip, and the corresponding certificate (Cert_Chip) can be associated with the root certificate (Root_Cert_Chip) of the security chip manufacturer and the root certificate (Root_Cert_Chip) of the certificate issuer, and then a symmetric key (i.e., the second key) that meets the security requirements can be generated, and the symmetric key is encrypted using the public key of the certificate (Cert_Chip) in the security chip to obtain the first key. The encrypted first key is signed with its own private key and sent to the electronic device through a secure channel. At the same time, the second server can start to encrypt the large model file using the second key. After the encryption is completed, the signed encrypted symmetric key and the encrypted large model file are sent to the electronic device together.
[0158] Step 409: The electronic device verifies the signature of the first key, decrypts the first key using the Cert_Chip private key to obtain the second key, and decrypts the encrypted model file using the second key.
[0159] In this way, the model key can be encrypted by the chip key of the electronic device, so that the model can only be used in the electronic device corresponding to the chip. In addition, if the chip of the electronic device is not hacked, the model file deployed in the electronic device cannot be extracted and stolen. In this way, the security of the model when deployed in the user's electronic device is improved.
[0160] The model acquisition method provided in the embodiment of the present application can be executed by a model acquisition device. In the embodiment of the present application, the model acquisition device executing the model acquisition method is taken as an example to illustrate the model acquisition device provided in the embodiment of the present application.
[0161] Figure 7 FIG. 1 shows a possible structural diagram of a model acquisition device involved in an embodiment of the present application. Figure 7 As shown, the model acquisition device 70 may include: an acquisition module 71 and a decryption module 72.
[0162] Among them, the acquisition module 71 is used to obtain the encrypted model file and the first key corresponding to the encrypted model file; the decryption module 72 is used to use the chip private key of the first chip to decrypt the first key obtained by the acquisition module 71 to obtain the second key; and, is used to use the second key to decrypt the encrypted model file to obtain the decrypted model file.
[0163] In a possible implementation, the above device further includes: a generating module, a sending module and a receiving module;
[0164] The generation module is used to generate a first random number signature according to a chip private key of a first chip of the electronic device and a first random number before the acquisition module 71 acquires the encrypted model file and the first key corresponding to the encrypted model file, where the first random number comes from the server;
[0165] The sending module is used to send the chip certificate of the first chip and the first random number signature obtained by the generating module to the server, the chip certificate of the first chip includes a chip public key, and the chip public key is used to generate the first key;
[0166] The receiving module is used to receive the encrypted model file and the first key from the server.
[0167] In a possible implementation, the generation module is specifically configured to call the first interface of the first chip, and use the chip private key of the first chip to sign the first random number to obtain the first random number signature.
[0168] In a possible implementation, the apparatus further includes: a determination module;
[0169] The sending module is further used to send a second random number and a first certificate to the server before the generating module generates a first random number signature according to the chip private key of the first chip of the electronic device and the first random number, wherein the first certificate is a device certificate of the electronic device;
[0170] The receiving module is further used to receive a first random number and a second random number signature from a server;
[0171] The determination module is used to determine whether the first random number comes from the server based on the first random number, the second random number signature and the root certificate corresponding to the server;
[0172] The generation module is specifically used to sign the first random number using the chip private key of the first chip of the electronic device to obtain the first random number signature when the determination module determines that the first random number comes from the server.
[0173] The embodiment of the present application provides a model acquisition device, which can encrypt the model key through the chip key of the electronic device, so that the model can only be used in the electronic device corresponding to the chip. In addition, if the chip of the electronic device is not hacked, the model file deployed in the electronic device cannot be extracted and stolen. In this way, the security of the model when deployed in the user's electronic device is improved.
[0174] The model deployment method provided in the embodiment of the present application can be executed by a model deployment device. In the embodiment of the present application, the model deployment method executed by the model deployment device is taken as an example to illustrate the model deployment device provided in the embodiment of the present application.
[0175] Figure 8 A possible structural diagram of a model deployment device involved in an embodiment of the present application is shown. Figure 8 As shown, the model deployment device 80 may include: a generation module 81, an encryption module 82 and a sending module 83.
[0176] Among them, the generation module 81 is used to generate a second key, and the second key is used to decrypt the model file; the encryption module 82 is used to use the chip public key of the first chip of the electronic device to encrypt the second key generated by the generation module 81 to obtain the first key; the sending module 83 is used to send the encrypted model file and the first key corresponding to the encrypted model file to the electronic device.
[0177] In a possible implementation, the above device further includes: a receiving module and a determining module;
[0178] The receiving module is used to receive the chip certificate and the first random number signature of the first chip from the electronic device before the generating module 81 generates the second key;
[0179] The above-mentioned determination module is used to determine whether the chip certificate of the first chip received by the receiving module is valid based on the root certificate corresponding to the first chip;
[0180] The generating module 81 is specifically configured to generate the second key when the chip certificate of the first chip is valid.
[0181] In a possible implementation, the receiving module is further configured to receive a second random number and a first certificate from the electronic device before receiving a chip certificate and a first random number signature from a first chip of the electronic device, wherein the first certificate is a device certificate of the electronic device;
[0182] The above-mentioned determination module is further used to determine whether the first certificate received by the receiving module is valid based on the root certificate corresponding to the electronic device;
[0183] The generating module 81 is further configured to generate a first random number when the first certificate is valid, and to sign a second random number using a private key of the server to obtain a second random number signature;
[0184] The sending module 83 is also used to send the first random number and the second random number signature to the electronic device.
[0185] The embodiment of the present application provides a model deployment device, which can encrypt the model key through the chip key of the electronic device, so that the model can only be used in the electronic device corresponding to the chip. In addition, if the chip of the electronic device is not hacked, the model file deployed in the electronic device cannot be extracted and stolen. In this way, the security of the model when deployed in the user's electronic device is improved.
[0186] The model acquisition device and model deployment device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or it can be other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a car electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0187] The model acquisition device and the model deployment device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0188] The model acquisition device provided in the embodiment of the present application can implement the various processes implemented in the above-mentioned model acquisition method embodiment, and the model deployment device provided in the embodiment of the present application can implement the various processes implemented in the above-mentioned model deployment method embodiment, and achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0189] Alternatively, if Fig. 9 As shown, an embodiment of the present application also provides an electronic device 900, including a processor 901 and a memory 902, wherein the memory 902 stores programs or instructions that can be executed on the processor 901, and when the program or instructions are executed by the processor 901, the various steps of the above-mentioned model acquisition method and model deployment method embodiments are implemented, and the same technical effects can be achieved. To avoid repetition, they are not described here.
[0190] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0191] Fig.10 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0192] The electronic device 1000 includes but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010 and other components.
[0193] Those skilled in the art will appreciate that the electronic device 1000 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 1010 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Fig.10 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0194] Among them, the processing module 1010 is used to obtain the encrypted model file and the first key corresponding to the encrypted model file; and, is used to use the chip private key of the first chip to decrypt the first key obtained by the processing module 1010 to obtain the second key; and, is also used to use the second key to decrypt the encrypted model file to obtain the decrypted model file.
[0195] In a possible implementation, the processing module 1010 is configured to generate a first random number signature according to a chip private key of a first chip of the electronic device and a first random number before the processing module 1010 obtains the encrypted model file and the first key corresponding to the encrypted model file, where the first random number comes from the server;
[0196] The radio frequency unit 1001 is used to send the chip certificate of the first chip and the first random number signature obtained by the processing module 1010 to the server, where the chip certificate of the first chip includes a chip public key, and the chip public key is used to generate a first key; and to receive the encrypted model file and the first key from the server.
[0197] In a possible implementation, the processing module 1010 is specifically configured to call the first interface of the first chip, and use the chip private key of the first chip to sign the first random number to obtain the first random number signature.
[0198] In a possible implementation, the radio frequency unit 1001 is further configured to send a second random number and a first certificate to a server before the processing module 1010 generates a first random number signature according to a chip private key of a first chip of the electronic device and a first random number, wherein the first certificate is a device certificate of the electronic device;
[0199] The radio frequency unit 1001 is further used to receive a first random number and a second random number signature from a server;
[0200] The processing module 1010 is used to determine whether the first random number comes from the server according to the first random number, the second random number signature and the root certificate corresponding to the server;
[0201] The processing module 1010 is specifically configured to sign the first random number using the chip private key of the first chip of the electronic device to obtain a first random number signature when the processing module 1010 determines that the first random number comes from the server.
[0202] The embodiment of the present application provides an electronic device, which can encrypt a model key through a chip key of the electronic device, so that the model can only be used in the electronic device corresponding to the chip. In addition, if the chip of the electronic device is not hacked, the model file deployed in the electronic device cannot be extracted and stolen. In this way, the security of the model when deployed in the user's electronic device is improved.
[0203] It should be understood that in the embodiment of the present application, the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 10041 and a microphone 10042, and the graphics processor 10041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 1007 includes a touch panel 10071 and at least one of other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 may include two parts: a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0204] The memory 1009 can be used to store software programs and various data. The memory 1009 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 1009 may include a volatile memory or a non-volatile memory, or the memory 1009 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 1009 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0205] The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 1010.
[0206] The embodiment of the present application also provides a server, including a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the following Figure 5 The server embodiment corresponds to the above server method embodiment, and each implementation process and implementation mode of the above method embodiment can be applied to the server embodiment and can achieve the same technical effect.
[0207] Specifically, the embodiment of the present application also provides a server, which can be Figure 8 The model deployment device shown. Fig.11 As shown, the server 1100 includes: an antenna 111, a radio frequency device 112, a baseband device 113, a processor 114 and a memory 115. The antenna 111 is connected to the radio frequency device 112. In the uplink direction, the radio frequency device 112 receives information through the antenna 111 and sends the received information to the baseband device 113 for processing. In the downlink direction, the baseband device 113 processes the information to be sent and sends it to the radio frequency device 112, and the radio frequency device 112 processes the received information and sends it out through the antenna 111.
[0208] The method executed by the server in the above embodiment may be implemented in the baseband device 113, which includes a baseband processor.
[0209] The baseband device 113 may include, for example, at least one baseband board on which a plurality of chips are arranged. Fig.11 As shown, one of the chips is, for example, a baseband processor, which is connected to the memory 115 through a bus interface to call the program in the memory 115 to execute the network device operations shown in the above method embodiment.
[0210] The server may further include a network interface 116, such as a Common Public Radio Interface (CPRI).
[0211] Specifically, the server 1100 of the embodiment of the present application further includes: instructions or programs stored in the memory 115 and executable on the processor 114, and the processor 114 calls the instructions or programs in the memory 115 to execute. Figure 8 The methods executed by the modules shown achieve the same technical effects, and therefore will not be described here in detail to avoid repetition.
[0212] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned model acquisition method and model deployment method embodiments is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0213] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0214] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned model acquisition method and model deployment method embodiments, and can achieve the same technical effects. To avoid repetition, they will not be repeated here.
[0215] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0216] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned model acquisition method and model deployment method embodiments, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0217] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0218] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0219] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A model acquisition method, characterized in that: The method comprises: The electronic device obtains the encrypted model file and a first key corresponding to the encrypted model file; The electronic device uses the chip private key of the first chip to decrypt the first key to obtain a second key; The electronic device uses the second key to decrypt the encrypted model file to obtain a decrypted model file.
2. The method according to claim 1, characterized in that: Before the electronic device obtains the encrypted model file and the first key corresponding to the encrypted model file, the method further includes: The electronic device generates a first random number signature according to a chip private key of a first chip of the electronic device and a first random number, where the first random number comes from a server; The electronic device sends the chip certificate of the first chip and the first random number signature to the server, where the chip certificate of the first chip includes a chip public key, and the chip public key is used to generate the first key; The electronic device obtains an encrypted model file and a first key corresponding to the encrypted model file, including: The electronic device receives the encrypted model file and the first key from the server.
3. The method according to claim 2, characterized in that The electronic device generates a first random number signature according to a chip private key of a first chip of the electronic device and a first random number, including: The electronic device calls the first interface of the first chip, and uses the chip private key of the first chip to sign the first random number to obtain the first random number signature.
4. The method according to claim 2 or 3, characterized in that: Before the electronic device generates a first random number signature according to a chip private key of a first chip of the electronic device and a first random number, the method further includes: The electronic device sends a second random number and a first certificate to the server, where the first certificate is a device certificate of the electronic device; The electronic device receives the first random number and the second random number signature from the server; The electronic device determines whether the first random number comes from the server according to the first random number, the second random number signature and the root certificate corresponding to the server; The electronic device generates a first random number signature according to a chip private key of a first chip of the electronic device and a first random number, including: When determining that the first random number comes from the server, the electronic device signs the first random number using the chip private key of the first chip of the electronic device to obtain the first random number signature.
5. A model deployment method, characterized in that: The method comprises: The server generates a second key, where the second key is used to decrypt the model file; The server uses the chip public key of the first chip of the electronic device to encrypt the second key to obtain the first key; The server sends the encrypted model file and the first key corresponding to the encrypted model file to the electronic device.
6. The method according to claim 5, characterized in that Before the server generates the second key, the method further includes: The server receives a chip certificate and a first random number signature of the first chip from the electronic device; The server determines whether the chip certificate of the first chip is valid based on the root certificate corresponding to the first chip; The server generates a second key, including: The server generates the second key when the chip certificate of the first chip is valid.
7. The method according to claim 6, characterized in that Before the server receives the chip certificate and the first random number signature of the first chip from the electronic device, the method further includes: The server receives a second random number and a first certificate from the electronic device, where the first certificate is a device certificate of the electronic device; The server determines whether the first certificate is valid based on the root certificate corresponding to the electronic device; When the first certificate is valid, the server generates a first random number, and signs the second random number using the private key of the server to obtain the second random number signature; The server sends the first random number and the second random number signature to the electronic device.
8. A model acquisition device, characterized in that: The device comprises: an acquisition module and a decryption module; The acquisition module is used to acquire the encrypted model file and the first key corresponding to the encrypted model file; The decryption module is configured to use the chip private key of the first chip to decrypt the first key acquired by the acquisition module to obtain a second key; The decryption module is further configured to use the second key to decrypt the encrypted model file to obtain a decrypted model file.
9. A model deployment device, characterized in that: The device comprises: a generating module, an encrypting module and a sending module; The generating module is used to generate a second key, and the second key is used to decrypt the model file; The encryption module is used to encrypt the second key generated by the generation module using the chip public key of the first chip of the electronic device to obtain the first key; The sending module is used to send the encrypted model file and the first key corresponding to the encrypted model file to the electronic device.
10. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the model acquisition method according to any one of claims 1 to 4 are implemented.
11. A server, characterized in that: It includes a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the model deployment method according to any one of claims 5 to 7 are implemented.
12. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the model acquisition method as described in any one of claims 1 to 4 are implemented, or the steps of the model deployment method as described in any one of claims 5 to 7 are implemented.
13. A computer program product, wherein the computer program product is stored in a storage medium, and wherein the computer program product is executed by at least one processor to implement the model acquisition method as described in any one of claims 1 to 4, or to implement the steps of the model deployment method as described in any one of claims 5 to 7.
Citation Information
Cited By
AI model edge device binding protection method based on hardware security module
CN120658440A
Model reasoning method, model encryption method, electronic equipment and storage medium
CN120675883A
