CN112686004B - Block chain-based single-document multi-interface editing method - Google Patents
Block chain-based single-document multi-interface editing method Download PDFInfo
- Publication number
- CN112686004B CN112686004B CN202011624754.6A CN202011624754A CN112686004B CN 112686004 B CN112686004 B CN 112686004B CN 202011624754 A CN202011624754 A CN 202011624754A CN 112686004 B CN112686004 B CN 112686004B
- Authority
- CN
- China
- Prior art keywords
- editing
- document
- block chain
- edge server
- serialized
- 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
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Document Processing Apparatus (AREA)
Abstract
The invention provides a single-copy document multi-interface editing method based on a block chain, which is characterized in that a terminal node participating in document editing is in communication connection with an edge server to obtain a serialized editing instruction stored in the block chain of the edge server and complete the synchronization of the current document version; in the editing process, the edge server collects editing instructions of corresponding terminal nodes, integrates the editing instructions to form a serialized editing instruction, and all the terminal nodes participating in editing and the corresponding edge server complete the synchronization of the current document version according to the serialized editing instruction; when the preset synchronization condition is met, the edge server participating in document editing broadcasts the current document version information and a new serialized editing instruction to the edge server block chain for storage, and after document consensus is achieved through a consensus mechanism, the document is synchronized to terminal nodes participating in document editing in all terminal block chains. The invention can effectively solve the problems of poor usability, low safety and high storage cost of the traditional single-document multi-interface editing method.
Description
Technical Field
The invention relates to the technical field of block chains, in particular to a single-document multi-interface editing method based on a block chain.
Background
In the document processing process, when the document processing workload is large or multi-user cooperative work is required, the connection of a plurality of terminal nodes through a plurality of interfaces can be considered, so that a plurality of users can edit the document such as content modification, addition, deletion and the like, and the document processing efficiency is improved conveniently. When a user edits a document by using a terminal node, the local document version needs to be synchronized according to the editing information of other users on the document stored in the system, and the editing information of the user is stored and is kept to be synchronized with the versions of other users. However, the related technologies at present have the problems of poor usability, low security, large storage overhead, and the like.
Disclosure of Invention
The invention aims to solve the technical problem of providing a single-file multi-interface editing method based on a block chain, so as to solve the problems of poor usability, low safety and high storage overhead of the traditional single-file multi-interface editing method.
In order to solve the technical problems, the invention adopts the technical scheme that: a single document multi-interface editing method based on a block chain is disclosed, all edge servers jointly form an edge server block chain, each edge server and all corresponding terminal nodes jointly form a terminal block chain, and the method specifically comprises the following steps:
step S1: the terminal nodes participating in document editing are in communication connection with the corresponding edge servers to acquire serialized editing instructions stored in the edge server block chain and complete the synchronization of the current document version;
step S2: in the editing process, the edge servers participating in document editing collect editing instructions of corresponding terminal nodes, integrate all the editing instructions to form a serialized editing instruction, and all the terminal nodes participating in editing and the corresponding edge servers complete the current document version synchronization according to the serialized editing instruction;
and step S3: when the preset synchronization condition is met, the edge server participating in document editing broadcasts the current document version information and the new serialized editing instruction to the edge server block chain for storage, and after document consensus is achieved through a consensus mechanism, the document version information and the new serialized editing instruction are synchronized to terminal nodes participating in document editing in all terminal block chains.
Preferably, in step S1, the obtaining of the serialized editing instruction stored in the edge server block chain includes the following steps:
step S11: the terminal nodes participating in document editing send request document version information to corresponding edge servers, and the edge servers feed back the current latest document version information;
step S12: comparing the local document version information of the terminal node with the latest document version information, and judging whether the document version information is the same or not;
step S13: and if the document version information is different, the terminal node sends an updating request to a corresponding edge server, and the edge server feeds back a serialized editing instruction which is known in the edge server block chain.
Preferably, the document version information includes, but is not limited to, a document hash value, a last editing time of a document, and a document name.
Preferably, in the step S2, the editing instructions all have time stamps, and all the editing instructions are integrated and ordered according to the sequence of time to form the serialized editing instructions.
Preferably, the terminal nodes participating in editing serially execute each sub-instruction in the serialized editing instruction.
Preferably, in the step S3, the preset synchronization condition includes a maximum synchronization waiting time and a version confirmation request.
Preferably, the method for using the preset synchronization condition includes the following steps:
step S31: the system automatically completes the document version synchronization once per the maximum synchronization waiting time;
step S32: when the edge server participating in document editing receives the version confirmation request of the corresponding terminal node, the whole system automatically completes one-time document version synchronization and clears the timer.
Compared with the prior art, the invention has the following beneficial effects:
the invention provides a single document multi-interface editing method based on a block chain, which combines the high-performance response of an edge server with a distributed self-organization mode of the block chain, ensures the expansibility in a loose coupling environment and the availability under a distributed request, and further ensures the high-efficiency availability of a single document multi-interface editing function. Because the edge server corresponding to the terminal node is the optimal choice after comprehensively considering the factors of network topology, server load, application layer characteristics and the like, the method has higher efficiency and good expansibility. Meanwhile, the terminal nodes which do not participate in document editing under the two-level distributed architecture of the block chain + edge calculation do not store the document, and storage cost is effectively reduced compared with a single-layer block chain architecture. In addition, the invention ensures the safety of single-document multi-interface editing based on the non-falsifiable characteristic of the block chain and the access control characteristic of the permission chain.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only preferred embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive exercise.
FIG. 1 is a flow chart of a block chain based single document multi-interface editing method of the present invention;
FIG. 2 is a schematic diagram of the relationship between an edge server block chain and a terminal block chain according to the present invention;
Detailed Description
For a better understanding of the technical content of the present invention, the following specific embodiments are provided, and the present invention is further described with reference to the accompanying drawings:
referring to fig. 1 and 2, in the method for editing a single document with multiple interfaces based on a block chain, all edge servers jointly form an edge server block chain, and each edge server and all corresponding terminal nodes jointly form a terminal block chain, where an edge server as a server for executing a document editing service and a terminal node that needs to perform document editing form a document editing system, the terminal node may be a mobile terminal or a PC terminal, the position of the terminal node in a physical space and a network space may be freely changed, and the edge server is a server of the system, and the position of the edge server is usually fixed. The edge server corresponding to the terminal node can change along with time, but for a given terminal node, the edge server corresponding to the terminal node at the same time is uniquely determined and agreed, the edge server carries out document editing operation on the terminal node within the service range, and the edge server corresponding to the terminal node is the optimal choice after comprehensively considering factors such as network topology, server load, application layer characteristics and the like, so the method has high efficiency and good expansibility. As shown in particular in fig. 2.
The method specifically comprises the following steps:
step S1: the terminal nodes participating in document editing are in communication connection with the corresponding edge servers to acquire serialized editing instructions stored in the edge server block chain and complete the synchronization of the current document version;
the user can use the terminal node to perform communication connection with the edge server through a transmission protocol, and the user can edit the document through the terminal node, wherein the editing operation can be adding, deleting or changing the content of the document. The edited document may be an online document in a system for multiple persons to edit the document cooperatively, and the document may be an office document, a program document, or the like, which is not limited herein.
After the terminal nodes participating in editing establish communication with the corresponding edge servers, the system performs the following operations:
step S11: the terminal nodes participating in document editing send request document version information to corresponding edge servers, and the edge servers feed back the current latest document version information;
step S12: comparing the local document version information of the terminal node with the latest document version information, and judging whether the document version information is the same or not;
the document version information refers to a group of multivariate groups capable of uniquely determining the document version, and the specific composition of the multivariate groups can change due to the actual application scenario, but in principle, the multivariate groups may include, but are not limited to, the hash value of the document, the last editing time of the document, the name of the document, and the like, and is not specifically limited herein.
Step S13: and if the document version information is different, the terminal node sends an updating request to a corresponding edge server, and the edge server feeds back a serialized editing instruction which is known in the edge server block chain.
For example, as shown in fig. 2, assuming that the terminal node 2 has a permission function of performing collaborative editing on a certain document, the user uses the terminal node 2 to perform communication connection with the edge server 1, and then the terminal node 2 sends a request to the edge server 1 to obtain the latest document version information, where the latest document version information is information that is currently stored in the edge server block chain after other users edit documents at other terminal nodes. The terminal node 2 compares the acquired document version information with local document version information, specifically, the hash value of the document, the last editing time of the document, the name of the document and other information can be compared, if the comparison result is consistent, the local document on the terminal node 2 is the latest document, and the editing operation can be directly carried out; if the comparison result is not consistent, which indicates that the document is updated, the terminal node 2 sends an update request to the edge server 1, the edge server feeds back a serialized editing instruction formed by editing operations of other users, which is stored in the edge server block chain, to the terminal node 2, and the terminal node 2 executes the serialized editing instruction, so that the document update is completed, and the user can perform the editing operations on the document.
Step S2: in the editing process, the edge servers participating in document editing collect editing instructions of corresponding terminal nodes, integrate all the editing instructions to form a serialized editing instruction, and complete the synchronization of the current document version according to the serialized editing instruction by all the terminal nodes participating in editing and the corresponding edge servers;
it should be noted that, in the whole system as shown in fig. 2, only part of the end nodes may participate in editing for a specific document, so only the corresponding part of the edge servers participate in editing, and in this step, only the end nodes and the edge servers participating in editing the document are involved.
For example, as shown in fig. 2, if only the terminal node 2 and the terminal node 3 participate in a document editing at the same time in a certain editing stage, the edge server 1 and the edge server 3 also participate in the document editing, the edge server 1 collects various editing instructions of the terminal node 2, the edge server 3 collects various editing instructions of the terminal node 7, and integrates the two editing instructions to form a serialized editing instruction, on one hand, the serialized editing instruction is stored in the edge server 1 and the edge server 3, and simultaneously the serialized editing instruction is also transmitted to the terminal node 2 and the terminal node 7, and the serialized editing instruction is executed by the terminal node 2 and the terminal node 7, thereby completing document synchronization on the terminal node 2, the edge server 1, the terminal node 7, and the edge server 3 which are editing the document cooperatively.
Specifically, the editing instructions are provided with time stamps, and all the editing instructions are integrated and ordered according to the time sequence to form the serialized editing instructions. And simultaneously, the terminal nodes participating in editing serially execute each sub-instruction in the serialized editing instruction.
For example, if the serialized editing instructions include sub-instructions arranged in chronological order as follows:
sub instruction 1: deleting the content at A in the document;
sub-instruction 2: modifying the content at B in the document;
sub-instruction 3: adding content at C in the document;
when the terminal nodes participating in editing execute the serialized editing instruction, the sub-instruction 1, the sub-instruction 2 and the sub-instruction 3 are sequentially and serially executed, and the significance is that the correctness and the effectiveness of the document content can be ensured when a plurality of terminal nodes collaboratively edit the document.
And step S3: when the preset synchronization condition is reached, the edge server participating in document editing broadcasts the current document version information and the new serialized editing instruction to the edge server block chain for storage, and after document consensus is achieved through a consensus mechanism, the document version information and the new serialized editing instruction are synchronized to all terminal nodes participating in document editing in all terminal block chains.
Through the preset synchronization condition, the whole system can be updated autonomously, namely when the synchronization condition is met, the current latest document version information and the latest serialized editing instruction are broadcasted to the edge server block chain, namely the current latest document version information and the serialized editing instruction are stored in the edge server which is currently involved in document editing and the server which is not currently involved in document editing, so that the terminal node with the document collaborative editing authority function can realize the synchronous updating of the document when the terminal node is in communication connection with any edge server in the system at any place, and a cycle is formed even if the content in the step S1 is effectively executed.
The document information stored in the edge server achieves document consensus under the existing specific consensus mechanism of the edge server block chain, and synchronizes the document consensus to terminal nodes participating in document editing in each terminal block chain. The terminal nodes which do not participate in document editing can not store the document, so that the storage overhead can be effectively reduced. In addition, the safety of single-document multi-interface editing is guaranteed based on the non-falsification characteristic of the block chain and the access control characteristic of the permission chain.
Specifically, the preset synchronization condition includes a maximum synchronization waiting time and a version confirmation request. The maximum synchronization waiting time refers to a time threshold value of repeated timing predefined according to an actual application environment, and after the maximum synchronization waiting time is reached each time, the document edited currently is subjected to consensus once, namely, the whole system automatically completes document updating once. The significance of the method is to prevent the document content from being lost or the version from being long forked due to long-time unconformity. The version confirmation request is a 'save' instruction executed after any terminal node finishes editing the document.
The use method of the preset synchronization condition comprises the following steps:
step S31: the system automatically completes the document version synchronization once every the maximum synchronization waiting time;
step S32: when the edge server participating in document editing receives the version confirmation request of the corresponding terminal node, the whole system automatically completes one-time document version synchronization, and clears the timer, namely, the maximum synchronization waiting time is restarted.
It should be understood that the above-described embodiments of the present invention are merely examples for clearly illustrating the present invention and are not intended to limit the embodiments of the present invention. Other variations and modifications will be apparent to persons skilled in the art in light of the above description. This need not be, nor should it be exhaustive of all embodiments. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the claims of the present invention.
Claims (7)
1. The method for editing the single document with multiple interfaces based on the block chain is characterized in that all edge servers jointly form the block chain of the edge servers, each edge server and all corresponding terminal nodes jointly form a terminal block chain, and the method specifically comprises the following steps:
step S1: the terminal nodes participating in document editing are in communication connection with the corresponding edge servers to acquire serialized editing instructions stored in the edge server block chain and complete the synchronization of the current document version;
step S2: in the editing process, the edge servers participating in document editing collect editing instructions of corresponding terminal nodes, integrate all the editing instructions to form a serialized editing instruction, and all the terminal nodes participating in editing and the corresponding edge servers complete the current document version synchronization according to the serialized editing instruction;
and step S3: when a preset synchronization condition is met, the edge server participating in document editing broadcasts the current document version information and a new serialized editing instruction to the edge server block chain for storage, and after document consensus is achieved through a consensus mechanism, the current document version information and the new serialized editing instruction are synchronized to terminal nodes participating in document editing in all terminal block chains.
2. The method for multi-interface editing of a single document based on a block chain according to claim 1, wherein in the step S1, the step of obtaining the serialized editing instructions stored in the edge server block chain includes the following steps:
step S11: the terminal nodes participating in document editing send request document version information to corresponding edge servers, and the edge servers feed back the current latest document version information;
step S12: comparing the local document version information of the terminal node with the latest document version information, and judging whether the document version information is the same or not;
step S13: and if the document version information is different, the terminal node sends an updating request to a corresponding edge server, and the edge server feeds back a piece of serialized editing instruction which is known in the edge server block chain.
3. The method for multi-interface editing of a single document based on a block chain as claimed in claim 2, wherein the document version information includes but is not limited to a document hash value, a last editing time of a document, and a document name.
4. The method for editing the single-document multi-interface based on the block chain according to claim 1, wherein in the step S2, the editing instructions are all provided with time stamps, and all the editing instructions are integrated and ordered according to the time sequence to form the serialized editing instructions.
5. The method for multi-interface editing of a single document based on a block chain according to claim 1, wherein the terminal nodes participating in editing serially execute each sub-instruction in the serialized editing instruction.
6. The method for multi-interface editing of a single-copy document based on a block chain as claimed in claim 1, wherein in said step S3, said preset synchronization conditions include a maximum synchronization waiting time and a version confirmation request.
7. The method for editing a single document with multiple interfaces based on a block chain according to claim 6, wherein the method for using the preset synchronization condition comprises the following steps:
step S31: the system automatically completes the document version synchronization once per the maximum synchronization waiting time;
step S32: when the edge server participating in document editing receives the version confirmation request of the corresponding terminal node, the whole system automatically completes one-time document version synchronization and clears the timer.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011624754.6A CN112686004B (en) | 2020-12-30 | 2020-12-30 | Block chain-based single-document multi-interface editing method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011624754.6A CN112686004B (en) | 2020-12-30 | 2020-12-30 | Block chain-based single-document multi-interface editing method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112686004A CN112686004A (en) | 2021-04-20 |
CN112686004B true CN112686004B (en) | 2023-04-11 |
Family
ID=75454025
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011624754.6A Active CN112686004B (en) | 2020-12-30 | 2020-12-30 | Block chain-based single-document multi-interface editing method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112686004B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114189755A (en) * | 2021-12-03 | 2022-03-15 | 创盛视联数码科技(北京)有限公司 | Synchronous display method, system and device for live broadcast and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110674619A (en) * | 2019-09-18 | 2020-01-10 | 北京达佳互联信息技术有限公司 | Online document editing method, device, equipment and computer storage medium |
CN111523150A (en) * | 2020-04-20 | 2020-08-11 | 中国工商银行股份有限公司 | Block chain-based document editing method, device and system |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10552381B2 (en) * | 2016-12-16 | 2020-02-04 | International Business Machines Corporation | Shared document editing in the blockchain |
CN109634913A (en) * | 2018-12-14 | 2019-04-16 | 北京达佳互联信息技术有限公司 | Storage method, device and the electronic equipment of document |
EP3924854A1 (en) * | 2019-02-12 | 2021-12-22 | Volenday LLC | Digitized contract generation with colocation security |
US20200394321A1 (en) * | 2019-06-11 | 2020-12-17 | International Business Machines Corporation | Document redaction and reconciliation |
CN111221569B (en) * | 2020-01-07 | 2023-07-25 | 中国联合网络通信集团有限公司 | Document updating method and server |
CN111866123B (en) * | 2020-07-17 | 2022-03-08 | 海南大学 | Data storage method and device based on block chain |
-
2020
- 2020-12-30 CN CN202011624754.6A patent/CN112686004B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110674619A (en) * | 2019-09-18 | 2020-01-10 | 北京达佳互联信息技术有限公司 | Online document editing method, device, equipment and computer storage medium |
CN111523150A (en) * | 2020-04-20 | 2020-08-11 | 中国工商银行股份有限公司 | Block chain-based document editing method, device and system |
Non-Patent Citations (2)
Title |
---|
李慧 等.区块链技术发展与展望.《农业大数据学报》.2020,第2卷(第2期),第5-13页. * |
涂铭.区块链上协同编辑***关键技术研究.《中国优秀硕士学位论文全文数据库 信息科技辑》.2020,(第3期),I138-680. * |
Also Published As
Publication number | Publication date |
---|---|
CN112686004A (en) | 2021-04-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107332876B (en) | Method and device for synchronizing block chain state | |
CN102088489B (en) | Distributed data synchronizing system and method | |
US9043278B1 (en) | System and method for the merging of databases | |
CN106372221B (en) | A kind of method of file synchronization, equipment and system | |
CN107944566B (en) | Machine learning method, main node, working node and system | |
CN103235835B (en) | For the inquiry implementation method and device of data-base cluster | |
CN111008521B (en) | Method, device and computer storage medium for generating wide table | |
EP1326184A3 (en) | Conflict resolution for collaborative work system | |
CN106484713A (en) | A kind of based on service-oriented Distributed Request Processing system | |
CN102404387B (en) | A kind of for carrying out the method for synchronizing information, device and equipment with other nodes | |
CN110334077A (en) | The method and device of database cross computer room migration | |
KR101304663B1 (en) | The system of cooperative editing of mind-map and the method thereof | |
CN110113406B (en) | Distributed computing service cluster system | |
CN112686004B (en) | Block chain-based single-document multi-interface editing method | |
CN112202877B (en) | Gateway linkage method, gateway, cloud server and user terminal | |
US10972296B2 (en) | Messaging to enforce operation serialization for consistency of a distributed data structure | |
CN103731465A (en) | Distributed system and transaction treatment method thereof | |
CN107277112B (en) | Scalable and efficient address space conversion algorithm | |
CN101119365B (en) | Cooperation interaction optimizing method under vast scale cooperative surroundings | |
CN110213359B (en) | Internet of vehicles networking data pushing system and method based on D2D | |
CN108062225B (en) | Method for issuing application cluster by multi-template combination | |
CN102508927B (en) | Device and method of data synchronization technology based on nuclear power construction multi-project management | |
CN102209049B (en) | Instant messaging system and method for user information processing | |
CN108156194B (en) | A kind of form data processing method | |
CN106210159A (en) | A kind of domain name analytic method and equipment |
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 |