Algorithm SDK compiling and packaging method and device and storage medium

During the deployment of deep learning algorithms, hardware information is used for encryption and authorization, and a target model with encryption tools is generated, which solves the problem of limited algorithm deployment methods in the existing technology, and realizes offline deployment and encryption of algorithm SDK Authorization improves security and deployment efficiency.

CN118963768APending Publication Date: 2024-11-15GUANGDONG ELECTRIC POWER SCI RES INST ENERGY TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411058301.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

The deployment methods of existing deep learning algorithms lack structured algorithm deployment solutions, and the compilation and encryption processes lack systematic design, resulting in limited independent deployment and deployment capabilities of algorithms, making it difficult to achieve offline empowerment and secure deployment of algorithm SDKs.

Method used

By compiling and packaging the SDK in the home directory, generating a target model with encryption tools and decryption tools, and using hardware information for encryption and authorization, ensuring that the algorithm can only run on specific hardware, realizing offline deployment and encryption authorization of the algorithm.

Benefits of technology

It improves the security and deployment efficiency of the algorithm, reduces the complexity of use, realizes offline deployment and empowerment of the algorithm SDK, avoids source code migration, and improves offline deployment capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118963768A_ABST
    Figure CN118963768A_ABST
Patent Text Reader

Abstract

The invention discloses an algorithm SDK compiling and packaging method and device and a storage medium, and belongs to the technical field of computers.The method comprises the steps that according to compiling configuration information, an SDK needing to be compiled is compiled and packaged under a main directory, the SDK needing to be compiled is installed in a first directory, a compiling result is generated, and an SDK packaging file is placed in a second directory; according to the file under the main directory, combining the compiled file into a file of a library, and encrypting and authorizing a compiled result by using an encryption tool to generate a target model; and issuing the target model to the equipment as a target program, so that when the target program runs in the equipment, the target program decrypts the loaded content by using a decryption tool, performs authorization verification on the decrypted content, and reasones the decrypted content by using a target algorithm after the authorization verification is passed, thereby obtaining the target program. Therefore, offline enabling, encrypting, authorizing and compiling functions of the algorithm SDK are realized, and offline SDK generation of the algorithm is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of deep learning algorithm technology, and in particular to a method, device and storage medium for compiling and packaging an algorithm SDK. Background Art

[0002] With the development of deep learning algorithms, more and more algorithms are deployed on current servers or clouds to provide algorithm capability services. The deployment, compilation and encryption of algorithms are urgent issues to be solved. Most of the current deep learning algorithm deployments are deployed using methods such as containerized migration and source code encryption.

[0003] The encryption authorization of the existing offline algorithm deployment method relies on the implementation on the software side, which is not conducive to the independent deployment of the algorithm and the ability to provide independent algorithm empowerment. The source code migration method of containerized deployment avoids the work of environment configuration, but restricts the performance and model of hardware resources, which is not conducive to the use of algorithm SDK. The existing technology lacks a structured algorithm deployment solution, and the compilation and encryption process lacks a systematic design, which is not conducive to the batch processing of the algorithm engineering deployment process. Summary of the invention

[0004] The present invention provides a method, device and storage medium for compiling and packaging an algorithm SDK to realize offline enabling, encryption, authorization and compilation functions of the algorithm SDK, thereby realizing offline algorithm SDK generation.

[0005] The present invention provides a method for compiling and packaging an algorithm SDK, comprising:

[0006] According to the compilation configuration information, compile and package the SDK to be compiled in the main directory, install the SDK to be compiled in the first directory, generate the compilation result, and place the SDK package file in the second directory;

[0007] According to the files in the main directory, the compiled files are merged into library files, and the compiled results are encrypted and authorized by using an encryption tool to generate a target model; the target model has an encryption tool and a decryption tool;

[0008] The target model is published as a target program on the corresponding device, so that when the target program is running on the corresponding device, the target program uses a decryption tool to decrypt the loaded content, and performs authorization verification on the decrypted content. After the authorization verification passes, the target algorithm is used to infer the decrypted content.

[0009] Further, according to the compilation configuration information, the SDK to be compiled is compiled and packaged in the main directory, the SDK to be compiled is installed in the first directory, the compilation result is generated, and the SDK package file is placed in the second directory, specifically:

[0010] The main directory includes a publishing queue directory, a publishing configuration directory, a first directory, and a second directory;

[0011] Add the SDK directory name that needs to be compiled to the release queue directory;

[0012] Set compilation options in the release configuration directory;

[0013] According to the release queue directory and the release configuration directory, execute the build.bat or build.sh command to compile and package the SDK that needs to be compiled;

[0014] Install the SDK to be compiled in the first directory;

[0015] Put the SDK package file in the second directory;

[0016] After the compilation is completed, the compilation results are generated.

[0017] Furthermore, the compiled files are merged into library files according to the files in the main directory, and the compiled results are encrypted and authorized by using encryption tools to generate the target model, specifically:

[0018] During the compilation process, encryption tools and decryption tools are generated in the first directory;

[0019] The compiled files are merged into library files, wherein the compiled files include files in the first directory under the main directory, and the encryption tool under the first directory is used to encrypt and authorize the compiled results to generate a target model.

[0020] Furthermore, the encryption tool in the first directory is used to encrypt and authorize the compilation result, specifically:

[0021] Encrypt the compilation result using an encryption tool, bind the user's hardware information, and generate an authorization field; the hardware information includes: CPU name, memory size, and network card MAC address;

[0022] Writing the authorization field into the target file to generate a fixed private key file;

[0023] Execute the rsa command on the compilation result to generate a public key file;

[0024] The target file and the fixed private key file are fixedly mixed to generate a first mixed character string;

[0025] The first mixed character string is encrypted using an encryption algorithm to generate an authorization file.

[0026] Furthermore, the first mixed character string is encrypted using an encryption algorithm to generate an authorization file, specifically:

[0027] Generate a random string based on the preset key length;

[0028] Generate characters of the first mixed character string according to the length of the first mixed character string; the length of the first mixed character string is less than the preset secret key length;

[0029] Recursively perform left-right substitution on the first mixed character string until a preset target is reached;

[0030] At the same time, the first mixed character string is encrypted using the RSA encryption method to generate an authorization file.

[0031] Furthermore, the authorization verification of the decrypted content is specifically performed as follows:

[0032] Generate a second mixed character string for the loaded content according to the authorization file and the public key file;

[0033] Decrypting the second mixed character string using a decryption algorithm to obtain a decrypted second mixed character string;

[0034] The decrypted second mixed character string is authenticated and authorized.

[0035] As a preferred solution, the algorithm SDK compilation and packaging method provided by the present invention does not require source code transplantation, and the algorithm implementation process and model weight encryption are performed to improve the encryption effect and security. Among them, the algorithm is bound to the hardware information, and the algorithm can only run on fixed hardware devices, which ensures that the algorithm will not be repeatedly abused on other devices, improves security performance, and realizes offline deployment and empowerment of the algorithm SDK. There is no need to provide a complex operating environment. As long as the general operating environment of the library file can be executed, it can be called, which reduces the complexity of use and improves the offline deployment capability.

[0036] Other features and advantages of the present invention will be described in detail in the following detailed description.

[0037] Accordingly, the present invention also provides a device for compiling and packaging an algorithm SDK, comprising: a compiling module, a synthesizing module and a publishing module;

[0038] The compiling module is used to compile and package the SDK to be compiled in the main directory according to the compiling configuration information, install the SDK to be compiled in the first directory, generate the compilation result, and place the SDK package file in the second directory;

[0039] The synthesis module is used to merge the compiled files into library files according to the files in the main directory, and encrypt and authorize the compiled results using encryption tools to generate a target model; the target model is provided with encryption tools and decryption tools;

[0040] The publishing module is used to publish the target model as a target program to the corresponding device, so that when the target program is running on the corresponding device, the target program uses a decryption tool to decrypt the loaded content and performs authorization verification on the decrypted content. After the authorization verification is passed, the target algorithm is used to infer the decrypted content.

[0041] Further, the compilation module includes: a compilation unit;

[0042] The main directory includes a publishing queue directory, a publishing configuration directory, a first directory, and a second directory;

[0043] The compiling unit is used to list the name of the SDK directory that needs to be compiled into the publishing queue directory;

[0044] Set compilation options in the release configuration directory;

[0045] According to the release queue directory and the release configuration directory, execute the build.bat or build.sh command to compile and package the SDK that needs to be compiled;

[0046] Install the SDK to be compiled in the first directory;

[0047] Put the SDK package file in the second directory;

[0048] After the compilation is completed, the compilation results are generated.

[0049] Further, the synthesis module includes an authorization and encryption unit;

[0050] The authorization and encryption unit is used to encrypt the compilation result using an encryption tool, and bind the user's hardware information to generate an authorization field; the hardware information includes: CPU name, memory size and network card MAC address;

[0051] Writing the authorization field into the target file to generate a fixed private key file;

[0052] Execute the rsa command on the compilation result to generate a public key file;

[0053] The target file and the fixed private key file are fixedly mixed to generate a first mixed character string;

[0054] Randomly generate an initial string based on the preset secret key length;

[0055] Generate characters of the initial character string according to the length of the first mixed character string; the length of the first mixed character string is less than the preset secret key length;

[0056] Recursively replace the initial character string with the left and right characters until a preset target is reached, thereby obtaining an encrypted first mixed character string;

[0057] At the same time, the first mixed character string is encrypted using the RSA encryption method to generate an authorization file.

[0058] Correspondingly, the present invention also provides a computer-readable storage medium, which includes a stored computer program; wherein, when the computer program is running, it controls the device where the computer-readable storage medium is located to execute a method for compiling and packaging an algorithm SDK as described in the content of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 It is a flowchart of an embodiment of the method for compiling and packaging the algorithm SDK provided by the present invention;

[0060] Figure 2 It is a structural diagram of an embodiment of a device for compiling and packaging an algorithm SDK provided by the present invention. DETAILED DESCRIPTION

[0061] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0062] Embodiment 1

[0063] In this embodiment, the SDK bottom layer is developed using C / C++ and encapsulated in Java and Python.

[0064] The overall SDK packaging process includes:

[0065] (1) SDK definition: First, you need to create a packaged algorithm project and define the interface name;

[0066] (2) Engineering file coding: writing and developing engineering codes;

[0067] (3) Compilation parameter configuration: This is a non-essential step, depending on actual needs.

[0068] (4) Execute compilation and packaging: compile the code and compress the dependent libraries into SDK files;

[0069] (5) Release: Finally, the packaged SDK file is released to the application environment.

[0070] The SDK publishing system consists of two main parts: the main system structure and the subsystem structure. The subsystem is each SDK to be released, and the main system encapsulated on the subsystem is used to schedule the release tasks of the subsystem.

[0071] The main system directory (home directory) structure is as follows:

[0072]

[0073] The subsystem directory (that is, the SDK directory) structure is as follows:

[0074] |--build.bat Windows compilation script

[0075] |--build.sh Linux compilation script

[0076] |--compress.bat Windows packaging script

[0077] |--compress.sh Linux packaging script

[0078] |--version.txt records the version file

[0079] Please refer to Figure 1 , a method for compiling and packaging an algorithm SDK provided in an embodiment of the present invention, comprising steps S101-S103:

[0080] Step S101: compile and package the SDK to be compiled in the main directory according to the compilation configuration information, install the SDK to be compiled in the first directory, generate a compilation result, and place the SDK package file in the second directory;

[0081] Further, according to the compilation configuration information, the SDK to be compiled is compiled and packaged in the main directory, the SDK to be compiled is installed in the first directory, the compilation result is generated, and the SDK package file is placed in the second directory, specifically:

[0082] The main directory includes a publishing queue directory, a publishing configuration directory, a first directory, and a second directory;

[0083] Add the SDK directory name that needs to be compiled to the release queue directory;

[0084] Set compilation options in the release configuration directory;

[0085] According to the release queue directory and the release configuration directory, execute the build.bat or build.sh command to compile and package the SDK that needs to be compiled;

[0086] Install the SDK to be compiled in the first directory;

[0087] Put the SDK package file in the second directory;

[0088] After the compilation is completed, the compilation results are generated.

[0089] In this embodiment, there are three main configuration files: config.txt, queue.txt, and SDK / version.txt.

[0090] List the SDK directory names that need to be compiled in queue.txt to ensure that the previous projects do not depend on the later projects.

[0091] And set the compilation options in config.txt; among them, the compilation-related options mainly include OpenCV dependency, GPU dependency and decryption dependency, which are defined in config.txt. If you want to add new options, you need to make modifications in the build.* files in the SDK.

[0092] SDK / version.txt is mainly used to record the version number of the SDK. The published package will include the contents inside.

[0093] In this embodiment, all SDKs are installed in third_party; all SDK package files are placed in the Release directory.

[0094] Step S102: according to the files in the main directory, the compiled files are merged into library files, and the compiled results are encrypted and authorized by using an encryption tool to generate a target model; the target model has an encryption tool and a decryption tool;

[0095] Furthermore, the compiled files are merged into library files according to the files in the main directory, and the compiled results are encrypted and authorized by using encryption tools to generate the target model, specifically:

[0096] During the compilation process, encryption tools and decryption tools are generated in the first directory;

[0097] The compiled files are merged into library files, wherein the compiled files include files in the first directory under the main directory, and the encryption tool under the first directory is used to encrypt and authorize the compiled results to generate a target model.

[0098] In this embodiment, Python encapsulation uses pybind11. C++ functions can be mapped to Python through pybind11, and its main purpose is to establish Python binding for existing C++ codes.

[0099] Combine the original script and weight file to generate a library file, which is .lib in Windows environment and .so in Linux environment. The library file is also called a model here, which has the function of model calling. Using the interface definition method, the model can be initialized, called for inference results, released, and other processes.

[0100] In this embodiment, the encryption SDK provided by the system is libencrypt, and the decryption SDK provided by the system is libdecrypt. The above tools can be generated under third_party / bin after compilation. The file names are ibEncrypt and ibDecrypt. Both are command line tools and can be executed without parameters.

[0101] Furthermore, the encryption tool in the first directory is used to encrypt and authorize the compilation result, specifically:

[0102] Encrypt the compilation result using an encryption tool, bind the user's hardware information, and generate an authorization field; the hardware information includes: CPU name, memory size, and network card MAC address;

[0103] Writing the authorization field into the target file to generate a fixed private key file;

[0104] Execute the rsa command on the compilation result to generate a public key file;

[0105] The target file and the fixed private key file are fixedly mixed to generate a first mixed character string;

[0106] The first mixed character string is encrypted using an encryption algorithm to generate an authorization file.

[0107] In this embodiment, ibEncrypt is used to encrypt the compilation results and bind the user's hardware information. The authorization method is mainly completed by binding the hardware, generating the authorization field, writing the rek.txt file, and generating the fixed private key privateKey.pem file.

[0108] Use the rsa command to generate the public key pubKey.pem file.

[0109] The fixed private key privateKey.pem file and the public key pubKey.pem file provide verification and comparison for the subsequent license.txt authorization file.

[0110] The rek.txt file and the private key privateKey.pem file are mixed and then the mixed string is encrypted using an encryption algorithm to generate the specified license.txt authorization file.

[0111] Furthermore, the first mixed character string is encrypted using an encryption algorithm to generate an authorization file, specifically:

[0112] Generate a random string based on the preset key length;

[0113] Generate characters of the first mixed character string according to the length of the first mixed character string; the length of the first mixed character string is less than the preset secret key length;

[0114] Recursively perform left-right substitution on the first mixed character string until a preset target is reached;

[0115] At the same time, the first mixed character string is encrypted using the RSA encryption method to generate an authorization file.

[0116] In this embodiment, the RSA encryption method is adopted: the key length is 256 bytes, the file encryption is performed every 254 bytes, and a maximum of 8192 arrays are encrypted to reduce the decryption calculation amount.

[0117] Step S103: Publish the target model as a target program to the corresponding device, so that when the target program is running on the corresponding device, the target program uses a decryption tool to decrypt the loaded content, and performs authorization verification on the decrypted content. After the authorization verification passes, the target algorithm is used to infer the decrypted content.

[0118] In this embodiment, the model is deployed and published to implement an offline publishing method for various scenario algorithms. Algorithm engineers can choose to upload, export, and delete their own private images to achieve secure migration of user data.

[0119] In this embodiment, reasoning is to call the model (loading, reasoning, releasing and other processes), and reasoning is to use the algorithm to predict the image and other data to obtain the prediction result, for example, to infer whether there is a person in a picture and the position of the person in the image.

[0120] Furthermore, the authorization verification of the decrypted content is specifically performed as follows:

[0121] Generate a second mixed character string for the loaded content according to the authorization file and the public key file;

[0122] Decrypting the second mixed character string using a decryption algorithm to obtain a decrypted second mixed character string;

[0123] The decrypted second mixed character string is authenticated and authorized.

[0124] In this embodiment, ibDecrypt is used to perform a decryption operation on the compilation result.

[0125] Implementing the embodiments of the present invention has the following effects:

[0126] The algorithm SDK compilation and packaging method provided by the present invention does not require source code transplantation, and the algorithm implementation process and model weight encryption are performed, which improves the encryption effect and security. Among them, the algorithm is bound to the hardware information, and the algorithm can only be run on a fixed hardware device, which ensures that the algorithm will not be repeatedly abused on other devices, improves the security performance, and realizes the offline deployment and empowerment of the algorithm SDK. There is no need to provide a complex operating environment. As long as the general operating environment of the library file can be executed, it can be called, which reduces the complexity of use and improves the offline deployment capability.

[0127] Embodiment 2

[0128] Please refer to Figure 2 , a device for compiling and packaging an algorithm SDK provided by an embodiment of the present invention, comprising: a compiling module 201, a synthesizing module 202 and a publishing module 203;

[0129] The compiling module is used to compile and package the SDK to be compiled in the main directory according to the compiling configuration information, install the SDK to be compiled in the first directory, generate the compilation result, and place the SDK package file in the second directory;

[0130] The synthesis module is used to merge the compiled files into library files according to the files in the main directory, and encrypt and authorize the compiled results using encryption tools to generate a target model; the target model is provided with encryption tools and decryption tools;

[0131] The publishing module is used to publish the target model as a target program to the corresponding device, so that when the target program is running on the corresponding device, the target program uses a decryption tool to decrypt the loaded content and performs authorization verification on the decrypted content. After the authorization verification is passed, the target algorithm is used to infer the decrypted content.

[0132] Further, the compilation module includes: a compilation unit;

[0133] The main directory includes a publishing queue directory, a publishing configuration directory, a first directory, and a second directory;

[0134] The compiling unit is used to list the name of the SDK directory that needs to be compiled into the publishing queue directory;

[0135] Set compilation options in the release configuration directory;

[0136] According to the release queue directory and the release configuration directory, execute the build.bat or build.sh command to compile and package the SDK that needs to be compiled;

[0137] Install the SDK to be compiled in the first directory;

[0138] Put the SDK package file in the second directory;

[0139] After the compilation is completed, the compilation results are generated.

[0140] Further, the synthesis module includes an authorization and encryption unit;

[0141] The authorization and encryption unit is used to encrypt the compilation result using an encryption tool, and bind the user's hardware information to generate an authorization field; the hardware information includes: CPU name, memory size and network card MAC address;

[0142] Writing the authorization field into the target file to generate a fixed private key file;

[0143] Execute the rsa command on the compilation result to generate a public key file;

[0144] The target file and the fixed private key file are fixedly mixed to generate a first mixed character string;

[0145] Randomly generate an initial string based on the preset secret key length;

[0146] Generate characters of the initial character string according to the length of the first mixed character string; the length of the first mixed character string is less than the preset secret key length;

[0147] Recursively replace the initial character string with the left and right characters until a preset target is reached, thereby obtaining an encrypted first mixed character string;

[0148] At the same time, the first mixed character string is encrypted using the RSA encryption method to generate an authorization file.

[0149] The above-mentioned algorithm SDK compilation and packaging device can implement the algorithm SDK compilation and packaging method of the above-mentioned method embodiment. The optional items in the above-mentioned method embodiment are also applicable to this embodiment and will not be described in detail here. The rest of the contents of the embodiment of this application can refer to the contents of the above-mentioned method embodiment, and will not be repeated in this embodiment.

[0150] Embodiment 3

[0151] Correspondingly, the present invention also provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the algorithm SDK compilation and packaging method described in any one of the above embodiments.

[0152] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program in the terminal device.

[0153] The terminal device may be a computing device such as a desktop computer, a notebook, a palmtop computer, a cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.

[0154] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, and uses various interfaces and lines to connect various parts of the entire terminal device.

[0155] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the terminal device by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of the mobile terminal, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0156] Wherein, if the module / unit integrated in the terminal device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0157] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for compiling and packaging an algorithm SDK. It is characterized in that include: According to the compilation configuration information, compile and package the SDK to be compiled in the main directory, install the SDK to be compiled in the first directory, generate the compilation result, and place the SDK package file in the second directory; According to the files in the main directory, the compiled files are merged into library files, and the compiled results are encrypted and authorized by using encryption tools to generate a target model; The target model is provided with an encryption tool and a decryption tool; The target model is published as a target program on the corresponding device, so that when the target program is running on the corresponding device, the target program uses a decryption tool to decrypt the loaded content, and performs authorization verification on the decrypted content. After the authorization verification passes, the target algorithm is used to infer the decrypted content.

2. A method for compiling and packaging an algorithm SDK as claimed in claim 1, It is characterized in that According to the compilation configuration information, the SDK to be compiled is compiled and packaged in the main directory, the SDK to be compiled is installed in the first directory, the compilation result is generated, and the SDK package file is placed in the second directory, specifically: The main directory includes a publishing queue directory, a publishing configuration directory, a first directory, and a second directory; Add the SDK directory name that needs to be compiled to the release queue directory; Set compilation options in the release configuration directory; According to the release queue directory and the release configuration directory, execute the build.bat or build.sh command to compile and package the SDK that needs to be compiled; Install the SDK to be compiled in the first directory; Put the SDK package file in the second directory; After the compilation is completed, the compilation results are generated.

3. A method for compiling and packaging an algorithm SDK as claimed in claim 1, It is characterized in that The compiled files are merged into library files according to the files in the main directory, and the compiled results are encrypted and authorized by encryption tools to generate the target model, specifically: During the compilation process, encryption tools and decryption tools are generated in the first directory; The compiled files are merged into library files, wherein the compiled files include files in the first directory under the main directory, and the encryption tool under the first directory is used to encrypt and authorize the compiled results to generate a target model.

4. A method for compiling and packaging an algorithm SDK as claimed in claim 3, It is characterized in that The encryption tool in the first directory is used to encrypt and authorize the compilation result, specifically: Use encryption tools to encrypt the compilation results, bind the user's hardware information, and generate authorization fields; The hardware information includes: CPU name, memory size and network card MAC address; Writing the authorization field into the target file to generate a fixed private key file; Execute the rsa command on the compilation result to generate a public key file; The target file and the fixed private key file are fixedly mixed to generate a first mixed character string; The first mixed character string is encrypted using an encryption algorithm to generate an authorization file.

5. A method for compiling and packaging an algorithm SDK as claimed in claim 4, It is characterized in that The method of encrypting the first mixed character string by using an encryption algorithm to generate an authorization file is specifically as follows: Generate a random string based on the preset key length; Generate characters of the first mixed character string according to the length of the first mixed character string; the length of the first mixed character string is less than the preset secret key length; Recursively perform left-right substitution on the first mixed character string until a preset target is reached; At the same time, the first mixed character string is encrypted using the RSA encryption method to generate an authorization file.

6. A method for compiling and packaging an algorithm SDK as described in any one of claims 1 to 5, It is characterized in that The authorization verification of the decrypted content is specifically as follows: Generate a second mixed character string for the loaded content according to the authorization file and the public key file; Decrypting the second mixed character string using a decryption algorithm to obtain a decrypted second mixed character string; The decrypted second mixed character string is authenticated and authorized.

7. A device for compiling and packaging algorithm SDK, It is characterized in that include: Compile modules, synthesize modules, and publish modules; The compiling module is used to compile and package the SDK to be compiled in the main directory according to the compiling configuration information, install the SDK to be compiled in the first directory, generate the compilation result, and place the SDK package file in the second directory; The synthesis module is used to merge the compiled files into library files according to the files in the main directory, and encrypt and authorize the compiled results using an encryption tool to generate a target model; The target model is provided with an encryption tool and a decryption tool; The publishing module is used to publish the target model as a target program to the corresponding device, so that when the target program is running on the corresponding device, the target program uses a decryption tool to decrypt the loaded content and performs authorization verification on the decrypted content. After the authorization verification is passed, the target algorithm is used to infer the decrypted content.

8. The device for compiling and packaging an algorithm SDK as claimed in claim 7, It is characterized in that The compilation module includes: a compilation unit; The main directory includes a publishing queue directory, a publishing configuration directory, a first directory, and a second directory; The compiling unit is used to list the name of the SDK directory that needs to be compiled into the publishing queue directory; Set compilation options in the release configuration directory; According to the release queue directory and the release configuration directory, execute the build.bat or build.sh command to compile and package the SDK that needs to be compiled; Install the SDK to be compiled in the first directory; Put the SDK package file in the second directory; After the compilation is completed, the compilation results are generated.

9. A device for compiling and packaging an algorithm SDK as described in any one of claims 7-8, It is characterized in that The synthesis module includes an authorization and encryption unit; The authorization and encryption unit is used to encrypt the compilation result using an encryption tool, bind the user's hardware information, and generate an authorization field; The hardware information includes: CPU name, memory size and network card MAC address; Writing the authorization field into the target file to generate a fixed private key file; Execute the rsa command on the compilation result to generate a public key file; The target file and the fixed private key file are fixedly mixed to generate a first mixed character string; Randomly generate an initial string based on the preset secret key length; Generate characters of the initial character string according to the length of the first mixed character string; the length of the first mixed character string is less than the preset secret key length; Recursively replace the initial character string with the left and right characters until a preset target is reached, thereby obtaining an encrypted first mixed character string; At the same time, the first mixed character string is encrypted using the RSA encryption method to generate an authorization file.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes a stored computer program; wherein, when the computer program is running, it controls the device where the computer-readable storage medium is located to execute the algorithm SDK compilation and packaging method as described in any one of claims 1 to 6.

Citation Information

Cited By

  • Video decoding method and device, equipment and storage medium

    CN119629361A

  • Offline authorization management method and system suitable for embedded operating system

    CN120408590A