登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
模力方舟
登录
注册
代码拉取完成,页面将自动刷新
开源项目
>
程序开发
>
安全开发相关
&&
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
7
Star
2
Fork
2
同济大学计算机开放实验室
/
ComoFramework
代码
Issues
48
Pull Requests
0
Wiki
统计
流水线
服务
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
SBOM
我知道了,不再自动展开
更新失败,请稍后重试!
移除标识
内容风险标识
本任务被
标识为内容中包含有代码安全 Bug 、隐私泄露等敏感信息,仓库外成员不可访问
学术化定义:单线程事务模型
待办的
#ICIYXM
XilongPei
拥有者
创建于
2025-07-01 08:19
很好,您已经给出了一个**功能安全背景下的单线程实时事务模型**的结构定义,目标是对其进行**严格的学术形式化定义**,并给出对应的 **AADL 建模模板**。下面我将分三部分展开: --- # ✅ 一、学术化定义:单线程事务模型 --- ## 🎯 1. 系统定义(高层) 定义一个**确定性调度的单线程周期事务处理模型**,其数学模型如下: ### Job 定义: > 一个 Job 是一个有序任务集合: > **Job = { Task₀, Task₁, ..., Taskₙ }** ### 每个 Task 定义: > Task\_i = (nameᵢ, wcetᵢ, periodᵢ, deadlineᵢ, actionᵢ, syncᵢ, clockᵢ) ### 假设条件: 1. 所有 Task 在单一 CPU 上按顺序串行调度; 2. 所有 Task 的 deadline ≤ period; 3. 任意两个 Task 的执行行为同步依赖仅在 Job 内部; 4. 所有 Task 无抢占、无动态资源分配; 5. 执行时不受中断干扰(适用于核隔离); --- ## 🔢 2. 时间语义定义 ### 周期性约束: * 对每个 Task\_i ∈ Job,定义: ```math ∀i, ∃k ∈ ℕ : dispatch_time(Task_i) = Job.start_time + k × period ``` ### 可确定性约束: * 调度顺序固定: ```math ∀i < j, complete(Task_i) ≤ dispatch(Task_j) ``` * 时间窗约束: ```math ∀i, wcet_i ≤ deadline_i ≤ period ``` --- ## 🧭 3. 同步语义 同步字段包括: * `action`:表示是否需要同步等待; * `WaitForSyncPaxos`:同步目标(如某个 Paxos slot); * `clock`:分布式一致性中的 Lamport 时钟。 这些可用于建模多节点间的逻辑一致性(见 AGREE 契约)。 --- # 📐 二、AADL 建模:RealTimeJob 与 RealTimeTask --- ## AADL 类型建模 ### 🧩 1. RealTimeTask 模型 ```aadl thread RealTimeTask features sync_data: in data port; output_result: out data port; end RealTimeTask; thread implementation RealTimeTask.impl properties Dispatch_Protocol => Periodic; Period => 5 ms; -- 从 C struct 映射 Compute_Execution_Time => 100 us .. 300 us; Deadline => 5 ms; SEI::Execution_Ordering => Non_Preemptive; -- 用户属性 Source_Language => "C"; Source_Name => "RealTimeTask"; Source_Properties::Logical_Clock => true; Source_Properties::Sync_Action => true; end RealTimeTask.impl; ``` ### 🧩 2. RealTimeJob = 有序 Task 集合 ```aadl process RealTimeJob end RealTimeJob; process implementation RealTimeJob.impl subcomponents task0: thread RealTimeTask.impl; task1: thread RealTimeTask.impl; task2: thread RealTimeTask.impl; connections data access sync_data -> task0.sync_data; data access sync_data -> task1.sync_data; -- 顺序调度行为可由调度器限制 end RealTimeJob.impl; ``` ### 🧩 3. processor + binding ```aadl processor IsolatedCore end IsolatedCore; processor implementation IsolatedCore.impl properties Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol); Preemptive_Scheduler => false; end IsolatedCore.impl; system SingleThreadTransactionSystem end SingleThreadTransactionSystem; system implementation SingleThreadTransactionSystem.impl subcomponents core: processor IsolatedCore.impl; job: process RealTimeJob.impl; properties Actual_Processor_Binding => (reference (core)) applies to job; end SingleThreadTransactionSystem.impl; ``` --- # ✅ 三、验证建议:使用 AGREE 契约分析行为正确性 --- ## 📜 契约约束示意 ```aadl annex agree {** assume "Task period >= wcet" : task0.compute_execution_time < task0.period; guarantee "Job 顺序性": task0.complete_time < task1.dispatch_time; guarantee "逻辑一致性": task0.clock < task1.clock; -- Lamport 时钟递增 guarantee "同步依赖满足": task1.WaitForSyncPaxos = task0.output_result; **}; ``` --- ## 📌 拓展建议 | 模块 | 内容 | | ---------------------- | ---------------------- | | `EMV2` | 模拟 Paxos 未达成、时钟偏移、任务溢出 | | `AGREE` | 验证同步数据流闭环与行为一致性 | | `Watchdog/Monitor` | 加入用于验证任务 deadline 超限场景 | | `AADL::SystemInstance` | 用于建模多 Job 多周期事务调度覆盖性 |
很好,您已经给出了一个**功能安全背景下的单线程实时事务模型**的结构定义,目标是对其进行**严格的学术形式化定义**,并给出对应的 **AADL 建模模板**。下面我将分三部分展开: --- # ✅ 一、学术化定义:单线程事务模型 --- ## 🎯 1. 系统定义(高层) 定义一个**确定性调度的单线程周期事务处理模型**,其数学模型如下: ### Job 定义: > 一个 Job 是一个有序任务集合: > **Job = { Task₀, Task₁, ..., Taskₙ }** ### 每个 Task 定义: > Task\_i = (nameᵢ, wcetᵢ, periodᵢ, deadlineᵢ, actionᵢ, syncᵢ, clockᵢ) ### 假设条件: 1. 所有 Task 在单一 CPU 上按顺序串行调度; 2. 所有 Task 的 deadline ≤ period; 3. 任意两个 Task 的执行行为同步依赖仅在 Job 内部; 4. 所有 Task 无抢占、无动态资源分配; 5. 执行时不受中断干扰(适用于核隔离); --- ## 🔢 2. 时间语义定义 ### 周期性约束: * 对每个 Task\_i ∈ Job,定义: ```math ∀i, ∃k ∈ ℕ : dispatch_time(Task_i) = Job.start_time + k × period ``` ### 可确定性约束: * 调度顺序固定: ```math ∀i < j, complete(Task_i) ≤ dispatch(Task_j) ``` * 时间窗约束: ```math ∀i, wcet_i ≤ deadline_i ≤ period ``` --- ## 🧭 3. 同步语义 同步字段包括: * `action`:表示是否需要同步等待; * `WaitForSyncPaxos`:同步目标(如某个 Paxos slot); * `clock`:分布式一致性中的 Lamport 时钟。 这些可用于建模多节点间的逻辑一致性(见 AGREE 契约)。 --- # 📐 二、AADL 建模:RealTimeJob 与 RealTimeTask --- ## AADL 类型建模 ### 🧩 1. RealTimeTask 模型 ```aadl thread RealTimeTask features sync_data: in data port; output_result: out data port; end RealTimeTask; thread implementation RealTimeTask.impl properties Dispatch_Protocol => Periodic; Period => 5 ms; -- 从 C struct 映射 Compute_Execution_Time => 100 us .. 300 us; Deadline => 5 ms; SEI::Execution_Ordering => Non_Preemptive; -- 用户属性 Source_Language => "C"; Source_Name => "RealTimeTask"; Source_Properties::Logical_Clock => true; Source_Properties::Sync_Action => true; end RealTimeTask.impl; ``` ### 🧩 2. RealTimeJob = 有序 Task 集合 ```aadl process RealTimeJob end RealTimeJob; process implementation RealTimeJob.impl subcomponents task0: thread RealTimeTask.impl; task1: thread RealTimeTask.impl; task2: thread RealTimeTask.impl; connections data access sync_data -> task0.sync_data; data access sync_data -> task1.sync_data; -- 顺序调度行为可由调度器限制 end RealTimeJob.impl; ``` ### 🧩 3. processor + binding ```aadl processor IsolatedCore end IsolatedCore; processor implementation IsolatedCore.impl properties Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol); Preemptive_Scheduler => false; end IsolatedCore.impl; system SingleThreadTransactionSystem end SingleThreadTransactionSystem; system implementation SingleThreadTransactionSystem.impl subcomponents core: processor IsolatedCore.impl; job: process RealTimeJob.impl; properties Actual_Processor_Binding => (reference (core)) applies to job; end SingleThreadTransactionSystem.impl; ``` --- # ✅ 三、验证建议:使用 AGREE 契约分析行为正确性 --- ## 📜 契约约束示意 ```aadl annex agree {** assume "Task period >= wcet" : task0.compute_execution_time < task0.period; guarantee "Job 顺序性": task0.complete_time < task1.dispatch_time; guarantee "逻辑一致性": task0.clock < task1.clock; -- Lamport 时钟递增 guarantee "同步依赖满足": task1.WaitForSyncPaxos = task0.output_result; **}; ``` --- ## 📌 拓展建议 | 模块 | 内容 | | ---------------------- | ---------------------- | | `EMV2` | 模拟 Paxos 未达成、时钟偏移、任务溢出 | | `AGREE` | 验证同步数据流闭环与行为一致性 | | `Watchdog/Monitor` | 加入用于验证任务 deadline 超限场景 | | `AADL::SystemInstance` | 用于建模多 Job 多周期事务调度覆盖性 |
评论 (
0
)
登录
后才可以发表评论
状态
待办的
待办的
进行中
已完成
已关闭
负责人
未设置
标签
未设置
标签管理
里程碑
未关联里程碑
未关联里程碑
Pull Requests
未关联
未关联
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
未关联
未关联
master
开始日期   -   截止日期
-
置顶选项
不置顶
置顶等级:高
置顶等级:中
置顶等级:低
优先级
不指定
严重
主要
次要
不重要
参与者(1)
C++
1
https://gitee.com/tjopenlab/ComoFramework.git
git@gitee.com:tjopenlab/ComoFramework.git
tjopenlab
ComoFramework
ComoFramework
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册