Edge device program software development method and system, edge device and storage medium
By extracting model parameter files and model metadata, finding the target application source code, generating file directories and copying related files, and compiling the target program files executable by edge devices, the problems of many types of tools, weak linkage and lack of automated deployment capabilities in edge intelligent software development are solved, and efficient software development and hardware decoupling are achieved.
Patent Information
- Application Number
- CN202510125200.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-27
- Publication Date
- 2025-03-04
AI Technical Summary
In the development of edge intelligent software based on NVDLA software solutions, there are problems such as many types of tools, weak linkage, and lack of automated deployment capabilities, resulting in low development efficiency.
Provides an edge device program software development method, which obtains the target program file executable by edge device by extracting model parameter files and model metadata, finding the target application source code, generating file directories and copying related files, and compiling the target program file executable by edge devices.
It has achieved simplified system environment configuration, improved software development efficiency, and decoupled the software to be developed from the hardware structure of specific edge devices, automatically introduced the required files, and realized the reuse of general file codes.
Smart Images

Figure CN119556912A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an edge device program software development method, system, edge device and storage medium. Background Art
[0002] The rapid iteration of artificial intelligence algorithms has led to an increasing demand for computing power. In order to deploy deep neural network models on edge devices and maintain the characteristics of low latency and high energy efficiency, dedicated AI accelerators have been widely adopted. NVDLA (NVIDIA Deep Learning Accelerator, a deep learning accelerator) is an open source complete AI accelerator solution for hardware and software. Its software solution can provide support for kernels, compilation tools, runtimes, etc., but when developing edge intelligent software based on this software solution, there are many types of tools required and weak linkage, and the lack of automated deployment capabilities leads to low development efficiency. Summary of the invention
[0003] In view of the above problems, the present invention provides an edge device program software development method, system, edge device and storage medium to simplify the system environment configuration required by the user and improve software development efficiency.
[0004] According to a first aspect of the present invention, there is provided an edge device program software development method, comprising: Extracting a model parameter file for describing a target AI model, and obtaining model metadata of the target AI model; Find the source code of the user's target application according to the configuration file provided by the user; Generate a file directory of the target application according to a directory generation rule in a preset project template file, and copy the target application source code, the model parameter file, the model metadata, and a common file for generating a target program file at a preset location in the file directory to obtain a target file; According to the target file and the configuration file, a target program file executable by the edge device is compiled.
[0005] Optionally, compiling the target program file executable by the edge device according to the target file and the configuration file includes: Reading a driving mode from the configuration file, the driving mode comprising a stand-alone driving mode and a host driving mode; According to the driving mode, determining an AI model template for compiling and processing the model parameter file from a stand-alone application template and a host driving template; According to the AI model template and the target file, a target program file executable by the edge device is compiled.
[0006] Optionally, determining, according to the driving mode, an AI model template for compiling and processing the model parameter file from a single application template and a host driver template includes: If the driving mode is a stand-alone driving mode, a stand-alone application template is selected as the AI model template; If the driving mode is a host driving mode, the host driving template is selected as the AI model template.
[0007] Optionally, the common file includes a header file; The compiling, according to the AI model template and the target file, to obtain a target program file executable by the edge device includes: According to the AI model template, compile the model parameter file to generate a model library file; A target program file executable by the edge device is compiled based on the model library file, the target application source code, the header file and the compilation file used for compilation.
[0008] Optionally, the extracting a model parameter file for describing the target AI model includes: According to the operators of the target AI model, the target AI model is disassembled to extract operator operation information, operator sets and operator weight sets; A model parameter file is obtained according to the operator operation information, the operator set and the operator weight set.
[0009] Optionally, the performing model decomposition on the target AI model according to the operator of the target AI model includes: According to the architecture features of the edge device provided by the user, the target AI model is structurally optimized to obtain an optimized target AI model; According to the operators of the optimized target AI model, the optimized target AI model is decomposed.
[0010] Optionally, the common files include header files and runtime libraries; The copying of the target application source code, the model parameter file, the model metadata, and the common file at the preset location in the file directory includes: By statically analyzing the target application source code, the target application source code, the model parameter file, the model metadata, the header file and the runtime library are copied to a preset location in the file directory.
[0011] According to a second aspect of the present invention, there is provided an edge device program software development system, characterized in that it includes: A model processing unit, used to extract a model parameter file for describing a target AI model, and to obtain model metadata of the target AI model; A message interaction unit, used to search for the user's target application source code according to the configuration file provided by the user; A project construction unit is used to generate a file directory of a target application according to a directory generation rule in a preset project template file; copy the target application source code, the model parameter file, the model metadata, and a common file for generating a target program file at a preset position in the file directory to obtain a target file; The synthesis and compilation unit is used to compile the target program file executable by the edge device according to the target file and the configuration file.
[0012] According to a third aspect of the present invention, an edge device is provided, comprising: a memory, a processor, and a target application loaded into the memory and executable on the processor, wherein the target application is obtained by the aforementioned edge device program software development method.
[0013] According to a fourth aspect of the present invention, there is provided a storage medium on which a computer program is stored, and when the program is executed by a processor, the aforementioned edge device program software development method is implemented.
[0014] The above one or more technical solutions in the present invention have at least the following technical effects: The present invention provides an edge device program software development method, system, edge device and storage medium, by extracting a model parameter file for describing a target AI model, and obtaining the model metadata of the target AI model; searching for the user's target application source code according to a configuration file provided by the user; generating a file directory of the target application according to a directory generation rule in a preset project template file, and copying the target application source code, the model parameter file, the model metadata and a general file for generating a target program file at a preset position in the file directory to obtain a target file; compiling the target program file executable by the edge device according to the target file and the configuration file. In this way, through the disassembly of each business process, for the target AI model, it is not necessary to make adjustments according to the specific edge device during training, and it is only related to the NVDLA compiler during compilation, thereby realizing the decoupling of the program software to be developed from the specific edge device hardware structure; and the required files can be automatically introduced to realize the reuse of the relevant code of the general file, so as to replace the development of special code for specific hardware, thereby simplifying the system environment configuration required by the user, so that the user can spend more energy on software development, thereby improving the efficiency of software development.
[0015] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only used for the purpose of illustrating the present invention and are not to be considered as limiting the present invention. Also, throughout the accompanying drawings, the same reference figures are used to represent the same components. In the drawings: Figure 1 A flow chart of an edge device program software development method in the present invention is shown.
[0017] Figure 2 A schematic diagram of the network structure of a convolutional neural network in the present invention is shown.
[0018] Figure 3 A block diagram of an edge device program software development system in the present invention is shown. DETAILED DESCRIPTION
[0019] To make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be described clearly and completely below in conjunction with the accompanying drawings of the present invention. The components of the present invention generally described and shown in the accompanying drawings herein can be arranged and designed in various different configurations.
[0020] Based on the contents of the present invention, all other solutions obtained by ordinary technicians in this field without making any creative work are within the scope of protection of the present invention.
[0021] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0022] In the description of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0023] Combination Figure 1 As shown, the present invention provides an edge device program software development method based on NVDLA (NVIDIA Deep Learning Accelerator).
[0024] The edge device program software development method includes steps 101 to 104: Step 101: extracting a model parameter file for describing a target AI (Artificial Intelligence) model and obtaining model metadata of the target AI model; In the present invention, the target AI model refers to a trained AI model provided by the user, such as a trained face recognition model, etc. The target application refers to the AI software running on the edge device, such as software that uses the AI model to perform face recognition tasks on the edge device.
[0025] Model metadata can be obtained based on the target AI model. Model metadata refers to the input and output features of the target AI model, as well as configuration information related to the target AI model.
[0026] In one example, the loaded target AI model will be optimized, including: Load the target AI model and its weights, and convert them into a unified format, such as json, xml, etc. The following content takes json format as an example.
[0027] Then, according to the architectural characteristics of the edge device, the target AI model is structurally optimized to obtain the optimized target AI model.
[0028] Among them, the architectural features of edge devices mainly refer to the X86 platform using complex instruction sets, the ARM platform using simple instruction sets, the platform using FPGA (Field Programmable Gate Array) and ARM (such as ZCU104), etc. In addition, there are some boards with accelerators.
[0029] Structural optimization is mainly based on the following aspects: 1. Make full use of the computing resources of the platform (board) as much as possible; 2. Check the bandwidth of data access (i.e. the speed of reading and writing data) and reduce the number of reads as much as possible; 3. Achieve a balance between the first two.
[0030] For example: The handwritten digit recognition dataset (MNIST dataset) is used to illustrate the use of convolutional neural network (LeNet). The network structure is as follows Figure 2 As shown in the figure, the network has 44.426K parameters and 281.64K multiplication and accumulation calculations. The platform architecture features the Xilinx ZCU104 development board, which has both ARM processors and FPGA resources, and is a hybrid architecture.
[0031] When using NVDLA's stand-alone driver mode, all computing tasks are performed on the edge device and do not involve network communication with the host (also known as the remote server).
[0032] First, the structure of the entire network model is optimized, and the structure of the convolution layer Conv to the activation function layer ReLU to the maximum pooling layer Maxpool is converted into the structure of the convolution layer Conv to the maximum pooling layer Maxpool to the activation function layer ReLU. This can reduce the amount of input data of the ReLU layer, thereby reducing the number of point-by-point calculations.
[0033] Then, weight optimization is performed. NVDLA supports operations in INT8 format. Here, the quantizer provided by NVDLA is used to quantize the weights of the target AI model into INT8 format, which reduces memory access by 3 / 4 compared to FP32 format.
[0034] Then the parameters are optimized. For example, for the fully connected layer FC1, its parameters are (256, 128), that is, the number of input channels is 256, the number of output channels is 128, and its input is , assuming that the NVDLA accelerator supports a maximum of 128 channels, the input dimension is changed to 2 The input tensor of the fully connected layer FC1 is adjusted to , that is, the weights are divided into two groups; when performing calculations, the input tensors and parameters are updated simultaneously.
[0035] When using the host-driven mode, part of the computing tasks can be assigned to the host under the remote procedure call. The entire network model is divided, and the input layer (for example, Conv1 layer, ReLU1 layer, Maxpool1 layer) is deployed on the host side without model optimization; the rest is deployed on the edge device side, and the input quantization work is completed by the host side, that is, the edge device side processes the entire integer data operation.
[0036] In one example, after performing structural optimization, weight optimization, and parameter optimization on the target AI model, the optimized target AI model can be disassembled according to the operators of the optimized target AI model to extract operator operation information, operator sets, and operator weight sets; then the operator operation information, operator sets, and operator weight sets are compressed into a model parameter file. The model parameter file is a compressed format file, which also contains an operator and weight link table file, which effectively prevents errors when operators load weights.
[0037] The operator operation information refers to the data flow of each network layer expressed in JSON format, which can also be understood as the order of operator operations. The operator set includes each layer of operators and their parameters.
[0038] Step 102: Find the target application source code of the user according to the configuration file provided by the user; In the present invention, the configuration file refers to a file for configuring parameters and initial settings for the target application. The target application source code refers to the development source code provided by the user. In the configuration file, the directory where the target application source code is located can be written out through a character string, thereby locating the location of the target application source code. The directory where the target application source code is located refers to the directory where the user stores the development source code.
[0039] Step 103: Generate a file directory of the target application according to the directory generation rules in the preset project template file; copy the target application source code, model parameter file, model metadata, and common files used to generate the target program file at a preset location in the file directory to obtain the target file; In the present invention, the project template file is preset. The project template file refers to a template file that can automatically set the directory file, driver, and the real-time operating system running at the bottom. The tool chain will automatically find the project template file, generate a file directory, and collect the required drivers and devices of the lower system.
[0040] In traditional technology, the structure of the target application, directory files, and underlying drivers, etc., all need to be set manually by the user, which takes a long time. However, with the project template file, you can collect them through the project template file and put them in the corresponding file directory to achieve automatic setting. In this way, users can focus more on software development rather than system environment configuration.
[0041] The file directory of the target application can be generated through the directory generation rules in the project template file. The file directory includes multiple files for storing corresponding content. The preset location in the file directory refers to the location for storing specified content files. For example, the target application source code, configuration files, model parameter files, model metadata, etc. are stored, and these contents are provided by the user. Some files are also used to store common files. Common files are universal in development, and they are still needed even if other applications are developed.
[0042] In the present invention, the general file may include a header file and a runtime library, etc. The general file does not require the user to provide configuration.
[0043] The present invention statically analyzes the target application source code and uses a regular matching method to introduce the required files into a preset location in the file directory. The required files refer to the target application source code, model parameter files, model metadata, header files, and runtime libraries.
[0044] Step 104: Compile the target program file executable by the edge device according to the target file and the configuration file.
[0045] In the present invention, NVDLA provides two AI model reasoning modes: stand-alone drive and host drive. The user will specify the drive mode in the configuration file. The drive mode can be determined by reading the configuration file. The drive mode is used to determine the part of the model parameter file that needs to be compiled.
[0046] The drive mode includes stand-alone drive mode and host drive mode. The difference between the two drive modes is that the model parameter files (json format) are compiled and processed differently. The stand-alone drive mode will compile the initialization of the target AI model, the format of input / output data (shape, data type), all calculation processes, etc. into the model library file.
[0047] The host driver mode will initialize the target AI model on the host side, and the compiler will only compile the input / output data format, calculation process, etc. of some models to be deployed on the edge device into the model library file.
[0048] In the present invention, an AI model template for compiling and processing a model parameter file can be determined from a single application template and a host driver template according to a driving mode.
[0049] Specifically, if the driving mode is a stand-alone driving mode, the single application template is selected as the AI model template; if the driving mode is a host driving mode, the host driving template is selected as the AI model template.
[0050] Among them, the stand-alone application template includes the main program template, the calculation graph json template, the operator source code template, the input data template and the weight data template.
[0051] The host driver template includes the main program template, operator source code template, input / output data template, weight data template, and RPC (Remote Procedure call) service template. Among them, the RPC service template is used to call the target AI model inference service on the edge device from the host. The RPC service template includes the RPC client template and the server template. The server runs on the edge and the client runs on the host.
[0052] Then, according to the AI model template, use the NVDLA Compiler to compile the model parameter file and generate the model library file; Then use a third-party compiler (for example, CMake) to compile the model library file, target application source code, header file, and compilation file for compilation (for example, CMakeLists.txt) to obtain a target program file (also called a product) that can be executed by the edge device.
[0053] It should be noted that some edge devices have operating systems, while others do not. For edge devices with operating systems, the target application can be transferred to the edge device terminal. For edge devices without operating systems, the target application can be burned to the edge device terminal.
[0054] Specifically, after obtaining the target application, the compiler interface will automatically search for the device linker. If found, the product of the target application will be loaded into the edge device. If not found, the product will be sent to the specified virtual machine, and then the test case will be started and run, the processing results will be output, and finally the target application will be burned into the edge device.
[0055] For example: Take the host-driven mode to implement MNIST digit recognition as an example.
[0056] AI model processing: Use PyTorch (neural network framework) to load Mnist_LeNet and its weights; Then, TVM (machine learning compilation framework) is used to optimize and parse the target AI model (hereinafter referred to as the model), and the model is split into operator operation information, operator set and operator weight set. The operator operation information is stored in json format and stored and accessed using Rapidjson (i.e., json parser and generator); the operator set includes multiple operator units (operators and their parameters), each of which is stored as a Python object file and accessed using Python's built-in method compile(); the operator weight set contains the weight data of multiple operators, and the weight data of each operator is stored as a Numpy array file and dynamically loaded using Python; and a link table of operators and weights in json format is established to achieve the mapping of operators and weights; then Python's third-party library is used to package it into the "mnist_model.tar" file.
[0057] The driver mode is read from the configuration file as the host driver mode, the host driver template is called, a file directory is generated, the target application source code, model metadata, and model parameter files are copied to the preset location of the file directory, and then the introduced target application source code is statically analyzed, regular expressions are used to match header files and runtime libraries, and then introduced.
[0058] The edge device board is Xilinx ZCU104, which is read from the configuration file. DPU is not used. The system introduces the host driver template and generates a file directory according to the project template file. TVM calls the host driver template to generate the json code of the model and compiles it using NVDLA Compiler to obtain the model library file. Then, after checking and modifying the CMakeLists.txt file, CMake instructions are used to compile and obtain the executable target application on the edge device.
[0059] The platform operating system is peta Linux, and the runtime library is NVDLA Runtime. The edge device software is transferred to the development board through the Python script. After receiving, the development board restarts. After initialization, the "Hello World!" test case is loaded and printed. Then, the service mode is turned on and waits for user input.
[0060] In summary, the present invention provides a method for developing edge device program software, by extracting the model parameter file used to describe the target AI model and obtaining the model metadata of the target AI model; according to the configuration file provided by the user, the user's target application source code is searched; according to the directory generation rules in the preset project template file, the file directory of the target application is generated, and the target application source code, model parameter file, model metadata and general files for generating target program files are copied at the preset position in the file directory to obtain the target file; according to the target file and the configuration file, the target program file executable by the edge device is compiled. In this way, through the disassembly of each business process, for the target AI model, it is not necessary to make adjustments according to the specific edge device hardware during training, and it is only related to the NVDLA compiler during compilation, thereby realizing the decoupling of the program software to be developed from the specific edge device hardware structure; the required files can be automatically introduced to realize the reuse of the general file related code, instead of developing special code for specific hardware; in the code generation stage, the user only needs to determine the AI model template and the compilation file to realize the code compilation for the specific hardware platform, thereby simplifying the system environment configuration required by the user, so that the user can spend more energy on software development, thereby improving the efficiency of software development.
[0061] Based on the same inventive concept, the present invention also provides an edge device program software development system, including: a device access module, a message processing module, a business module and an automatic deployment module.
[0062] Among them, the device access service module is responsible for the communication of gateway devices, including the host and edge devices, the host and the linker, and the linker and the edge devices.
[0063] The message processing module includes a format conversion service, which is responsible for the conversion of message formats; a code generation service, which is responsible for generating target source code using templates and files sent by the business layer; a compiler interface, which calls the compiler to complete the packaged program source code, generate products, and provide a unified transmission configuration object, allowing users to use different device linkers indiscriminately to complete communication with the device access layer.
[0064] The business module is used to provide core functions, including three parts: AI model processing, project generation and management, and collection and packaging. Among them, AI model processing includes model preprocessing, optimization, and disassembly; project generation and management services implement template generation and manage file directories and the files therein; collection and packaging is responsible for the collection of files and codes generated by model disassembly and code generation, and is responsible for packaging and compressing scattered files.
[0065] The automated deployment module is used to integrate the microkernel operating system according to the hardware platform and driver of NVDLA, provide system services to upper-layer applications, and the communication with the device access layer is completed by the physical linker or software script linker.
[0066] For example, the system supports the loading of models such as PyTorch, TensorFlow, and ONNX, and the intermediate format uses json. The system is implemented by integrating TVM, Rapidjson, NVDLA software stack, CMake, GCC / G++, Qemu, and self-written modules. Among them, TVM provides support for target AI model optimization, parsing, and code generation. TVM and NVDLA Compiler are connected through data coupling, and json is uniformly used as shared data. Rapidjson provides the creation and access of json files. CMake and GCC / G++ implement the compilation of model library source code and target application source code. Through the integration of Qemu commands, the Qemu virtual machine can be directly started in the target application for automatic deployment. In addition, self-written modules are used to implement services such as collection and packaging, format conversion, compiler interface, and automatic deployment.
[0067] Based on the same inventive concept, Figure 3 As shown, the present invention also provides another edge device program software development system, including: A model processing unit, used to extract a model parameter file for describing a target AI model and obtain model metadata of the target AI model; A message interaction unit, used to search for the user's target application source code according to the configuration file provided by the user; The project construction unit is used to generate a file directory of the target application according to the directory generation rules in the preset project template file; copy the target application source code, model parameter file, model metadata and common files used to generate the target program file at a preset location in the file directory to obtain the target file; The synthesis and compilation unit is used to compile the target program file executable by the edge device according to the target file and the configuration file.
[0068] Optionally, the edge device program software development system also includes a device access unit for communication with gateway devices, specifically communication services between the host and edge devices, the host and the linker, and the linker and the edge devices.
[0069] Optionally, the synthesis and compilation unit is also used to: Read the drive mode from the configuration file, the drive mode is a stand-alone drive mode and a host drive mode; According to the drive mode, determine the AI model template used to compile and process the model parameter file from the stand-alone application template and the host drive template; According to the AI model template and target file, compile and obtain the target program file that can be executed by the edge device.
[0070] Optionally, the synthesis and compilation unit is also used to: If the drive mode is a stand-alone drive mode, select the stand-alone application template as the AI model template; If the drive mode is host drive mode, select the host drive template as the AI model template.
[0071] Optionally, the synthesis and compilation unit is also used to: According to the AI model template, compile the model parameter file and generate the model library file; According to the model library file, the target application source code, the header file and the compilation file used for compilation, the target program file executable by the edge device is compiled.
[0072] Optionally, the model processing unit is also used for: According to the operators of the target AI model, the target AI model is disassembled to extract the operator operation information, operator set and operator weight set; The model parameter file is obtained according to the operator operation information, operator set and operator weight set.
[0073] Optionally, the model processing unit is also used for: According to the architecture characteristics of the edge device provided by the user, the target AI model is structurally optimized to obtain the optimized target AI model; According to the operators of the optimized target AI model, the optimized target AI model is disassembled.
[0074] Optionally, the project build unit is also used to: By statically analyzing the target application source code, the target application source code, model parameter files, model metadata, header files, and runtime libraries are copied to the preset location in the file directory.
[0075] In summary, the present invention provides an edge device program software development system, which extracts the model parameter file used to describe the target AI model and obtains the model metadata of the target AI model; searches for the user's target application source code according to the configuration file provided by the user; generates a file directory of the target application according to the directory generation rules in the preset project template file, and copies the target application source code, model parameter file, model metadata, and common files for generating target program files at the preset location in the file directory to obtain the target file; compiles the target program file executable by the edge device according to the target file and the configuration file. In this way, the decoupling of the program software to be developed and the specific hardware structure is achieved through the disassembly of each business process. At the same time, it simplifies the system environment configuration required by the user, allowing the user to focus more on software development, thereby improving software development efficiency.
[0076] Technical personnel in the relevant field can clearly understand that for the convenience and conciseness of description, the specific working process of the edge intelligent software development system described above can refer to the corresponding process in the aforementioned method, and will not be elaborated here.
[0077] Based on the same inventive concept, the present invention also provides an edge device, the edge device comprising: a memory, a processor, and a target application loaded on the memory and operable on the processor, the target application being determined by a target program file obtained by the aforementioned edge device program software development method. Please refer to the aforementioned for the specific method content, which will not be repeated here.
[0078] On the basis of the above, the present invention provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the edge device program software development method of any of the aforementioned embodiments is implemented.
[0079] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the readable storage medium described above can refer to the corresponding process in the aforementioned method, and will not be described in detail here.
[0080] The above are only various embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for developing edge device program software, characterized in that: include: Extracting a model parameter file for describing a target AI model and obtaining model metadata of the target AI model; Find the source code of the user's target application according to the configuration file provided by the user; Generate a file directory of the target application according to a directory generation rule in a preset project template file, and copy the target application source code, the model parameter file, the model metadata, and a common file for generating a target program file at a preset location in the file directory to obtain a target file; According to the target file and the configuration file, a target program file executable by the edge device is compiled.
2. The method according to claim 1, characterized in that The target program file executable by the edge device is compiled according to the target file and the configuration file, including: Reading a driving mode from the configuration file, wherein the driving mode includes a stand-alone driving mode and a host driving mode; According to the driving mode, determining an AI model template for compiling and processing the model parameter file from a stand-alone application template and a host driving template; According to the AI model template and the target file, a target program file executable by the edge device is compiled.
3. The method according to claim 2, characterized in that The step of determining, according to the driving mode, an AI model template for compiling and processing the model parameter file from a single application template and a host driver template includes: If the driving mode is a stand-alone driving mode, a stand-alone application template is selected as the AI model template; If the driving mode is a host driving mode, the host driving template is selected as the AI model template.
4. The method according to claim 2, characterized in that: The common files include header files; The compiling, according to the AI model template and the target file, to obtain a target program file executable by the edge device includes: According to the AI model template, compile the model parameter file to generate a model library file; A target program file executable by the edge device is compiled based on the model library file, the target application source code, the header file and the compilation file used for compilation.
5. The method according to claim 1, characterized in that The extracting a model parameter file for describing the target AI model includes: According to the operators of the target AI model, the target AI model is disassembled to extract operator operation information, operator sets and operator weight sets; A model parameter file is obtained according to the operator operation information, the operator set and the operator weight set.
6. The method according to claim 5, characterized in that The step of performing model decomposition on the target AI model according to the operator of the target AI model includes: According to the architecture features of the edge device provided by the user, the target AI model is structurally optimized to obtain an optimized target AI model; According to the operators of the optimized target AI model, the optimized target AI model is decomposed.
7. The method according to claim 1, characterized in that The common files include header files and runtime libraries; The copying of the target application source code, the model parameter file, the model metadata, and the common file for generating the target program file at the preset location in the file directory includes: By statically analyzing the target application source code, the target application source code, the model parameter file, the model metadata, the header file and the runtime library are copied to a preset location in the file directory.
8. An edge device program software development system, characterized in that: include: A model processing unit, used to extract a model parameter file for describing a target AI model, and to obtain model metadata of the target AI model; A message interaction unit, used to search for the user's target application source code according to the configuration file provided by the user; A project construction unit is used to generate a file directory of a target application according to a directory generation rule in a preset project template file; Copying the target application source code, the model parameter file, the model metadata, and a common file for generating a target program file at a preset location in the file directory to obtain a target file; The synthesis and compilation unit is used to compile the target program file executable by the edge device according to the target file and the configuration file.
9. An edge device, characterized in that: The edge device includes: a memory, a processor, and a target application loaded into the memory and executable on the processor, wherein the target application is obtained by the edge device program software development method described in any one of claims 1-7.
10. A storage medium, characterized in that: A computer program is stored thereon, and when the program is executed by a processor, the edge device program software development method as described in any one of claims 1-7 is implemented.
Citation Information
Patent Citations
Method, platform and system for excavating data
CN101324901A
Small program generation method, device, equipment and computer readable storage medium
CN110532029A
Method for generating bill of material file and related equipment
CN118277750A
Model training method and metadata processing method
CN118981560A
Cited By
Implementation method and system of application system
CN120631427A