Collaborative modeling method, device, electronic device and medium

By obtaining and managing the state of directed acyclic graphs in multi-player collaborative modeling, real-time synchronization of the model is achieved, task repetition and synchronization problems during multi-player editing are solved, and user experience and resource utilization efficiency are improved.

CN113051062BActive Publication Date: 2025-01-14INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110427487.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-20
Publication Date
2025-01-14
Estimated Expiration
2041-04-20

AI Technical Summary

Technical Problem

During the multi-person collaborative modeling process, when multiple people edit the same directed acyclic graph online at the same time, untimely communication may lead to repeated execution of modeling tasks and overwriting of models, wasting resources and reducing user experience.

Method used

By obtaining the state of directed acyclic graph, the database model is updated in response to user instructions in the edit mode in the locked state, and the model update information is pushed to the read-only mode users based on the communication connection, real-time synchronization is achieved to ensure that the locked state of the model is in the appropriate position. Automatically unlocked under conditions.

Benefits of technology

Real-time synchronization of the model is realized, avoiding the problem of repeated tasks being executed and the model not being synchronized in time, and improving the user experience and resource utilization efficiency of the modeling process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113051062B_ABST
    Figure CN113051062B_ABST
Patent Text Reader

Abstract

The present disclosure provides a collaborative modeling method, including: obtaining the state of a directed acyclic graph; when the state of the directed acyclic graph is a locked state, in response to a model editing instruction of a first user in an editing mode, updating the model in a database; pushing model update information to a second user in a read-only mode based on a communication connection, wherein the model update information includes the state of the updated model; and in response to an unlocking instruction of the first user, setting the state of the directed acyclic graph to an unlocked state, and ending the modeling process of the first user. In addition, the present disclosure also provides a collaborative modeling device, an electronic device, a computer-readable storage medium, and a computer program product. The collaborative modeling method and device provided by the present disclosure can be used in the field of computer technology, finance, or other fields.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and more specifically, to a collaborative modeling method, a collaborative modeling device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art

[0002] For the same business needs, it is often necessary for multiple people to collaborate on modeling, and collaborative modeling by multiple people will inevitably lead to multiple people editing the same directed acyclic graph (DAG) online at the same time. Due to untimely communication, problems such as repeated execution of modeling tasks and model overwriting may occur, which not only wastes the modeling time of modelers, but also consumes the operating resources of the platform, bringing a poor interactive experience to users.

[0003] In the process of implementing the present disclosure, it was found that the existing collaborative modeling method based on directed acyclic graph has problems such as secondary model coverage, repeated task execution, and failure to synchronize the model in time. Summary of the invention

[0004] In view of this, the present disclosure provides a collaborative modeling method, a collaborative modeling device, an electronic device, a computer-readable storage medium, and a computer program product.

[0005] One aspect of the present disclosure provides a collaborative modeling method, including: obtaining the state of a directed acyclic graph; when the state of the directed acyclic graph is a locked state, updating the model in a database in response to a model editing instruction of a first user in an editing mode; pushing model update information to a second user in a read-only mode based on a communication connection, wherein the model update information includes the state of the updated model; and in response to an unlocking instruction of the first user, setting the state of the directed acyclic graph to an unlocked state, thereby ending the modeling process of the first user.

[0006] According to an embodiment of the present disclosure, the above-mentioned obtaining the state of the directed acyclic graph includes: obtaining the state of the directed acyclic graph based on a dictionary table; wherein the above-mentioned dictionary table includes: identification information of the above-mentioned directed acyclic graph, the state of the above-mentioned directed acyclic graph, identification information of the above-mentioned first user and the address of the above-mentioned first user.

[0007] According to an embodiment of the present disclosure, it also includes: in response to a request from a modeling user to access the directed acyclic graph, obtaining the state of the directed acyclic graph based on a dictionary table; when the state of the directed acyclic graph is an unlocked state, determining that the modeling user is the first user; and when the state of the directed acyclic graph is a locked state, determining that the modeling user is the second user.

[0008] According to an embodiment of the present disclosure, after determining that the above-mentioned modeled user is the above-mentioned first user, it also includes: storing the identification information of the above-mentioned first user and the address of the above-mentioned first user in the above-mentioned dictionary table; in response to the locking instruction of the above-mentioned first user, setting the state of the above-mentioned directed acyclic graph to a locked state; establishing a communication connection with the above-mentioned first user based on a full-duplex communication protocol; and storing the identification information of the above-mentioned first user, the address of the above-mentioned first user and the session information with the above-mentioned first user in an edit hash table corresponding to the above-mentioned directed acyclic graph.

[0009] According to an embodiment of the present disclosure, after determining that the above-mentioned modeled user is the above-mentioned second user, it also includes: establishing a communication connection with the above-mentioned second user based on a full-duplex communication protocol; and storing the identification information of the above-mentioned second user, the address of the above-mentioned second user and the session information with the above-mentioned second user in a read-only hash table corresponding to the above-mentioned directed acyclic graph.

[0010] According to an embodiment of the present disclosure, it also includes: in a case where it is detected that the above-mentioned communication connection is disconnected, determining the user corresponding to the above-mentioned disconnected communication connection based on the above-mentioned session information; and in a case where the user corresponding to the above-mentioned disconnected communication connection is the above-mentioned first user, setting the state of the above-mentioned directed acyclic graph to an unlocked state.

[0011] According to an embodiment of the present disclosure, the above-mentioned model editing instructions include save model instructions, run operator instructions and stop operator instructions; the above-mentioned response to the model editing instructions of the first user in the editing mode, updating the state of the model in the database includes: when receiving any one of the save model instructions, run operator instructions and stop operator instructions of the above-mentioned first user, using the model edited by the above-mentioned first user to replace the model in the above-mentioned database.

[0012] According to an embodiment of the present disclosure, it also includes: when the state of the directed acyclic graph is a locked state, no response is made to the locking instruction of the second user, the model editing instruction and the unlocking instruction.

[0013] According to an embodiment of the present disclosure, after the state of the directed acyclic graph is set to an unlocked state, the method further includes: disconnecting the communication connection with the first user and the second user.

[0014] Another aspect of the present disclosure provides a collaborative modeling device, including an acquisition module, a first execution module, a sending module, and a second execution module. The acquisition module is used to acquire the state of a directed acyclic graph; the first execution module is used to update the model in the database in response to the model editing instruction of the first user in the editing mode when the state of the directed acyclic graph is locked; the sending module is used to push model update information to the second user in the read-only mode based on the communication connection, wherein the model update information includes the state of the updated model; and the second execution module is used to set the state of the directed acyclic graph to an unlocked state in response to the unlock instruction of the first user, thereby ending the modeling process of the first user.

[0015] According to an embodiment of the present disclosure, the above-mentioned acquisition module is also used to obtain the state of the directed acyclic graph based on a dictionary table; wherein the above-mentioned dictionary table includes: identification information of the above-mentioned directed acyclic graph, the state of the above-mentioned directed acyclic graph, identification information of the above-mentioned first user and the address of the above-mentioned first user.

[0016] According to an embodiment of the present disclosure, the collaborative modeling device further includes a determination module, wherein the determination module includes a first determination unit, a second determination unit, and a third determination unit. The first determination unit is used to obtain the state of the directed acyclic graph based on the dictionary table in response to a request from a modeling user to access the directed acyclic graph; the second determination unit is used to determine that the modeling user is the first user when the state of the directed acyclic graph is an unlocked state; and the third determination unit is used to determine that the modeling user is the second user when the state of the directed acyclic graph is a locked state.

[0017] According to an embodiment of the present disclosure, the second determination unit further includes a first determination subunit, a second determination subunit, a third determination subunit and a fourth determination subunit. The first determination subunit is used to store the identification information of the first user and the address of the first user in the dictionary table; the second determination subunit is used to set the state of the directed acyclic graph to a locked state in response to the locking instruction of the first user; the third determination subunit is used to establish a communication connection with the first user based on a full-duplex communication protocol; and the fourth determination subunit is used to store the identification information of the first user, the address of the first user and the session information with the first user in the edit hash table corresponding to the directed acyclic graph.

[0018] According to an embodiment of the present disclosure, the third determination unit further includes a fifth determination subunit and a sixth determination subunit. The fifth determination subunit is used to establish a communication connection with the second user based on a full-duplex communication protocol; and the sixth determination subunit is used to store the identification information of the second user, the address of the second user, and the session information with the second user in a read-only hash table corresponding to the directed acyclic graph.

[0019] According to an embodiment of the present disclosure, the collaborative modeling device further includes a judgment module, wherein the judgment module includes a first judgment unit and a second judgment unit. The first judgment unit is used to determine the user corresponding to the disconnected communication connection based on the session information when the disconnected communication connection is detected; and the second judgment unit is used to set the state of the directed acyclic graph to an unlocked state when the user corresponding to the disconnected communication connection is the first user.

[0020] According to an embodiment of the present disclosure, the above-mentioned model editing instructions include save model instructions, run operator instructions and stop operator instructions; the above-mentioned first execution module is also used to use the model edited by the above-mentioned first user to replace the model in the above-mentioned database when receiving any one of the save model instructions, run operator instructions and stop operator instructions of the above-mentioned first user.

[0021] According to an embodiment of the present disclosure, the collaborative modeling device further includes a third execution module, wherein the third execution module is used to disconnect the communication connection with the first user and the second user.

[0022] Another aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more instructions, wherein when the one or more instructions are executed by the one or more processors, the one or more processors implement the method as described above.

[0023] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the above method when executed.

[0024] Another aspect of the present disclosure provides a computer program product, which includes computer executable instructions, and when the instructions are executed, are used to implement the method as described above.

[0025] According to an embodiment of the present disclosure, when the directed acyclic graph is in a locked state, the changes made to the model by a first user in editing mode are pushed in real time to a second user in read-only mode through a communication connection, thereby achieving real-time synchronization of the model, avoiding the problems of repeated execution of tasks and failure to synchronize the model in a timely manner in the collaborative modeling process, and improving the user experience of the modeling process. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0027] Figure 1 The schematic diagram of the working principle of HTTP protocol is shown schematically;

[0028] Figure 2 Schematically illustrates an exemplary system architecture 200 to which the collaborative modeling method according to an embodiment of the present disclosure can be applied;

[0029] Figure 3 A flowchart of a collaborative modeling method according to an embodiment of the present disclosure is schematically shown;

[0030] Figure 4 A schematic diagram schematically shows a collaborative modeling process according to another embodiment of the present disclosure;

[0031] Figure 5 A schematic diagram schematically shows a timing diagram of status updates of a first user and a second user according to another embodiment of the present disclosure;

[0032] Figure 6 The schematic diagram of the working principle of the WebSocket protocol is shown schematically;

[0033] Figure 7 A block diagram of a collaborative modeling apparatus according to an embodiment of the present disclosure is schematically shown;

[0034] Figure 8 A block diagram of an electronic device suitable for implementing a collaborative modeling method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0035] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0036] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0037] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.

[0038] In the case of using expressions such as "at least one of A, B, and C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.). In the case of using expressions such as "at least one of A, B, or C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, or C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0039] With the development of the Internet, artificial intelligence is becoming a key component in the process of enterprise transformation. In order to lower the threshold of machine learning, machine learning platforms have emerged. In the process of the development of machine learning platforms, a large number of efficient machine learning algorithm components have been accumulated. Based on these components, modelers can quickly build models to implement business processes and solve specific problems. Among them, the drag-and-drop task flow modeling method has become one of the mainstream in the industry.

[0040] For the same business needs, it is often necessary for multiple people to collaborate on modeling, and the collaborative construction of multiple people will inevitably lead to multiple people editing the same directed acyclic graph online at the same time. Sometimes, due to untimely communication, problems such as repeated execution of tasks and model overwriting may occur, which not only wastes the modeling time of modelers, but also consumes the operating resources of the platform, bringing a poor interactive experience to users.

[0041] At present, although a check-in and check-out mechanism can be used, that is, the directed acyclic graph is locked during editing, and can only be edited by the current user, and other users enter the current directed acyclic graph in read-only mode, and complete the interaction with the server by sending HTTP requests and window events through JavaScript, setting the directed acyclic graph to a locked state. If problems such as browser failure to respond and network anomalies occur, the browser cannot send an unlock request to the server in time, causing the directed acyclic graph to be locked and the model to be unable to be saved in time. To a certain extent, although the check-in and check-out mechanism can improve the problems of repeated task execution and model overwriting, problems such as the directed acyclic graph being locked, the model being unable to be saved in time, and the difficulty for read-only users to obtain directed acyclic graph checkout information in time still exist.

[0042] Figure 1 The schematic diagram shows the working principle of the HTTP protocol.

[0043] like Figure 1 As shown, the HTTP protocol is a stateless, connectionless, unidirectional application layer protocol that adopts a request / response model. Communication requests can only be initiated by the client, and the server responds to the request. In the related art, since only the HTTP protocol is used, it is impossible to realize that the server actively initiates messages to the client. It is difficult for read-only users to synchronize with editing users. Editing users adjust and transform the model, and read-only users cannot perceive it. They can only read the model state when entering the directed acyclic graph, or exit modeling and re-enter the directed acyclic graph to re-acquire the latest model state. If the client adopts a timed refresh directed acyclic graph mechanism, long polling is achieved through frequent asynchronous JavaScript and XML (AJAX) requests. When the number of operators is small and the connection is not complex, the read-only user can synchronize with the editing user; however, when the number of operators is large and the connection is complex, the use of a timed refresh mechanism is a considerable burden on both the client and the server. The timed refresh mechanism is not only inefficient, but also very wasteful of resources.

[0044] In view of the above problems, the embodiment of the present disclosure adds a heartbeat mechanism on the basis of the check-in and check-out mechanism, and adopts a full-duplex communication protocol to realize the interaction between the server and the client, thereby obtaining a collaborative modeling method based on collaborative modeling of directed acyclic graphs. After the user locks the directed acyclic graph and enters the editing mode, other users enter the directed acyclic graph in read-only mode. When the editing user saves the model, runs the operator, and stops the operator, the directed acyclic graph of the read-only user will be updated to the latest state in real time, so as to achieve model synchronization between the editing mode and the read-only mode; when the user exits the editing mode, the directed acyclic graph is set to an unlocked state, and the read-only user of the current directed acyclic graph is notified; when the user loses connection with the currently locked directed acyclic graph due to page jumps, closing the browser, or network abnormalities, the directed acyclic graph will automatically unlock normally, and the data will be automatically saved to the database, and the read-only user of the current directed acyclic graph will be notified.

[0045] Specifically, the embodiments of the present disclosure provide a collaborative modeling method, a collaborative modeling device, an electronic device, a computer-readable storage medium, and a computer program product. The collaborative modeling method includes: obtaining the state of a directed acyclic graph; when the state of the directed acyclic graph is a locked state, in response to a model editing instruction of a first user in an editing mode, updating the model in the database; pushing model update information to a second user in a read-only mode based on a communication connection, wherein the model update information includes the state of the updated model; and in response to an unlocking instruction of the first user, setting the state of the directed acyclic graph to an unlocked state, and ending the modeling process of the first user.

[0046] Figure 2 The exemplary system architecture 200 to which the collaborative modeling method can be applied according to an embodiment of the present disclosure is schematically shown. It should be noted that: Figure 2 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.

[0047] like Figure 2 As shown, the system architecture 200 according to this embodiment may include terminal devices 201 , 202 , 203 , a network 204 and a server 205 .

[0048] The terminal devices 201 , 202 , and 203 may be various electronic devices having a display screen and supporting information input and network transmission, including but not limited to tablet computers, laptop computers, desktop computers, and the like.

[0049] The server 205 may be a single server or a server group near the terminal devices 201, 202, 203, or a server or a server group in the cloud. The server 205 includes at least one processor and at least one memory. The server 205 may receive a request sent by the terminal devices 201, 202, 203, and use the processor to execute a corresponding instruction according to the request, and store the processing result in the memory, and may also feed back the processing result to the terminal devices 201, 202, 203.

[0050] The network 204 is used to provide a medium for communication connection between the terminal devices 201, 202, 203 and the server 205. The network 204 may include various connection types, such as wired and / or wireless communication connections, etc. Users can use the terminal devices 201, 202, 203 to interact with the server 205 through the network 204 based on the communication protocol to receive or send messages, etc.

[0051] It should be noted that the collaborative modeling method provided in the embodiment of the present disclosure can generally be executed by the server 205. Accordingly, the collaborative modeling apparatus provided in the embodiment of the present disclosure can generally be set in the server 205. The collaborative modeling method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 205 and can communicate with the terminal devices 201, 202, 203 and / or the server 205. Accordingly, the collaborative modeling apparatus provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 205 and can communicate with the terminal devices 201, 202, 203 and / or the server 205.

[0052] It should be understood that Figure 2 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0053] Figure 3 The flowchart of the collaborative modeling method according to the embodiment of the present disclosure is schematically shown.

[0054] like Figure 3 As shown, the method includes operations S310 to S340.

[0055] In operation S310 , a state of a directed acyclic graph is acquired.

[0056] According to an embodiment of the present disclosure, the state of the directed acyclic graph includes a locked state and an unlocked state, and the state of the directed acyclic graph can be switched after receiving a corresponding instruction.

[0057] In operation S320, when the state of the directed acyclic graph is the locked state, in response to a model editing instruction of a first user in an editing mode, the model in the database is updated.

[0058] According to an embodiment of the present disclosure, when the directed acyclic graph is in a locked state, the server only responds to the relevant instructions of the first user in the editing mode. Upon receiving the model editing instruction of the first user, the server can store the model in the current directed acyclic graph into the database to update the model in the database.

[0059] In operation S330, the model update information is pushed to the second user in the read-only mode based on the communication connection.

[0060] According to an embodiment of the present disclosure, the model update information may include the state of the updated model and may also include user information of the first user.

[0061] According to an embodiment of the present disclosure, the communication connection may include a first communication connection between a first user and a server, and a second communication connection between a second user and the server. Through the first communication connection, the server may obtain user information of the first user, such as identification information of the first user, address of the first user, etc. After receiving the instruction of the first user, the server may push the user information of the first user and the updated model to the second user through the second communication connection, so that the second user knows the latest status of the model.

[0062] In operation S340, in response to the unlocking instruction of the first user, the state of the directed acyclic graph is set to an unlocked state, and the modeling process of the first user is ended.

[0063] According to an embodiment of the present disclosure, when the directed acyclic graph is in a locked state, the changes made to the model by a first user in editing mode are pushed in real time to a second user in read-only mode through a communication connection, thereby achieving real-time synchronization of the model, avoiding the problems of repeated execution of tasks and failure to synchronize the model in a timely manner in the collaborative modeling process, and improving the user experience of the modeling process.

[0064] Reference below Figures 4 to 6 , combined with specific embodiments Figure 3 The method shown is further explained.

[0065] Figure 4 A schematic diagram of a collaborative modeling process according to another embodiment of the present disclosure is schematically shown.

[0066] like Figure 4 As shown, first, when the server receives a request from a modeler to access a directed acyclic graph, it executes a method such as operation S401 to determine the state of the directed acyclic graph so as to determine the working mode of the modeler.

[0067] According to an embodiment of the present disclosure, obtaining the status of the directed acyclic graph may be obtaining the status of the directed acyclic graph based on a dictionary table. The dictionary table may be a data dictionary table created when creating the directed acyclic graph or in the process of using the directed acyclic graph, and the data dictionary table may be as shown in Table 1, which includes identification information of the directed acyclic graph, the status of the directed acyclic graph, identification information of the first user, and the address of the first user.

[0068] Table 1

[0069]

[0070]

[0071] According to an embodiment of the present disclosure, the state of the directed acyclic graph may include a locked state and an unlocked state. When the state of the directed acyclic graph is an unlocked state, the modeling user is determined to be the first user; when the state of the directed acyclic graph is a locked state, the modeling user is determined to be the second user.

[0072] According to an embodiment of the present disclosure, when the modeled user is the first user, the identification information of the first user and the address of the first user may be stored in a dictionary table as shown in Table 1, and wait for a locking instruction.

[0073] According to an embodiment of the present disclosure, the locking instruction may be initiated by the first user, or may be automatically executed by the server after a preset time after the first user appears. For example, when the first user accesses a directed acyclic graph in an unlocked state, he or she directly starts editing the model without sending a locking instruction. After detecting the access of the first user, the server may directly lock the directed acyclic graph after 30 seconds.

[0074] In operation S402, the directed acyclic graph is set to a locked state and enters an editing mode.

[0075] According to an embodiment of the present disclosure, when the first user is in the editing mode, before responding to and executing the model editing instruction of the first user, the server can also verify the user information as in operation S403, and compare the user information of the user who initiated the instruction with the user information of the first user recorded in the dictionary table. If they are consistent, the method of operation S404 is executed to respond to and execute the model editing instruction; if they are inconsistent, the method of operation S405 is executed to enter the read-only mode and wait for the directed acyclic graph to be unlocked.

[0076] According to an embodiment of the present disclosure, the model editing instruction may include a save model instruction, a run operator instruction, and a stop operator instruction.

[0077] According to an embodiment of the present disclosure, after the first user enters the editing mode, the server may also establish a communication connection with the first user based on a full-duplex communication protocol, and through the communication connection, the server may actively obtain the model being edited by the first user.

[0078] According to an embodiment of the present disclosure, when any one of the save model instruction, run operator instruction and stop operator instruction of the first user is received, the model being edited by the first user can be used to replace the model in the database.

[0079] When the modeling user is the second user, the read-only mode may be entered as in operation S405 to wait for the directed acyclic graph to be unlocked.

[0080] According to an embodiment of the present disclosure, when the second user is in read-only mode, the server can establish a communication connection with the second user based on a full-duplex communication protocol. Upon receiving a model editing instruction from the first user, the server can actively send the updated model in the database and the user information of the first user to the second user through the communication connection to achieve real-time synchronization of the model.

[0081] According to an embodiment of the present disclosure, when the second user is in read-only mode, the related information of the directed acyclic graph can be viewed, but the server will not respond to the locking instruction, model editing instruction and unlocking instruction of the second user.

[0082] In operation S406 , an unlock instruction is responded to and executed.

[0083] According to an embodiment of the present disclosure, after executing the unlock instruction, the server can make the first user and the second user exit the edit mode and the read-only mode respectively, disconnect the communication connection with the first user and the second user, and set the directed acyclic graph to an unlocked state, thereby ending the modeling process of the first user. After the directed acyclic graph is unlocked, the second user can initiate a request to access the directed acyclic graph again to start the modeling process. In particular, when the number of second users in read-only mode is one, the user can directly enter the edit mode.

[0084] According to the embodiments of the present disclosure, by classifying the modeling users who access the modeling based on the state of the directed acyclic graph, it is possible to effectively avoid the situation where multiple people perform modeling operations at the same time, reduce the waste of resources, and avoid the model being overwritten.

[0085] Figure 5 The following schematically shows a timing diagram of status updates of a first user and a second user according to another embodiment of the present disclosure.

[0086] like Figure 5As shown, after the first user locks the directed acyclic graph and enters the editing mode, the second user enters the directed acyclic graph in read-only mode. When the first user saves the model, runs the operator, and stops the operator, the directed acyclic graph of the second user will be updated to the latest state in real time to achieve model synchronization between the editing mode and the read-only mode; when the first user exits the editing mode, the directed acyclic graph is set to an unlocked state, and the second user of the current directed acyclic graph is notified; if the first user loses connection with the currently locked directed acyclic graph due to page jumps, browser closing, or network abnormalities, the directed acyclic graph will be automatically unlocked normally, and the data will be automatically saved to the database, and the second user of the current directed acyclic graph will be notified.

[0087] Figure 6 The schematic diagram shows the working principle of the WebSocket protocol.

[0088] like Figure 6 As shown, the WebSocket protocol is implemented based on the TCP protocol. It is a protocol for full-duplex communication on a single TCP connection. The client and the server only need to complete a handshake once to create a persistent connection between the two, making data exchange easier and allowing the server to actively push data to the client.

[0089] In the collaborative modeling process of another embodiment of the present disclosure, the full-duplex communication protocol may be the WebSocket protocol. Based on this protocol, after the server and the first user or the server and the second user establish the first HTTP connection, subsequent data exchange does not need to resend HTTP requests. Compared with the HTTP protocol, this protocol does not require a polling mechanism to be set up in the server, does not require repeated establishment of HTTP connections, and saves bandwidth resources.

[0090] According to an embodiment of the present disclosure, a hash table (ConcurrentHashMap) may be created to store user information of modeled users. For example, an edit hash table (writeMap) may be created to store user information of a first user, and a read-only hash table (readMap) may be created to store user information of a second user. The primary key of the hash table is the identification information (UUID) of the directed acyclic graph, and the specific value is a list for storing identification information of the directed acyclic graph, identification information of the first user or the second user, the address of the first user or the second user, and session information of the first user or the second user.

[0091] In another embodiment of the present disclosure, after establishing a WebSocket connection with a first user, it also includes storing the first user's identification information, the first user's address, and the session information with the first user in an edit hash table; after establishing a WebSocket connection with a second user, it also includes storing the second user's identification information, the second user's address, and the session information with the second user in a read-only hash table.

[0092] According to an embodiment of the present disclosure, after establishing a WebSocket connection with the first user, the server can also verify the information in the hash table. For example, it can be determined whether the identification information of the directed acyclic graph exists in the edit hash table; if not, the identification information of the directed acyclic graph is added to the edit hash table; if it exists, the identification information of the directed acyclic graph is added to the read-only hash table. In this way, when the model information in the database changes, the server can push relevant information to the modeling user in read-only mode.

[0093] According to an embodiment of the present disclosure, after completing the WebSocket connection with the first user and the second user, the server can realize the synchronization of the model and the push function of information. For example, when the first user saves, runs, or stops the directed acyclic graph, the server will obtain these operation information and send the latest state of the model to the second user corresponding to the directed acyclic graph in the read-only hash table.

[0094] According to an embodiment of the present disclosure, when a WebSocket connection is detected to be disconnected, the server can also determine the user corresponding to the disconnected WebSocket connection based on the session information, and when the user corresponding to the disconnected WebSocket connection is the first user, the state of the directed acyclic graph is set to an unlocked state. For example, it can be determined whether the session information of the server is consistent with the session information of the directed acyclic graph in the edit hash table; if there is a consistency, it can be considered that the first user has behaviors such as disconnection and shutdown, resulting in abnormal disconnection of the WebSocket connection. At this time, the information that the first user exits the edit mode can be pushed to the second user of the directed acyclic graph in the read-only hash table, and the model data can be synchronized, and all WebSocket connections of the directed acyclic graph can be closed, and the directed acyclic graph can be set to an unlocked state; on the other hand, if it is detected that the user corresponding to the disconnected WebSocket connection is the second user, the WebSocket connection with the second user is closed.

[0095] According to the embodiments of the present disclosure, a heartbeat mechanism is established by adopting the WebSocket protocol to avoid the problem that after a user locks a directed acyclic graph, the directed acyclic graph is locked and cannot be edited subsequently due to abnormal exit from modeling due to network abnormalities, browser non-response, etc. At the same time, it can also help users in read-only mode to update the synchronization model status in real time.

[0096] According to the embodiments of the present disclosure, through the check-in and check-out mechanism and the heartbeat mechanism, users can model immersively without having to pay attention to the influence of other people's factors, while avoiding the waste of resources from repeated modeling, providing users with a better modeling environment and interactive experience.

[0097] Figure 7 A block diagram of a collaborative modeling apparatus according to an embodiment of the present disclosure is schematically shown.

[0098] like Figure 7 As shown, the collaborative modeling apparatus includes an acquisition module 710 , a first execution module 720 , a sending module 730 and a second execution module 740 .

[0099] The acquisition module 710 is used to acquire the state of the directed acyclic graph.

[0100] The first execution module 720 is configured to update the model in the database in response to a model editing instruction of a first user in an editing mode when the state of the directed acyclic graph is a locked state.

[0101] The sending module 730 is used to push the model update information to the second user in the read-only mode based on the communication connection, wherein the model update information includes the state of the updated model.

[0102] The second execution module 740 is used to respond to the unlocking instruction of the first user, set the state of the directed acyclic graph to an unlocked state, and end the modeling process of the first user.

[0103] According to an embodiment of the present disclosure, when the directed acyclic graph is in a locked state, the changes made to the model by a first user in editing mode are pushed in real time to a second user in read-only mode through a communication connection, thereby achieving real-time synchronization of the model, avoiding the problems of repeated execution of tasks and failure to synchronize the model in a timely manner in the collaborative modeling process, and improving the user experience of the modeling process.

[0104] According to an embodiment of the present disclosure, the acquisition module 710 is also used to acquire the state of the directed acyclic graph based on a dictionary table; wherein the dictionary table includes: identification information of the directed acyclic graph, the state of the directed acyclic graph, identification information of the first user and the address of the first user.

[0105] According to an embodiment of the present disclosure, the collaborative modeling device further includes a determination module, wherein the determination module includes a first determination unit, a second determination unit, and a third determination unit. The first determination unit is used to obtain the state of the directed acyclic graph based on the dictionary table in response to a request from a modeling user to access the directed acyclic graph; the second determination unit is used to determine that the modeling user is the first user when the state of the directed acyclic graph is an unlocked state; and the third determination unit is used to determine that the modeling user is the second user when the state of the directed acyclic graph is a locked state.

[0106] According to an embodiment of the present disclosure, the second determination unit further includes a first determination subunit, a second determination subunit, a third determination subunit and a fourth determination subunit. The first determination subunit is used to store the identification information of the first user and the address of the first user in the dictionary table; the second determination subunit is used to set the state of the directed acyclic graph to a locked state in response to the locking instruction of the first user; the third determination subunit is used to establish a communication connection with the first user based on a full-duplex communication protocol; and the fourth determination subunit is used to store the identification information of the first user, the address of the first user and the session information with the first user in an edit hash table corresponding to the directed acyclic graph.

[0107] According to an embodiment of the present disclosure, the third determination unit further includes a fifth determination subunit and a sixth determination subunit. The fifth determination subunit is used to establish a communication connection with the second user based on the full-duplex communication protocol; and the sixth determination subunit is used to store the identification information of the second user, the address of the second user, and the session information with the second user in a read-only hash table corresponding to the directed acyclic graph.

[0108] According to an embodiment of the present disclosure, the collaborative modeling device further includes a judgment module, wherein the judgment module includes a first judgment unit and a second judgment unit. The first judgment unit is used to determine the user corresponding to the disconnected communication connection based on the session information when a communication connection is detected to be disconnected; and the second judgment unit is used to set the state of the directed acyclic graph to an unlocked state when the user corresponding to the disconnected communication connection is the first user.

[0109] According to an embodiment of the present disclosure, the model editing instructions include a save model instruction, a run operator instruction, and a stop operator instruction; the first execution module 720 is also used to replace the model in the database with the model edited by the first user when receiving any one of the save model instruction, the run operator instruction, and the stop operator instruction from the first user.

[0110] According to an embodiment of the present disclosure, the collaborative modeling apparatus further includes a third execution module, wherein the third execution module is used to disconnect the communication connection with the first user and the second user.

[0111] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.

[0112] It should be noted that the collaborative modeling method and device provided in the embodiments of the present disclosure can be used in the field of computer technology or finance, and can also be used in any other field, such as the field of smart office, etc. The application field of the collaborative modeling method and device provided in the embodiments of the present disclosure is not limited.

[0113] Figure 8 A block diagram of an electronic device suitable for implementing a collaborative modeling method according to an embodiment of the present disclosure is schematically shown. Figure 8 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0114] like Figure 8 As shown, the electronic device 800 according to an embodiment of the present disclosure includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 into a random access memory (RAM) 803. The processor 801 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include an onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0115] In RAM 803, various programs and data required for the operation of electronic device 800 are stored. Processor 801, ROM 802 and RAM 803 are connected to each other via bus 804. Processor 801 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 802 and / or RAM 803. It should be noted that the program can also be stored in one or more memories other than ROM 802 and RAM 803. Processor 801 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.

[0116] According to an embodiment of the present disclosure, the electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to the bus 804. The electronic device 800 may further include one or more of the following components connected to the I / O interface 805: an input portion 806 including a keyboard, a mouse, etc.; an output portion 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 808 including a hard disk, etc.; and a communication portion 809 including a network interface card such as a LAN card, a modem, etc. The communication portion 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage portion 808 as needed.

[0117] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the processor 801, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.

[0118] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

[0119] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.

[0120] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 802 and / or the RAM 803 described above and / or one or more memories other than the ROM 802 and the RAM 803 .

[0121] An embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method provided by the embodiment of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the collaborative modeling method provided by the embodiment of the present disclosure.

[0122] When the computer program is executed by the processor 801, the above functions defined in the system / device of the embodiment of the present disclosure are executed. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0123] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 809, and / or installed from a removable medium 811. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0124] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).

[0125] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. It can be understood by those skilled in the art that the features recorded in the various embodiments and / or claims of the present disclosure can be combined and / or combined in a variety of ways, even if such a combination or combination is not explicitly recorded in the present disclosure. In particular, without departing from the spirit and teaching of the present disclosure, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.

[0126] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. A collaborative modeling method, comprising: Get the state of the directed acyclic graph; When the state of the directed acyclic graph is a locked state, in response to a model editing instruction of a first user in an editing mode, updating the model in the database; Pushing model update information to a second user in read-only mode based on the communication connection, wherein the model update information includes a state of the updated model; and In response to an unlocking instruction from the first user, setting the state of the directed acyclic graph to an unlocked state, and ending the modeling process of the first user; The first user and the second user are obtained by classifying the modeled users accessed based on the state of the directed acyclic graph; After determining that the modeling user is the first user, the method further includes: storing the identification information of the first user, the address of the first user, and the session information with the first user in an edit hash table corresponding to the directed acyclic graph; After determining that the modeling user is the second user, the method further includes: storing the identification information of the second user, the address of the second user, and the session information with the second user in a read-only hash table corresponding to the directed acyclic graph; In the case where it is detected that the communication connection is disconnected, determining a user corresponding to the disconnected communication connection based on the session information in the edit hash table and the session information in the read-only hash table; and In a case where the user corresponding to the disconnected communication connection is the first user, the state of the directed acyclic graph is set to an unlocked state.

2. The method according to claim 1, wherein: The state of obtaining the directed acyclic graph includes: Get the state of the directed acyclic graph based on the dictionary table; The dictionary table includes: identification information of the directed acyclic graph, the state of the directed acyclic graph, identification information of the first user, and the address of the first user.

3. The method according to claim 1, further comprising: In response to a request from a modeling user to access the directed acyclic graph, acquiring a state of the directed acyclic graph based on a dictionary table; When the state of the directed acyclic graph is an unlocked state, determining that the modeling user is the first user; as well as When the state of the directed acyclic graph is a locked state, the modeling user is determined to be the second user.

4. The method according to claim 3, wherein: After determining that the modeling user is the first user, the method further includes: storing the identification information of the first user and the address of the first user in the dictionary table; In response to a locking instruction from the first user, setting the state of the directed acyclic graph to a locked state; A communication connection is established with the first user based on a full-duplex communication protocol.

5. The method according to claim 3, wherein: After determining that the modeling user is the second user, the method further includes: A communication connection is established with the second user based on a full-duplex communication protocol.

6. The method according to claim 1, wherein: The model editing instructions include save model instructions, run operator instructions and stop operator instructions; In response to a model editing instruction of a first user in the editing mode, updating the state of the model in the database comprises: When any one of the save model instruction, run operator instruction and stop operator instruction from the first user is received, the model edited by the first user is used to replace the model in the database.

7. The method according to claim 6, further comprising: When the state of the directed acyclic graph is a locked state, no response is made to the locking instruction, the model editing instruction and the unlocking instruction of the second user.

8. The method according to claim 1, wherein: After setting the state of the directed acyclic graph to an unlocked state, the method further includes: The communication connection with the first user and the second user is disconnected.

9. A collaborative modeling device, comprising: An acquisition module is used to obtain the state of the directed acyclic graph; A first execution module is used to update the model in the database in response to a model editing instruction of a first user in an editing mode when the state of the directed acyclic graph is a locked state; a sending module, configured to push model update information to a second user in a read-only mode based on a communication connection, wherein the model update information includes a state of an updated model, and the first user and the second user are obtained by classifying accessed modeling users based on the state of the directed acyclic graph; and A second execution module, configured to, in response to an unlocking instruction of the first user, set the state of the directed acyclic graph to an unlocked state, and end the modeling process of the first user; Wherein, the collaborative modeling device further includes a determination module and a judgment module, the determination module includes a fourth determination subunit and a sixth determination subunit, and the judgment module includes a first judgment unit and a second judgment unit; The fourth determining subunit is configured to store the identification information of the first user, the address of the first user, and the session information with the first user into an edit hash table corresponding to the directed acyclic graph; The sixth determining subunit is configured to store the identification information of the second user, the address of the second user, and the session information with the second user into a read-only hash table corresponding to the directed acyclic graph; The first determination unit is configured to determine, when detecting that the communication connection is disconnected, a user corresponding to the disconnected communication connection based on the session information in the edit hash table and the session information in the read-only hash table; and The second judgment unit is configured to set the state of the directed acyclic graph to an unlocked state when the user corresponding to the disconnected communication connection is the first user.

10. An electronic device comprising: one or more processors; a memory for storing one or more instructions, Wherein, when the one or more instructions are executed by the one or more processors, the one or more processors are enabled to implement the method according to any one of claims 1 to 8.

11. A computer-readable storage medium having executable instructions stored thereon, wherein when the executable instructions are executed by a processor, the processor is enabled to implement the method according to any one of claims 1 to 8.

12. A computer program product, comprising computer executable instructions, which are used to implement the method of any one of claims 1 to 8 when executed.

Citation Information

Patent Citations

  • A collaborative editing method based on TCP WebSocket protocol

    CN109299046A

  • Auxiliary translation and review synchronization system based on browser and implementation method

    CN110213335A