1 Star 0 Fork 4.9K

fish / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
code-management.md 3.08 KB
一键复制 编辑 原始数据 按行查看 历史
NEEN 提交于 2021-03-12 17:59 . !197 Docs Update version 1.0.1

Code Management

Code of the AI engine framework consists of three parts: client, server, and common. The client module provides the server connection management function. The northbound SDK needs to encapsulate and call the public APIs provided by the client in the algorithm's external APIs. The server module provides functions such as plug-in loading and task management. Plug-ins are integrated using the plug-in APIs provided by the server. The common module provides platform-related operation methods, engine protocols, and tool classes for other modules.

Figure 1 shows the code dependency between modules of the AI engine framework.

Figure 1 Code dependency

Recommendation: Develop plug-ins and northbound SDKs in the directories specified by the AI engine.

In the overall planning of the AI engine framework, northbound SDKs are a part of the client, and plug-ins are called by the server and are considered a part of the server. Therefore, the following directories have been planned for plug-in and northbound SDK development in the AI engine framework:

  • SDK code directory: //foundation/ai/engine/services/client/algorithm_sdk

    e.g. //foundation/ai/engine/services/client/algorithm_sdk/cv

    e.g. //foundation/ai/engine/services/client/algorithm_sdk/nlu

  • Plug-in code directory: //foundation/ai/engine/services/server/plugin

    e.g. //foundation/ai/engine/services/server/plugin/cv

    e.g. //foundation/ai/engine/services/server/plugin/nlu

Rule: Store all external APIs provided by plug-ins in the interfaces/kits directory of the AI subsystem.

The AI subsystem exposes its capabilities through external APIs of northbound SDKs. According to API management requirements of OpenHarmony, store all external APIs of northbound SDKs in the interfaces/kits directory of the subsystem. Currently, the external APIs of plug-ins of the AI subsystem are stored in the following directory: //foundation/ai/engine/interface/kits. You can add a sub-directory for each newly added plug-in in this directory. For example, if you add a CV plug-in, then store its external APIs in the //foundation/ai/engine/interfaces/kits/cv directory.

Rule: Make sure that plug-in compilation results are stored in the /usr/lib directory.

Plug-in loading on the server uses the dlopen mode and can only be performed in the /usr/lib directory. Therefore, when compiling the .so file of a plug-in, set the output directory as /usr/lib in the compilation configuration file.

1
https://gitee.com/fish_neil/docs.git
git@gitee.com:fish_neil/docs.git
fish_neil
docs
docs
master

搜索帮助