基于WebSocket的实时协同编辑方法及应用
合集下载
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
第 18 卷 第 5 期 第 52期019 年 5 月
软件导刊 Software Guide
Vol. 18 No. 5 May. 2019
基于 WebSocket 的实时协同编辑方法及应用
陈诗雨,熊才权,董 奕,梅 清
(湖北工业大学 计算机学院,湖北 武汉 430068)
摘 要:操作意图一致性控制是同编辑的重要研究问题。传统的协同控制算法在操作意图一致性和交互性
上存在加锁粒度大小难以把握、函数转换结果与用户意图不一致、操作对象全局 ID 难以分配等局限性。为减
少用户协同工作中出现的操作意图不一致现象,提高工作效率,提出一种基于 WebSocket 协议及隐藏/恢复机制
的共享同步控制方法。该方法采用 WebSocket 技术,通过集合类对编辑样本和操作主体进行共同控制,从而减
CHEN Shi-Yu,XIONG Cai-Quan,DONG Yi,MEI Qing (School of Computer Science,Hubei University of Technology,Wuhan 430068,China)
Abstract:Operation intention consistency control is an important research problem in collaborative editing. Traditional collaborative control algorithm has shortcomings in operating intention consistency and interaction,such as the difficulties to ensure the sizes of lock granularities,the inconsistency between function conversion results and users’intentions and difficulties to allocate global operation ID. In order to reduce the user operation intent inconsistent phenomenon occurring in a collaborative work and improve the efficiency of users to work together,we put forward shared SSCM(Shared Synchronization Control Method)based on the WebSocket protocol and hide/recovery mechanism,the method uses the WebSocket technology,control the common edit samples and operating subject through the collection class,thus reduces the waiting time for operation main body,and realises the consistency of shared editing samples in si⁃ lence and dynamic cases. This method can not only solve the problem of the consistency of user operation intention,but also can meet the user's interactive demand in the collaborative process and improve the quality of the page. Key Words:WebSocket;operational intent consistency;page quality;shared synchronization control method(SSCM)
DOI:10. 11907/rjdk. 182139
中图分类号:TP301
文献标识码:A
文章编号:1672-7800(2019)005-0079-05
Real-Time Collaborative Editing Method Based on WebSocket and Its Application
作的修改。实时协同编辑需要解决的重点问题是保证用 户 操 作 意 图 的 一 致 性 ,即 如 何 在 较 高 的 网 络 延 迟 下 尽 可 能 多 地 维 护 用 户 意 图 。 现 有 的 操 作 意 图 一 致 性 算 法 如 OT (Operational Transformation)算 法[1]、AST(Address SpaceT⁃ ransformation)算 法[2]、CRDT(Commutative Replicated Data Type)算 法 等 [3-6] 各 具 优 点 ,但 都 存 在 局 限 性[3]。 在 OT 算 法 中 ,本 地 操 作 可 以 立 即 执 行 ,而 远 程 操 作 需 要 结 合 本 地 历
0 引言
协 同 编 辑 指 在 网 络 环 境 下 多 人 共 同 编 辑 一 个 文 档 ,集 结 群 体 智 慧 ,使 最 终 文 档 满 足 群 体 多 数 人 员 的 意 见 要 求 , 是计算机协同工作研究领域的典型应用。协同工作要求 很 强 的 实 时 性 ,即 用 户 不 用 刷 新 页 面 就 能 及 时 看 到 他 人 所
小 操 作 主 体 的 等 待 时 间 ,实 现 在 静 默 和 动 态 两 种 情 况 下 共 享 编 辑 样 本 的 一 致 性 ,不 仅 很 好 解 决 了 用 户 操 作 意 图
一致性问题,还能满足用户在协同过程中的交互需求,提高页面质量。
关键词:WebSocket;操作意图一致性;页面质量;共享同步控制方法(SSCM)
软件导刊 Software Guide
Vol. 18 No. 5 May. 2019
基于 WebSocket 的实时协同编辑方法及应用
陈诗雨,熊才权,董 奕,梅 清
(湖北工业大学 计算机学院,湖北 武汉 430068)
摘 要:操作意图一致性控制是同编辑的重要研究问题。传统的协同控制算法在操作意图一致性和交互性
上存在加锁粒度大小难以把握、函数转换结果与用户意图不一致、操作对象全局 ID 难以分配等局限性。为减
少用户协同工作中出现的操作意图不一致现象,提高工作效率,提出一种基于 WebSocket 协议及隐藏/恢复机制
的共享同步控制方法。该方法采用 WebSocket 技术,通过集合类对编辑样本和操作主体进行共同控制,从而减
CHEN Shi-Yu,XIONG Cai-Quan,DONG Yi,MEI Qing (School of Computer Science,Hubei University of Technology,Wuhan 430068,China)
Abstract:Operation intention consistency control is an important research problem in collaborative editing. Traditional collaborative control algorithm has shortcomings in operating intention consistency and interaction,such as the difficulties to ensure the sizes of lock granularities,the inconsistency between function conversion results and users’intentions and difficulties to allocate global operation ID. In order to reduce the user operation intent inconsistent phenomenon occurring in a collaborative work and improve the efficiency of users to work together,we put forward shared SSCM(Shared Synchronization Control Method)based on the WebSocket protocol and hide/recovery mechanism,the method uses the WebSocket technology,control the common edit samples and operating subject through the collection class,thus reduces the waiting time for operation main body,and realises the consistency of shared editing samples in si⁃ lence and dynamic cases. This method can not only solve the problem of the consistency of user operation intention,but also can meet the user's interactive demand in the collaborative process and improve the quality of the page. Key Words:WebSocket;operational intent consistency;page quality;shared synchronization control method(SSCM)
DOI:10. 11907/rjdk. 182139
中图分类号:TP301
文献标识码:A
文章编号:1672-7800(2019)005-0079-05
Real-Time Collaborative Editing Method Based on WebSocket and Its Application
作的修改。实时协同编辑需要解决的重点问题是保证用 户 操 作 意 图 的 一 致 性 ,即 如 何 在 较 高 的 网 络 延 迟 下 尽 可 能 多 地 维 护 用 户 意 图 。 现 有 的 操 作 意 图 一 致 性 算 法 如 OT (Operational Transformation)算 法[1]、AST(Address SpaceT⁃ ransformation)算 法[2]、CRDT(Commutative Replicated Data Type)算 法 等 [3-6] 各 具 优 点 ,但 都 存 在 局 限 性[3]。 在 OT 算 法 中 ,本 地 操 作 可 以 立 即 执 行 ,而 远 程 操 作 需 要 结 合 本 地 历
0 引言
协 同 编 辑 指 在 网 络 环 境 下 多 人 共 同 编 辑 一 个 文 档 ,集 结 群 体 智 慧 ,使 最 终 文 档 满 足 群 体 多 数 人 员 的 意 见 要 求 , 是计算机协同工作研究领域的典型应用。协同工作要求 很 强 的 实 时 性 ,即 用 户 不 用 刷 新 页 面 就 能 及 时 看 到 他 人 所
小 操 作 主 体 的 等 待 时 间 ,实 现 在 静 默 和 动 态 两 种 情 况 下 共 享 编 辑 样 本 的 一 致 性 ,不 仅 很 好 解 决 了 用 户 操 作 意 图
一致性问题,还能满足用户在协同过程中的交互需求,提高页面质量。
关键词:WebSocket;操作意图一致性;页面质量;共享同步控制方法(SSCM)