CN113190518B - Consistency maintenance method in collaborative editing based on mobile cloud computing - Google Patents
Consistency maintenance method in collaborative editing based on mobile cloud computing Download PDFInfo
- Publication number
- CN113190518B CN113190518B CN202110389602.0A CN202110389602A CN113190518B CN 113190518 B CN113190518 B CN 113190518B CN 202110389602 A CN202110389602 A CN 202110389602A CN 113190518 B CN113190518 B CN 113190518B
- Authority
- CN
- China
- Prior art keywords
- remote
- cloud
- node
- local
- operations
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 32
- 238000012423 maintenance Methods 0.000 title description 7
- 239000008186 active pharmaceutical agent Substances 0.000 claims description 24
- 238000003780 insertion Methods 0.000 claims description 14
- 230000037431 insertion Effects 0.000 claims description 14
- 230000010354 integration Effects 0.000 claims description 8
- 238000012217 deletion Methods 0.000 claims description 3
- 230000037430 deletion Effects 0.000 claims description 3
- 230000008569 process Effects 0.000 claims description 2
- 230000004043 responsiveness Effects 0.000 abstract description 6
- 238000010586 diagram Methods 0.000 description 3
- 238000011160 research Methods 0.000 description 3
- 230000001360 synchronised effect Effects 0.000 description 3
- 230000009466 transformation Effects 0.000 description 3
- 238000013461 design Methods 0.000 description 2
- 230000010076 replication Effects 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 241000405147 Hermes Species 0.000 description 1
- 238000009825 accumulation Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000013468 resource allocation Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/18—File system types
- G06F16/1805—Append-only file systems, e.g. using logs or journals to store data
- G06F16/1815—Journaling file systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/176—Support for shared access to files; File sharing support
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/178—Techniques for file synchronisation in file systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/18—File system types
- G06F16/182—Distributed file systems
- G06F16/184—Distributed file systems implemented as replicated file system
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
本发明公开了基于移动云计算的协同编辑中一致性维护方法,包括如下步骤:步骤1:云端克隆和移动终端全复制式数据结构的初始化;步骤2:移动终端集成操作;步骤3:云端克隆集成操作。本发明充分利用了云端的计算和存储优势,有效地突破了移动终端的资源限制,让移动端执行轻量级的协同编辑操作,云端执行重量级的协同编辑操作,从而为移动用户提供更好的交互性和响应性,维护了移动协同编辑的共享文档副本一致性。
The invention discloses a method for maintaining consistency in collaborative editing based on mobile cloud computing. integrated operations. The invention makes full use of the computing and storage advantages of the cloud, effectively breaks through the resource limitation of the mobile terminal, allows the mobile terminal to perform lightweight collaborative editing operations, and the cloud performs heavyweight collaborative editing operations, thereby providing mobile users with better The interactivity and responsiveness of mobile co-editing maintains the consistency of shared document copies for mobile collaborative editing.
Description
技术领域technical field
本发明涉及面向云计算和移动计算的技术领域,具体地指一种基于移动云计算的协同编辑中一致性维护方法。The invention relates to the technical field oriented to cloud computing and mobile computing, in particular to a method for maintaining consistency in collaborative editing based on mobile cloud computing.
背景技术Background technique
随着移动计算、协同计算的飞速发展,越来越多的移动协同应用成功地应用到生产生活中各个领域,如移动协同办公、移动医疗、移动商务等。移动协同编辑作为移动协同办公中的典型代表,允许地理位置分散的移动用户通过移动互联网相互协作,完成对共享对象的编辑或设计,有利于群体智慧的分享,提升协同工作效率。近年来,移动协同编辑逐渐成为CSCW领域关注的热点问题。With the rapid development of mobile computing and collaborative computing, more and more mobile collaborative applications have been successfully applied to various fields of production and life, such as mobile collaborative office, mobile medical care, and mobile commerce. As a typical representative of mobile collaborative office, mobile collaborative editing allows geographically dispersed mobile users to collaborate with each other through the mobile Internet to complete the editing or design of shared objects, which is conducive to the sharing of group wisdom and improves collaborative work efficiency. In recent years, mobile collaborative editing has gradually become a hot issue in the CSCW field.
随着移动用户规模不断增加,移动终端面临计算、存储、电池容量等资源限制。为此,将云计算引入到移动终端中,可以突破移动终端的资源限制,给移动协同用户带来更好的用户体验。为了提供给移动用户良好的交互性和响应性,云端、移动端均采用全复制式的数据结构来存储共享对象的副本,因此,给共享对象的一致性维护带来巨大挑战。As the scale of mobile users continues to increase, mobile terminals face resource constraints such as computing, storage, and battery capacity. Therefore, introducing cloud computing into mobile terminals can break through the resource limitations of mobile terminals and bring better user experience to mobile collaborative users. In order to provide mobile users with good interactivity and responsiveness, both the cloud and the mobile terminal use a fully replicated data structure to store copies of shared objects, which brings great challenges to the consistency maintenance of shared objects.
典型的一致性维护方法有OT(Operation Transformation)、AST(Address SpaceTransformation)和CRDT(CRDT,Commutative Replicated Data Type)。相关研究表明,与传统的一致性维护方法相比,CRDT方法在较高网络延迟下能保证高响应性和高伸缩性,适合应用在大规模动态的协同编辑中。在移动云计算的协同编辑研究中,基于OT和AST技术的移动协同已有一定研究成果,例如Google Docs、OptiCloud和Hermes。然而,基于CRDT的一致性维护方法的研究多集中在传统的桌面协同应用中。将CRDT技术扩展和应用到移动云下的协同编辑中还存在诸多方面的技术挑战。一方面,在移动协同工作环境中,用户的移动性带来了不稳定的网络,导致移动用户积累了大量的本地操作序列,传统的CRDT技术无法直接处理大批量离线的操作序列;另一方面,移动终端的计算、存储资源与桌面的PC机存在较大差距,传统的CRDT技术并没有考虑到移动终端因素。因此,将CRDT技术应用到移动云下的协同编辑中需要在协同编辑框架、支持离线操作、移动终端资源、时延性等方面进一步改进和扩展。Typical consistency maintenance methods are OT (Operation Transformation), AST (Address SpaceTransformation) and CRDT (CRDT, Commutative Replicated Data Type). Relevant studies have shown that, compared with the traditional consistency maintenance method, the CRDT method can ensure high responsiveness and high scalability under higher network latency, and is suitable for large-scale dynamic collaborative editing. In the collaborative editing research of mobile cloud computing, some research achievements have been made on mobile collaboration based on OT and AST technology, such as Google Docs, OptiCloud and Hermes. However, the research on CRDT-based consistency maintenance methods mostly focuses on traditional desktop collaborative applications. There are still many technical challenges in extending and applying CRDT technology to collaborative editing under the mobile cloud. On the one hand, in the mobile collaborative work environment, the mobility of users brings unstable networks, which leads to the accumulation of a large number of local operation sequences for mobile users, and the traditional CRDT technology cannot directly handle a large number of offline operation sequences; on the other hand, , there is a big gap between the computing and storage resources of the mobile terminal and the desktop PC, and the traditional CRDT technology does not take into account the factors of the mobile terminal. Therefore, applying CRDT technology to collaborative editing under the mobile cloud requires further improvement and expansion in the collaborative editing framework, support for offline operations, mobile terminal resources, and latency.
发明内容SUMMARY OF THE INVENTION
本发明的目的就是要提供一种基于移动云计算的协同编辑中一致性维护方法,本发明突破移动终端的资源限制,在云端存储移动终端副本(云端克隆),并设计一种资源分配策略,让云端进行重量级协同编辑操作,移动终端进行轻量级的协同编辑操作,提升移动端协同编辑的响应性,进一步维护云端克隆、所有移动终端共享文档副本一致性。The purpose of the present invention is to provide a method for maintaining consistency in collaborative editing based on mobile cloud computing. The present invention breaks through the resource limitation of mobile terminals, stores mobile terminal copies (cloud clones) in the cloud, and designs a resource allocation strategy, Let the cloud perform heavyweight collaborative editing operations, and mobile terminals perform lightweight collaborative editing operations, improve the responsiveness of collaborative editing on the mobile terminal, and further maintain the consistency of cloud clones and document copies shared by all mobile terminals.
为实现此目的,本发明所设计的一种基于移动云计算的协同编辑中一致性维护方法,其特征在于,它包括如下步骤:To achieve this purpose, a method for maintaining consistency in collaborative editing based on mobile cloud computing designed by the present invention is characterized in that it comprises the following steps:
步骤1:将云端克隆的操作日志locallog’,remotelog’,remotelog”,log’,c2mremotelog清空,将移动终端的操作日志locallog,remotelog和log清空;将云端克隆的同步信号量c初始化为0,将移动终端的同步信号量m初始化为1;Step 1: Clear the operation log locallog', remotelog', remotelog", log', c2mremotelog of the cloud clone, and clear the operation log locallog, remotelog and log of the mobile terminal; initialize the synchronization semaphore c of the cloud clone to 0, and set the The synchronization semaphore m of the mobile terminal is initialized to 1;
操作日志locallog’存储用于从移动终端接收到的本地操作;操作日志remotelog’用于存储云端其它克隆发送来的远程操作;操作日志remotelog”用于存储云端克隆已经执行了的远程操作集合;操作日志log’用于存储云端克隆已经执行的本操作和远程操作集合;操作日志c2mremotelog用于存储云端生成的移动端可直接执行的远程操作;The operation log locallog' is used to store the local operations received from the mobile terminal; the operation log remotelog' is used to store the remote operations sent by other clones in the cloud; the operation log remotelog' is used to store the collection of remote operations performed by the cloud clone; operations The log log' is used to store the set of operations and remote operations that have been performed by the cloud clone; the operation log c2mremotelog is used to store the remote operations generated by the cloud that can be directly performed by the mobile terminal;
操作日志locallog用于存储移动终端产生的本地操作;操作日志remotelog用于存储来自云端克隆传递的可直接执行的远程操作;操作日志log用于存储移动终端所有已经执行的本地操作和远程操作;The operation log locallog is used to store the local operations generated by the mobile terminal; the operation log remotelog is used to store the directly executable remote operations from the cloud clone transfer; the operation log log is used to store all the local operations and remote operations performed by the mobile terminal;
步骤2:移动终端集成操作,首先,产生本地操作o,将本地操作o加入到操作日志locallog中,调用函数IntegrateLocal(o)集成本地操作,并将执行完的本地操作o加入到操作日志log中;然后,将同步信号量m置为0,即与云端克隆同步操作,将操作日志locallog发送给云端克隆,接收云端克隆发送来的可直接执行的远程操作,存储到操作日志remotelog中;最后执行操作日志remotelog中的可直接执行的远程操作;Step 2: Mobile terminal integration operation. First, generate a local operation o, add the local operation o to the operation log locallog, call the function IntegrateLocal(o) to integrate the local operation, and add the executed local operation o to the operation log log ; Then, set the synchronization semaphore m to 0, that is, synchronize the operation with the cloud clone, send the operation log locallog to the cloud clone, receive the directly executable remote operations sent by the cloud clone, and store them in the operation log remotelog; finally execute Directly executable remote operations in the operation log remotelog;
步骤3:云端克隆集成操作,首先,云端克隆接收来自移动终端发送的本地操作集合存储到操作日志locallog’中,接下来,调用函数LocalExecution(o)执行操作日志locallog’中的本地操作,并调用函数Update(o)更新云端克隆已经执行的远程操作,生成移动终端可以直接执行的远程操作,存储到远程操作集合c2mremotelog,然后将远程操作集合c2mremotelog发送给移动终端;最后,设置同步信号量c为1,接收并集成来自其它云端克隆发送来的远程操作集合,调用函数LocalExecution(o)执行操作日志remotelog’中的远程操作,并将执行完的远程操作加入到操作日志remotelog”。Step 3: Cloud clone integration operation. First, the cloud clone receives the local operation set sent from the mobile terminal and stores it in the operation log locallog'. Next, the function LocalExecution(o) is called to execute the local operation in the operation log locallog', and call The function Update(o) updates the remote operations performed by the cloud clone, generates remote operations that can be directly performed by the mobile terminal, stores it in the remote operation set c2mremotelog, and then sends the remote operation set c2mremotelog to the mobile terminal; finally, set the synchronization semaphore c as 1. Receive and integrate the remote operation set sent from other cloud clones, call the function LocalExecution(o) to execute the remote operation in the operation log remotelog', and add the executed remote operation to the operation log remotelog".
本发明充分利用了云端的计算和存储优势,有效地突破了移动终端的资源限制,让移动端执行轻量级的协同编辑操作,云端执行重量级的协同编辑操作,从而为移动用户提供更好的交互性和响应性,维护了移动协同编辑的共享文档副本一致性。The invention makes full use of the computing and storage advantages of the cloud, effectively breaks through the resource limitation of the mobile terminal, allows the mobile terminal to perform lightweight collaborative editing operations, and the cloud performs heavyweight collaborative editing operations, thereby providing mobile users with better The interactivity and responsiveness of mobile co-editing maintains the consistency of shared document copies for mobile collaborative editing.
附图说明Description of drawings
图1为本发明云端和移动终端的协同编辑架构示意图;1 is a schematic diagram of the collaborative editing architecture of the cloud and a mobile terminal according to the present invention;
图1中,所有云端克隆C1’,C2’,C3’......Cn’都维护相同的数据结构DS’,DS’为移动终端存储的共享文档的数据结构DS(data structure)的副本,DS包括一个哈希表和一个单链表;In Figure 1 , all cloud clones C1 ', C2 ', C3'... Cn ' maintain the same data structure DS', DS' is the data structure DS of the shared document stored by the mobile terminal ( data structure), DS includes a hash table and a singly linked list;
图2为每个移动终端维护的DS结构图;Fig. 2 is the DS structure diagram that each mobile terminal maintains;
图3为云端和移动终端协同编辑的任务分配模型;Figure 3 is a task assignment model for collaborative editing between the cloud and the mobile terminal;
图4为云端克隆本地操作的转换和集成函数以及生成可直接执行的远程操作函数的示意图。FIG. 4 is a schematic diagram of the transformation and integration functions of the cloud clone local operation and the generation of directly executable remote operation functions.
具体实施方式Detailed ways
以下结合附图和具体实施例对本发明作进一步的详细说明:The present invention will be described in further detail below in conjunction with the accompanying drawings and specific embodiments:
如图1所示的一种基于移动云计算的协同编辑中一致性维护方法,该方法中包括移动终端和云端的协同编辑架构、云端克隆和移动终端全复制式数据结构、云端克隆和移动终端的同步策略,其中,所述的移动终端和云端的协同编辑架构为云端克隆和移动终端建立集中式协同编辑架构,云端克隆和移动终端的全复制式数据结构用于存储每个云端克隆、移动终端的共享文档副本以及产生的操作日志集,云端克隆和移动终端的同步策略包括操作增量式同步方法以及云端克隆、移动终端的一致性维护方法,基于移动云计算的协同编辑中的一致性维护方法包括如下步骤:As shown in Figure 1, a method for maintaining consistency in collaborative editing based on mobile cloud computing, the method includes a collaborative editing architecture between mobile terminals and cloud, cloud clone and mobile terminal full replication data structure, cloud clone and mobile terminal synchronization strategy, wherein the collaborative editing architecture of the mobile terminal and the cloud establishes a centralized collaborative editing architecture for the cloud clone and the mobile terminal, and the fully replicated data structure of the cloud clone and the mobile terminal is used to store each cloud clone, mobile terminal The shared document copy of the terminal and the generated operation log set, the synchronization strategy of cloud clone and mobile terminal includes operation incremental synchronization method and cloud clone, the consistency maintenance method of mobile terminal, and the consistency in collaborative editing based on mobile cloud computing The maintenance method includes the following steps:
步骤1:云端克隆和移动终端全复制式数据结构的初始化,将云端克隆(云服务器存储多个移动终端副本,每个云端克隆都与移动终端存储相同的数据结构,相当于是移动终端数据结构的副本)的操作日志locallog’,remotelog’,remotelog”,log’,c2mremotelog清空,将移动终端的操作日志locallog,remotelog和log清空;将云端克隆的同步信号量c初始化为0,将移动终端的同步信号量m初始化为1;Step 1: Initialization of cloud clone and mobile terminal full replication data structure, the cloud clone (cloud server stores multiple mobile terminal copies, each cloud clone stores the same data structure as the mobile terminal, which is equivalent to the mobile terminal data structure) copy) operation log locallog', remotelog', remotelog", log', c2mremotelog, clear the operation log locallog, remotelog and log of the mobile terminal; initialize the synchronization semaphore c of the cloud clone to 0, and synchronize the mobile terminal The semaphore m is initialized to 1;
操作日志locallog’存储用于从移动终端(移动终端为手机或pad等,用户可以在手机上产生操作,例如在文档中插入字符串)接收到的本地操作(本地操作,即用户在手机上产生的操作,包括在文档中插入操作、删除操作);操作日志remotelog’用于存储云端其它克隆发送来的远程操作(运程操作指的是某一个移动终端接收到其它移动终端发送来的本地操作,即其它移动终端自己产生的操作);操作日志remotelog”用于存储云端克隆已经执行了的远程操作集合;操作日志log’用于存储云端克隆已经执行的本操作和远程操作集合(云端有个服务器,将操作传递给移动终端对应的云端克隆,让云端克隆执行);操作日志c2mremotelog用于存储云端生成的移动端可直接执行的远程操作;The operation log locallog' is used to store the local operations (local operations, that is, the user generates operations on the mobile phone) received from the mobile terminal (the mobile terminal is a mobile phone or a pad, etc., the user can generate operations on the mobile phone, such as inserting a string in a document). operation, including insert operation and delete operation in the document); the operation log remotelog' is used to store the remote operations sent by other clones in the cloud (the remote operation refers to the local operation sent by a certain mobile terminal from other mobile terminals, That is, the operations generated by other mobile terminals); the operation log "remotelog" is used to store the remote operation set that the cloud clone has performed; the operation log' is used to store the operation and the remote operation set that the cloud clone has performed (there is a server in the cloud). , pass the operation to the cloud clone corresponding to the mobile terminal, and let the cloud clone execute); the operation log c2mremotelog is used to store the remote operations generated by the cloud that can be directly executed by the mobile terminal;
操作日志locallog用于存储移动终端产生的本地操作;操作日志remotelog用于存储来自云端克隆传递的可直接执行的远程操作;操作日志log用于存储移动终端所有已经执行的本地操作和远程操作;The operation log locallog is used to store the local operations generated by the mobile terminal; the operation log remotelog is used to store the directly executable remote operations from the cloud clone transfer; the operation log log is used to store all the local operations and remote operations performed by the mobile terminal;
步骤2:移动终端集成操作,首先,产生本地操作o,将本地操作o加入到操作日志locallog中,调用函数IntegrateLocal(o)集成本地操作,并将执行完的本地操作o加入到操作日志log中;然后,将同步信号量m置为0,即与云端克隆同步操作,将操作日志locallog发送给云端克隆,接收云端克隆发送来的可直接执行的远程操作,存储到操作日志remotelog中;最后执行操作日志remotelog中的可直接执行的远程操作;Step 2: Mobile terminal integration operation. First, generate a local operation o, add the local operation o to the operation log locallog, call the function IntegrateLocal(o) to integrate the local operation, and add the executed local operation o to the operation log log ; Then, set the synchronization semaphore m to 0, that is, synchronize the operation with the cloud clone, send the operation log locallog to the cloud clone, receive the directly executable remote operations sent by the cloud clone, and store them in the operation log remotelog; finally execute Directly executable remote operations in the operation log remotelog;
步骤3:云端克隆集成操作,首先,云端克隆接收来自移动终端发送的本地操作集合存储到操作日志locallog’中,接下来,调用函数LocalExecution(o)(本地执行函数,该函数用于云端克隆执行本地操作和远程操作调用)执行操作日志locallog’中的本地操作,并调用函数Update(o)更新云端克隆已经执行的远程操作,生成移动终端可以直接执行的远程操作,存储到远程操作集合c2mremotelog,然后将远程操作集合c2mremotelog发送给移动终端;最后,设置同步信号量c为1,接收并集成来自其它云端克隆发送来的远程操作集合,调用函数LocalExecution(o)执行操作日志remotelog’中的远程操作,并将执行完的远程操作加入到操作日志remotelog”。Step 3: Cloud clone integration operation. First, the cloud clone receives the local operation set sent from the mobile terminal and stores it in the operation log locallog'. Next, calls the function LocalExecution(o) (local execution function, which is used for cloud clone execution. Local operation and remote operation call) execute the local operation in the operation log locallog', and call the function Update(o) to update the remote operation performed by the cloud clone, generate the remote operation that the mobile terminal can directly perform, and store it in the remote operation collection c2mremotelog, Then send the remote operation set c2mremotelog to the mobile terminal; finally, set the synchronization semaphore c to 1, receive and integrate the remote operation set sent from other cloud clones, and call the function LocalExecution(o) to execute the remote operation in the operation log remotelog' , and add the executed remote operation to the operation log remotelog".
上述技术方案中,所述每个云端克隆都维护(包括对数据结构中哈希表和单链表内部的结点的插入和删除,遍历等操作)相同的数据结构DS’,数据结构DS’包括一个哈希表和一个单链表,数据结构DS’的哈希表用于存储已经执行了本地操作和远程操作的操作对象(操作对象可以理解为node,插入操作的操作对象就是链表中一个结点,里面存储插入的字符串等信息),数据结构DS’的单链表用于全序链接所有已经执行的操作对象。In the above technical solution, each cloud clone maintains the same data structure DS' (including operations such as insertion and deletion, traversal, etc. of the nodes in the hash table and the singly linked list in the data structure), and the data structure DS' includes: A hash table and a singly linked list, the hash table of the data structure DS' is used to store the operation object that has performed local operations and remote operations (the operation object can be understood as node, and the operation object of the insertion operation is a node in the linked list. , which stores information such as inserted strings), the singly linked list of the data structure DS' is used to link all the executed operation objects in total order.
每个云端克隆都维护一个同步信号量c,当同步信号量c的值为1时,云端克隆与其它克隆进行远程操作的同步;当同步信号量c的值为0时,云端克隆与移动终端进行本地操作和可直接执行的远程操作的同步。Each cloud clone maintains a synchronization semaphore c. When the value of the synchronization semaphore c is 1, the cloud clone and other clones perform remote operation synchronization; when the value of the synchronization semaphore c is 0, the cloud clone and the mobile terminal Synchronization of local operations and directly executable remote operations.
每个移动终端都维护相同的数据结构DS,数据结构DS包括一个哈希表和一个单链表,数据结构DS的哈希表用于存储已经执行了本地操作和远程操作的操作对象,数据结构DS的单链表用于全序链接所有已经执行的操作对象。Each mobile terminal maintains the same data structure DS. The data structure DS includes a hash table and a singly linked list. The hash table of the data structure DS is used to store operation objects that have performed local operations and remote operations. The data structure DS The singly linked list is used to link all executed operation objects in total order.
每个移动终端维护一个同步信号量m,当同步信号量m的值为1时,移动终端产生并集成本地操作;当同步信号量m的值为0时,移动终端与云端克隆同步,将本地操作传递给云端克隆,并接收云端克隆传递的可以直接执行的远程操作。Each mobile terminal maintains a synchronization semaphore m. When the value of the synchronization semaphore m is 1, the mobile terminal generates and integrates local operations; when the value of the synchronization semaphore m is 0, the mobile terminal is cloned with the cloud, and the local Actions are passed to the cloud clone and receive remote actions passed by the cloud clone that can be executed directly.
上述技术方案中,调用函数LocalExecution(o)执行操作日志locallog’中的本地操作的具体方法为:当本地操作o为插入操作时,通过哈希函数在单链表中找到本地操作o的目标操作对象Tar_node,由于并发的插入操作可能在目标操作对象Tar_node目标位置后插入了多个新对象(移动终端1和移动终端2同时产生插入操作,有可能它们在文档的同一位置插入字符,这时就是冲突操作。需要比较彼此的标识符ID来确定最终位置),因此本地操作o需要与多个并发插入对象的标识符ID进行大小比较,当找到第一个小于本地操作o的标识符ID的操作对象next_node时,将本地操作o的目标对象更新为next_node的前一个对象pre_node,并将本地操作o的操作对象插入到pre_node和next_node之间;当本地操作o为删除操作时,将其目标操作对象Tar_node的visible值减1,即将本地操作o的操作对象置为墓碑,visible值为结点的可见性,如果visible值<=0,结点不可见,如果visible值>0,结点可见。In the above technical solution, the specific method of calling the function LocalExecution(o) to perform the local operation in the operation log locallog' is: when the local operation o is an insertion operation, the target operation object of the local operation o is found in the singly linked list through a hash function Tar_node, due to the concurrent insertion operation, multiple new objects may be inserted after the target position of the target operation object Tar_node (
上述技术方案中,调用函数LocalExecution(o)执行操作日志remotelog’中的远程操作的具体方法为:当远程操作o为插入操作时,通过哈希函数在单链表中找到远程操作o的目标操作对象Tar_node,由于并发的插入操作可能在目标操作对象Tar_node目标位置后插入了多个新对象,远程操作o需要与多个并发插入对象的标识符ID进行大小比较,当找到第一个小于远程操作o的标识符ID的操作对象next_node时,将远程操作o的目标对象更新为next_node的前一个对象pre_node,并将远程操作o的操作对象插入到pre_node和next_node之间;当远程操作o为删除操作时,将远程操作o的目标操作对象Tar_node的visible值减1,即将远程操作o的操作对象置为墓碑。In the above technical solution, the specific method of calling the function LocalExecution(o) to execute the remote operation in the operation log remotelog' is: when the remote operation o is an insertion operation, the target operation object of the remote operation o is found in the singly linked list through a hash function Tar_node, since the concurrent insertion operation may insert multiple new objects after the target position of the target operation object Tar_node, the remote operation o needs to compare the size with the identifier IDs of multiple concurrently inserted objects, and when the first one is found that is smaller than the remote operation o When the operation object of the identifier ID is next_node, the target object of the remote operation o is updated to the previous object pre_node of the next_node, and the operation object of the remote operation o is inserted between pre_node and next_node; when the remote operation o is a delete operation , decrement the visible value of the target operation object Tar_node of the remote operation o by 1, that is, set the operation object of the remote operation o to the tombstone.
上述技术方案中,调用函数Update(o)更新云端克隆已经执行的远程操作的具体方法为:当一个远程操作o被集成时,需要在单链表中找到远程操作o的操作对象cur_node,当远程操作o的操作对象后面链接的对象是远程插入操作的对象remote_node时,需要将远程插入操作的对象remote_node的目标对象设置为操作对象cur_node,即更新remote_node的目标标识符ID为远程操作o的标识符ID。In the above technical solution, the specific method of calling the function Update(o) to update the remote operation performed by the cloud clone is: when a remote operation o is integrated, the operation object cur_node of the remote operation o needs to be found in the singly linked list. When the object linked behind the operation object of o is the remote_node object of the remote insertion operation, the target object of the remote_node object of the remote insertion operation needs to be set to the operation object cur_node, that is, the target identifier ID of the remote_node is updated to the identifier ID of the remote operation o .
上述技术方案中,调用函数IntegrateLocal(o)集成本地操作的具体执行过程为:首先通过哈希表,找到本地操作o的目标操作对象Tar_node;如果本地操作o的操作类型为插入操作,直接在目标操作对象Tar_node的后面插入本地操作o的对象New_node;如果本地操作o的操作类型为删除操作,直接将目标操作对象Tar_node的visibile的值减1,即将Tar_node置为墓碑。In the above technical solution, the specific execution process of calling the function IntegrateLocal(o) to integrate the local operation is: first, through the hash table, find the target operation object Tar_node of the local operation o; if the operation type of the local operation o is an insert operation, directly in the target operation After the operation object Tar_node, insert the object New_node of the local operation o; if the operation type of the local operation o is a delete operation, directly reduce the value of the visibile of the target operation object Tar_node by 1, that is, set the Tar_node as a tombstone.
上述方案中涉及到的操作o(包括本地操作和远程操作)以及结点node相关定义如下:The operations o (including local operations and remote operations) involved in the above scheme and the related definitions of the node node are as follows:
定义1:一个操作o是一个六元组<type,l,tar_key,cur_key,con,tar_o>,(1)type是o的操作类型;(2)l是一个布尔型变量,值为true或者false;(3)tar_key是o的目标操作的标识符;(4)cur_key是o的标识符;(5)con是插入或者删除的字符;(6)tar_o是待撤销的目标操作。Definition 1: An operation o is a six-tuple <type, l, tar_key, cur_key, con, tar_o>, (1) type is the operation type of o; (2) l is a boolean variable with a value of true or false ; (3) tar_key is the identifier of the target operation of o; (4) cur_key is the identifier of o; (5) con is the character inserted or deleted; (6) tar_o is the target operation to be undone.
定义2:一个node是一个五元组<cur_key,visible,con,next,link>,(1)cur_key是node的标识符;(2)visible是一个整型变量,用来表示node的可见性;(3)con是node存储的内容;(4)next是一个指针,指向List中的下一个node;(5)link是一个指针,用来链接Hash Table(哈希表)和List(单链表)中对应的node。Definition 2: A node is a five-tuple <cur_key, visible, con, next, link>, (1) cur_key is the identifier of the node; (2) visible is an integer variable used to represent the visibility of the node; (3) con is the content stored by node; (4) next is a pointer to the next node in the List; (5) link is a pointer to link Hash Table (Hash Table) and List (Single Linked List) The corresponding node in .
定义3:标识符(ID,identifier)Definition 3: Identifier (ID, identifier)
操作o的标识符由三个元素组成,即<s,site,ssv>,(1)s为唯一的协同会话号;(2)site为唯一的移动站点号;(3)ssv为操作的状态向量和。The identifier of operation o consists of three elements, namely <s, site, ssv>, (1) s is the unique collaborative session number; (2) site is the unique mobile site number; (3) ssv is the state of the operation vector sum.
定义4:给定任意两个操作oi和oj,它们的ID记作ID(oi)和ID(oj),如果有ID(oi)<ID(oj),当且仅当(1)ID(oi)[s]<ID(oj)[s](比较两个操作oi和oj的ID中协同会话号s的大小),或者(2)ID(oi)[s]=ID(oj)[s],ID(oi)[ssv]<ID(oj)[ssv](比较两个操作oi和oj的ID中状态向量和ssv的大小);或者(3)ID(oi)[s]=ID(oj)[s],ID(oi)[ssv]=ID(oj)[ssv],ID(oi)[site]<ID(oj)[site](比较两个操作oi和oj的ID中站点号site大小)。Definition 4: Given any two operations o i and o j , their IDs are denoted as ID(o i ) and ID(o j ), if ID(o i )<ID(o j ), if and only if (1) ID(o i )[s]<ID(o j )[s] (compare the size of the collaborative session number s in the IDs of two operations o i and o j ), or (2) ID(o i ) [s]=ID(o j )[s], ID(o i )[ssv]<ID(o j )[ssv] (compare the size of state vector and ssv in ID of two operations o i and o j ) ; or (3) ID(o i )[s]=ID(o j )[s],ID(o i )[ssv]=ID(o j )[ssv],ID(o i )[site]< ID(o j )[site] (compare the size of the site number site in the IDs of the two operations o i and o j ).
云端和移动终端的协同编辑的框架如图1所示。云端存储了每个移动终端副本,例如云端副本C1’是移动终端C1的克隆,云端副本C2’是移动终端C2的克隆,云端副本Cn’是移动终端Cn的克隆。地理位置分散的多个移动终端通过移动互联网参与到同一个协同会话中。移动终端的同步信号量m为1时,移动终端产生和集成本地操作,移动终端的同步信号量m为0时,将本地操作发送到云端克隆,并接收云端克隆传递的可直接执行的远程操作。云端克隆的同步信号量c为1时,接收并集成来自其它克隆的远程操作;云端克隆的同步信号量为0时,接收并集成移动终端传递的本地操作,并生成可直接执行的远程操作发送给移动终端。移动终端接收到可直接执行的远程操作后直接执行。The framework of collaborative editing between cloud and mobile terminals is shown in Figure 1. The cloud stores copies of each mobile terminal. For example, cloud copy C1 ' is a clone of mobile terminal C1 , cloud copy C2 ' is a clone of mobile terminal C2 , and cloud copy Cn ' is a clone of mobile terminal Cn . A plurality of geographically dispersed mobile terminals participate in the same collaborative session through the mobile Internet. When the synchronization semaphore m of the mobile terminal is 1, the mobile terminal generates and integrates local operations; when the synchronization semaphore m of the mobile terminal is 0, the local operation is sent to the cloud clone, and the directly executable remote operation transmitted by the cloud clone is received . When the synchronous semaphore c of the cloud clone is 1, it receives and integrates remote operations from other clones; when the synchronous semaphore of the cloud clone is 0, it receives and integrates the local operation transmitted by the mobile terminal, and generates a remote operation that can be directly executed. to the mobile terminal. The mobile terminal directly executes the directly executable remote operation after receiving it.
结合附图2,对DS数据结构进行详细阐述。当多个移动用户开始协同编辑时,所有移动终端的DS进行初始化,HT(哈希表)和List(单链表)初始化为空,视图层的单链表Lview也为空。当移动用户产生本地插入操作时,将新插入的node插入到HT和List中。例如,移动用户可以连续插入四个结点node1,node2,node3,node4。当移动用户产生删除操作时,将对应的node置为墓碑。例如,删除已经插入的结点node4。Lview全序链接List中所有可见的node。例如,全序链接List中所有可见结点node1,node2,node3,node5,node6。The DS data structure is described in detail with reference to FIG. 2 . When multiple mobile users start collaborative editing, DSs of all mobile terminals are initialized, HT (hash table) and List (single linked list) are initialized to be empty, and the single linked list Lview of the view layer is also empty. When a mobile user generates a local insert operation, insert the newly inserted node into HT and List. For example, a mobile user can insert four nodes node1, node2, node3, node4 in a row. When a mobile user deletes, the corresponding node is set as a tombstone. For example, delete the already inserted node node4. Lview links all visible nodes in the List in total order. For example, all visible nodes node1, node2, node3, node5, node6 in the total order link List.
结合附图3,对云端和移动终端的协同编辑的任务分配模型进一步详细说明:移动终端执行轻量级的协同编辑任务。首先,初始化同步信号量m=1,产生和执行本地操作;然后更新同步信号量m=0,将待同步的本地操作传递给云端克隆;然后,接收并执行云端克隆发送来的可直接执行的远程操作,并将同步信号m的值更新为1,即移动终端可以继续产生并执行远程操作。云端克隆执行重量级的编辑任务,首先,初始化云端克隆的同步信号量c=0,接收和集成移动终端传递的本地操作;然后,更新同步信号量c=1,传播接收到的本地操作到云端克隆;接下来,转换并集成来自云端克隆的远程操作;最后,更新同步信号c=0,生成移动终端可直接执行的远程操作发送给移动终端。With reference to FIG. 3 , the task allocation model for collaborative editing between the cloud and the mobile terminal is further described in detail: the mobile terminal performs a lightweight collaborative editing task. First, initialize the synchronization semaphore m=1, generate and execute local operations; then update the synchronization semaphore m=0, pass the local operation to be synchronized to the cloud clone; then, receive and execute the directly executable sent by the cloud clone The remote operation is performed, and the value of the synchronization signal m is updated to 1, that is, the mobile terminal can continue to generate and perform the remote operation. Cloud clone performs heavyweight editing tasks. First, initialize the synchronization semaphore c=0 of the cloud clone, receive and integrate the local operations transmitted by the mobile terminal; then, update the synchronization semaphore c=1, and propagate the received local operations to the cloud clone; next, convert and integrate the remote operation from the cloud clone; finally, update the synchronization signal c=0, generate a remote operation that can be directly executed by the mobile terminal and send it to the mobile terminal.
图4给出了云端克隆本地操作的转换和集成函数(LocalExecution(ofl))以及生成可直接执行的远程操作函数(Update(ofrj))的基本思想。假设DS初始状态为”aa-bb-cc-dd-ee”,“aa-bb-cc-dd-ee”为文档DS的已经有字符串。远程操作ofri已经将”dd”插入到”cc”后,远程操作ofrj已经将”ee”插入到”dd”后。假设待执行的本地操作ofli将”ff”插入到”cc”后。由于”cc”后可能存在并发操作插入的文本”dd”和”ee”,调用LocalExecution(ofli)生成可直接执行的本地操作ofli'。经过ID的比较,ofli'将”ff”插入到”dd”和”ee”之间。因此,ofli'的目标ID由IDcc更新为IDdd。由于ofli'的执行影响了ofrj的执行效果,调用Update(ofrj)生成可直接执行的远程操作ofrj'。ofrj'的目标ID由IDdd被更新为IDff,最后更新remotelog”中的ofrj为ofrj'。Figure 4 shows the basic idea of the transformation and integration function (LocalExecution(o fl )) of cloud clone local operation and the generation of directly executable remote operation function (Update(o frj )). Suppose the initial state of the DS is "aa-bb-cc-dd-ee", and "aa-bb-cc-dd-ee" is the existing string of the document DS. The remote operation o fri has inserted "dd" after "cc", and the remote operation o frj has inserted "ee" after "dd". Suppose the local operation to be performed o fli inserts "ff" after "cc". Since there may be texts "dd" and "ee" inserted by concurrent operations after "cc", call LocalExecution(o fli ) to generate directly executable local operations of o fli '. After ID comparison, o fli 'inserts "ff" between "dd" and "ee". Therefore, the target ID of o fli ' is updated from ID cc to ID dd . Since the execution of o fli ' affects the execution effect of o frj , call Update(o frj ) to generate a directly executable remote operation o frj '. The target ID of o frj ' is updated from ID dd to ID ff , and finally o frj in remotelog" is updated to o frj '.
本发明突破移动终端的资源限制,让云端进行重量级协同编辑操作,移动终端进行轻量级的协同编辑操作,提升移动端协同编辑的响应性,进一步维护云端克隆、所有移动终端共享文档副本一致性。The invention breaks through the resource limitation of the mobile terminal, allows the cloud to perform heavyweight collaborative editing operations, and the mobile terminal performs lightweight collaborative editing operations, improves the responsiveness of collaborative editing on the mobile terminal, and further maintains cloud clones and all mobile terminals share the same copy of documents sex.
本说明书未作详细描述的内容属于本领域专业技术人员公知的现有技术。The content not described in detail in this specification belongs to the prior art known to those skilled in the art.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110389602.0A CN113190518B (en) | 2021-04-12 | 2021-04-12 | Consistency maintenance method in collaborative editing based on mobile cloud computing |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110389602.0A CN113190518B (en) | 2021-04-12 | 2021-04-12 | Consistency maintenance method in collaborative editing based on mobile cloud computing |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113190518A CN113190518A (en) | 2021-07-30 |
CN113190518B true CN113190518B (en) | 2022-04-15 |
Family
ID=76975532
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110389602.0A Active CN113190518B (en) | 2021-04-12 | 2021-04-12 | Consistency maintenance method in collaborative editing based on mobile cloud computing |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113190518B (en) |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104077425A (en) * | 2014-07-28 | 2014-10-01 | 武汉大学 | OP (operational transformation)-based real-time collaborative method for text editing |
CN106133766A (en) * | 2014-03-18 | 2016-11-16 | 谷歌公司 | For calculating, apply and show the system and method for document increment |
CN107003879A (en) * | 2014-12-11 | 2017-08-01 | 利夫卢珀股份有限公司 | The method and system of destruction operation is cooperateed with while in computer application software |
CN107451108A (en) * | 2017-06-13 | 2017-12-08 | 广州视源电子科技股份有限公司 | Method and system for collaboratively editing document |
CN107943777A (en) * | 2017-12-14 | 2018-04-20 | 北京久蓉科技有限公司 | A kind of collaborative editing, cooperative processing method, device, equipment and storage medium |
CN108292300A (en) * | 2016-01-13 | 2018-07-17 | 微软技术许可有限责任公司 | Autosave operation for the collaborative editing to electronic document |
US10063660B1 (en) * | 2018-02-09 | 2018-08-28 | Picmonkey, Llc | Collaborative editing of media in a mixed computing environment |
US10430388B1 (en) * | 2011-10-17 | 2019-10-01 | Google Llc | Systems and methods for incremental loading of collaboratively generated presentations |
CN110888845A (en) * | 2019-11-22 | 2020-03-17 | 上海亦存网络科技有限公司 | Method and system for collaboratively editing file and monitoring file operation |
CN112395836A (en) * | 2019-08-01 | 2021-02-23 | 珠海金山办公软件有限公司 | Method and device for editing document, computer storage medium and terminal |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9747582B2 (en) * | 2013-03-12 | 2017-08-29 | Dropbox, Inc. | Implementing a consistent ordering of operations in collaborative editing of shared content items |
US9832237B2 (en) * | 2013-11-27 | 2017-11-28 | Getgo, Inc. | Collaborative online document editing |
US10909080B2 (en) * | 2015-05-04 | 2021-02-02 | Microsoft Technology Licensing, Llc | System and method for implementing shared document edits in real-time |
-
2021
- 2021-04-12 CN CN202110389602.0A patent/CN113190518B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10430388B1 (en) * | 2011-10-17 | 2019-10-01 | Google Llc | Systems and methods for incremental loading of collaboratively generated presentations |
CN106133766A (en) * | 2014-03-18 | 2016-11-16 | 谷歌公司 | For calculating, apply and show the system and method for document increment |
CN104077425A (en) * | 2014-07-28 | 2014-10-01 | 武汉大学 | OP (operational transformation)-based real-time collaborative method for text editing |
CN107003879A (en) * | 2014-12-11 | 2017-08-01 | 利夫卢珀股份有限公司 | The method and system of destruction operation is cooperateed with while in computer application software |
CN108292300A (en) * | 2016-01-13 | 2018-07-17 | 微软技术许可有限责任公司 | Autosave operation for the collaborative editing to electronic document |
CN107451108A (en) * | 2017-06-13 | 2017-12-08 | 广州视源电子科技股份有限公司 | Method and system for collaboratively editing document |
CN107943777A (en) * | 2017-12-14 | 2018-04-20 | 北京久蓉科技有限公司 | A kind of collaborative editing, cooperative processing method, device, equipment and storage medium |
US10063660B1 (en) * | 2018-02-09 | 2018-08-28 | Picmonkey, Llc | Collaborative editing of media in a mixed computing environment |
CN112395836A (en) * | 2019-08-01 | 2021-02-23 | 珠海金山办公软件有限公司 | Method and device for editing document, computer storage medium and terminal |
CN110888845A (en) * | 2019-11-22 | 2020-03-17 | 上海亦存网络科技有限公司 | Method and system for collaboratively editing file and monitoring file operation |
Non-Patent Citations (1)
Title |
---|
"支持操作意图一致性的实时协同编辑算法综述";何发智 等;《计算机学报》;20170120;第41卷(第04期);第840-867页 * |
Also Published As
Publication number | Publication date |
---|---|
CN113190518A (en) | 2021-07-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104023050B (en) | Device collaborative multi-screen interaction system and method thereof in device cloud environment | |
CN103324605B (en) | Method, equipment and the system of a kind of multi-user collaborative editor | |
CN106657169B (en) | Master-slave node data synchronization method in Redis | |
CN113785281B (en) | Message transfer implementing operation serialization to achieve consistency of distributed data structures | |
CN103902410A (en) | Data backup acceleration method for cloud storage system | |
CN105991720A (en) | Configuration change method and device | |
CN103716397B (en) | A kind of service-oriented simulation clock propulsion method | |
CN103428288B (en) | Based on the copies synchronized method of subregion state table and coordinator node | |
CN107277112B (en) | Scalable and efficient address space conversion algorithm | |
Jannes et al. | OWebSync: Seamless synchronization of distributed web clients | |
CN113190518B (en) | Consistency maintenance method in collaborative editing based on mobile cloud computing | |
CN103491161B (en) | In interactive cloud application, AST part replicates and synchronous method | |
CN108063812B (en) | Consistency maintenance method for file management under real-time cloud office system | |
CN105955828A (en) | Real-time cooperative editing consistency maintenance method supporting string operation | |
CN103401951A (en) | Peer-to-peer architecture based elastic cloud distribution method | |
CN114374701A (en) | A multi-level linkage artificial intelligence platform sample model transparent sharing device | |
CN110166448A (en) | Heterogeneous protocol for isomery controller cluster converts middleware and method | |
CN112738234B (en) | Lightweight asynchronous mobile collaborative editing method based on CRDT | |
Chung et al. | Flexible support for application-sharing architecture | |
San Ting et al. | A generic peer-to-peer network simulator | |
CN103036964B (en) | Internet bar server data updating method based on peer-to-peer (P2P) | |
CN113268315A (en) | Online migration method for virtual host | |
CN112686004A (en) | Block chain-based single-document multi-interface editing method | |
CN115883653B (en) | Request processing method, request processing device, electronic equipment and storage medium | |
Tarun | A Reputation Replica Propagation Strategy for Mobile Users in Mobile Distributed Database System |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |