People want to achieve collaborative "online Excel"? It did not so simple

This article from the original technical team and starting Grape City

Please indicate the source: Grape City's official website , Grape City to provide professional development tools for developers, solutions and services, enabling developers.

 

Excel is a tool commonly used in our office, it almost can handle most of the data for us, friendly interface, rich formula functions and easy to use chart provides no small help in the statistical data for us, but after a period of time run, there will be the following situation:

 

 

 

So many branches of confusion will be difficult to guarantee the safety and authoritative document.

So clever little thought of a solution partners, sharing a copy of an Excel document, according to different ranks of officers, set and can only be read-only permission to edit, as well as to develop according to different rules for different people, such as: Zhang ten o'clock every day editor, Wang day eleven o'clock edit way to solve the problem of conflict. This very clever way to solve the problem of multiple copies of the process, but you can not edit the issue has not been resolved, a department if enough people, so time-sharing strategy may take a day to complete an Excel editing.

So many people work together online documentation requirements have become more and more become strong, because in their daily work, document collaboration with the rest of the team is a common thing to work again. Due to the different division of labor, work in progress, the information within the team often need to synchronize in time, however, along with the expanding team of business scale, collaborative online, multiplayer collaboration, and project management software and other issues will be followed, as a constraint to business bottlenecks and efficient development.

These problems usually presents:

  1. Inter-departmental, regional communication and collaboration inconvenience
  2. Over-reliance on files, folders shared form, can not ensure the security of documents
  3. Record and can not reflect the views of staff and evaluate text documents
  4. Documentation when changes occur, not to inform the relevant departments and employees
  5. Document can not be online collaborative editing, lack the necessary management and control processes
  6. Multiplayer co-editing a document, you can not modify the record retention and version history

 

In response to these problems, and now in the market, we have a lot more than this kind of collaboration tools, such as: foreign Google Docs, Office365, and domestic Tencent documents, graphite documents, the proper way cloud collaboration.

Because the purpose of this article we would like to start realization of the principle forms the basis of in-depth study and difficult coordination office systems, etc. From the perspective of corporate IT managers, so the finished software we do not do too much in this repeat. Then we started it.

Multiplayer cooperative forms: History and Development

Multiplayer cooperative long history, originated in the static multiplayer cooperation mode, namely everyone to complete their work, and then aggregated.

More than the initial collaboration: Collaboration static

  • Incremental Collaboration
    • E-mail: you come to me
    • Forum: thread back
  • Exclusive Collaboration
    • Document delivery
    • Microsoft VSS
  • Merge Collaboration
    • SVN
    • Git
    • diff, patch, merge instruction

 

Common static multiplayer collaboration

Development of multiplayer collaboration: from static to dynamic

  • Static collaboration metaphor
    • Mosaic painting
    • blocks
  • Static collaboration features
    • Multiple versions
    • Block operation
    • There are collaborative action
  • Static collaboration disadvantage
    • Version fragmentation
    • Lack of timeliness
    • Collaboration high cost of action

Static cost more than collaboration, will join as the number and complexity of the project showed a rising exponentially. So, for businesses, no need for a coordination action only version, version controlled without coordination cost model, namely dynamic multiplayer cooperative mode.

Multiplayer cooperative boom period: Dynamic

  • Dynamic collaboration metaphor
    • Drawn Together blackboard
  • Dynamic collaboration features
    • The only version
    • Atomic operation
    • No collaborative action
  • The advantages of dynamic collaboration
    • Versionable
    • real time
    • No collaboration costs
  • Typical products
    • Office Online
    • graphite
    • OnlyOffice

Multiplayer cooperative basis: Principles and architecture

Any information, no matter what its form to show, if you want people to do real-time editing and presentation, it only needs to implement the following three steps:

  1. Operationalize
  2. Can be transferred
  3. Reducible

Illustrates the way many people work together to achieve the

Operationalize

Operation of, any information that can be converted to a set of set of operations. It is easy to understand, but it's still worth a lot of points to think about:

  • Segmentation and Combination
    • How to ensure that: all change information can be broken down into a set of operations? Conversely, how to cover all information changes?
    • How granularity split decision?
      • Crude one point?
      • A little thin?
      • How to balance the explanatory and scalability?
  • Absolute and relative operating operation
    • Absolute operation
      • Pinhole printer perfect world
      • Edit nightmare era of printer
    • Relative operation
      • 4K TV is not a dream
      • Why digital TV is less stable than analog TV
    • Absolute and relative operating metaphor operations: time and space swap

Can be transferred

Can be transmitted, is there a way to refer to the operation transmitted over the network to the other terminals. Dynamic multiplayer collaboration, consider the following points:

  • Transmission Content
    • 原始文本
      • 清晰
      • 冗余
    • 压缩技术
      • 逻辑压缩
      • 协议压缩
      • 手动压缩
  • 网络协议
    • Socket
      • TCP
      • UDP
    • HTTP
    • WebSocket
  • QoS(Quality of Service,服务质量)
    • 快速失败

    • 自动回滚

    • 自动重连

    • 自动恢复

可还原

可还原,就是指接收到来自网络的操作消息后,可以在本地完全一致地再次执行该操作。可还原包括了:

  1. 绝对操作的还原
    • 控制体积
    • 合理的提示
  2. 相对操作的还原
    • 严格的顺序性
    • 从源头保障顺序性
    • 顺序性的补救
  3. 本地操作的还原
    • 过滤收到的操作集合
    • 从源头细化操作颗粒
    • 本地保存本地执行
  4. 无入侵的还原
    • 定义入侵
    • 排除入侵
    • 千人千面

多人协作的难点:乱序与冲突

乱序

乱序的表现形式如下图,小明在客户端执行了一系列操作,传递到服务器时发生乱序,导致小花看到了截然不同的信息:

 

 

 

为了解决乱序问题,可以尝试以下方法:

1. 用性能换取顺序正确——基于协议

 

 

 

2. 用性能换取顺序正确——基于回执

 

 

 

两种方法的优缺点
  1. 基于协议
  • 优点
    • 可靠,历经考验
    • 简单,无需开发
  • 缺点
    • 资源开销高
    • 必须整套使用
  • 优点
    • 自主可控,按需开发
    • 资源开销可控
  • 缺点
    • 需要自己投入开发
    • 应用层逻辑控制使得网络复杂度向外蔓延
    • 复杂度带来维护成本
  1. 基于回执

 

基于乱序处理方法的总结

网络不是绝对可靠的,为了实现相对可靠,需要付出一定的代价,企业需要考虑的是:如何衡量所付出的代价与产出成正比。

冲突

比乱序更高级的一种表现形式,存在多向、多维度等问题。

 

 

 

如何避免错误的蔓延?

原则:任何一次不一致,都会导致后续的操作基于错误的信息进行,从而不断扩大错误,造成无法收拾的结果。因此,不一致是不能被容忍的。

解决办法:

  1. 严格一致性:独占
  2. 最终一致性:检查与修复
  3. 非技术手段:设计与提示
严格的一致性

独占就是同一时间同一范围只能由一人操作。

  1. 范围
    1. 整个表格,类似VSS
    2. 工作表
    3. 单元格范围
  2. 排他性
    1. 独占冲突时,必有一方被弹开
    2. 直到占有者解开,不然无法占用
    3. 占用前无法操作
    4. 原理和锁基本一致
  3. 优点
    1. 可以确保严格一致性,不会产生多版本的错误累积
    2. 比起修复恢复这类弥补手段,一开始就不出错的成本最低
    3. 逻辑清楚简单,开发维护成本低
  4. 缺点
    1. 静态协作的味道
    2. 独占动作严重影响体验
    3. 大幅降低协作效率
  5. 需对表格实现的 功能
    1. 锁定工作表
    2. 锁定单元格
最终一致性

基于唯一正确顺序,察觉客户端的错误,撤销错误操作后重新执行正确的操作。

  1. 唯一正确
    1. 服务器到达顺序
    2. 协作边界分流
    3. P2P+选举算法
  2. 察觉错误
    1. 服务器回执id
    2. 服务器回执操作,MS
  3. 撤销错误
    1. 撤销到错误发生前的一步操作的结果
    2. 保存副本实现撤销功能
    3. 利用操作版本快照
  4. 重新执行
    1. 操作队列需保存
    2. 区分好无感知执行与显式执行

 

针对多人协作难点的总结

如何实现Excel相关功能是需要开发人员需要花时间去研究的,另外为了满足需求,适配多设备和平台的兼容性也非常重要。

另外,多人协作表格的本质还具有如下本质和特点:

  •  Server – Clients 中心系统,类似数值敏感的小型网游
  • 任何这类系统都是在体验和正确性中寻求平衡
  • 表格的数值敏感性高于网游,数据操作和存储的挑战更大
  • 表格的计算复杂度更高,尤其涉及复杂公式嵌套与全量统计筛选
  • Web存在天花板,所以复杂的页游并不多见,端游较多

 

最后,假如您想了解更多如何实现多人协作平台相关的内容,欢迎参加2019年12月18日(周三) 14点由上海佳软CTO带来的一场线上直播:https://live.vhall.com/483759540,相信届时我们都会受益良多的。

 

Guess you like

Origin www.cnblogs.com/powertoolsteam/p/onlineexcel.html