diff --git a/docs-en/readme/distributed-scheduler.md b/docs-en/readme/distributed-scheduler.md index 799453b3065a685d200f972d83d30265e97473c9..28435bba82faf265731673538bb511a9d3733ae4 100755 --- a/docs-en/readme/distributed-scheduler.md +++ b/docs-en/readme/distributed-scheduler.md @@ -2,9 +2,9 @@ ## Overview -The Distributed Scheduler sets up a distributed service platform in OpenHarmony by using a proxy between the primary and secondary devices. With the distributed scheduler, the primary device \(OpenHarmony-powered smart TV\) can start a Feature Ability \(FA\) deployed on the secondary device \(a memory-constrained OpenHarmony device such as a lite wearable\). The following figure shows the components of the Distributed Scheduler. +The Distributed Scheduler is used for cross-device component management. It allows the local device to access or control remote components, and enables application collaboration in distributed scenarios. The following figure shows the modules in the Distributed Scheduler. -![](figures/en-us_image_0000001055199362.png) +![](figures/en-us_image_0000001055103250.png) ## Directory Structure @@ -21,17 +21,12 @@ The following table describes the directory structure of the Distributed Schedul

dtbschedmgr_lite

-

Implementation logic of the Distributed Scheduler

+

Implementation of the Distributed Scheduler

safwk_lite

-

Implementation logic of system service processes

- - -

samgr_lite

- -

Implementation logic of local service management

+

Implementation of the foundation process

@@ -45,13 +40,13 @@ The source code directory structure of the Distributed Scheduler is as follows: │ ├── distributed_schedule_service.h # Header file for the open APIs provided by the Distributed Scheduler │ ├── dmslite_check_remote_permission.h # Header file for the permission management module of the Distributed Scheduler │ ├── dmslite_famgr.h # Header file for the FA management module of the Distributed Scheduler -│ ├── dmslite_inner_common.h # Header file for the service files of the Distributed Scheduler -│ ├── dmslite.h # Header file for the implementation of the Distributed Scheduler +│ ├── dmslite_inner_common.h # Internal common file for the Distributed Scheduler +│ ├── dmslite.h # Header file for the implementation of the Distributed Scheduler Service │ ├── dmslite_log.h # Header file for the log module -│ ├── dmslite_msg_parser.h # Header file for communication data deserialization +│ ├── dmslite_msg_parser.h # Header file for the distributed message parsing module │ ├── dmslite_tlv_common.h # Header file for the TLV data parsing module -│ └── dmslite_session.h # Header file for enabling cross-device communication -├── README.md +│ └── dmslite_session.h # Header file for the inter-device communication module +├── readme.md ├── LICENSE ├── source ├── distributed_schedule_service.c @@ -65,69 +60,59 @@ The source code directory structure of the Distributed Scheduler is as follows: ## Constraints -- Language: C -- Networking: Devices must be on the same LAN. -- Operating system: OpenHarmony +**Language**: C or C++ + +**Networking environment**: The primary and secondary devices must be on the same LAN and can ping each other. + +**Operating system**: OpenHarmony **Limitations and constraints on remote startup**: - Only FAs can be started remotely. Remote startup is unavailable to abilities using the Service template. -- Before the remote startup, ensure that the primary and secondary devices are on the same network segment and can ping each other. Otherwise, the remote startup fails. +- Before the remote startup, ensure that the distributed networking between the primary and secondary devices is successful. Otherwise, the remote startup fails. ## Usage -**Compiling the Distributed Scheduler** +- **Compiling the Distributed Scheduler** -The distributed scheduler uses some feature macros to customize the function code to be compiled on different platforms. The function code is stored in **build\\lite\\config\\subsystem\\distributedschedule\\**. The directory structure is as follows: +The code of the Distributed Scheduler is stored in the following directory: ``` -build/lite/config/subsystem/distributedschedule -├── BUILD.gn +foundation/distributedschedule/services/dtbschedmgr_lite ``` -Modify the **BUILD.gn** file when compiling code for different platforms. The following code snippet uses code compilation for the Hi3518EV300 and Hi3516DV300 development boards as an example: +When compiling the code for a specific platform, you need to specify the target platform. The following code snippet uses code compilation for the Hi3516DV300 platform as an example: ``` -zlite_subsystem("distributedschedule") { - subsystem_components = [ - "//foundation/distributedschedule/services/samgr_lite:samgr", - ] - if (board_name == "hi3518ev300" || board_name == "hi3516dv300") { - subsystem_components += [ - "//foundation/distributedschedule/services/safwk_lite:safwk_lite", - "//foundation/distributedschedule/services/dtbschedmgr_lite:dtbschedmgr", // Configure the distributed scheduler. - ] - } -} +python build.py ipcamera -p hi3516dv300_liteos_a ``` -**\* Primary device development** \(taking FA startup as an example\) +- **Primary device development** \(taking FA startup as an example\) -Create a **Want** instance. You should first create an **ElementName** object with **deviceId**, **bundleName**, and **abilityName** specified and add this object to the **Want** instance. Then, set the multi-device startup flag **Want.FLAG\_ABILITYSLICE\_MULTI\_DEVICE** to the **Want** instance to enable remote FA startup. +Create a **Want** instance to set the remote device ID, bundle name, and ability class name of the target FA and set the **Want.FLAG\_ABILITYSLICE\_MULTI\_DEVICE** flag to enable distributed startup. ``` -// Import related header files. import ohos.aafwk.ability.Ability; import ohos.aafwk.content.Want; import ohos.bundle.ElementName; -// Start the remote FA on the secondary device. -Want want = new Want(); // Create a Want instance that encapsulates information about the remote FA to start. -ElementName name = new ElementName("remote_device_id", "com.huawei.remote_package_name", "remote_class_name"); +// Create a Want instance that will be passed to the startAbility method. +Want want = new Want(); +ElementName name = new ElementName(remote_device_id, "com.huawei.remote_bundle_name", "remote_ability_name"); want.setElement(name); // Add information about the target FA for startup to the Want instance. want.setFlags(Want.FLAG_ABILITYSLICE_MULTI_DEVICE); // Set the multi-device startup flag. If this flag is not set, remote FA startup will be unavailable. + +// Start the remote FA on the secondary device. startAbility(want); // Start the specified FA based on the want parameter. If the name and type of the want parameter are different from those used in the IDE, use the parameter name and type in the IDE. ``` -**\* Prerequisites** - -**Networking between the primary and secondary devices**: Before the remote startup, ensure that the two devices are on the same network segment and can ping each other. Otherwise, the remote startup fails. +- **Prerequisites** -**FA installation on the secondary device**: Before the remote startup, ensure that the target FA has been installed on the secondary device. +The target FA with the specified bundle name must have been installed on the secondary device. -**\* Execution** \(taking FA startup as an example\) +- **Execution** \(taking FA startup as an example\) -Call **startAbility** on the primary device \(smart TV\) to start the FA of the secondary device \(memory-constrained device such as a lite wearable\). +Call the **startAbility** method on the primary device to start the target FA on the secondary device. ## Repositories Involved diff --git a/docs-en/readme/figures/en-us_image_0000001055103250.png b/docs-en/readme/figures/en-us_image_0000001055103250.png new file mode 100755 index 0000000000000000000000000000000000000000..1123a2ad54538e66721419518ac33c94a6eaa5d3 Binary files /dev/null and b/docs-en/readme/figures/en-us_image_0000001055103250.png differ diff --git a/docs-en/readme/figures/en-us_image_0000001055199362.png b/docs-en/readme/figures/en-us_image_0000001055199362.png deleted file mode 100755 index 91ee8f2b429c045f5f3fc57a09c76bb9c6c8bc14..0000000000000000000000000000000000000000 Binary files a/docs-en/readme/figures/en-us_image_0000001055199362.png and /dev/null differ