diff --git a/README.md b/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..04efe2e0041cd5d32f032ea02cf6d90f3747bb9a
--- /dev/null
+++ b/README.md
@@ -0,0 +1,90 @@
+# The Part of Frame Aware Sched
+
+- [ Introduction](#section_introduction)
+- [ Directory Structure](#section_catalogue)
+- [Framework](#section_framework)
+ - [The component of Frame Information Collection ](#section_collection)
+ - [The component of Frame Aware Policy](#section_policy)
+- [ Usage Guidelines](#section_usage)
+- [ Repositories Involved](#section_projects)
+
+## Introduction
+
+The part of Frame Aware Sched belongs to subsystem named *Resource Schedule Subsystem*.
+
+In order to ensure the cpu scheduling supply, it updates the process scheduling groups and adjust the kernel schedule parameters to influence the kernel scheduling behavior according to the information of the application frame drawing and the application life cycle status.
+
+## Directory Structure
+
+```
+//foundation/resourceschedule/frame_aware_sched
+├── common # 部件通用工具类
+│ └── include
+│ ├── frame_info_const.h # 绘帧过程信息
+│ ├── frame_aware_constants.h # 通用参数配置
+│ ├── frame_aware_log_domain.h # 封装hilog,用于日志打印
+│ └── single_instance.h # 封装了单例模式的类模板
+│
+├── interfaces
+│ └── innerkits # 对内接口目录
+│
+├── frameworks
+│ └── core
+│ ├── frame_aware_collector # 应用绘帧信息收集组件
+│ └── frame_aware_policy # 帧感知调度机制组件
+│
+├── profiles # 组件配置文件
+└── test # 自测试用例目录
+```
+## Framework
+
+According to the thread it belongs to during execution, the *Farme Aware Sched* is devided into two parts, which are *Frame Aware Collector* and *Frame Aware Policy*. The framework is shown in the following picture.
+
+- *Frame Aware Collector*: which is the core strategy of drawing frames, including frame event processing module, slide scene strategy module, and model processing module.
+
+ Module-frame event processing : responsible for coordinating and dispatching the message information of the frame drawing sub-process of the JS-UI subsystem and the Graphic subsystem.
+
+ Module-slide scene strategy: responsible for the sliding scene recognize and provide the scenario-based fine scheduling by the interface of the model processing module.
+
+ Module-model processing module: responsible for providing the adjustment and scheduling algorithm of each sub-process.
+
+- *Frame Aware Policy*: which is consists of four part: event processing module, application management module, and RTG (Related-Thread-Group) management module and scheduling parameter control module.
+
+ Module-Application state event processing: which is responsible for registering and receiving messages from the global resource management and control subsystem, such as application state switch, window focus state change, etc, and distributing messages to the application management and control module and RTG grouping module.
+
+ Module-Application management: responsible for the unified management of the application messages of the event processing module.
+
+ Module-RTG Managerment: the kernel interface set, sets the RTG accoding to the application state to realize thread scheduling management.
+
+ Module-Scheduling Parameter Control:responsible for reading the default scheduling prameter configuration.
+
+
+
+### The component of Frame Information Collection
+
+The *frame information collection* is mainly responsible for adjusting the parameters of kernel scheduling and scaling the thread load. When the user slides on the application, it recognizes the key threads (such as draw frame thread and render thread) , perceives the sub-process of the application frame drawing, and adjust the kernel scheduling parameters according to the task timeout status to perform real-time resources.
+
+- According to the screen refresh rate, it analyze the current frame rate information. The resource supply of key threads is increased according to the time to end of the drawing frame.
+- Adjust resource supply according to the duration of each sub-process during graphics rendering process.
+- Adjust resource supply for frame sub-process task with high frame loss rate.
+
+### The component of Frame Aware Policy
+
+As the basis for the realization of application frame perception, the *frame aware policy* is mainly reposible for controlling thread groups and thread priorities, realizing the unified management of application threads and ensuring the performance of the entire system.
+
+### Usage Guidelines
+
+System developers can add or remove this part by configuring the product definition JSON file under **/productdefine/common/products** to enable or disable this part:
+
+` "resourceschedule:frame_aware_sched":{} `
+
+## Repositories Involved
+
+- [resource_schedule_service](https://gitee.com/openharmony/resourceschedule_resource_schedule_service)
+- [ace_ace_engine]( https://gitee.com/openharmony/ace_ace_engine)
+- [graphic_standard](https://gitee.com/openharmony/graphic_standard)
+- [aafwk_standard](https://gitee.com/openharmony/aafwk_standard )
+- **frame_aware_sched**
+
+
+
diff --git a/README_ZH.md b/README_ZH.md
index c092e6c91f7bd20ad76802a38b007465f655a7c9..3407d7e84c2305d8916c19e0db534106479af3db 100644
--- a/README_ZH.md
+++ b/README_ZH.md
@@ -11,7 +11,7 @@
## 目录
```
-//foundation/resourceschedule/plugins/frame_aware_sched
+//foundation/resourceschedule/frame_aware_sched
├── common # 部件通用工具类
│ └── include
│ ├── frame_info_const.h # 绘帧过程信息
diff --git a/common/include/frame_info_const.h b/common/include/frame_info_const.h
index d1e4bf4dbe2f6efdeafc7d24d06f6aede8a416b1..d525abf0f1ee5d917f6f6d98133021a011558c99 100644
--- a/common/include/frame_info_const.h
+++ b/common/include/frame_info_const.h
@@ -19,30 +19,29 @@
namespace OHOS {
namespace RME {
enum class FrameEvent {
- FLUSH_ANIMATION,
- FLUSH_BUILD,
- FLUSH_LAYOUT,
- FLUSH_RENDER,
- FLUSH_RENDER_FINISH, // to add, do not realize
- PROCESS_POST_FLUSH,
- PROCESS_COMMANDS,
- ANIMATE,
- RENDER,
- SEND_COMMANDS,
+ EVENT_BEGIN_FRAME,
+ EVENT_FLUSH_ANIMATION_START,
+ EVENT_FLUSH_ANIMATION_END,
+ EVENT_FLUSH_BUILD_START,
+ EVENT_FLUSH_BUILD_END,
+ EVENT_FLUSH_LAYOUT_START,
+ EVENT_FLUSH_LAYOUT_END,
+ EVENT_FLUSH_RENDER_START,
+ EVENT_FLUSH_RENDER_END,
+ EVENT_FLUSH_RENDER_FINISH_START,
+ EVENT_FLUSH_RENDER_FINISH_END,
+ EVENT_PROCESS_POST_FLUSH_START,
+ EVENT_PROCESS_COMMANDS_START,
+ EVENT_ANIMATE_START,
+ EVENT_RENDER_START,
+ EVENT_SEND_COMMANDS_START,
+ EVENT_END_FRAME,
EVENT_SET_PARAM,
EVENT_RTG_ENABLE,
EVENT_BUFFER_COUNT,
UNKNOWN,
};
-enum class EventState {
- EVENT_ENTER,
- EVENT_CONSUMED,
- EVENT_EXIT,
- ENABLE,
- DISABLE,
-};
-
enum class SceneEvent {
SCENE_INVALID = 0,
VIDEO,
diff --git a/common/include/rtg_interface.h b/common/include/rtg_interface.h
index f409dc793eba752d6d798d1ebf80e0ecc0d42df8..68d5a6092bbbd183240452d6d51eb64709151075 100644
--- a/common/include/rtg_interface.h
+++ b/common/include/rtg_interface.h
@@ -27,8 +27,6 @@ using namespace std;
#define MAX_SUBPROCESS_NUM 8
#define MULTI_FRAME_NUM 5
-typedef int pid_t;
-
struct rtg_enable_data {
int enable;
int len;
@@ -85,9 +83,8 @@ enum rtg_sched_cmdid {
RTG_CTRL_MAX_NR,
};
-extern "C"{
+extern "C" {
int EnableRtg(bool flag);
- //-----for frame rtg-----//
int CreateNewRtgGrp(int prioType = 0, int rtNum = 0); // Return GrpId if success
int AddThreadToRtg(int tid, int grpId, int prioType = 0);
int AddThreadsToRtg(vector tids, int grpId, int prioType = 0);
diff --git a/common/include/single_instance.h b/common/include/single_instance.h
index 087f4a2140cddeac23e01757b93d4ddbf14ca7a9..a586551ee963e4b937ff21a93ad49558829446bd 100644
--- a/common/include/single_instance.h
+++ b/common/include/single_instance.h
@@ -18,7 +18,6 @@
namespace OHOS {
namespace RME {
-
#define DECLARE_SINGLE_INSTANCE_BASE(className) \
public: \
static className& GetInstance(); \
@@ -28,13 +27,11 @@ private: \
className(className&&) = delete; \
className& operator=(className&&) = delete; \
-
-#define DECLARE_SINGLE_INSTANCE(className) \
- DECLARE_SINGLE_INSTANCE_BASE(className) \
-private: \
- className() = default; \
- ~className() = default; \
-
+#define DECLARE_SINGLE_INSTANCE(className) \
+ DECLARE_SINGLE_INSTANCE_BASE(className) \
+private: \
+ className() = default; \
+ ~className() = default; \
#define IMPLEMENT_SINGLE_INSTANCE(className) \
className& className::GetInstance() \
diff --git a/frameworks/core/frame_aware_collector/include/frame_msg_mgr.h b/frameworks/core/frame_aware_collector/include/frame_msg_mgr.h
index dfcaef330466321765c1086e43c7e6a387e0dac6..67d842b9a9f9dfcf0e2acdffe987b3177f186aea 100644
--- a/frameworks/core/frame_aware_collector/include/frame_msg_mgr.h
+++ b/frameworks/core/frame_aware_collector/include/frame_msg_mgr.h
@@ -17,6 +17,7 @@
#define FRAME_MSG_MGR_H
#include
+#include