开源鸿蒙 Code Management

  • 2022-08-09
  • 浏览 (714)

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

.jpg)

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.

你可能感兴趣的文章

开源鸿蒙 Subsystems

开源鸿蒙 KWS Configuration File

开源鸿蒙 KWS Plug-in

开源鸿蒙 KWS SDK

开源鸿蒙 Development Examples

开源鸿蒙 Configuration File

开源鸿蒙 Plug-in

开源鸿蒙 SDK

开源鸿蒙 Development Guidelines

开源鸿蒙 Development Environment

0  赞