Method and device for collaboratively editing model, user terminal and storage medium

The CRDT-based method and device allow multiple users to collaboratively edit complex virtual models online efficiently and stably, reducing server load and supporting offline editing, by processing data locally and caching operations.

CN119205047APending Publication Date: 2024-12-27CONTEMPORARY AMPEREX FUTURE ENERGY RES INST (SHANGHAI) LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310772918.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-27
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

Existing computer systems cannot support multiple users in collaboratively editing the same complex virtual multidimensional model online without causing conflicts and degrading performance.

Method used

A method and device that enable local user terminals to process collaborative editing data using conflict-free replicated data type (CRDT) algorithms, allowing users to edit multidimensional models independently and efficiently, without the need for a central server, and supporting offline editing through data caching and CRDT conflict resolution.

Benefits of technology

Enables smooth and stable collaborative editing of multidimensional models by multiple users online, reducing server load and improving user experience by eliminating the need for central processing and supporting offline operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119205047A_ABST
    Figure CN119205047A_ABST
Patent Text Reader

Abstract

The invention provides a collaborative model editing method and device, a user terminal and a storage medium, and is suitable for the technical field of computer communication, the method comprises the following steps: a local user terminal obtains collaborative operation data generated by other user terminals, the local user terminal and the other user terminals are user terminals accessing a service node, and the collaborative operation data is generated by the local user terminal; the collaborative operation data represents data used for editing a multi-dimensional model of the service node; the collaborative operation data is processed according to a preset processing mode, target editing data is obtained, the target editing data is used for editing the multi-dimensional model, and then multiple users can collaboratively edit the same multi-dimensional model online.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer communication technology, and in particular, relates to a method, device, user terminal and storage medium for collaborative editing of a model. Background Art

[0002] In the application of the construction process of large-scale virtual multi-dimensional model scenes, the traditional modeling method is that modeling engineers use 3DMax, Blender and other modeling tools for offline modeling work, and the modeling division of labor in the virtual model needs to synchronize the work progress in real time to avoid modeling work conflicts;

[0003] Since multidimensional virtual models such as three-dimensional models often have very complex model data structures, computer devices cannot support different users to collaboratively edit the same target virtual model online; how to enable multiple users to collaboratively edit the same multidimensional virtual model scene online and ensure the normal and smooth operation of computer devices is a technical problem to be solved. Summary of the invention

[0004] The embodiments of the present application provide a method, device, user terminal and storage medium for collaboratively editing a model, which can solve the technical problem that current computer equipment cannot support different users to perform collaborative editing operations on the same target multi-dimensional virtual model online; wherein the related equipment includes a device for collaboratively editing a model, a user terminal, a server and a computer-readable storage medium.

[0005] In a first aspect, an embodiment of the present application provides a method for collaboratively editing a model, which is applied to a user terminal, and the method includes:

[0006] The local user terminal acquires collaborative operation data generated by other user terminals, the local user terminal and the other user terminals are both user terminals accessing the service node, and the collaborative operation data represents data used to edit the multidimensional model of the service node;

[0007] The collaborative operation data is processed according to a preset processing method to obtain target editing data, and the target editing data is used to edit the multi-dimensional model.

[0008] In the embodiment of the present application, multiple users can collaboratively edit the same virtual model scene online, and there is no need for a central server to handle the collaborative editing operations, so the user's operating experience will be smoother and more stable.

[0009] In some embodiments, the data format of the collaborative operation data is a target format;

[0010] Before the local user terminal obtains the collaborative operation data generated by other user terminals, the method further includes:

[0011] Acquire local operation data, where the local operation data represents data used to edit the multidimensional model of the service node, and the data format of the local operation data is a target format;

[0012] Before the collaborative operation data is processed in a preset processing manner to obtain target editing data, the method further includes:

[0013] Generate target operation data based on the local operation data and the collaborative operation data, wherein the target operation data represents data for editing the multidimensional model, and the format of the target operation data is the target format;

[0014] The step of processing the collaborative operation data in a preset processing manner to obtain target editing data includes:

[0015] The target operation data is processed according to a preset processing method to obtain target editing data.

[0016] In an embodiment of the present application, the local user terminal will merge the local operation data and the collaborative operation data of the same format according to a preset processing method to obtain target operation data, and then process the target operation data according to the preset processing method to obtain target editing data. Finally, the local user terminal edits the multidimensional model through the target editing data to complete the collaborative editing of the multidimensional model. There is no need for the central server to process the collaborative editing operation, and the user's operating experience will be smoother and more stable.

[0017] In some embodiments, the obtaining of local operation data includes:

[0018] In response to a local editing operation on the multidimensional model of the service node, obtaining local editing data;

[0019] Performing a first process on the local edit data to obtain local operation data having a data structure in the target format;

[0020] The step of processing the target operation data in a preset processing manner to obtain target editing data includes:

[0021] The target operation data is then subjected to a second processing to obtain target editing data.

[0022] In the embodiment of the present application, the local user terminal processes the user's local editing data and encodes it into local operation data in a target format; this helps to improve network transmission efficiency and reduce freezes in the user terminal.

[0023] In some embodiments, the first processing of the local edited data to obtain the local operation data having a data structure in the target format includes:

[0024] extracting a first key edit field from the local edit data;

[0025] Converting the first key edit field into local operation data having a data structure in a target format;

[0026] The target editing data is then subjected to a second processing to obtain the target editing data, comprising:

[0027] converting the target edit data into a second key edit field;

[0028] Target edit data is generated based on the second key edit field.

[0029] or

[0030] The first processing of the local edited data to obtain local operation data having a data structure in the target format includes:

[0031] Compressing the local edited data to obtain local operation data having a data structure in a target format;

[0032] The target editing data is then subjected to a second processing to obtain the target editing data, comprising:

[0033] The target editing data is decompressed, and the target editing data is determined based on the decompressed data.

[0034] In an embodiment of the present application, the complex data of the multidimensional model is compressed and converted to a certain extent, so that when the local user terminal receives the user's editing operation on the multidimensional model, it can quickly locate the target editing area corresponding to the user's editing operation, which helps to improve the processing speed.

[0035] In some embodiments, after the local editing data is obtained in response to the local editing operation on the multi-dimensional model of the service node, the method further includes:

[0036] Storing the local edited data in a preset area;

[0037] Detect local communication status;

[0038] If the local communication state is an offline state, the local edited data is cached; if the local communication state is restored from an offline state to an online state at the kth time, the local edited data is obtained from the preset area, and the local edited data is first processed to obtain local operation data with a data structure in a target format; wherein the kth time is an arbitrary time;

[0039] The obtaining of collaborative operation data generated by other user terminals includes:

[0040] At the kth moment, collaborative operation data generated by other user terminals in the target format is obtained.

[0041] In the embodiment of the present application, while satisfying the requirement that multiple different users can collaboratively edit the same virtual model online, it can also support user offline editing operations without the need for the server to perform related offline editing calculations, thereby reducing the server's generation of a large number of operation nodes to be calculated, saving time in conflict calculations, and improving user experience.

[0042] In some embodiments, the method further comprises:

[0043] After the user terminal accesses the service node, a long connection is established between the user terminal and the service node, the long connection is used to keep the local user terminal sending data in the target format to the service node, and the long connection is also used to broadcast the data in the target format to other user terminals.

[0044] In an embodiment of the present application, a long connection is established between the service node and the user terminal, and the response between the ends is maintained, so that the user terminal can actively report the data in the target format to the service node, and the service node can also broadcast the data in the target format reported by different user terminals within the service node network.

[0045] In some embodiments, the local user terminal obtains the collaborative operation data generated by other user terminals, including:

[0046] The local user terminal determines a target editing area corresponding to the local operation data;

[0047] Respectively obtaining the operation data to be compared in the target format generated by other user terminals;

[0048] Compare the editing areas corresponding to the operation data to be compared with the target editing area respectively, and use the same operation data to be compared between the editing area and the target editing area as the collaborative operation data;

[0049] The generating target operation data based on the local operation data and the collaborative operation data comprises:

[0050] The local operation data and the collaborative operation data are conflict-merged to generate target operation data.

[0051] In an embodiment of the present application, the local user terminal analyzes the operation data to be compared generated by other user terminals. When the local user terminal and other user terminals are performing editing operations on the same editing area of ​​the same multidimensional model, the local user terminal can accurately and autonomously find other user terminals with which the local editing operations have a collaborative operation conflict.

[0052] In a second aspect, the present application also proposes a device for collaboratively editing a model, comprising:

[0053] an acquisition unit, configured to acquire collaborative operation data generated by other user terminals, the local user terminal and the other user terminals being user terminals accessing the service node, the collaborative operation data representing data used to edit the multidimensional model of the service node;

[0054] A processing unit is used to process the collaborative operation data according to a preset processing method to obtain target editing data, and the target editing data is used to edit the multidimensional model.

[0055] In a third aspect, the present application further proposes a user terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the first aspect above when executing the computer program.

[0056] In a fourth aspect, the present application further proposes a storage medium, which is a computer-readable storage medium, and the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect above is implemented.

[0057] It can be understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant description of the beneficial effects of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0059] Figure 1 A flowchart of an embodiment of a method for collaboratively editing a model provided by the present application;

[0060] Figure 2 A flowchart of another embodiment of a method for collaboratively editing a model provided by the present application;

[0061] Figure 3 A flowchart of another embodiment of a method for collaboratively editing a model provided by the present application;

[0062] Figure 4 A flowchart of another embodiment of a method for collaboratively editing a model provided by the present application;

[0063] Figure 5 A schematic diagram of the structure of an embodiment of a computer device for collaborative editing of a model provided by the present application;

[0064] Figure 6 It is a structural block diagram of a device for collaborative editing model provided by this application. DETAILED DESCRIPTION

[0065] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" in the specification and claims of this application and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions.

[0066] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0067] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0068] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0069] In the description of the embodiments of the present application, the term "plurality" refers to more than two (including two), unless otherwise clearly and specifically defined.

[0070] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0071] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0072] The inventor of this application noticed that compared with the traditional solution of multiple users editing the same text online, since the virtual multidimensional model has a more complex model data structure, computer equipment cannot support different users to perform collaborative editing operations on the same target multidimensional model online. Currently, it is not possible to achieve fast and efficient online collaborative editing of multidimensional models by multiple different users.

[0073] Based on the above considerations, in order to enable multiple users to collaboratively edit the same multidimensional model scene online, the inventors, after in-depth research, proposed a method, device, user terminal, server, and computer-readable storage medium for collaborative editing of models, which completes the collaborative editing of multidimensional models through local terminals, enabling multiple users to quickly and efficiently collaboratively edit the same multidimensional model scene online.

[0074] Specifically, under the premise that the local user terminal and other user terminals are access service nodes, such as Figure 1 As shown, the collaborative editing model method mainly includes the following steps:

[0075] Step S11, the local user terminal obtains the collaborative operation data generated by other user terminals;

[0076] Step S12: the local user terminal processes the collaborative operation data according to a preset processing method to obtain target editing data, and edits the multidimensional model using the target editing data.

[0077] In a specific application, the multidimensional model to be edited will be stored in a service node, which may be a cloud server or a service node under a cloud server. The service node may also be a service node under a blockchain system. Of course, the service node may also be a service node in an internal local area network. This embodiment is described by taking a service node under a cloud server as an example:

[0078] It is understandable that the user terminal accessing the service node is equivalent to the user entering a room for online editing of the virtual model. Each user can edit the multidimensional model online through his or her own local user terminal. After editing, the local user terminal will autonomously transmit the local operation data related to the local editing model to the service node. The service node will broadcast the local operation data reported by each user terminal. The local user terminal will find the collaborative operation data from the data broadcast by the service node. After that, the local user terminal will process the collaborative operation data according to a preset processing method to obtain the target editing data. Finally, the local user terminal edits the multidimensional model through the target editing data to complete the collaborative editing of the multidimensional model. There is no need for the central server to process the collaborative editing operation, and the user's operation experience will be smoother and more stable.

[0079] In one embodiment, the data format of the collaborative operation data is a target format;

[0080] Accordingly, if Figure 2 As shown, before step S11, the method further includes

[0081] Step S10, acquiring local operation data, wherein the local operation data represents data used to edit the multidimensional model of the service node, and the data format of the local operation data is a target format;

[0082] Specifically, the target format may be a CRDT (Conflict-free Replicated Data Type) format.

[0083] Accordingly, before step S12, the following steps are included:

[0084] Step S111 : generating target operation data based on the local operation data and the collaborative operation data, wherein the target operation data represents data for editing the multidimensional model, and the format of the target operation data is the target format.

[0085] Accordingly, the step S12 includes:

[0086] Step S121, processing the target operation data according to a preset processing method to obtain target editing data.

[0087] It is understandable that the local operation data and the collaborative operation data are essentially the same and both belong to the conflict-free replicated data type format data. The present application adopts an algorithm related to the conflict-free replicated data type, which can eliminate the need for the server to centrally handle collaborative editing operation conflicts.

[0088] Further, in one embodiment, if Figure 3 As shown, the step S10 further includes:

[0089] Step S101: Responding to a local editing operation on the multidimensional model of the service node, obtaining local editing data;

[0090] It should be noted that the data structure of the local editing data is a multi-dimensional model structure, and the multi-dimensional model includes a two-dimensional model, a three-dimensional model, a four-dimensional model, a five-dimensional model, etc. In this embodiment, a three-dimensional (3D) model is used as an example of the multi-dimensional model for illustration, and for example, the three-dimensional model structure may include 3DMax or Blender.

[0091] The execution subject of each step of the method of this embodiment is a local user terminal. The local user terminal responds to the user's editing operation on the three-dimensional model and obtains local editing data corresponding to the editing operation.

[0092] Step S102: performing a first process on the local edit data to obtain local operation data having a data structure in the target format;

[0093] In a specific implementation, the first processing is: converting the local edit data into local operation data having a data structure of a conflict-free replication data type;

[0094] For example, the local user terminal converts the local editing data from the original 3D model into local operation data of the CRDT conflict-free replication data type (equivalent to encoding the 3D model), so that the local terminal user can call the CRDT algorithm to execute the step S111 to merge the local operation data and the collaborative operation data for conflict processing to generate target operation data; this embodiment adopts an algorithm related to the conflict-free replication data type, which does not require the server to centrally process the collaborative editing operation conflicts, and the user terminal can process the collaborative editing operations by itself; therefore, this application converts the user's local editing data into local operation data that can be applied to the CRDT algorithm, which helps to realize a solution in which multiple users can collaboratively edit the same virtual multi-dimensional model scene online, thereby improving the processing speed of the system.

[0095] In the specific implementation, a data model encoder and a data model decoder are pre-built, and the local user terminal calls the data model encoder to encode the local edited data, thereby obtaining local operation data with a data structure of a conflict-free replicated data type (CRDT).

[0096] In step S11, the local user terminal obtains collaborative operation data generated by other user terminals;

[0097] In a specific application, the local operation data is sent to a service node, and the service node is used to save the local operation data to a shared data set, wherein the shared data set includes local operation data sent by multiple different user terminals;

[0098] The local terminal obtains collaborative operation data matching the local operation data from the shared data set. In one embodiment, step S11 specifically includes the following steps: the local user terminal determines the target editing area corresponding to the local operation data; obtains the operation data to be compared in the target format generated by other user terminals; compares the editing areas corresponding to each operation data to be compared with the target editing area, and uses the same operation data to be compared as collaborative operation data. When the local user terminal and other user terminals are editing the same editing area of ​​the same multidimensional model, the local terminal will automatically determine the corresponding collaborative operation data.

[0099] It can be understood that the service node involved in this embodiment is used to store the local operation data (CRDT format) uploaded by each user terminal into a shared data set. The shared data set can be regarded as a global variable. The service node will broadcast the shared data set to facilitate different user terminals to access the shared data set. The local user terminal will match its own local operation data (CRDT format) with the (to be compared) operation data (CRDT format) uploaded by other user terminals in the shared data set. If the match is successful, it means that there is an operation conflict relationship between the two. The local operation data (CRDT format) that has an operation conflict relationship with the local operation data (CRDT format) is regarded as collaborative operation data, indicating that the editing operations of the two users are to edit the same target editing area of ​​the three-dimensional model.

[0100] Step S111: generating target operation data based on the local operation data and the collaborative operation data.

[0101] Specifically, the local user terminal will call the CRDT algorithm to merge the two data structures in CRDT format, and finally obtain the target operation data in CRDT format;

[0102] Accordingly, the step S121 includes:

[0103] Step S121': performing a second processing on the target operation data to obtain target editing data. Finally, the local user terminal loads the target editing data to edit the multi-dimensional model.

[0104] It is understandable that the target operation data obtained through the above step S111 cannot directly edit the multidimensional model. The local user terminal needs to call the data model decoder to decode the target editing data, and then convert the target editing data from the CRDT format to the multidimensional model structure, and then obtain the target editing data, load the target editing data to re-edit and render the multidimensional model. In this way, multiple users can collaboratively edit the same virtual multidimensional model scene online, and there is no need for the central server to handle the collaborative editing operation, and the user's operating experience will be smoother and more stable.

[0105] In one embodiment, after the user terminal accesses the service node, a long connection is established between the user terminal and the service node, the long connection is used to keep the local user terminal sending data in the target format to the service node, and the long connection is also used to broadcast the data in the target format to other user terminals.

[0106] In a specific implementation, the long connection can be WebSocket (a full-duplex communication protocol based on TCP). For example, when a local user terminal is connected to a 3D model editing room (service node), after several handshakes are performed to determine that the communication between the two devices is normal, a long connection is established between the service node and the local user terminal, and the response between the ends is maintained. In this way, the user terminal can actively report CRDT format data (local operation data) to the service node, and the service node can also broadcast CRDT format data (collaborative operation data) reported by different user terminals within the service node network.

[0107] Further, in one embodiment, in order to further solve the technical problem that the collaborative editing model solution does not support offline editing, please refer to Figure 4 , Figure 4 This is a flow chart of another embodiment of the method for collaborative editing of a model according to the present invention. Figure 3 The methods involved are applied to specific scenarios to solve the problem that the collaborative editing model solution does not support offline editing;

[0108] It is understandable that the current mainstream construction methods of multi-dimensional model scenarios are as follows:

[0109] Construction method 1: Modeling through the modeling capabilities provided by modeling software such as 3DMax, Blender and other tools;

[0110] Construction method 2: Use multi-dimensional scene construction tools such as Unity3D to place devices or build scenes by dragging models;

[0111] Both of the above scenarios require offline editing, which requires continuous synchronization of work progress during multi-person collaboration to avoid work conflicts. The mainstream trend of online editing is more mature in the field of rich text editors. However, it is difficult to avoid conflicts when multiple people are editing virtual models online at the same time. For example, if user A and user B are arranging a room at the same time, it is easy to cause conflicts when user A and user B are placing devices in the room at the same time.

[0112] For conventional solutions, since the OT algorithm and ShareDB solution require a centralized server to handle OT conflicts, they are not friendly to offline editing support. However, this application uses the CRDT algorithm, which does not require a central server to handle collaborative editing operations, and supports local user terminals for offline editing. Users can use local user terminals to call modeling software such as 3DMax, Blender, etc. to provide modeling capabilities for modeling, or call three-dimensional scene building tools such as Unity3D to drag and drop models to place devices or build scenes.

[0113] In this embodiment, after step S101, the following steps are further included:

[0114] Step S012, storing the local edited data into a preset area;

[0115] In a specific application, this embodiment uses a double-ended linked list as the preset area as an example for explanation. A double-ended linked list structure is pre-established in the computer program loaded in the local terminal. After each new node editing operation in the three-dimensional scene, a piece of local editing data is automatically generated, and the local editing data is stored in the double-ended linked list, and the step length agreement is set. The user's Redo / Undo operation will insert and remove the local editing data in the double-ended linked list, which is convenient for subsequent processing operations.

[0116] Step S013, detect the local communication status; WebSocket can be used to establish a long connection between the local user terminal and the server, and detect the network connection status in real time;

[0117] If the local communication state is online, the step S102 (the step of performing a first process on the local edited data to obtain local operation data having a data structure in a target format) is performed normally;

[0118] otherwise,

[0119] Execute step S014: cache the local edited data;

[0120] In a specific implementation, the local edited data in the double-ended linked list may be converted into string data for caching;

[0121] Execute step S015: if the local communication state is restored from the offline state to the online state at the kth time, obtain the local editing data from the preset area, and execute the step 102 normally;

[0122] In a specific implementation, if the local communication state is restored from an offline state to an online state at the kth moment, the string data in the double-ended linked list is restored to the local edited data, and the step of performing the first processing on the local edited data to obtain the local operation data having a data structure in a target format is performed normally;

[0123] In specific applications, the WebSocket connection status detection can be used to determine whether the local communication status of the local user terminal is online or offline, and the connection status is monitored for events. The local editing data can be converted into local operation data of the CRDT format type through the data model decoder (mentioned in the above embodiment), and the local editing data can be bound to the global double-ended linked list structure. For example, when a user uses a browser to edit a three-dimensional model online, and the user's local user terminal is offline, the local editing data in the double-ended linked list can be converted into string data, and then the string data in the double-ended linked list is stored in the browser cache; when the user re-establishes the network connection relationship, the string data in the cache is restored to the local editing data, and the local editing data is converted into local local operation data for CRDT conflict calculation. At the same time, when reconnecting to the server, the local operation data is sent to the service node so that the service node temporarily stores the local operation data generated after the local user terminal is reconnected to the shared data set.

[0124] Accordingly, the step S04 further comprises:

[0125] Step S041: acquiring collaborative operation data matching the local operation data from the shared data set at the kth moment, wherein the collaborative operation data is local operation data having an operation conflict relationship with the local operation data at the kth moment.

[0126] It is understandable that after the user re-establishes the network connection relationship, the latest scene data of the server's three-dimensional scene is obtained (that is, the shared data set includes local operation data sent by multiple different user terminals), and the local operation data is subjected to CRDT conflict calculation with the latest scene data of the server's three-dimensional scene, and the data model decoder is called to decode the target operation data to obtain local editing data whose data structure is a three-dimensional model structure.

[0127] While satisfying the requirement that multiple different users can collaboratively edit the same virtual model online, this embodiment can also support user offline editing operations without the need for the server to perform related offline editing calculations, thereby reducing the large number of operation nodes to be calculated generated by the server, saving time for conflict calculations, and improving user experience.

[0128] In some embodiments, since the data structure of a multidimensional model is more complex than that of a conventional text or document, data compression and data conversion are required; for example, three-dimensional model data includes at least model coordinate data and model texture data, and the data volume is very large.

[0129] Accordingly, the step S101 responds to the local editing operation on the multi-dimensional model of the service node to obtain local editing data, further comprising:

[0130] Step S011: monitoring each key-value pair data in the multidimensional model, wherein the key of the key-value pair data represents the editing area of ​​the multidimensional model, and the value of the key-value pair data represents the local editing data of the editing area;

[0131] Step S012: If it is monitored that the value of the target key-value pair data changes, it is determined that an editing operation exists in the target editing area corresponding to the target key-value pair data, and the local editing data corresponding to the target editing area is obtained.

[0132] It is understandable that, since the data structure of a multidimensional model is more complex than that of a general text or document, data compression and data conversion are required. In some embodiments, taking a three-dimensional model as an example, to implement a solution in which multiple users can collaboratively edit the same virtual model scene online, the step S102 (performing a first processing on the local edit data to obtain local operation data having a data structure in a target format) further includes:

[0133] Extracting a first key edit field from the local edit data, converting the first key edit field into local operation data with a data structure in a target format; or compressing the local edit data to obtain local operation data with a data structure in a target format;

[0134] The step S121' (performing a second process on the target editing data to obtain the target editing data) comprises:

[0135] The target editing data is converted into a second key editing field, and the target editing data is generated based on the second key editing field; or the target editing data is decompressed, and the target editing data is determined based on the decompressed data.

[0136] In a specific implementation, the first process may include:

[0137] Sub-step A1: Initialize the Web-side 3D renderer, which is not limited to WebGL or WebGPU and related Web3D frameworks. It is necessary to initialize the basic scene Scene, light Light, camera Camera, mesh model Mesh, etc. to assist in implementing the technical solution of this application and verify the effect of the technical solution of this application.

[0138] Sub-step A2: Abstract the data structure of the multi-dimensional model into data fields and establish a scene tree index set, which may include the following fields:

[0139] (1) The single-node data of the 3D scene is abstracted and named in the form of key-value pairs. The single-node data needs to include the following fields (the key name is not limited to the following naming method):

[0140] ID: represents the unique identifier of the current 3D node. It uses RFC4122 to define UUID. You can add, delete, modify, and query based on the ID.

[0141] modelURL: indicates the 3D model path corresponding to the current concept 3D node. This field can be used to quickly synchronize the newly added 3D model node.

[0142] parent: represents the parent node ID of the current 3D node. A null value means that the current object has no parent node in the scene.

[0143] childrenMap: represents the child node ID set of the current 3D node. A null value means that the current object has no child nodes in the scene.

[0144] expand: indicates an expandable field, and any other data fields can be added according to the actual application scenario. (2) Create a scene tree structure based on the data declaration format in the previous step (1) to arrange the attribution or dependency relationship of the three-dimensional scene.

[0145] Sub-step A3: abstracting the local editing data in the multidimensional model may include the following specific implementations:

[0146] The process of building a multidimensional model requires editing of single model nodes (hereinafter referred to as nodes or editing areas). Common modeling operations include node position, rotation, scaling, color, adding / deleting, etc. The operation data model needs to ensure that only the user's editing behavior type, edited node ID, editing results, etc. are recorded. The fields are designed as follows:

[0147] targetID: The object currently being edited. You can query nodes based on the target ID.

[0148] type: the editing operation category of the current node, such as setting the position, etc.

[0149] currentValue: the value before the edit operation, used for conflict comparison and operation rollback information recording;

[0150] modifyValue: edits the modified value, which is used for conflict calculation to produce the final result and rollback the editing operation;

[0151] timeStamp: the timestamp of the current user's editing operation;

[0152] expand: expandable fields, you can add any fields according to the actual application scenario;

[0153] Sub-step A4: Setting up an event monitoring mechanism to monitor operation changes occurring on any node where the UUID is located;

[0154] Through the above sub-steps A2 and A3: the complex data of the multidimensional model can be compressed and converted to a certain extent, so that when the local user terminal receives the user's local editing operation on the multidimensional model, it can execute the above steps S011 and S012 through the event monitoring mechanism, and then quickly locate the target editing area for the user's editing operation, which helps to improve the processing speed.

[0155] Further, in some embodiments, since the current algorithms related to the conflict-free replicated data type do not support corresponding processing of data of a multidimensional model structure, in order to solve the technical problem that the current algorithms related to the conflict-free replicated data type do not support processing of data of a multidimensional model structure, before executing the step S101, the present embodiment may perform the following processing in the relevant computer programs loaded in the local terminal and the service node in advance, including: establishing a global conflict instance based on the data structure of the conflict-free replicated data type; establishing a preset parsing relationship between the editing area of ​​the multidimensional model and the global conflict instance;

[0156] In specific applications, the real-time collaboration library corresponding to the conflict-free replicated data type can be called to create a global conflict instance for the user terminal; and a preset parsing relationship between the global conflict instance and each editing area of ​​the multidimensional model needs to be established. For example, a mapping relationship between the global conflict instance and the editing area of ​​the multidimensional model can be established based on the UUID in the scene tree index set in the aforementioned embodiment.

[0157] Accordingly, in the process of executing step S101, the operation changes of the editing area corresponding to any UUID are monitored by the set event monitoring mechanism, and the local editing data in step S101 is obtained;

[0158] Accordingly, after executing step S102, the method further includes:

[0159] The local operation data is sent to the global conflict instance, so that the local operation data is accompanied by the editing area identity and the user terminal identity; in this way, the user terminal only needs to send the CRDT operation data of the local user editing the multidimensional model to the global conflict instance through a long connection each time, so that the service node only needs to access the global conflict instance corresponding to the user terminal to know which editing areas the user has operated on, and broadcast the CRDT operation data of the user terminal; instead of sending a large amount of editing operation data directly to the service node when the user edits the multidimensional model as in conventional technology, resulting in a waste of network resource traffic;

[0160] It is understandable that when different users operate and edit the same virtual model, although the editing area is the same, their respective editing operations are different. The computer system cannot directly compare the operation data in the two global conflict instances, and cannot determine whether the two global conflict instances are operations in the same editing area. Therefore, it is necessary to transform the two global conflict instances separately, and obtain the editing areas corresponding to the respective global conflict instances through the preset parsing relationship. If the final editing areas are the same, the data in the current CRDT format in the two global conflict instances match each other.

[0161] In this embodiment, by analyzing the global conflict instances of user terminals layer by layer, the target editing area representing the multidimensional model structure can be obtained, and the local user terminal can then accurately and autonomously find the collaborative operation data of other user terminals that have a collaborative operation conflict relationship with the local editing operation.

[0162] In specific applications, still taking the three-dimensional model as an example, the corresponding target key-value pair data can be determined based on the target editing area, and the corresponding key ID of the target key-value pair data can be obtained. The actual three-dimensional model node can be obtained according to this ID, and the Web3DAPI interface can be called according to the model address of the node. By obtaining the node where this ID is located, loading the node model address, and processing the edit value of the node, the local global conflict instance can be bridged to the Web3D scene. In this way, multiple users can see the construction progress of the multi-dimensional scene and the working status of different users in real time on the browser side, and the efficiency of building the multi-dimensional scene can be improved by solving the problem of collaborative modeling conflicts.

[0163] Further, in one embodiment, if Figure 6 As shown, the present invention also provides a device for collaboratively editing a model, comprising:

[0164] The acquisition unit 10 is used to acquire the collaborative operation data generated by other user terminals, the local user terminal and the other user terminals are user terminals accessing the service node, and the collaborative operation data represents data used to edit the multidimensional model of the service node;

[0165] The processing unit 20 is used to process the collaborative operation data according to a preset processing method to obtain target editing data, and the target editing data is used to edit the multi-dimensional model.

[0166] It should be noted that the collaborative editing model device can be understood as a virtual device that can be loaded into the user terminal of the aforementioned embodiment. The user terminal calls the collaborative editing model device through a processor, and then runs the specific implementation scheme in the above collaborative editing model method embodiment;

[0167] In a specific application, the device of the collaborative editing model includes a data model encoder and a data model decoder, the local editing data is encoded by the data model encoder, and finally the target operation data is decoded by the data model decoder. The information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of this application, and their specific functions and technical effects can be specifically referred to in the method embodiment part.

[0168] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0169] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0170] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0171] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0172] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A method for collaboratively editing a model, characterized in that: Applied to a user terminal, the method comprises: The local user terminal acquires collaborative operation data generated by other user terminals, the local user terminal and the other user terminals are both user terminals accessing the service node, and the collaborative operation data represents data used to edit the multidimensional model of the service node; The collaborative operation data is processed according to a preset processing method to obtain target editing data, and the target editing data is used to edit the multi-dimensional model.

2. The method according to claim 1, characterized in that The data format of the collaborative operation data is a target format; Before the local user terminal obtains the collaborative operation data generated by other user terminals, the method further includes: Acquire local operation data, where the local operation data represents data used to edit the multidimensional model of the service node, and the data format of the local operation data is a target format; Before the collaborative operation data is processed in a preset processing manner to obtain target editing data, the method further includes: Generate target operation data based on the local operation data and the collaborative operation data, wherein the target operation data represents data for editing the multidimensional model, and the format of the target operation data is the target format; The step of processing the collaborative operation data in a preset processing manner to obtain target editing data includes: The target operation data is processed according to a preset processing method to obtain target editing data.

3. The method according to claim 2, characterized in that The obtaining of local operation data includes: In response to a local editing operation on the multidimensional model of the service node, obtaining local editing data; Performing a first process on the local edit data to obtain local operation data having a data structure in the target format; The step of processing the target operation data in a preset processing manner to obtain target editing data includes: The target operation data is then subjected to a second processing to obtain target editing data.

4. The method according to claim 3, characterized in that The first processing of the local edited data to obtain local operation data having a data structure in the target format includes: extracting a first key edit field from the local edit data; Converting the first key edit field into local operation data having a data structure in a target format; The target editing data is then subjected to a second processing to obtain the target editing data, comprising: converting the target edit data into a second key edit field; Target edit data is generated based on the second key edit field.

5. The method according to claim 3, characterized in that The first processing of the local edited data to obtain local operation data having a data structure in the target format includes: Compressing the local edited data to obtain local operation data with a data structure in a target format; The target editing data is then subjected to a second processing to obtain the target editing data, comprising: The target editing data is decompressed, and the target editing data is determined based on the decompressed data.

6. The method according to claims 3-5, characterized in that: After the local edit data is obtained in response to the local edit operation on the multi-dimensional model of the service node, the method further includes: Storing the local edited data in a preset area; Detect local communication status; If the local communication state is an offline state, the local edited data is cached; if the local communication state is restored from an offline state to an online state at the kth time, the local edited data is obtained from the preset area, and the local edited data is first processed to obtain local operation data with a data structure in a target format; wherein the kth time is an arbitrary time; The obtaining of collaborative operation data generated by other user terminals includes: At the kth moment, collaborative operation data generated by other user terminals in the target format is obtained.

7. The method according to claim 6, characterized in that After the local communication status is detected, the method further includes: If the local communication state is an online state, the step of performing a first processing on the local edited data to obtain local operation data having a data structure in the target format is executed.

8. The method according to any one of claims 2 to 5, characterized in that: The method further comprises: After the user terminal accesses the service node, a long connection is established between the user terminal and the service node, the long connection is used to keep the local user terminal sending data in the target format to the service node, and the long connection is also used to broadcast the data in the target format to other user terminals.

9. The method according to any one of claims 2 to 5, characterized in that: The local user terminal obtains the collaborative operation data generated by other user terminals, including: The local user terminal determines a target editing area corresponding to the local operation data; Respectively obtaining the operation data to be compared in the target format generated by other user terminals; Compare the editing areas corresponding to the operation data to be compared with the target editing area respectively, and use the same operation data to be compared between the editing area and the target editing area as the collaborative operation data; The generating target operation data based on the local operation data and the collaborative operation data comprises: The local operation data and the collaborative operation data are conflict-merged to generate target operation data.

10. A device for collaboratively editing a model, characterized in that: include: an acquisition unit, configured to acquire collaborative operation data generated by other user terminals, the local user terminal and the other user terminals being user terminals accessing the service node, the collaborative operation data representing data used to edit the multidimensional model of the service node; A processing unit is used to process the collaborative operation data according to a preset processing method to obtain target editing data, and the target editing data is used to edit the multidimensional model.

11. A user terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 9 is implemented.

12. A storage medium, wherein the storage medium is a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.

Citation Information

Cited By

  • OFD document modification system and method oriented to cloud collaboration, computer equipment and computer readable storage medium

    CN120430286A