CN109815710A - A kind of guard method of intelligent algorithm model file - Google Patents
A kind of guard method of intelligent algorithm model file Download PDFInfo
- Publication number
- CN109815710A CN109815710A CN201811534806.3A CN201811534806A CN109815710A CN 109815710 A CN109815710 A CN 109815710A CN 201811534806 A CN201811534806 A CN 201811534806A CN 109815710 A CN109815710 A CN 109815710A
- Authority
- CN
- China
- Prior art keywords
- file
- encryption
- source code
- model
- guard method
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Abstract
The invention discloses a kind of guard methods of intelligent algorithm model file; the application program of model file and application intelligent algorithm processing data in a local intelligent equipment including an intelligent algorithm; it is further comprising the steps of: step S1; model file is encrypted, an encryption file is formed;Step S2 carries out random division processing to encryption file, generates multiple sub- encryption files;Step S3 encrypts the corresponding source code subfile of file generated according to every height respectively;Step S4, by institute's source code subfile compiling link into application program.The beneficial effect of above-mentioned technical proposal is: it is able to solve the intelligent algorithm model being placed in equipment end, is easy to crack the problem of usurping, conceals position and the content of model file, improves the difficulty of reverse-engineering, the effective protection safety of algorithm model.
Description
Technical field
The present invention relates to artificial intelligence field more particularly to a kind of guard methods of intelligent algorithm model file.
Background technique
With the rapid development of artificial intelligence industry in recent years, the application of artificial intelligence is continuously emerged.Typical artificial intelligence
Energy application software, consists of three parts: application module, AI Computational frame and algorithm model.Algorithm model includes neural network knot
Structure and the network parameter for using mass data to obtain after training for application scenarios, it may be possible to one or more individually texts
Part is the most crucial part of application software.
For the artificial intelligence application in cloud, algorithm model is placed on the server of service provider, in safety
State.And for the artificial intelligence application of embedded equipment, algorithm model must be put into equipment in company with application software together
On.How to guarantee the algorithm model placed in equipment end, be not cracked, usurp, is a problem to be solved.It is especially right
For algorithm company, algorithm model is its core value, and this respect demand is more strong.
Current existing guard method is broadly divided into two classes: the first kind is traditional to encrypt to algorithm model file.
Individual model file is still remained in system, provides clue for competitor analysis algorithm model;Second class, model text
Part becomes source code file, and entire application program compiling link together.In this way, individual model file is not present in system,
For example model file can be converted to C++ file by the MACE of millet company, the tool of offer.But the C++ file that MACE is generated
In, each network layer has individual data definition, completely remains the structure of network, and also do not encrypt, safety
Property is inadequate.
Summary of the invention
According to the above-mentioned problems in the prior art, a kind of protection side of intelligent algorithm model file is now provided
Method, it is intended to solve the problem of to be placed in the intelligent algorithm model in equipment end and be easy to crack and usurp, conceal the position of model file
It sets and content, improves the difficulty of reverse-engineering, the effective protection safety of algorithm model.
Above-mentioned technical proposal specifically includes:
A kind of guard method of intelligent algorithm model file includes that an artificial intelligence is calculated in a local intelligent equipment
The model file of method and the application program of application intelligent algorithm processing data, further comprising the steps of:
The model file is encrypted in step S1, forms an encryption file;
Step S2 carries out random division processing to the encryption file, generates multiple sub- encryption files;
Step S3, respectively according to the corresponding source code subfile of each sub- encryption file generated;
Step S4, by all source code subfile compiling links into the application program.
Preferably, in the step S1, using preset Encryption Algorithm, the model file is carried out using encryption key
Encryption forms the encryption file.
Preferably, each source code subfile includes module control head and a character array;
It include for deriving the information of the Encryption Algorithm and the encryption key, the encryption in the module control head
The total length of file, the sub- encryption file it is described encryption file in initial position, the sub- encryption file size with
And the address of the sub- encryption file;
The character array is the text information of the sub- encryption file.
Preferably, in the step S4, by all source code subfile compiling links into the application program after,
Each source code subfile is scattered in the different location of the application program at random.
Preferably, when the application program is needed using the model file, following decryption steps are executed:
Step A1 finds the module control head of all source code subfiles;
Step A2 controls head according to the module, forms the encryption text according to all source code subfile splits
Part;
Step A3 adds according to the cipher mode that the encryption file is encrypted in the step S1 to described
Ciphertext part is decrypted, and obtains the model file and exports.
Preferably, the step A2 is specifically included:
Step A21 controls head according to the module, extracts the character in the corresponding source code subfile respectively
The content of array;
Step A22, according to the content for extracting all character arrays, split forms the encryption file.
Preferably, the step A3 is specifically included:
Step A31 controls head according to the module and the Encryption Algorithm and encryption used in the step S1 is calculated
Key;
Step A32 carries out the encryption file using the Encryption Algorithm and the encryption key that are calculated
Decryption, obtains the model file and exports.
Preferably, the source code subfile is C file perhaps C++ file or assembling file.
The beneficial effect of above-mentioned technical proposal is: a kind of guard method of intelligent algorithm model file is provided, it can
It solves the problem of to be placed in the intelligent algorithm model in equipment end and is easy to crack and usurp, conceal the position of model file and interior
Hold, improves the difficulty of reverse-engineering, the effective protection safety of algorithm model.
Detailed description of the invention
Fig. 1 is a kind of totality of the guard method of intelligent algorithm model file in preferred embodiment of the invention
Flow diagram;
Fig. 2 is a kind of model of the guard method of intelligent algorithm model file in preferred embodiment of the invention
File decryption overall procedure schematic diagram;
Fig. 3-4 is in preferred embodiment of the invention, on the basis of Fig. 1, to intelligent algorithm model file
The flow diagram that guard method is described further.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, those of ordinary skill in the art without creative labor it is obtained it is all its
His embodiment, shall fall within the protection scope of the present invention.
It should be noted that in the absence of conflict, the feature in embodiment and embodiment in the present invention can phase
Mutually combination.
The present invention will be further explained below with reference to the attached drawings and specific examples, but not as the limitation of the invention.
Based on the above-mentioned problems in the prior art, the present invention provides a kind of protection of intelligent algorithm model file
Method, model file and application intelligent algorithm in a local intelligent equipment including an intelligent algorithm handle number
According to application program, as shown in Figure 1, further comprising the steps of:
Step S1, is encrypted model file, forms an encryption file;
Step S2 carries out random division processing to encryption file, generates multiple sub- encryption files;
Step S3 encrypts the corresponding source code subfile of file generated according to every height respectively;
Step S4, by institute's source code subfile compiling link into application program.
Specifically, in specific embodiments of the present invention, a kind of model file of intelligent algorithm is embedded in local intelligent
In equipment, preset application program is handled data using above-mentioned intelligent algorithm in equipment.In order to protect above-mentioned people
The model file of work intelligent algorithm is not easy to crack and usurp, firstly, model file is encrypted to form an encryption file;
Then, random division is carried out into multiple sub- encryption files to encryption file;Further, file life is encrypted according to every height respectively
At corresponding source code subfile, wherein source code subfile can be C file perhaps C++ file or assembling file;Most
Afterwards, by institute's source code subfile compiling link into application program.
In preferred embodiment of the invention, in step S1, using preset Encryption Algorithm, using encryption key to model
File is encrypted, and forms encryption file.
Specifically, the basic process of data encryption be exactly to the file or data that were originally plaintext by certain algorithm at
Reason, becomes one section of unreadable code, commonly referred to as " ciphertext ", show that it can only after inputting corresponding key could
Original content is shown, approach in this way achievees the purpose that protect data not stolen, read by juridical-person.Encryption Algorithm is logical
Often it is divided into two major classes: " symmetrical expression " and " asymmetric ".
In a preferred embodiment of the invention, using symmetry encryption technology, that is, encrypts and decrypt using same close
Key, normally referred to as " SessionKey " this encryption technology are widely adopted now, and the DES as used by U.S. government adds
Data Encryption Standard is exactly a kind of typical " symmetrical expression " enciphered method, its SessionKey length is 56bits.
Model file is encrypted using above-mentioned symmetry encryption technology, forms encryption file.
Further, each source code subfile includes module control head and a character array;Wherein, module controls head
In include for deriving the information of Encryption Algorithm and encryption key, encrypting the total length of file, sub- encryption file in encryption file
In initial position, sub- encryption file size and son encryption file address;Character array is the text of son encryption file
Information.
In preferred embodiment of the invention, in step S4, by institute's source code subfile compiling link to application program
In after, each source code subfile is scattered in the different location of application program at random.
Specifically, institute's source code subfile is compiled into a file destination, it is right when carrying out link generation application program
The file destination list progress of incoming linker is randomly ordered, to upset position of each file destination in listed files, from
And realize in the application program of generation, each source code subfile is scattered in the different location of application program at random.
It should be noted that the file destination of other modules in above-mentioned list comprising application program.
In preferred embodiment of the invention, as shown in Fig. 2, when application program is needed using model file, under execution
State decryption step:
Step A1 finds the module control head of whole source code subfiles;
Step A2 controls head according to module, forms encryption file according to the subfile split of institute's source code;
Step A3 solves encryption file according to the cipher mode that encryption file is encrypted in step S1
It is close, it obtains model file and exports.
Specifically, it in above-described embodiment, before application program needs calling model file, needs first in the application,
Head is controlled according to the module that whole source code subfiles are found in the address of sub- encryption file;Then, it is controlled in head according to module
Institute's source code subfile split is formed encryption file by initial position of the son encryption file in encryption file;Finally, due to
Using using symmetry encryption technology, can according in step S1 to the cipher mode that is encrypted of encryption file and use
In the information for deriving Encryption Algorithm and encryption key, encryption file is decrypted, model file is obtained and exports.
In preferred embodiment of the invention, as shown in figure 3, step A2 is specifically included:
Step A21 controls head according to module, extracts the content of the character array in corresponding source code subfile respectively;
Step A22, according to the content for extracting all character arrays, split forms encryption file.
Specifically, in above-described embodiment, head is first controlled according to module, respectively corresponding source code of extraction module control
The content of character array in file;Again file will be being encrypted according to the content and son encryption file of extracting all character arrays
In initial position, by sub- encryption file split formed encryption file.
In preferred embodiment of the invention, as shown in figure 4, step A3 is specifically included:
Step A31 controls head according to module and the Encryption Algorithm used in step S1 and encryption key is calculated;
Step A32 is decrypted encryption file using the Encryption Algorithm and encryption key being calculated, obtains model
File simultaneously exports.
Specifically, it in above-described embodiment, is first calculated in step S1 according to module control head and model file is added
Encryption Algorithm employed in close treatment process and encryption key;Again using the Encryption Algorithm and encryption key being calculated
Encryption file is decrypted, model file is obtained and exports.
The foregoing is merely preferred embodiments of the present invention, are not intended to limit embodiments of the present invention and protection model
It encloses, to those skilled in the art, should can appreciate that all with made by description of the invention and diagramatic content
Equivalent replacement and obviously change obtained scheme, should all be included within the scope of the present invention.
Claims (8)
1. a kind of guard method of intelligent algorithm model file, which is characterized in that include one in a local intelligent equipment
The model file of intelligent algorithm and the application program of application intelligent algorithm processing data, further include following step
It is rapid:
The model file is encrypted in step S1, forms an encryption file;
Step S2 carries out random division processing to the encryption file, generates multiple sub- encryption files;
Step S3, respectively according to the corresponding source code subfile of each sub- encryption file generated;
Step S4, by all source code subfile compiling links into the application program.
2. guard method as described in claim 1, which is characterized in that in the step S1, using preset Encryption Algorithm, benefit
The model file is encrypted with encryption key, forms the encryption file.
3. guard method as described in claim 1, which is characterized in that each source code subfile is controlled including a module
Head and a character array;
It include for deriving the information of the Encryption Algorithm and the encryption key, the encryption file in the module control head
Total length, the sub- encryption file it is described encryption file in initial position, the sub- encryption file size and institute
State the address of sub- encryption file;
The character array is the text information of the sub- encryption file.
4. guard method as described in claim 1, which is characterized in that in the step S4, by all source code Ziwens
After part compiling link is into the application program, each source code subfile is scattered in the application program not at random
Same position.
5. guard method as claimed in claim 2, which is characterized in that when the application program is needed using the model file
When, execute following decryption steps:
Step A1 finds the module control head of all source code subfiles;
Step A2 controls head according to the module, forms the encryption file according to all source code subfile splits;
Step A3, according to the cipher mode that the encryption file is encrypted in the step S1, to the encryption text
Part is decrypted, and obtains the model file and exports.
6. guard method as claimed in claim 5, which is characterized in that the step A2 is specifically included:
Step A21 controls head according to the module, extracts the character array in the corresponding source code subfile respectively
Content;
Step A22, according to the content for extracting all character arrays, split forms the encryption file.
7. guard method as claimed in claim 5, which is characterized in that the step A3 is specifically included:
Step A31 controls head according to the module and the Encryption Algorithm used in the step S1 and encryption key is calculated;
Step A32 is decrypted the encryption file using the Encryption Algorithm and the encryption key being calculated,
It obtains the model file and exports.
8. guard method as described in claim 1, which is characterized in that the source code subfile is C file or C++ text
Part or assembling file.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811534806.3A CN109815710A (en) | 2018-12-14 | 2018-12-14 | A kind of guard method of intelligent algorithm model file |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811534806.3A CN109815710A (en) | 2018-12-14 | 2018-12-14 | A kind of guard method of intelligent algorithm model file |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109815710A true CN109815710A (en) | 2019-05-28 |
Family
ID=66601683
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811534806.3A Pending CN109815710A (en) | 2018-12-14 | 2018-12-14 | A kind of guard method of intelligent algorithm model file |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109815710A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110062014A (en) * | 2019-06-11 | 2019-07-26 | 苏州思必驰信息科技有限公司 | The encryption and decryption method and system of network model |
CN110619220A (en) * | 2019-08-09 | 2019-12-27 | 北京小米移动软件有限公司 | Method and device for encrypting neural network model and storage medium |
CN112508200A (en) * | 2020-12-18 | 2021-03-16 | 北京百度网讯科技有限公司 | Method, apparatus, device, medium, and program for processing machine learning model file |
CN112749780A (en) * | 2019-10-31 | 2021-05-04 | 阿里巴巴集团控股有限公司 | Data processing method, device and equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7165050B2 (en) * | 2004-09-20 | 2007-01-16 | Aaron Marking | Media on demand via peering |
CN102402670A (en) * | 2011-08-03 | 2012-04-04 | 广东欧珀移动通信有限公司 | File encryption and decryption method |
CN103346998A (en) * | 2013-05-18 | 2013-10-09 | 北京凯锐立德科技有限公司 | File breaking encryption-based file security protection method |
CN105516204A (en) * | 2016-01-27 | 2016-04-20 | 北京理工大学 | Method for high-security network data storage |
CN105975877A (en) * | 2016-07-01 | 2016-09-28 | 中国联合网络通信有限公司重庆市分公司 | Safe storage method for sensitive file |
-
2018
- 2018-12-14 CN CN201811534806.3A patent/CN109815710A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7165050B2 (en) * | 2004-09-20 | 2007-01-16 | Aaron Marking | Media on demand via peering |
CN102402670A (en) * | 2011-08-03 | 2012-04-04 | 广东欧珀移动通信有限公司 | File encryption and decryption method |
CN103346998A (en) * | 2013-05-18 | 2013-10-09 | 北京凯锐立德科技有限公司 | File breaking encryption-based file security protection method |
CN105516204A (en) * | 2016-01-27 | 2016-04-20 | 北京理工大学 | Method for high-security network data storage |
CN105975877A (en) * | 2016-07-01 | 2016-09-28 | 中国联合网络通信有限公司重庆市分公司 | Safe storage method for sensitive file |
Non-Patent Citations (1)
Title |
---|
NUOHY: "小米开源框架mace android案例调试", 《HTTPS://BLOG.CSDN.NET/QQ_27063119/ARTICLE/DETAILS/81015227》 * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110062014A (en) * | 2019-06-11 | 2019-07-26 | 苏州思必驰信息科技有限公司 | The encryption and decryption method and system of network model |
CN110062014B (en) * | 2019-06-11 | 2021-08-20 | 思必驰科技股份有限公司 | Encryption and decryption method and system of network model |
CN110619220A (en) * | 2019-08-09 | 2019-12-27 | 北京小米移动软件有限公司 | Method and device for encrypting neural network model and storage medium |
CN110619220B (en) * | 2019-08-09 | 2022-03-11 | 北京小米移动软件有限公司 | Method and device for encrypting neural network model and storage medium |
CN112749780A (en) * | 2019-10-31 | 2021-05-04 | 阿里巴巴集团控股有限公司 | Data processing method, device and equipment |
CN112508200A (en) * | 2020-12-18 | 2021-03-16 | 北京百度网讯科技有限公司 | Method, apparatus, device, medium, and program for processing machine learning model file |
CN112508200B (en) * | 2020-12-18 | 2024-01-16 | 北京百度网讯科技有限公司 | Method, apparatus, device, medium, and program for processing machine learning model file |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109815710A (en) | A kind of guard method of intelligent algorithm model file | |
CN109040090B (en) | A kind of data ciphering method and device | |
CN104205117B (en) | device file encryption and decryption method and device | |
CN100536393C (en) | Secret shared key mechanism based user management method | |
CN103248650B (en) | A kind of document down loading method and system | |
CN109902494A (en) | Data encryption storage method, device and document storage system | |
GB2567990A (en) | Data protection system and method | |
CN105184181B (en) | File encryption method, file decryption method and file encryption device | |
CN104704501B (en) | Securely generate and store in computer systems password | |
CN103177222A (en) | Processing method for file shell adding and shell removing and device thereof | |
CN103853943B (en) | program protection method and device | |
CN104657670A (en) | Data encryption based safety use method of configuration file | |
CN107423626A (en) | A kind of method of the BIOS renewal trust chains based on continuous hash value | |
CN103294496A (en) | Burning system | |
CN109075967A (en) | Data interactive method, ground control terminal, server and system based on unmanned plane | |
CN106557707A (en) | A kind of method and system for processing document data | |
CN110704854A (en) | Stream type encryption method aiming at text data reserved format | |
CN109474616A (en) | Multi-platform data sharing method and device and computer readable storage medium | |
CN104951674A (en) | Information hiding method for application program | |
CN102045159A (en) | Decryption processing method and device thereof | |
CN105825142A (en) | Method and device for encrypting and decrypting documents in mobile terminal | |
CN105184119B (en) | A kind of method for security protection of software | |
CN116502732B (en) | Federal learning method and system based on trusted execution environment | |
CN109614810A (en) | Data encryption and decryption method based on fingerprint | |
CN105159797A (en) | Oracle database based backup and recovery method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190528 |
|
RJ01 | Rejection of invention patent application after publication |