WebSocket and JSON-PATCH-based conflict resolution method and system for realizing multi-person collaborative editing

By using WebSocket and JSON-PATCH-based methods in a multi-person collaborative development environment, we receive and process operation information in real time, detect and resolve conflicts, and achieve efficient management and data consistency guarantee for multi-person collaborative editing.

CN119902754APending Publication Date: 2025-04-29CHINA TELECOM CORP LTD
View PDF 0 Cites 7 Cited by

Patent Information

Application Number
CN202411930051.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

In a multi-person collaborative development environment, how to effectively manage and integrate real-time changes from different developers, resolve conflicts and ensure data consistency.

Method used

Using the method based on WebSocket and JSON-PATCH, the JSON format operation information from multiple clients is received and processed through the WebSocket server, conflict detection is performed based on the operation type defined by JSON-PATCH, and merged according to the preset priority rules, and finally broadcast the merge result to all clients for update interface.

Benefits of technology

Real-time conflict detection and resolution of multiple collaborative editing is realized, the accuracy and system performance of collaborative editing are improved, and the correctness and consistency of the final document is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119902754A_ABST
    Figure CN119902754A_ABST
Patent Text Reader

Abstract

The invention provides a conflict resolution method and system for realizing multi-person collaborative editing based on WebSocket and JSON-PATCH, and relates to the technical field of I T and software development, the method comprises the following steps: obtaining an editing operation of a user at a client of a low-code platform, and converting the editing operation into operation information in a JSON format; the method comprises the following steps: receiving operation information in a JSON format sent by a plurality of clients through a WebSocket server; storing the received operation information in the JSON format in a database according to a user account; based on the operation type defined by the JSON-PATCH, conflict detection is carried out on the concurrent operation of the multiple users; according to a preset priority rule, carrying out merging processing on the detected conflict operations; a result obtained after combination processing is broadcasted to all the clients through a WebSocket server; and the client receives the broadcast combination result and updates the low-code platform interface. According to the method, the user operation is formatted by using the JSON-PATCH, so that operation conversion is realized to solve conflicts.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of IT and software development technology, and in particular to a conflict resolution method and system for implementing multi-person collaborative editing based on WebSocket and JSON-PATCH. Background Art

[0002] With the popularity of low-code development platforms, more and more companies and teams are beginning to adopt this development model to accelerate the construction and iteration of applications. In an environment where multiple people are collaborating on a development project, how to effectively manage and integrate changes from different developers has become a key technical challenge. As shown in the figure below, the industry currently uses a variety of methods to solve this problem, including version control systems, lock and permission management, and data synchronization and conflict resolution strategies. However, these traditional methods have some limitations when dealing with real-time multi-person collaborative editing. Summary of the invention

[0003] This application shows a conflict resolution method and system for implementing multi-person collaborative editing based on WebSocket and JSON-PATCH.

[0004] In a first aspect, the present application shows a conflict resolution method for implementing multi-person collaborative editing based on WebSocket and JSON-PATCH, the method comprising:

[0005] Obtain the user's editing operations on the client side of the low-code platform and convert the editing operations into operation information in JSON format;

[0006] Receive JSON-formatted operation information sent by multiple clients through the WebSocket server;

[0007] The received operation information in JSON format is stored in the database according to the user account;

[0008] Based on the operation type defined by JSON-PATCH, conflict detection is performed on concurrent operations of multiple users;

[0009] According to the preset priority rules, the detected conflicting operations are merged;

[0010] Broadcast the merged results to all clients via the WebSocket server;

[0011] The client receives the broadcast merge results and updates the low-code platform interface.

[0012] Furthermore, the operation information in JSON format includes:

[0013] User identification information, operation timestamp, operation type, operation path, and operation content.

[0014] Furthermore, the operation types defined by JSON-PATCH include:

[0015] Add operation, used to add new elements or sub-objects under the specified path;

[0016] The remove operation is used to remove elements from the specified path;

[0017] Replace operation, used to replace the element value of the specified path;

[0018] Move operations, which are used to move elements from one position to another;

[0019] The copy operation is used to copy elements to a new location;

[0020] Test operation, used to test whether the specified path meets certain conditions.

[0021] Furthermore, the preset priority rules include:

[0022] Priority rules based on user roles and permissions, where administrator operations take precedence over ordinary user operations;

[0023] Timestamp-based priority rules, where operations that arrive earlier have higher priority;

[0024] Priority rules based on operation dependencies ensure that dependent operations are executed in the correct order;

[0025] Priority rules based on the operation type, where the remove operation has the highest priority.

[0026] Furthermore, the WebSocket server has the following functions:

[0027] Manage the establishment, maintenance and disconnection of client connections;

[0028] Provides an automatic connection downgrade mechanism to switch to other compatible transmission methods when WebSocket is unavailable;

[0029] Supports custom events and room mechanisms to achieve refined message management;

[0030] Provides a heartbeat detection mechanism to maintain an active connection.

[0031] Furthermore, the specific steps of the merging process include:

[0032] Step 501, checking the user roles of conflicting operations, and giving priority to the administrator's operation;

[0033] Step 502: If the user roles are the same, compare the operation timestamps and use the operation that arrives first;

[0034] Step 503, if the timestamps are the same, check the operation dependency to ensure that the dependent operation is executed first;

[0035] Step 504: If the judgment cannot be made through steps 501 to 503, the removal operation is performed first according to the priority of the operation type.

[0036] Furthermore, it also includes using the built-in error handling mechanism of Socket.io; monitoring the connection status and handling connection interruptions; handling data transmission errors; triggering a retry or recovery mechanism; and notifying the client of the error status.

[0037] Furthermore, it also includes the data persistence step:

[0038] Store the operation information in the database;

[0039] Record operation history;

[0040] Support operation rollback;

[0041] Provides a data recovery mechanism.

[0042] In the second aspect, the present application shows a conflict resolution system for implementing multi-person collaborative editing based on WebSocket and JSON-PATCH, the system comprising:

[0043] The operation information acquisition module is used to obtain the user's editing operations on the client side of the low-code platform and convert the editing operations into operation information in JSON format;

[0044] The operation information receiving module is used to receive the operation information in JSON format sent by multiple clients through the WebSocket server;

[0045] The storage module is used to store the received operation information in JSON format in the database according to the user account;

[0046] The conflict detection module is used to detect conflicts between concurrent operations of multiple users based on the operation type defined by JSON-PATCH;

[0047] A merging processing module, used to merge the detected conflicting operations according to a preset priority rule;

[0048] The broadcast module is used to broadcast the merged results to all clients through the WebSocket server;

[0049] The update module is used for the client to receive the broadcast merge results and update the low-code platform interface.

[0050] Furthermore, the client of the low-code platform includes:

[0051] Graphical user interface for visual development;

[0052] A collaborative editing module for obtaining user editing operations;

[0053] Data conversion module for converting edit operations into JSON format;

[0054] A display module used to receive broadcast results and update the interface.

[0055] The technical solution provided by this application may have the following beneficial effects:

[0056] 1. Use JSON-PATCH to format user operations and implement operation conversion to resolve conflicts

[0057] Lightweight operation format: JSON-PATCH is a lightweight specification that allows operations such as adding, deleting, and modifying JSON documents. It describes changes to documents in the form of an operation list, which is very suitable for network transmission.

[0058] Efficient differential updates: By describing the minimal set of changes to a document, JSON-PATCH can efficiently deliver updates between the client and the server, reducing the amount of data transferred.

[0059] Easy to implement and integrate: JSON-PATCH is simple to operate, easy to implement in various programming languages ​​and platforms, and can be seamlessly integrated with existing JSON structures.

[0060] 2. Combining JSON-PATCH with OT Algorithm

[0061] Real-time conflict detection and resolution: JSON-PATCH is used to describe the user's specific operations, while the OT (operation transformation) algorithm is responsible for handling conflicts between these operations. Operations are transformed according to priority rules such as timestamps and user roles. The OT algorithm ensures that operations of multiple users can be applied in parallel without causing inconsistencies.

[0062] Improve the accuracy of collaborative editing: When used together, the system can accurately identify and merge the real-time editing operations of multiple users to ensure the correctness of the final document.

[0063] Improve system performance: JSON-PATCH provides a concise description of operations, and the OT algorithm optimizes the order of operation execution. The combination of the two reduces the processing burden of the server and improves the system response speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] Figure 1 It is a flow chart of the steps of the application method.

[0065] Figure 2 It is the collaborative timing diagram of this application;

[0066] Figure 3 This is the error log conversion flow chart for this application;

[0067] Figure 4 It is a structural diagram of the system of this application;

[0068] Figure 5 is a block diagram of an electronic device of the present application;

[0069] Figure 6 It is a block diagram of a computer-readable storage medium of the present application. DETAILED DESCRIPTION

[0070] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0071] Glossary:

[0072] WebSocket: A protocol for full-duplex communication over a single TCP connection that allows the server to actively push data to the client.

[0073] JSON-PATCH: An algorithm for finding the differences between two JSON objects and generating operational transformation (OT) operations.

[0074] Low-code platform: A development environment that allows users to quickly build applications through a graphical interface and a small amount of code.

[0075] Collaborative editing: A mechanism whereby multiple users can edit the same document or project at the same time.

[0076] Reference Figure 1 , shows a conflict resolution method for implementing multi-person collaborative editing based on WebSocket and JSON-PATCH of the present application, which can be applied to electronic devices, and the method includes the following steps:

[0077] Step 101, obtaining the user's editing operation on the client of the low-code platform, and converting the editing operation into operation information in JSON format;

[0078] Specifically, the operation information in JSON format includes:

[0079] User identification information, operation timestamp, operation type, operation path, and operation content.

[0080] As a preferred example, the low-code platform (Client A and Client B) is a visual development environment for quickly building applications. It provides a rich set of graphical components, drag-and-drop layout tools, and predefined workflow templates, allowing users to design and deploy applications without writing a lot of code. The core functions of the platform include:

[0081] User interface: The front end adopts responsive web design and provides an intuitive graphical user interface (GUI), including a canvas area, component library, property panel, event editor, etc. Users can directly develop applications by dragging components, configuring properties, and designing workflows.

[0082] Backend services: The server side implements business logic processing, data storage and retrieval, user authentication and authorization, etc. Use microservice architecture to modularize core functions for easy expansion and maintenance.

[0083] Data model: The platform uses a JSON-based data model to represent the state of the application, including page layout, component properties, data binding relationships, business rules, etc. All user editing operations are performed on this data model.

[0084] Step 102, receiving operation information in JSON format sent by multiple clients through the WebSocket server;

[0085] Specifically, the WebSocket server has the following functions:

[0086] Manage the establishment, maintenance and disconnection of client connections;

[0087] Provides an automatic connection downgrade mechanism to switch to other compatible transmission methods when WebSocket is unavailable;

[0088] Supports custom events and room mechanisms to achieve refined message management;

[0089] Provides a heartbeat detection mechanism to maintain an active connection.

[0090] A preferred example is a Websocket server, using Socket.io as the core component of the Websocket real-time communication server. The Socket.io framework is used to achieve efficient, flexible, cross-platform two-way real-time communication between the client and the server. The server has the following functions:

[0091] Connection management: accept client connection requests, verify identity and establish Socket.io connection, manage the connection life cycle (such as connection establishment, maintenance, disconnection, reconnection, etc.). Socket.io provides an automatic downgrade mechanism. When WebSocket is unavailable, it can seamlessly switch to other compatible transmission methods (such as long polling, polling, Flash Socket, etc.) to ensure the reliability of communication.

[0092] Message transmission: Receive the JSON formatted operation data sent by the client, and ensure that the data is transmitted to the data synchronization module completely and accurately. At the same time, the operation data processed by the data synchronization module is broadcast to all relevant clients in the form of events. The Socket.io framework supports custom events and room (namespace) mechanisms, which facilitates the refined management of different types of messages and user groups.

[0093] Error handling: Figure 3 As shown in the figure, Socket.io's built-in error handling mechanism is used to monitor the connection status, handle connection interruptions and data transmission errors in a timely manner, notify the client and trigger the corresponding retry or recovery mechanism. In addition, Socket.io provides a heartbeat detection mechanism to automatically maintain the active state of the connection and prevent abnormal disconnection caused by network idle period.

[0094] Step 103, storing the received operation information in JSON format in a database according to the user account;

[0095] Step 104, based on the operation type defined by JSON-PATCH, conflict detection is performed on concurrent operations of multiple users;

[0096] Specifically, the operation types defined by JSON-PATCH include:

[0097] Add operation, used to add new elements or sub-objects under the specified path;

[0098] The remove operation is used to remove elements from the specified path;

[0099] Replace operation, used to replace the element value of the specified path;

[0100] Move operations, which are used to move elements from one position to another;

[0101] The copy operation is used to copy elements to a new location;

[0102] Test operation, used to test whether the specified path meets certain conditions;

[0103] The specific conditions are as follows:

[0104] Test operation is used to verify whether the data value under the specified path meets specific conditions. This operation verifies the integrity and consistency of the data by checking the data path to ensure that the data corresponding to the path meets the preset requirements or constraints. Specific conditions can include but are not limited to the following types:

[0105] Value matching: Verify that the value at a specified path is equal to the expected value. For example, check if the value of a field is a specific value.

[0106] Type matching: Verifies that the value at the specified path is of the expected data type, such as string, integer, Boolean, etc.

[0107] Range constraint: Verify that the value on the specified path is within a preset value range.

[0108] Structural consistency: Checks whether the data structure of the specified path conforms to the expected format, applicable to array and object type data.

[0109] Regular expression matching: Perform a regular expression check on the path value to verify whether the string data meets the specific format requirements.

[0110] Existence check: Verify that the element on the specified path exists or that the path itself is valid.

[0111] Step 105, merging the detected conflicting operations according to a preset priority rule;

[0112] Specifically, the preset priority rules include:

[0113] Priority rules based on user roles and permissions, where administrator operations take precedence over ordinary user operations;

[0114] Timestamp-based priority rules, where operations that arrive earlier have higher priority;

[0115] Priority rules based on operation dependencies ensure that dependent operations are executed in the correct order;

[0116] Priority rules based on the operation type, where the remove operation has the highest priority.

[0117] In a preferred example, this application has several built-in priority rules. When conflicts occur in the same place, they will be merged according to the following priorities, including:

[0118] 1. User roles and permissions: In some cases, the user's permission level may affect the merged results of operations. For example, the operations of administrators or advanced users may override the operations of ordinary users.

[0119] Specifically, when a user with higher permissions (such as an administrator or advanced user) encounters an operation conflict, his or her editing operations may be merged first, thereby overwriting the operations of users with lower permissions (such as ordinary users). This merge strategy helps ensure that modifications by important roles are processed first, protecting the integrity and consistency of system data.

[0120] For example, when an administrator and a normal user edit the same data item, the administrator's modification will take precedence over the normal user's modification. In this case, even if both modify the same data path, the administrator's operation will overwrite the normal user's operation, and the final merge result will be based on the administrator's modification. The purpose of this is that the administrator, as a user with higher authority, often has a higher priority in his modification operations, so that his operations will be executed first in the event of a conflict.

[0121] Specifically, suppose an administrator and a common user modify a data item at the same time. During the merging process, if the modifications made by the two conflict, the system will determine that the administrator's operation should take precedence over the common user's operation based on the preset permission rules. This priority merging rule can not only ensure that the modifications made by high-privilege users are executed, but also avoid data inconsistency or business logic errors caused by interference from operations by low-privilege users.

[0122] For example, the operation content of administrator A is:

[0123]

[0124] The operations of ordinary user B are as follows:

[0125]

[0126] Administrator A's operation takes precedence over user B's, so the result after merging is:

[0127]

[0128] 2. Timestamp: Each operation is accompanied by a timestamp, which indicates the actual time when the user performed the operation. The relative order of operations is determined based on these timestamps, giving earlier operations higher priority when merging.

[0129] Specifically, when multiple users modify the same data item at the same time, the system determines the order of operations by comparing timestamps. Earlier operations are given higher priority, so in the event of a conflict, the earlier submitted operations will be merged first.

[0130] For example, suppose user A and user B modify the same data item at different time points. By comparing the timestamps, the system can determine that user A's operation is earlier than user B's operation. Therefore, when the operations are merged, user A's modification will be given a higher priority, while user B's modification will be merged into the final result.

[0131] When merging, the earlier operation (that is, the operation of user A) will be considered by the system first and will be part of the final result; if the subsequent operation (that is, the operation of user B) has no conflict or can be merged smoothly, the system will merge it in according to the timestamp order. Ultimately, the merge result will reflect the execution order of each operation and ensure that the final data state is consistent with the timestamp record.

[0132] For example, user A's operation content is:

[0133]

[0134] User B's operation content is:

[0135]

[0136]

[0137] User A's operation arrives before user B's, so the merged result is:

[0138]

[0139] 3. Dependencies: Some operations may depend on the results of other operations. For example, modifying the properties of a page element may require another operation to create the element first. In this case, make sure the dependent operations are applied first.

[0140] For example, an operation may need to be completed before other operations can be successfully executed. Common scenarios include modifying the properties of a page element may require creating the element first, or deleting an element may affect other operations that depend on the element. In this case, the system needs to ensure that the dependent operations can be applied first during the merge process to ensure the logical order of operations and data consistency.

[0141] Specifically, when there are dependencies between operations, the system will determine which operations should be executed first based on the order and dependencies of the operations. If an operation depends on the results of other operations, the dependent operations will be executed first to ensure that the dependent operations can be completed correctly. Only after the dependent operations are completed will the dependent operations be allowed to continue.

[0142] For example, suppose that user C and user D perform editing operations on the same data item, where user C's operation involves deleting a page element, while user D's operation involves modifying the attributes of the element. Since user D's modification operation depends on user C's deletion operation (i.e., the attribute that user D wants to modify exists in the deleted element), the system will determine that user C's deletion operation has a higher priority.

[0143] In this case, the merge process will first apply user C's delete operation, because user D's modification operation depends on the existence of the element. User D's modification operation will not be able to proceed before the deletion operation is executed, and the final merge result only retains user C's deletion operation, but does not include user D's modification operation.

[0144] In this way, the system can properly handle the dependencies between operations and ensure that each operation is executed in the correct order, thereby avoiding data conflicts or business logic problems caused by incorrect operation order.

[0145] For example, the operation content of user C is:

[0146]

[0147] User D's operation content is:

[0148]

[0149] UserC's delete operation takes precedence because UserD's modification depends on the deleted element.

[0150] The result after merging is:

[0151]

[0152] 4. Operation priority: Different types of JSON-Patch operations have different priorities, especially when operation conflicts occur. In order to effectively resolve conflicts, the system defines different priorities for different types of operations to ensure that the most critical or most destructive operations are applied first. Specifically, for operations that may result in data deletion or structural changes (such as deletion operations), the system defines them as the highest priority operations. This is because deletion operations usually cause other operations to become invalid or conflicting, so they must be executed first to maintain data consistency and accuracy.

[0153] For example, suppose user A and user B perform different types of operations on the same data path at the same time. If user A performs an edit operation and user B performs a delete operation, the system will consider the delete operation (remove) as the highest priority operation because the delete operation is more destructive and will cause the target data element to no longer exist.

[0154] In this case, the system will choose to execute the deletion operation of user B according to the priority rule and cancel the editing operation of user A. Because once the deletion operation is executed, the data element on the path will no longer exist, and any subsequent modification operations (such as editing, replacing or adding) will become invalid. Therefore, the merged result will only retain the deletion operation and cancel other operations related to the element.

[0155] This priority definition ensures that when a conflict occurs, the delete operation is always processed first, thus avoiding invalid or erroneous results caused by subsequent modification operations. Ultimately, the system will follow this priority rule to ensure that the delete operation is applied first and avoid the execution of other invalid operations.

[0156] For example, user A's operation content is:

[0157]

[0158]

[0159] User B's operation content is:

[0160]

[0161] The result after merging is:

[0162]

[0163] Specifically, the specific steps of the merge process include:

[0164] Step 501, checking the user roles of conflicting operations, and giving priority to the administrator's operation;

[0165] Step 502: If the user roles are the same, compare the operation timestamps and use the operation that arrives first;

[0166] Step 503, if the timestamps are the same, check the operation dependency to ensure that the dependent operation is executed first;

[0167] Step 504: If the judgment cannot be made through steps 501 to 503, the removal operation is performed first according to the priority of the operation type.

[0168] In a preferred example, the merging process includes:

[0169] Step 1 (User Operation): User A enters a project on the low-code platform and modifies some configuration information of the project, such as the title of a page. At the same time, User B enters the same project on the low-code platform on another terminal and also starts to modify the title of the page.

[0170] Step 2 (Collaborative editing module): Figure 2 As shown in the figure, the low-code platform opened by user A converts the operation of user A to edit the title into information in json format through the collaborative editing module, such as

[0171]

[0172] Similarly, the collaborative editing module of user B also converts the title editing operation into JSON format information, such as

[0173]

[0174]

[0175] Step 3 (Websocket server): If the terminals of user A and user B have not established a connection with the Websocket server of the low-code platform, they will first apply to establish a connection. After the connection is successfully established, the terminals of user A and user B will respectively transmit the generated JSON information to the Websocket server. The Websocket server then passes the information to the following steps.

[0176] Step 4 (data synchronization module): After receiving the data, the data synchronization module will first store the operations of user a and user b in the MySQL database in the account dimension for subsequent use. Then, the data will be passed to the subsequent steps according to the order in which the data of user a and user b arrive.

[0177] Step 5, Step 6, Step 7 (OT algorithm module):

[0178] First, we define an operational transformation (OT) algorithm based on JSON Patch, which defines a series of operations for processing and transforming JSON documents. These operations include but are not limited to the following:

[0179] 1. Add: Add a new element or sub-object under the specified path of the JSON document. For example, {"op":"add","path":" / newKey","value":"newValue"}.

[0180] 2. Remove: Remove the element with the specified path from the JSON document. For example, {"op":"remove","path":" / removeKey"}.

[0181] 3. Replace: Replace the element value of the specified path in the JSON document with a new value. For example, {"op":"replace","path":" / title","value":"new title"}.

[0182] 4. Move: Move an element in a JSON document from one location to another. For example, {"op":"move","from":" / oldPath","path":" / newPath"}.

[0183] 5. Copy: Copy the elements in the JSON document to a new location. For example, {"op":"copy","from":" / oldPath","path":" / newPath"}.

[0184] 6. Test: Test whether the specified path of the JSON document meets the specific conditions. For example, {"op":"test","path":" / path","value":"expectedValue"}.

[0185] These operations can be used independently or in combination to achieve complex document transformation and editing. By defining the transformation rules of these operations, multiple users can edit the same JSON document concurrently while ensuring that the final state of the document is consistent.

[0186] Step 8 (receive the merged results)

[0187] Data synchronization module receives the merged result: The data synchronization module receives the merged result from the OT algorithm module and prepares to broadcast it to all clients.

[0188] Step 9 (Result Broadcast)

[0189] Broadcast the merge results to the WebSocket server: The data synchronization module sends the merge results to all relevant clients through the WebSocket server to ensure that all users' interfaces can be updated synchronously.

[0190] Steps 10 and 11 (Client Update)

[0191] Update client interface:

[0192] Collaborative editing modules A and B: Each receives update information from the WebSocket server and updates its own low-code platform interface.

[0193] This ensures a consistent and real-time user experience, with users seeing changes made by other collaborators immediately.

[0194] Step 106, broadcasting the merged result to all clients via the WebSocket server;

[0195] Step 107, the client receives the broadcast merge results and updates the low-code platform interface.

[0196] Specifically, it also includes the data persistence steps:

[0197] Store the operation information in the database;

[0198] Record operation history;

[0199] Support operation rollback;

[0200] Provides a data recovery mechanism.

[0201] like Figure 4 , shows a conflict resolution system for implementing multi-person collaborative editing based on WebSocket and JSON-PATCH of the present application, the system comprising:

[0202] The operation information acquisition module is used to obtain the user's editing operations on the client side of the low-code platform and convert the editing operations into operation information in JSON format;

[0203] The operation information receiving module is used to receive the operation information in JSON format sent by multiple clients through the WebSocket server;

[0204] The storage module is used to store the received operation information in JSON format in the database according to the user account;

[0205] The conflict detection module is used to detect conflicts between concurrent operations of multiple users based on the operation type defined by JSON-PATCH;

[0206] A merging processing module, used to merge the detected conflicting operations according to a preset priority rule;

[0207] The broadcast module is used to broadcast the merged results to all clients through the WebSocket server;

[0208] The update module is used for the client to receive the broadcast merge results and update the low-code platform interface.

[0209] Optionally, an embodiment of the present application further provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0210] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0211] Figure 5 800 is a block diagram of an electronic device 800 shown in the present application. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0212] Reference Figure 5 , the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .

[0213] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0214] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, images, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0215] The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 800.

[0216] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0217] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0218] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0219] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0220] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast operation information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0221] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0222] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by a processor 820 of an electronic device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0223] Figure 619 is a block diagram of a computer-readable storage medium 1900 shown in the present application. For example, the computer-readable storage medium 1900 may be provided as a server.

[0224] Reference Figure 6 , the computer-readable storage medium 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions, such as an application, that can be executed by the processing component 1922. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.

[0225] The computer readable storage medium 1900 may also include a power supply component 1926 configured to perform power management of the computer readable storage medium 1900, a wired or wireless network interface 1950 configured to connect the computer readable storage medium 1900 to a network, and an input / output (I / O) interface 1958. The computer readable storage medium 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.

[0226] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0227] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0228] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

[0229] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0230] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0231] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0232] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0233] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0234] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.

[0235] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A conflict resolution method for multi-person collaborative editing based on WebSocket and JSON-PATCH, characterized in that: The method comprises: Obtain the user's editing operations on the client side of the low-code platform and convert the editing operations into operation information in JSON format; Receive JSON-formatted operation information sent by multiple clients through the WebSocket server; The received operation information in JSON format is stored in the database according to the user account; Based on the operation type defined by JSON-PATCH, conflict detection is performed on concurrent operations of multiple users; According to the preset priority rules, the detected conflicting operations are merged; Broadcast the merged results to all clients via the WebSocket server; The client receives the broadcast merge results and updates the low-code platform interface.

2. A method for implementing conflict resolution for multi-person collaborative editing based on WebSocket and JSON-PATCH as claimed in claim 1, characterized in that: The operation information in JSON format includes: User identification information, operation timestamp, operation type, operation path, and operation content.

3. The method for implementing a conflict resolution method for multi-person collaborative editing based on WebSocket and JSON-PATCH as claimed in claim 1, characterized in that: The operation types defined by JSON-PATCH include: Add operation, used to add new elements or sub-objects under the specified path; The remove operation is used to remove elements from the specified path; Replace operation, used to replace the element value of the specified path; Move operations, which are used to move elements from one position to another; The copy operation is used to copy elements to a new location; Test operation, used to test whether the specified path meets certain conditions.

4. The method for implementing a conflict resolution method for multi-person collaborative editing based on WebSocket and JSON-PATCH as claimed in claim 1, characterized in that: The preset priority rules include: Priority rules based on user roles and permissions, where administrator operations take precedence over ordinary user operations; Timestamp-based priority rules, where operations that arrive earlier have higher priority; Priority rules based on operation dependencies ensure that dependent operations are executed in the correct order; Priority rules based on the operation type, where the remove operation has the highest priority.

5. The method for implementing a conflict resolution method for multi-person collaborative editing based on WebSocket and JSON-PATCH as claimed in claim 1, characterized in that: The WebSocket server has the following functions: Manage the establishment, maintenance and disconnection of client connections; Provides an automatic connection downgrade mechanism to switch to other compatible transmission methods when WebSocket is unavailable; Supports custom events and room mechanisms to achieve refined message management; Provides a heartbeat detection mechanism to maintain an active connection.

6. The method for implementing a conflict resolution method for multi-person collaborative editing based on WebSocket and JSON-PATCH as claimed in claim 1, characterized in that: The specific steps of the merge process include: Step 501, checking the user roles of conflicting operations, and giving priority to the administrator's operation; Step 502: If the user roles are the same, compare the operation timestamps and use the operation that arrives first; Step 503, if the timestamps are the same, check the operation dependency to ensure that the dependent operation is executed first; Step 504: If the judgment cannot be made through steps 501 to 503, the removal operation is performed first according to the priority of the operation type.

7. The method for implementing a conflict resolution method for multi-person collaborative editing based on WebSocket and JSON-PATCH as claimed in claim 1, characterized in that: It also includes built-in error handling mechanisms through Socket.io; monitoring connection status and handling connection interruptions; handling data transmission errors; Trigger retry or recovery mechanisms; notify clients of error status.

8. The method for conflict resolution based on WebSocket and JSON-PATCH for multi-person collaborative editing as claimed in claim 1, characterized in that: It also includes data persistence steps: Store the operation information in the database; Record operation history; Support operation rollback; Provides a data recovery mechanism.

9. A conflict resolution system for multi-person collaborative editing based on WebSocket and JSON-PATCH, characterized in that: The system comprises: The operation information acquisition module is used to obtain the user's editing operations on the client side of the low-code platform and convert the editing operations into operation information in JSON format; The operation information receiving module is used to receive the operation information in JSON format sent by multiple clients through the WebSocket server; The storage module is used to store the received operation information in JSON format in the database according to the user account; The conflict detection module is used to detect conflicts between concurrent operations of multiple users based on the operation type defined by JSON-PATCH; A merging processing module, used to merge the detected conflicting operations according to a preset priority rule; The broadcast module is used to broadcast the merged results to all clients through the WebSocket server; The update module is used for the client to receive the broadcast merge results and update the low-code platform interface.

10. A conflict resolution system for implementing multi-person collaborative editing based on WebSocket and JSON-PATCH as claimed in claim 9, characterized in that: The clients of the low-code platform include: Graphical user interface for visual development; A collaborative editing module for obtaining user editing operations; Data conversion module for converting edit operations into JSON format; A display module used to receive broadcast results and update the interface.

Citation Information

Cited By

  • Online document processing method and system based on document processing model

    CN120337879A

  • Cross-platform visualization system, method, device, medium and program product

    CN120491951A

  • Cross-platform visualization system, method, device, medium and program product

    CN120491951B

  • Synchronous updating method, system and equipment for low-code component and storage medium

    CN120950104A

  • Synchronous update methods, systems, devices, and storage media for low-code components

    CN120950104B