Code processing method and device based on collaborative drawing board and storage medium

By using a collaborative canvas approach, the system receives and processes code editing commands from multiple users, utilizes an abstract syntax tree to detect and merge conflicts, and automatically resolves code editing conflicts, thereby improving the efficiency and fluency of code processing.

CN122363672APending Publication Date: 2026-07-10TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2025-01-08
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

In existing technologies, conflicts are prone to occur when multiple people collaborate on code, resulting in low code processing efficiency. The locking mechanisms and version control systems of related technologies cannot efficiently resolve complex conflicts, increasing developers' waiting time and communication costs.

Method used

By adopting a collaborative canvas-based approach, code editing commands are received from multiple collaborative canvas clients. An abstract syntax tree is obtained for conflict detection, editing operations are merged, and page update commands are generated to automatically resolve code editing conflicts and achieve code updates and display.

Benefits of technology

It improves the smoothness and efficiency of collaborative code processing among multiple users, automatically resolves conflicts between code editing operations, and enhances the overall efficiency of code processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122363672A_ABST
    Figure CN122363672A_ABST
Patent Text Reader

Abstract

This disclosure provides a code processing method, apparatus, and storage medium based on a collaborative canvas. The method involves receiving multiple code editing commands from multiple collaborative canvas clients; obtaining an abstract syntax tree (AST) of a first target code file; performing conflict detection on the multiple code editing operations based on the AST to obtain conflict detection results; fusing the multiple code editing operations based on the conflict detection results; updating the first target code file according to the fused target code editing operations to obtain a second target code file; generating page update commands based on the second target code file and sending the page update commands to the multiple collaborative canvas clients, so that the multiple collaborative canvas clients update the code content displayed in the code editing area of ​​the collaborative canvas based on the page update commands. This method can improve the efficiency of code processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of artificial intelligence technology, and in particular to a code processing method, apparatus and storage medium based on a collaborative drawing board. Background Technology

[0002] With the rapid development of internet technology, internet applications have become more diverse and complex than ever before. Today, internet applications have permeated all aspects of people's lives, from work and study to communication and entertainment, providing people with richer functions and more convenient services.

[0003] Code files form the foundation for the functional logic and business processes of internet applications. Taking e-commerce applications as an example, functional logic such as product display, shopping cart orders, product price calculation, and payment processes all need to be implemented through code. To continuously expand, optimize, and maintain the functionality of internet applications, the scale of code development for these applications continues to grow, involving large-scale code processing work during the development process.

[0004] In related technologies, the efficiency of processing code is not high. Summary of the Invention

[0005] This disclosure provides a code processing method, apparatus, and storage medium based on a collaborative drawing board, which can improve the efficiency of code processing.

[0006] The first aspect of this disclosure provides a code processing method based on a collaborative canvas, the method comprising:

[0007] Receive multiple code editing instructions sent by multiple collaborative whiteboard clients, wherein the code editing instructions include code editing operations for collaborative editing of a first target code file;

[0008] Obtain the abstract syntax tree of the first target code file, and perform conflict detection on multiple code editing operations based on the abstract syntax tree to obtain the conflict detection results;

[0009] Based on the conflict detection results, the multiple code editing operations are fused together, and the first target code file is updated according to the fused target code editing operations to obtain the second target code file;

[0010] A page update instruction is generated based on the second target code file and sent to the plurality of collaborative artboard clients, so that the plurality of collaborative artboard clients update the code content displayed in the code editing area of ​​the collaborative artboard based on the page update instruction.

[0011] A second aspect of this disclosure provides a code processing apparatus based on a collaborative drawing board, the apparatus comprising:

[0012] The receiving unit is used to receive multiple code editing instructions sent by multiple collaborative whiteboard clients, wherein the code editing instructions include code editing operations for collaborative editing of a first target code file;

[0013] The detection unit is used to obtain the abstract syntax tree of the first target code file, and to perform conflict detection on multiple code editing operations based on the abstract syntax tree to obtain conflict detection results;

[0014] An update unit is used to fuse the multiple code editing operations based on the conflict detection results, and update the first target code file according to the fused target code editing operations to obtain a second target code file;

[0015] The sending unit is configured to generate a page update instruction based on the second target code file and send the page update instruction to the plurality of collaborative canvas clients, so that the plurality of collaborative canvas clients update the code content displayed in the code editing area of ​​the collaborative canvas based on the page update instruction.

[0016] Optionally, in some embodiments, the code processing apparatus based on a collaborative canvas provided in this disclosure further includes:

[0017] The display subunit is used to display the collaborative canvas interface in the collaborative canvas client. The collaborative canvas interface includes a code editing area, in which a first target code file is displayed.

[0018] The first generation subunit is used to receive code editing operations on the first target code file and generate code editing instructions based on the code editing operations.

[0019] Optionally, in some embodiments, the first display subunit includes:

[0020] The first display module is used to display the collaborative canvas interface in the collaborative canvas client, the collaborative canvas interface including a code editing area;

[0021] The second display module is used to display a list of code files in response to a code file open operation received in the code editing area;

[0022] The third display module is used to display the first target code file in the code editing area in response to the selection operation of the first target code file in the code file list.

[0023] Optionally, in some embodiments, the first display subunit includes:

[0024] The fourth display module is used to display the collaborative canvas interface in the collaborative canvas client, the collaborative canvas interface including a code editing area;

[0025] The fifth display module is used to display text box elements in the collaborative canvas client, wherein the text box elements contain code text;

[0026] The sixth display module is configured to generate a first target code file based on the code text in response to a drag operation that moves the text box element to the code editing area, and to display the first target code file in the code editing area.

[0027] Optionally, in some embodiments, the sixth display module includes:

[0028] The `get` submodule is used to obtain the element attribute data of the text box element in response to a drag operation that moves the text box element to the code editing area.

[0029] The conversion submodule is used to extract code text from the element attribute data and perform format conversion on the code text to generate a first target code file;

[0030] The display submodule is used to display the first target code file in the code editing area.

[0031] Optionally, in some embodiments, the generating subunit includes:

[0032] The determination module is used to receive code editing operations on the first target code file and determine the modified content of the target code based on the code editing operations;

[0033] The segmentation module is used to segment the modified content of the target code into multiple target code fragments.

[0034] A generation module is used to generate code editing instructions based on the code editing operation and the plurality of target code fragments.

[0035] Optionally, in some embodiments, the detection unit includes:

[0036] The first determining subunit is used to determine the code structure node corresponding to each code editing operation in the abstract syntax tree;

[0037] The detection subunit is used to perform conflict detection on the multiple code editing operations based on the code structure node corresponding to each code editing operation, and obtain the conflict detection result.

[0038] Optionally, in some embodiments, the code processing apparatus based on a collaborative canvas provided in this disclosure further includes:

[0039] The receiving subunit is used to receive code execution instructions sent by any collaborative canvas client, the code execution instructions including code execution operations on code files in the code editing area;

[0040] The execution subunit is used to run the code file based on the code execution instructions, obtain the code execution result, and send the code execution result to the collaborative drawing board client.

[0041] Optionally, in some embodiments, the operating subunit includes:

[0042] A creation module is used to create a preset execution container based on the code execution instructions, and to deploy the code execution environment in the preset execution container;

[0043] The execution module is used to run the code file in the code execution environment and obtain the code execution results.

[0044] Optionally, in some embodiments, the updating unit includes:

[0045] The sending subunit is used to update the first target code file based on a preset code conflict resolution strategy when the conflict detection result indicates that there is a conflict between the multiple code editing operations, to obtain a candidate code conflict resolution file, and to send the conflict detection result and the candidate code conflict resolution file to the multiple collaborative canvas clients.

[0046] The fusion subunit is used to receive code conflict resolution instructions returned by the collaborative canvas client based on the candidate code conflict resolution file, and to fuse the multiple code editing operations based on the code conflict resolution instructions;

[0047] The update subunit is used to update the first target code file according to the target code editing operation obtained by fusion, so as to obtain the second target code file.

[0048] Optionally, in some embodiments, the updating unit includes:

[0049] The second determining subunit is used to obtain the code editing operation of each collaborative canvas client and determine the code editing position in the first target code file based on the code editing operation;

[0050] The third determining subunit is used to determine the content of the displayed code based on the code editing location and the second target code file;

[0051] The second generation subunit is used to generate a page update instruction corresponding to each of the collaborative canvas clients based on the content of the display code.

[0052] A third aspect of this disclosure provides a storage medium storing a computer program that, when executed by a processor, implements the code processing method based on a collaborative drawing board as described in the first aspect.

[0053] This fourth aspect of the disclosure provides a computer device including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the code processing method based on a collaborative drawing board as described in the first aspect.

[0054] The fifth aspect of this disclosure provides a computer program product comprising a computer program that is read and executed by a processor of a computer device, causing the computer device to perform the code processing method based on a collaborative drawing board as described in the first aspect.

[0055] The code processing method based on a collaborative canvas provided in this disclosure involves receiving multiple code editing instructions sent by multiple collaborative canvas clients; obtaining an abstract syntax tree of a first target code file; performing conflict detection on the multiple code editing operations based on the abstract syntax tree to obtain conflict detection results; fusing the multiple code editing operations based on the conflict detection results; updating the first target code file according to the fused target code editing operations to obtain a second target code file; generating a page update instruction based on the second target code file and sending the page update instruction to the multiple collaborative canvas clients, so that the multiple collaborative canvas clients update the code content displayed in the code editing area of ​​the collaborative canvas based on the page update instruction.

[0056] This disclosure provides a method for code processing based on a collaborative canvas. Leveraging the collaborative canvas's multi-user collaboration and data synchronization sharing functions, it enables collaborative code processing by multiple users. During collaborative code processing, code editing conflicts may arise. This disclosure can obtain the abstract syntax tree (AST) of the first target code file to be processed, and perform conflict detection on multiple code editing operations based on the AST, achieving precise location of code conflict. Furthermore, the conflict is resolved automatically, and the resulting second target code file is sent to the collaborative canvas's code editing area for display. Thus, this disclosure enables multi-user collaborative code processing based on the collaborative canvas's functionality, and automatically resolves conflicts arising between code editing operations during processing, improving the smoothness of collaborative code processing and thereby increasing code processing efficiency.

[0057] Other features and advantages of this disclosure will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the disclosure. The objectives and other advantages of this disclosure may be realized and obtained by means of the structures particularly pointed out in the description, claims and drawings. Attached Figure Description

[0058] The accompanying drawings are provided to further understand the technical solutions of this disclosure and constitute a part of the specification. They are used together with the embodiments of this disclosure to explain the technical solutions of this disclosure and do not constitute a limitation on the technical solutions of this disclosure.

[0059] Figure 1 A system architecture diagram for the code processing method based on a collaborative canvas, as described in an embodiment of this disclosure;

[0060] Figure 2 This is a flowchart illustrating the code processing method based on a collaborative canvas provided in this disclosure.

[0061] Figure 3A This is a schematic diagram illustrating the display of a code editing area in a collaborative canvas interface provided in this disclosure.

[0062] Figure 3B This is a schematic diagram illustrating the display of a list of code files in the code editing area provided in this disclosure.

[0063] Figure 3C This is a schematic diagram illustrating the display of a first object code file in a code editing area, as provided in this disclosure.

[0064] Figure 3D This is a diagram illustrating the dragging of a text box element from the collaboration canvas interface to the code editing area provided in this disclosure.

[0065] Figure 4 A schematic diagram of an abstract syntax tree provided for embodiments of this disclosure;

[0066] Figure 5A A diagram illustrating code conflict warnings provided in this disclosure;

[0067] Figure 5B A schematic diagram of the display code conflict solution provided in this disclosure;

[0068] Figure 5C A schematic diagram of the conflict resolution file for the modified candidate code provided in this disclosure;

[0069] Figure 6 This is another flowchart illustrating the code processing method based on the collaborative canvas provided in this disclosure.

[0070] Figure 7A schematic diagram of a module of the collaborative canvas-based code processing device provided in this disclosure;

[0071] Figure 8 A schematic diagram of the structure of the code processing device based on the collaborative canvas provided in the embodiments of this disclosure;

[0072] Figure 9 This is a terminal structure diagram for implementing various methods according to an embodiment of the present disclosure;

[0073] Figure 10 This is a server structure diagram illustrating the implementation of various methods according to an embodiment of the present disclosure. Detailed Implementation

[0074] To make the objectives, technical solutions, and advantages of this disclosure clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and are not intended to limit the scope of this disclosure.

[0075] Before providing a further detailed description of the embodiments of this disclosure, the terms and concepts used in these embodiments are explained, and they are subject to the following interpretations:

[0076] Abstract Syntax Tree (AST): An AST is a tree-like representation of the abstract syntactic structure of source code written in a programming language. It serves as an intermediate representation used by editors or interpreters when processing source code. Each node in an AST represents a syntactic structure in the source code, such as variable declarations, expressions, function calls, and control structures. The root node typically represents the entire source file, while child nodes represent specific syntactic elements and their relationships. For example, an AST node representing a function declaration might contain multiple child nodes, such as the function name, parameter list, and function body. ASTs are commonly used for code analysis and conflict detection.

[0077] Operation Transformation (OT): Operation transformation is a method used in collaborative technologies to maintain consistency across different copies of data. On different terminals, operations are adjusted according to their order to maintain data consistency. In real-time collaborative editing scenarios, multiple users may simultaneously operate on the same document or data. Operation transformation resolves operation conflicts by transforming and reordering user operations, ensuring that each user's operation is correctly applied to the document.

[0078] Differential Synchronization Algorithm (DSA): The differential synchronization algorithm is used to compare code modifications and merge the modifications.

[0079] Distributed Version Control System (DVCS): In software development, to solve the problem of multi-person collaboration, a version control system is needed to merge and control the development and modification content of the same project by multiple people. There are two types of version control: centralized version control systems, where code control and synchronization are performed on a single server, and distributed version control systems, which essentially delegate both the server and client sides of a centralized version control system to the participating clients. A middleman is only needed when different developers need to merge code. Common distributed version control systems include Git.

[0080] With the development of internet technology, internet applications provide people with richer and more diverse functions and more convenient services. Internet applications have permeated all aspects of daily life, from clothing, food, housing, and transportation to entertainment and education, providing great convenience.

[0081] Code files form the foundation for the functional logic and business processes of internet applications. To continuously expand and optimize the functional services of internet applications, the scale of code development continues to grow, involving large-scale code processing tasks such as editing, running, and debugging. Collaborative editing by multiple users can improve the efficiency of code processing during application development. However, collaborative code processing by multiple users can easily lead to code conflicts. Related technologies offer code editors based on a locking mechanism. This method locks the code file during editing. Locks are mechanisms used by computers to coordinate concurrent access to a resource by multiple processes or threads. This prevents multiple clients from simultaneously modifying the same code file or the same code partition, thus avoiding editing conflicts. However, this method cannot support concurrent editing by multiple users, has low editing efficiency, increases developer waiting time and communication costs, and cannot provide effective solutions for handling complex code editing conflicts. Related technologies also offer a collaborative code editing method based on a version control system. This method records the historical modification operations of the code file in the version control system, allowing multiple clients to modify the code simultaneously. When merging code modifications from different clients, the version control system can automatically resolve code editing conflicts according to certain rules. However, version control systems may not provide suitable solutions when dealing with complex code editing conflicts, requiring developers to resolve them manually. Secondly, version control systems may introduce new errors when merging code changes, further increasing the difficulty of debugging. When collaboratively processing code for large R&D projects, version control systems can easily incur high maintenance costs. Existing collaborative code editing methods in related technologies cannot efficiently handle code conflicts caused by multiple people collaborating on code editing, ultimately leading to low code processing efficiency.

[0082] To address the issue of low code processing efficiency in the aforementioned scenarios, this disclosure provides a code processing method based on a collaborative canvas, enabling multiple users to collaborate on code processing and efficiently resolving code conflicts, thereby improving code processing efficiency in the above situations.

[0083] System architecture and scenario description applied in the embodiments of this disclosure

[0084] Figure 1 This is a system architecture diagram of a code processing method based on a collaborative whiteboard according to an embodiment of this disclosure. It includes a terminal 140, an Internet 130, a gateway 120, a server 110, etc.

[0085] Terminal 140 can take various forms, including desktop computers, laptops, PDAs (personal digital assistants), mobile phones, in-vehicle terminals, home theater terminals, dedicated terminals, intelligent voice interaction devices, smart home appliances, or even aircraft. Furthermore, it can be a single device or a collection of multiple devices. Terminal 140 can communicate with the Internet 130 via wired or wireless means to exchange data. Terminal 140 may include a collaborative drawing board client.

[0086] Server 110 refers to a computer system capable of providing certain services to terminal 140. Compared to ordinary terminal 140, server 110 has higher requirements in terms of stability, security, and performance. Server 110 can be a single high-performance computer in a network platform, a cluster of multiple high-performance computers, a portion of a single high-performance computer (e.g., a virtual machine), or a combination of portions of multiple high-performance computers (e.g., virtual machines). In this embodiment, server 110 specifically provides storage functionality; that is, server 110 can be a database node in a distributed database, and this disclosure includes a cluster of multiple servers 110 forming a distributed database. Server 110 may include a collaborative drawing board server.

[0087] Gateway 120, also known as an internetwork connector or protocol converter, is a computer system or device that acts as a translator, enabling network interconnection at the transport layer. It bridges the gap between two systems using different communication protocols, data formats, languages, or even completely different architectures. Gateways can also provide filtering and security functions. Messages sent from terminal 140 to server 110 are forwarded to the corresponding server 110 via gateway 120. Messages sent from server 110 to terminal 140 are also forwarded to the corresponding terminal 140 via gateway 120. In this embodiment, terminal 140 sends a data access request to server 110 via gateway 120, and server 110 returns the data access result to terminal 140 via gateway 120.

[0088] The code processing method based on the collaborative drawing board provided in this embodiment can be implemented in the server 110, or partly in the terminal 140 and partly in the server 110.

[0089] When the code processing method based on the collaborative canvas provided in this embodiment is implemented in the server 110, the server 110 receives multiple code editing instructions sent by multiple terminals 140; then, the server 110 obtains the abstract syntax tree of the first target code file, and performs conflict detection on the multiple code editing operations based on the abstract syntax tree to obtain conflict detection results; further, the server 110 merges the multiple code editing operations based on the conflict detection results, and updates the first target code file according to the merged target code editing operations to obtain a second target code file; finally, the server 110 generates a page update instruction based on the second target code file and sends the page update instruction to the multiple terminals 140, so that the multiple terminals 140 update the code content displayed in the code editing area of ​​the collaborative canvas based on the page update instruction.

[0090] When the code processing method based on the collaborative canvas provided in this embodiment is partially implemented in the terminal 140 and partially implemented in the server 110, the server 110 receives multiple code editing instructions sent by multiple terminals 140. Then, the server 110 obtains the abstract syntax tree of the first target code file and performs conflict detection on the multiple code editing operations based on the abstract syntax tree to obtain conflict detection results. Further, the server 110 merges the multiple code editing operations based on the conflict detection results and updates the first target code file according to the merged target code editing operations to obtain a second target code file. Finally, the server 110 generates a page update instruction based on the second target code file and sends the page update instruction to the multiple terminals 140 so that the multiple terminals 140 update the code content displayed in the code editing area of ​​the collaborative canvas based on the page update instruction.

[0091] The code processing method based on collaborative canvas provided in this disclosure can be applied to code processing tasks of various Internet applications, such as code processing tasks of various application programs, and code processing tasks of various operating systems.

[0092] For example, when the code processing method based on collaborative canvas provided in this embodiment is applied to code processing tasks in office applications, it can receive multiple code editing instructions for office application code files sent by multiple collaborative canvas clients. Then, it can obtain the abstract syntax tree of a first target code file and perform conflict detection on the multiple code editing operations based on the abstract syntax tree to obtain conflict detection results. Further, it can merge the multiple code editing operations based on the conflict detection results and update the first target code file according to the merged target code editing operations to obtain a second target code file. Finally, it can generate page update instructions based on the second target code file and send the page update instructions to multiple collaborative canvas clients, so that the multiple collaborative canvas clients update the code content displayed in the code editing area of ​​the collaborative canvas based on the page update instructions.

[0093] For example, when this embodiment of the present disclosure is applied to code processing in a game application, multiple code editing instructions for the game application code file sent by multiple collaborative artboard clients can be received. Then, an abstract syntax tree (AST) of the first target code file can be obtained, and conflict detection can be performed on the multiple code editing operations based on the AST to obtain conflict detection results. Further, the multiple code editing operations can be merged based on the conflict detection results, and the first target code file can be updated according to the merged target code editing operations to obtain a second target code file. Finally, a page update instruction can be generated based on the second target code file and sent to the multiple collaborative artboard clients, so that the multiple collaborative artboard clients update the code content displayed in the code editing area of ​​the collaborative artboard based on the page update instruction.

[0094] The above examples do not limit the scope of protection in this case.

[0095] General Description of Embodiments in this Disclosure

[0096] According to one embodiment of this disclosure, a code processing method based on a collaborative canvas is provided. For example... Figure 2 The diagram shown is a flowchart illustrating a collaborative drawing board-based code processing method provided in this disclosure. This method can be applied to a collaborative drawing board-based code processing device, which can be integrated into a computer device, specifically a server. The collaborative drawing board-based code processing method may include:

[0097] Step 210: Receive multiple code editing commands sent by multiple collaborative canvas clients.

[0098] As described above, the code processing method based on a collaborative whiteboard provided in this disclosure can be applied to code processing tasks in various Internet applications, such as code processing tasks for various application programs and code processing tasks for various operating systems. During code development, code can be partitioned based on its function, and corresponding developers can be assigned to write code for specific functional areas. Multiple developers can simultaneously process the code in the same functional area. For example, in game application code development, the code can be partitioned according to the game application's functions, such as including rendering engine code areas, game logic function code areas (e.g., level tasks and reward mechanisms), and interface interaction code areas. A code functional area can be collaboratively developed by multiple developers, and the code in the same functional area can be processed through different terminals. The code corresponding to a functional area can correspond to one code file, or it can be multiple sub-code files within a main file. In this disclosure, multi-person collaborative code processing can refer to multiple people collaboratively processing the same code file.

[0099] In this context, a collaborative artboard client can represent a collaborative artboard application account, which can be logged in via a webpage, an application, or a mini-program. A collaborative artboard client can also represent the terminal device used to log in to the collaborative artboard application account; the terminal device can be any of the aforementioned devices such as a mobile phone, computer, or tablet. When at least two collaborative artboard clients are detected simultaneously editing the same code file, each collaborative artboard client can send a code editing instruction to the collaborative artboard server. "Simultaneously" can refer to the same instant or a preset time period, such as multiple collaborative artboard client code editing operations detected within three minutes prior to the current time. Code editing instructions can include collaborative code editing operations on a first target code file, and can also include a communication protocol between the collaborative artboard client and the collaborative artboard server. The first target code file can represent a target code file that multiple collaborative artboard clients are working on collaboratively. Code editing operations can represent descriptive information about the processing of the code content in the first target code file. Specifically, this can include the code processing type, such as modifying, inserting, or deleting code; the location of the code editing operation, such as the filename of the first target file, the line number and column number corresponding to the editing location in the code file; and the content of the code editing, such as inserted characters, modified variables, or deleted functions. Thus, a code editing operation can be represented as: insert “XXX” in line 10, column 5 of file XXX.

[0100] After detecting code editing operations from multiple collaborative artboard clients, code editing instructions can be generated based on these operations. The collaborative artboard server can then receive these instructions from multiple clients. A local proxy module can be created for each client to handle communication between the client and the server. Specifically, the server can receive these instructions via network communication protocols such as WebSocket and Hypertext Transfer Protocol (HTTP). WebSocket enables full-duplex communication over a single Transmission Control Protocol (TCP), allowing for real-time bidirectional communication between the clients and the server. This ensures that code modifications performed by one client are transmitted to the local workspaces of other participating clients.

[0101] In some embodiments, the process of generating code editing instructions may include, but is not limited to, the following steps:

[0102] The collaboration board interface is displayed in the collaboration board client. The collaboration board interface includes a code editing area, in which the first target code file is displayed.

[0103] Receive code editing operations on the first target code file and generate code editing instructions based on the code editing operations.

[0104] Specifically, you can log in to your collaborative canvas application account in the collaborative canvas client to access the collaborative canvas interface. The collaborative canvas interface can include some functional controls and common canvas operation options, as well as a code editing area. The code editing area can be displayed by clicking the code editing control, triggered by the mouse, or selected when opening the collaborative canvas application; there are no restrictions here. The code editing area is equivalent to the code editing page in a code editor. It can include not only the code editing module but also a sidebar, output console, and operation navigation bar. The code editing module can be used to view and input code; the sidebar can display project files and file structure, as well as code structure, such as hierarchical relationships, functions, classes, and function bodies, improving the efficiency of locating code positions; the output console can display code status, such as compiling, and can also output compilation results and error messages, as well as breakpoint information and variable values ​​during debugging; the operation navigation bar can include some commonly used operation options, such as saving code, compiling and running code, and undoing. Please refer to [link / reference]. Figure 3A The collaborative canvas interface 300 includes a collaborative canvas operation bar 310, which displays the name of the current canvas file, such as "XXX canvas," at the top of the collaborative canvas interface 300. The collaborative canvas operation bar 310 can include commonly used function controls and code editing-related function controls. Specifically, from left to right, the collaborative canvas operation bar 310 includes an open file control, an insert text box control, an insert image control, and a code editing control 311. The open file control, insert text box control, and insert image control can be used to open or insert files, insert text box elements, and insert images in the collaborative canvas interface 300, respectively. The code editing control 311 can be used to open the code editing area 320 in the collaborative canvas interface 300. Figure 3A As shown, clicking the code editing control 311 with the mouse can trigger the display of the code editing area 320 in the collaboration canvas interface 300. The above example does not limit the scope of this disclosure; the code editing area can be displayed in the collaboration canvas interface in the aforementioned manner. In the code editing area 320, the name of the currently opened code file can be displayed at the top, for example, the currently displayed code file name is "XXX code file". Specifically, the code editing area 320 may include a code operation navigation bar 321, a sidebar 322, a code editing module 323, and a code output console 324. The code operation navigation bar 321 may include multiple code operation controls, for example, in... Figure 3AThe code editing module 320, from left to right, includes controls for opening a code file, saving a code file, running / compiling a code file, and undoing edits. Each control allows for specific code operations, such as compiling, saving, and reversing changes. The sidebar 322 displays the file hierarchy of the current code file, including the project file, header file, and subfiles. For example, the workspace shows the xxx project, which contains the xx file, which contains two subfiles, xx file 1 and xx file 2. xx file 1 contains the sub-code file "xx file 1.1". The sidebar 322 also displays the hierarchical structure of the code files shown in the code editing module 323 (code outline view). The code editing module 323 is the core area of ​​the code editing area 320, used for inputting and modifying code. The code output console 324 displays the current status of the code, such as whether it is compiling. If compilation is successful, the output result is displayed; if compilation fails, an error message is displayed.

[0105] In this embodiment of the disclosure, a code editing area is displayed in the collaborative whiteboard application interface, and a first target code file is displayed in the code editing area, including but not limited to the following steps:

[0106] Display the collaboration board interface in the collaboration board client;

[0107] In response to a code file open operation received in the code editing area, display a list of code files;

[0108] In response to the selection of the first target code file in the code file list, the first target code file is displayed in the code editing area.

[0109] Specifically, in this embodiment of the disclosure, a collaborative canvas interface can be displayed in the collaborative canvas client. The collaborative canvas interface may include a code editing area. The collaborative canvas client can respond to a code file open operation received in the code editing area and display a list of code files. The code file open operation can be achieved by clicking the open code file operation control or by triggering frequently used operation options with the mouse. Furthermore, the open code file operation can be selected from the frequently used operation options, and then the list of code files is displayed in the code editing area.

[0110] Furthermore, the collaborative canvas client can respond to the selection of the first target file in the code file list by displaying the selected first target code file in the code editing area. Please refer to [link / reference]. Figure 3BAs shown in the figure, in the code editing area 320, clicking the "Open Code File" control 3211 in the code operation navigation bar 321 responds to the "Open File" operation in the code editing area 320, displaying the code file list area 325 in the code editing area 320. This is an example of opening a code file list and does not constitute a limitation on the embodiments of this disclosure. The code file list area 325 may include multiple candidate code files and their related file attribute information. The file attribute information may include file name, path, and file size, for example, for "Code File 1.XXX", its file path is "E:\XX Project\XX", and its file size is 1MB. The bottom of the code file list area 325 may include a file name search bar and a file path search bar, and may also include open and cancel controls. When there are many code files, the first target code file to be opened can be determined by searching by file name or file path. After displaying the code file list area 325 in the code editing area 320, the selection operation of the first target code file in the code file list area 325 can be received. The selection operation of the first target code file can be implemented through mouse events, gesture recognition selection operation, or pupil trajectory detection. There are no restrictions here. After selecting the first target code file, click the open control and then display the first target code file. Alternatively, after selecting the first target code control, the code content of the first target code file can be directly displayed in the code editing area 320.

[0111] In some embodiments, please refer to Figure 3C Assuming in Figure 3B When "Code File 1.XXX" is selected in the code file list area 325, the title displayed at the top of the code editing area 320 changes accordingly to "Code File 1.XXX". The code content of "Code File 1.XXX" can then be displayed in the code editing module 323. If multiple code files are opened simultaneously, the code file selection control 3231 can be displayed in the code editing module 323. For example, if "Code File 1.XXX" to "Code File 3.XXX" are opened simultaneously, the code file selection control 3231 corresponding to each file will be displayed in the code editing module 323. Figure 3C When the code file selection control 3231 for "Code File 1.XXX" is selected, the code content of "Code File 1.XXX" will be displayed in the code editing module 323.

[0112] In some embodiments, a collaboration board interface is displayed in the collaboration board client. The collaboration board interface includes a code editing area, in which a first target code file is displayed, including:

[0113] Display the collaboration board interface in the collaboration board client;

[0114] Display text box elements in the collaborative artboard client;

[0115] In response to a drag operation that moves a text box element to the code editing area, a first target code file is generated based on the code text and displayed in the code editing area.

[0116] Specifically, in this embodiment of the disclosure, a collaborative canvas interface can be displayed in the collaborative canvas client, and the collaborative canvas interface may include the aforementioned code editing area. Text box elements can be displayed in the collaborative canvas client, and these text box elements can be displayed in the collaborative canvas interface by clicking on the text box insertion control; this is not limited here. The text box element can be a document link or document attachment, such as a Word document (docx format document file), a text document (txt format document file), or standalone text. The document may include code content, such as executable code corresponding to multiple functions of an internet application. The text box element may include code text, the display position of the text box in the collaborative canvas interface, and related attribute information such as text formatting information.

[0117] Furthermore, in response to a drag operation where a text box element is dragged to the code editing area, a first target code file can be generated based on the code text and displayed in the code editing area. The drag operation can be performed by recognizing a drag gesture or by using the mouse; there is no restriction here.

[0118] In some embodiments, in response to a drag operation that moves a text box element to the code editing area, a first target code file is generated based on the code text, and the first target code file is displayed in the code editing area, including but not limited to the following steps:

[0119] In response to a drag operation where a text box element is dragged to the code editing area, retrieve the element attribute data of the text box element;

[0120] Extract code text from element attribute data and perform format conversion on the code text to generate the first target code file;

[0121] Display the first target code file in the code editing area.

[0122] Specifically, in this embodiment of the disclosure, the collaborative canvas client can respond to a drag operation that moves a text box element to the code editing area and obtain the element attribute data of the text box element from the collaborative canvas server. The element attribute data may include the display position of the text box element in the collaborative canvas interface, as well as the element content and formatting information of the text box element. If the text box element is a document attachment, the element attribute information may also include the storage path (or access link) of the document attachment, etc.

[0123] Furthermore, the text box element can be parsed to obtain its element attribute data, and the code text can be extracted from the element attribute data. The code text can be formatted to generate a first target code file. Specifically, when a drag operation is detected where a text box element is dragged to the code editing area, candidate programming language types can be displayed. For example, candidate programming language types may include Python, Java, and C++. The user can select the target programming language format to be converted from the candidate programming language types. If the user does not select a target programming language format, the most commonly used programming language type can be used as the target programming language format for format conversion.

[0124] After determining the target programming language type for the code text conversion, the code text can be formatted based on the syntax rules of the target programming language type, and the file name extension of the code can be changed to the corresponding programming language type's file name extension. For example, the file name extension for Python is ".py", and for Java, it's ".java". If the code text in a document is being converted, and the code text in the document is written based on different functional sections, the corresponding code hierarchy structure can be generated simultaneously during the format conversion. After the code text is formatted to obtain the first target code file, it can be displayed in the code editing area. Furthermore, a folder can be automatically created in the collaborative artboard client to store the first target code file. The folder creation path can be the same as the storage path of the text document, and the name can also be the same as the text document's name, but the file format will be different. Alternatively, the operator can choose the storage path and name of the formatted first target code file themselves; there are no restrictions here.

[0125] In this disclosed embodiment, please refer to Figure 3DFor example, in the collaborative canvas interface 300, an attachment link of a text document element 330 can be displayed. The text document element 330 can be dragged to the code editing area 320 using the mouse. Further, the code text in the text document element 330 can be extracted using the aforementioned steps, and the code text can be formatted to obtain a first target code file. The code content of the first target code file can then be displayed in the code editing module 323. Figure 3D As shown, if the filename of text document element 330 is "Code File 1" and the selected target programming language is Python, then the generated first target code file will have the filename extension ".py" and will be named "Code File 1.py". The first target code file, after format conversion, is displayed in the code editing module 323. The code content 3232 is obtained by format conversion of the code text in text document element 330. Furthermore, the code hierarchy corresponding to the code content 3232 can be displayed in the sidebar 322.

[0126] In some embodiments, after displaying the first target code file in the code editing area through the foregoing steps, code editing operations on the first code file can be received, and code editing instructions can be generated based on the code editing operations, specifically including:

[0127] Receive code editing operations on the first target code file, and determine the modified content of the target code based on the code editing operations;

[0128] The modified target code is segmented to obtain multiple target code fragments;

[0129] Generate code editing instructions based on code editing operations and multiple target code snippets.

[0130] Specifically, in this embodiment, code editing operations on the first target code file can be received in the code editing area, and the target code modification content can be determined based on the code editing operations. Specifically, the code editing operation can be any type of editing operation such as insertion, modification, or deletion. Further, the target code modification content can be determined based on the code editing operations. The target code modification content is the code modification content corresponding to code editing operations by multiple collaborative canvas clients within a preset time period after the last code synchronization, i.e., the code increment. Incremental synchronization technology can be used, i.e., only the code content that has changed since the last synchronization is transmitted. This reduces network transmission latency and bandwidth consumption of code editing instructions.

[0131] Furthermore, after determining the target code modifications, these modifications can be chunked. Specifically, chunking involves dividing the target code modifications into chunks, resulting in multiple target code fragments, which are code blocks. By dividing the target code modifications into code blocks for transmission, the amount of data required for a single transmission to the collaborative drawing board server can be reduced. Similarly, since the collaborative drawing board client and server communicate bidirectionally, when the collaborative drawing board server returns code files to the client, the code files can also be chunked before being transmitted back to the client, further reducing the amount of data required for a single transmission.

[0132] Furthermore, after dividing the target code modification content into multiple target code fragments, code editing instructions can be generated by packaging the relevant information of the code editing operation and its corresponding multiple target code fragments.

[0133] Step 220: Obtain the abstract syntax tree of the first target code file, and perform conflict detection on multiple code editing operations based on the abstract syntax tree to obtain the conflict detection results.

[0134] Specifically, through the aforementioned steps, the collaborative whiteboard server receives multiple code editing commands sent by multiple collaborative whiteboard clients. Further, the abstract syntax tree (AST) of the first target code file can be obtained. Specifically, a lexical analyzer can segment the first target code file according to character order, obtaining multiple lexical units (tokens). A lexical unit is the smallest syntactic unit with independent meaning in the code, such as keywords, identifiers, operators, and constants. Alternatively, a parser can construct an AST based on the token sequence generated by the lexical analyzer, according to the syntax rules corresponding to the programming language type. Furthermore, a code library for obtaining the AST can be integrated into the code editing area. For example, for Python code files, the AST module in the Python library can be used to directly obtain the AST of the Python code; for Java code, the ANTLR tool can be used to directly obtain the AST of the Java code. In this way, the first target code file can be represented in a structured manner, facilitating the rapid and accurate location of code conflicts and their scope. Further, after obtaining the AST of the first target code file, conflict detection can be performed on multiple code editing operations based on the AST.

[0135] In this disclosed embodiment, please refer to Figure 4As shown in the figure, the abstract syntax tree 400 of the code in the code editing area 320 of the collaborative drawing board interface 300 includes a root node stmts_list, which can represent a list of statements. The root node stmts_list can include child nodes assign(=) and stmt_for. assign(=) can represent an assignment statement node, and stmt_for can represent a loop statement node, representing a for loop. The assign(=) node includes child nodes variable(sum) and constant(0). variable(sum) can represent a variable node, representing the variable sum, and constant(0) can represent a constant node, representing the value 0. In the previous example, sum is initialized to 0. The `stmt_for` node includes child nodes `variable(i)`, `assign(=)`, and `func_call`. `variable(i)` can represent a variable node indicating the loop variable `i`. `assign(=)` can represent another assignment statement node, indicating an accumulation operation on `sum` within the loop body. `func_call` can represent a function call node. `update` and `for_body` are components of the `for` loop; `update` represents the part updating the loop variable, and `for_body` represents the statements within the loop body. `iterator` represents iteration. The `assign(=)` node can include child nodes `variable(sum)` and `oper_add(+)`. `variable(sum)` can represent a variable node, and `oper_add(+)` can represent an operator node, indicating an addition operation. `func_call` can include child nodes `symbol(range)` and `args`. `symbol(range)` can be a symbol node, representing the `range` function (with the function name `range`), and `args` can be a parameter node, representing the parameters of the `range` function. The node oper_add(+) includes child nodes variable(sum) and variable(i), and the node args can include child nodes constant(100) and constant(0). Constant(100) can represent a constant node with the value 100, and constant(0) can represent a constant node with the value 0.

[0136] In some embodiments, conflict detection is performed on multiple code editing operations based on an abstract syntax tree to obtain conflict detection results, including:

[0137] Determine the corresponding code structure node in the abstract syntax tree for each code editing operation;

[0138] Conflict detection is performed on multiple code editing operations based on the code structure node corresponding to each code editing operation, and the conflict detection results are obtained.

[0139] Specifically, the position of the code character corresponding to each code editing operation can be searched in the abstract syntax tree (AST), thus mapping each code editing operation to a code structure node in the AST. For example, a code insertion operation can be represented as adding a new child node under a code structure node in the AST; a code deletion operation can be represented as removing a code structure node and its sub-ASTs. For instance, if the code editing operation is to delete a function definition in the code of the first target file, then in the AST, this code deletion operation can correspond to deleting the code structure node representing the function definition and all its child nodes.

[0140] Furthermore, after mapping each code editing operation to a code structure node in the abstract syntax tree (AST), it is possible to detect whether multiple code editing operations overlap in nodes or node ranges within the AST. If at least two code editing operations correspond to the same or related code structure nodes, a code conflict may occur. For example, one code editing operation modifies the parameter list of a function in the first target code file (this code editing operation corresponds to a parameter child node under the function structure node in the AST), while another code editing operation deletes the entire function in the first target code file (this code editing operation corresponds to deleting the entire function structure node in the AST). In this case, the two code editing operations conflict because deleting the function node will prevent the code editing operation that modifies the parameter list from executing correctly, and vice versa. Alternatively, when two code editing operations modify the same code structure node, they may be modifying the same code segment, which could also lead to a conflict. Thus, through the aforementioned conflict detection method, this embodiment of the present disclosure can perform conflict detection on multiple code editing operations based on the AST of the first target code file to obtain conflict detection results. The embodiments disclosed herein can automatically detect code conflicts in collaborative code editing, improving the fluency of collaborative code processing and thus improving code processing efficiency.

[0141] Step 230: Based on the conflict detection results, multiple code editing operations are merged, and the first target code file is updated according to the merged target code editing operations to obtain the second target code file.

[0142] Specifically, conflict detection is performed on multiple code editing operations through the aforementioned steps to obtain conflict detection results. Further, the multiple code editing operations can be merged based on the conflict detection results. When the conflict detection results indicate that there are no conflicts among the multiple code editing operations, the multiple code editing operations are merged, and the first target code file is updated according to the merged target code editing operations to obtain the second target code file.

[0143] In some embodiments, fusing multiple code editing operations based on conflict detection results, and updating the first target code file according to the fused target code editing operations to obtain a second target code file, may include the following steps:

[0144] When the conflict detection result indicates that there is a conflict between multiple code editing operations, the first target code file is updated based on the preset code conflict resolution strategy to obtain the candidate code conflict resolution file, and the conflict detection result and the candidate code conflict resolution file are sent to multiple collaborative canvas clients;

[0145] Receive code conflict resolution instructions returned by the collaboration board client based on the candidate code conflict resolution file, and merge multiple code editing operations based on the code conflict resolution instructions;

[0146] The first target code file is updated based on the edit operations of the merged target code to obtain the second target code file.

[0147] Specifically, in this embodiment of the disclosure, when the conflict detection result indicates that multiple code editing operations conflict, the conflict can be resolved based on preset rules and code conflict resolution strategies. Specifically, a conflict resolution algorithm can be used to resolve code editing conflicts between multiple code editing operations. This conflict resolution algorithm can be an operation transformation algorithm or a differential synchronization algorithm. In the method of resolving code editing conflicts based on operation transformation, the collaborative canvas server can represent each code editing operation as a series of atomic operations and map these atomic operations to a globally consistent state through a transformation function. In the method of resolving code editing conflicts based on differential synchronization algorithm, the collaborative canvas server can calculate the differences between different versions of code and generate a fused target code editing operation based on the difference information between different code versions. Then, it updates the first target code file according to the fused target code editing operation to obtain a second target code file. Thus, this embodiment of the disclosure can assist in resolving code editing conflicts and improve code processing efficiency.

[0148] Furthermore, by updating the first target code file based on a preset code conflict resolution strategy, candidate code conflict resolution files can be obtained. These candidate files represent the code files obtained by the collaboration board server after resolving code editing conflicts based on the preset strategy. The conflict detection results and candidate code conflict resolution files can be sent to multiple collaboration board clients. Specifically, they can be sent to the collaboration board client corresponding to the conflicting code editing operation, or to all collaboration board clients involved in the collaborative processing of the first target code file. For example, please refer to... Figure 5A ,like Figure 5A As shown, if the conflict detection result indicates that two or more of the multiple code editing operations sent by multiple collaborative canvas clients are in conflict, a code conflict warning message can be sent to the collaborative canvas clients. This message can be sent to the collaborative canvas clients with conflicting code editing operations, or it can be sent to all participating collaborative canvas clients. Figure 5A As shown, the collaborative whiteboard client can receive conflict alerts sent by the collaborative whiteboard server and display them in the code editing area 320. Specifically, conflict information can be displayed via pop-up windows, such as "The current code editing operation conflicts with the code editing operation of account XXX!" in the conflict alert pop-up window 510. The conflict alert can include account information related to the conflicting operation. Furthermore, the specific conflict detection results can be viewed by clicking on the conflict details alert 511. For example, clicking on the conflict details alert 511 will display the conflict details area 520 in the code editing area 320. The conflict details area 520 can include detailed information about the conflict detection results, such as the name of the conflicting code file, the location of the conflicting code segment, and the specific content of the code conflict (e.g., the involved code editing operations and the corresponding code modifications). Figure 5A As shown, the conflict details area 520 can display two code conflict details, specifically "Code file 1, line XX, column XX: Variable duplicate" and "Code file 1, line XX, column XX: Variable naming conflict with function naming".

[0149] Furthermore, the collaborative canvas server can send multiple candidate code conflict resolution files generated according to the conflict resolution algorithm to the collaborative canvas client for preview. This means the client can preview the updated code file based on the fused target code after editing. For example, please refer to... Figure 5BAs shown in the figure, the conflict details area 520 may include a conflict resolution suggestion area 521. Clicking the conflict resolution suggestion area 521 will display the conflict resolution area 530 in the code editing area 320. Specifically, the conflict resolution area 530 may display candidate code conflict resolution files in the form of code files. You can preview the code merging results provided by the collaboration board server by clicking the file, or you can directly display the specific content of the candidate code conflict resolution files in the conflict resolution area 530. There are no restrictions here.

[0150] Furthermore, after previewing the candidate code conflict resolution file in conflict resolution area 530, you can confirm and modify the previewed file. For example, please refer to... Figure 5C The conflict resolution area 530 may also include a code confirmation control 531 and a code modification control 532. Clicking the code confirmation control 531 confirms the candidate code conflict resolution file, and clicking the code modification control 532 modifies the candidate code conflict resolution file. Specifically, clicking the code modification control 532 triggers the code modification area 540, where code can be modified. The code modification area 540 may include common controls such as save file, edit file, and undo / redo. If code modification conflicts exist between two or more collaborative artboard clients during code modification, the permission information of the collaborative artboard client executing the code modification operation can be obtained. This permission information may include the collaborative artboard client's account information and permission level. Furthermore, the code modification operation of the collaborative artboard client with the higher permission level can be executed. If a collaborative artboard client with a lower permission level wants to execute a code modification operation, it can send a permission request to the collaborative artboard client with the higher permission level to obtain permission to perform the code modification operation. This improves the efficiency of resolving code conflicts.

[0151] Furthermore, the collaborative canvas client can generate code conflict resolution instructions based on the modifications made to the candidate code conflict resolution files. These instructions can include relevant attribute information of the modified candidate code conflict resolution files, the modification location, the modified content, and the account information of the collaborative canvas client executing the modification operation. Upon receiving the code conflict resolution instructions from the collaborative canvas client to the collaborative canvas server, the server can further merge multiple code editing operations based on these instructions and update the first target code file according to the merged target code editing operations to obtain a second target code file. Thus, this embodiment of the present disclosure can automatically handle code conflicts arising during multi-user collaborative code processing based on a preset conflict resolution strategy, improving code processing efficiency. It can also review and modify conflict resolution solutions, improving the accuracy of code conflict resolution.

[0152] In some embodiments, the code processing method based on a collaborative canvas provided in this disclosure may further include the following steps:

[0153] Receive code execution instructions sent by any collaborative artboard client;

[0154] The code file is executed based on the code execution command, the code execution result is obtained, and the code execution result is sent to the collaborative drawing board client.

[0155] Specifically, in this embodiment of the disclosure, the collaborative whiteboard server can receive code execution instructions sent by any collaborative whiteboard client, wherein the code execution instructions may include code execution operations on code files in the code editing area, for example, such as... Figure 3A As shown, the code operation navigation bar 321 in the code editing area 320 can be clicked with the mouse. After the mouse event of clicking the code operation control is detected, a code operation instruction can be sent to the collaboration board server. The code operation instruction can include code operation on the code file in the code editing area, and can also include the code content in the code file, the operation mode, etc. The operation mode can include normal operation mode or debug operation mode, etc.

[0156] Furthermore, after receiving the code execution command, the collaborative whiteboard server can run the code file based on the command and obtain the execution result. Specifically, it can build a corresponding code execution environment according to the programming language type of the code file. For example, for Python code, it can call the Python interpreter to parse the code file; for Java code, it can start the Java Virtual Machine (JVM). Simultaneously, the collaborative whiteboard server can load the code file into the built execution environment. The collaborative whiteboard server runs the code file in the code execution environment, obtains the execution result, and returns the result to the collaborative whiteboard client. The result can be displayed in the code output console of the code editing area, for example, in... Figure 3C If the code runs successfully, the output will be displayed in the code output console 324 within the code editing area 320, such as printing "Hello World!". If the code fails, an error message will be displayed in the code output console 324, which may include the location of the error and a brief explanation of the reason for the error. It should be noted that code execution can begin at any time. When multiple people are collaborating on code processing, a single collaborative artboard client can run code at any time without affecting other collaborative artboard clients.

[0157] In some embodiments, a code file is run based on code execution instructions to obtain code execution results, including:

[0158] A pre-defined runtime container is created based on the code execution instructions, and the code execution environment is deployed in the pre-defined runtime container;

[0159] Run the code file in the code execution environment to obtain the code execution result.

[0160] Specifically, after receiving a code execution command, the collaborative whiteboard server can create a preset execution container based on the command. As mentioned earlier, the code execution command can include the programming language type of the code file, the corresponding runtime environment requirements, and the programming language version. Furthermore, a code execution container can be created for each collaborative whiteboard client, thus avoiding interference between different code file execution tasks. Container technologies can include Docker containers, Linux kernel-based process-level container technology (LinuxContainers, LXC), etc., and a corresponding code execution container can be created based on the operating system type.

[0161] Furthermore, after the code execution container is created, the corresponding code execution environment can be installed and configured within it. Specifically, deploying the code execution environment within the container can include downloading necessary software packages from a software repository and configuring environment variables. For example, if the programming language and version included in the code execution instructions is Python 3.8, and the code file depends on the NumPy library, the collaborative drawing server can install the Python 3.8 interpreter and the NumPy library within the code execution container to ensure that the execution environment meets the requirements for code execution. After the code execution environment is created, the code file can be run within it. During execution, the code can call various resources in the execution environment, such as function libraries and system interfaces, according to its own syntax logic, to complete various operations and obtain the code execution results.

[0162] Specifically, the code execution result can include output information, such as outputting running data using the print statement, or error messages, i.e., information related to syntax errors, logical errors, or runtime errors that occurred during the code file's execution. The collaboration board server can capture this output information, obtain the code execution result, and return it to the collaboration board client that requested the code execution for display.

[0163] In this embodiment, an intelligent debugging module can also be provided to offer real-time code analysis and debugging suggestions. The intelligent debugging module can integrate static code analysis tools and dynamic code analysis tools. Specifically, the static code analysis tools may include SonarQube and a Programming Mistakes Detector (PMD), while the dynamic code analysis tools may include Valgrind and Xcode Instruments. Real-time code detection is achieved through these static and dynamic code analysis tools. Static code analysis tools can perform syntax, logic, and style checks on the code without executing the code file. For example, they can check for syntax errors, unused variables, and duplicate code blocks. Static code analysis tools can perform these checks on the code file in real time, helping developers to promptly identify and fix potential code errors during the coding process, thereby improving code accuracy. Dynamic code analysis technology monitors the runtime status of the code file in real time. Dynamic code analysis can analyze the code during execution, capturing runtime exceptions and errors. For example, code instrumentation techniques (such as bytecode instrumentation in Java) can be used to collect code execution status information during runtime, such as function call relationships and code execution time. In this way, potential errors in the code file can be located.

[0164] In other embodiments, the intelligent debugging module can leverage artificial intelligence and machine learning technologies to provide developers with intelligent and personalized debugging support services. For example, it can analyze the code modification records of collaborative whiteboard clients over a period of time using neural network models to predict potential problems they may encounter during code writing and execution, and provide solutions in advance. Simultaneously, it can utilize Natural Language Processing (NLP) technology to analyze developers' descriptions, thereby more accurately understanding their needs and problems during code processing and improving code processing efficiency. During collaborative code processing, the intelligent debugging module can analyze the code editing operations sent by different collaborative whiteboard clients in real time, providing personalized optimization and debugging suggestions for each client.

[0165] Step 240: Generate a page update instruction based on the second target code file and send the page update instruction to multiple collaborative artboard clients, so that the multiple collaborative artboard clients update the code content displayed in the code editing area of ​​the collaborative artboard based on the page update instruction.

[0166] In this embodiment, a target code editing operation is obtained by merging the code editing operations of multiple collaborative artboard clients. Based on this target code editing operation, a first target code file is updated to obtain a second target code file. Then, a page update instruction can be generated based on the second target code file and sent to multiple collaborative artboard clients. The page update instruction may include the account information of each collaborative artboard client, the corresponding update code content, and the update location information.

[0167] In some embodiments, generating page update instructions based on a second target code file may include the following steps:

[0168] Obtain the code editing operations of each collaborative artboard client, and determine the code editing location in the first target code file based on the code editing operations;

[0169] The displayed code content is determined based on the code editing location and the second target code file;

[0170] Generate page update instructions for each collaborative canvas client based on the displayed code content.

[0171] In this embodiment, the code editing operations of each collaborative artboard client can be acquired, and the code editing position in the first target code file can be determined based on the code editing operations. For example, client A modifies the code content in row XX, column XX of the first page of code file 1, and client B modifies the code content in row XX, column XX of the third page of code file 1. Further, based on the finally determined code update content in the second target code file and the code editing position of each collaborative artboard client, the synchronized display code content of each collaborative artboard client can be determined. Finally, a page update instruction corresponding to each collaborative artboard client can be generated based on the display code content, and the page update instruction can be sent to the corresponding collaborative artboard client. For example, for client A, the updated code content can be displayed in row XX, column XX of the first page of code file 1, and for client B, the corresponding code update content can be displayed in row XX, column XX of the third page of code file 1. This avoids frequent page jumps in the code editing page of the collaborative artboard client during code synchronization, improving the user experience.

[0172] The code processing method based on a collaborative canvas provided in this disclosure involves receiving multiple code editing instructions sent by multiple collaborative canvas clients; obtaining an abstract syntax tree of a first target code file; performing conflict detection on the multiple code editing operations based on the abstract syntax tree to obtain conflict detection results; fusing the multiple code editing operations based on the conflict detection results; updating the first target code file according to the fused target code editing operations to obtain a second target code file; generating a page update instruction based on the second target code file and sending the page update instruction to the multiple collaborative canvas clients, so that the multiple collaborative canvas clients update the code content displayed in the code editing area of ​​the collaborative canvas based on the page update instruction.

[0173] This disclosure provides a method for code processing based on a collaborative canvas. Leveraging the collaborative canvas's multi-user collaboration and data synchronization sharing functions, it enables collaborative code processing by multiple users. During collaborative code processing, code editing conflicts may arise. This disclosure can obtain the abstract syntax tree (AST) of the first target code file to be processed, and perform conflict detection on multiple code editing operations based on the AST, achieving precise location of code conflict. Furthermore, the conflict is resolved automatically, and the resulting second target code file is sent to the collaborative canvas's code editing area for display. Thus, this disclosure enables multi-user collaborative code processing based on the collaborative canvas's functionality, and automatically resolves conflicts arising between code editing operations during processing, improving the smoothness of collaborative code processing and thereby increasing code processing efficiency.

[0174] This disclosure provides a detailed description of embodiments in conjunction with specific application scenarios.

[0175] like Figure 6 The diagram shown is another flowchart illustrating the code processing method based on a collaborative canvas provided in this disclosure. This embodiment will use the code processing of an Internet application as an example to describe the code processing method based on a collaborative canvas in detail, focusing on the executing entities of each step. The method specifically includes the following steps:

[0176] Step 601: The collaborative whiteboard client receives the code editing operation on the first target code file and generates code editing instructions based on the code editing operation.

[0177] In this embodiment, the code processing method based on a collaborative canvas provided in this disclosure will be described in detail using the code processing scenario of an Internet application as an example. Code files are the foundation for implementing Internet functional logic and business processes. Code development is crucial for the functional optimization and service expansion of Internet applications. The code development process involves a large amount of code processing work; therefore, to improve the development efficiency of Internet applications, it is necessary to improve code processing efficiency. To improve code processing efficiency, this disclosure provides a code processing method based on a collaborative canvas. In this embodiment, the collaborative canvas client can be any of a personal computer, mobile device, wearable smart device, in-vehicle device, or server device.

[0178] The collaborative canvas client can display the collaborative canvas application interface and a code editing area within it. It can receive code file opening operations within the code editing area and display a list of code files. Furthermore, it can receive file selection operations from the code file list, selecting the first target code file, and then display that first target code file in the code editing area. See [link to documentation] for details. Figures 3A to 3D Furthermore, it can receive code editing operations on the first target code file in the code editing area, generate code editing instructions based on the code editing operations, and then send the code editing instructions to the collaboration board server.

[0179] Step 602: The collaborative canvas server receives code editing instructions sent by multiple collaborative canvas clients and obtains the abstract syntax tree of the first target code file.

[0180] In this embodiment of the disclosure, the collaborative whiteboard server can receive code editing instructions for a first target code file sent by multiple collaborative whiteboard clients participating in code collaboration. When the collaborative whiteboard server receives the code editing instructions, it can obtain the access link or storage path of the first target code file based on the code editing instructions, and determine the programming language type corresponding to the first target code file. Furthermore, it can call the corresponding analysis tool for obtaining the abstract syntax tree to obtain the abstract syntax tree of the first target code file. The specific acquisition method has been described in the foregoing steps and will not be repeated here.

[0181] Step 603: The collaborative whiteboard server determines the code structure node corresponding to each code editing operation in the abstract syntax tree, and performs conflict detection on multiple code editing operations based on the code structure node to obtain the conflict detection result.

[0182] Furthermore, after determining the abstract syntax tree (AST), the collaborative whiteboard server can identify the corresponding code structure node in the AST for each code editing operation. Then, it can perform conflict detection on multiple code editing operations based on the corresponding code structure node. Specifically, if two or more code editing operations correspond to the same code structure node or have related code structure nodes, the conflict detection result indicates a code editing conflict between two or more of the multiple code editing operations. The AST can represent the syntax and hierarchical structure information of a code file. Compared to related technologies that only compare text in different versions of code files, which cannot delve into the code development logic and discover potential conflicts, this embodiment of the disclosure performs conflict detection on multiple code editing operations based on the AST, enabling conflict analysis and detection from the code logic perspective, thus improving the accuracy of code conflict detection. After performing code conflict detection on multiple code editing operations, the collaborative whiteboard server can send a code conflict notification to the collaborative whiteboard client, such as... Figure 5A As shown in the image, in the code editing area, developers can see detailed conflict detection results, such as the code location information corresponding to the conflicting code segment, the developers involved in the code editing conflict, and the corresponding code editing content.

[0183] Step 604: When the conflict detection result indicates that there is a conflict between multiple code editing operations, the collaboration board server updates the first target code file based on the preset code conflict resolution strategy to obtain the candidate code conflict resolution file, and sends the candidate code conflict resolution file to the collaboration board client.

[0184] Specifically, in this embodiment, the collaborative whiteboard server can invoke a preset code conflict resolution strategy to merge multiple code editing operations, obtaining a merged target code editing operation. Then, based on the target code editing operation, the first target code file is updated to obtain a candidate code conflict resolution file. The merging of multiple code editing operations can be achieved using an operation transformation algorithm or a differential synchronization algorithm; no limitation is made here. Since the candidate code conflict resolution file is generated by the collaborative whiteboard server after intelligently resolving code conflicts, the accuracy of the code in the candidate code conflict resolution file may not be high. In this case, the collaborative whiteboard server can send the generated candidate code conflict resolution file to any collaborative whiteboard client. When displaying the code conflict detection results, the collaborative whiteboard client can simultaneously display conflict resolution suggestions intelligently generated based on the conflict resolution algorithm, i.e., display the code content in the candidate code conflict resolution file. The candidate code conflict resolution file can highlight conflicting code segments and provide corresponding code modification suggestions to developers through annotations. Figure 5B As shown, developers can preview code modification suggestions in the code editing area of ​​the collaboration board client.

[0185] Step 605: The collaboration board server receives code conflict resolution instructions returned by any collaboration board client, and updates the candidate code conflict resolution file based on the conflict resolution instructions to obtain the second target code file.

[0186] After the collaboration board application interface displays detailed conflict detection information and candidate conflict resolution files, the collaboration board client can receive code modification operations in the code editing area for the candidate conflict resolution files, modifying the solutions provided by the conflict resolution algorithm. It can also receive code confirmation operations in the code editing area for the candidate conflict resolution files, confirming the solutions provided by the conflict resolution algorithm. Furthermore, the collaboration board client can generate code conflict resolution instructions based on the code modification operations for the candidate conflict resolution files. This allows for the review and modification of the intelligently generated conflict solutions, further improving the accuracy of code conflict resolution.

[0187] Any collaborative canvas client can receive code modification operations for candidate conflict resolution files and generate corresponding conflict resolution instructions, which are then sent to the collaborative canvas server. Upon receiving the conflict resolution instructions, the collaborative canvas server, if conflicts exist, can determine the final target code modification operation within the conflict resolution instructions based on the client's permission level. The server can then update the candidate conflict resolution files based on the determined target code modification operation, resulting in a conflict-free second target code file.

[0188] Step 606: The collaborative canvas server obtains the code editing position corresponding to each code editing operation, and generates a page update instruction corresponding to each collaborative canvas client based on the code editing position and the second target code file.

[0189] Specifically, the collaborative artboard server can obtain the code editing position corresponding to each code editing operation. This code editing position can be represented in the first target code file. Based on the code editing position and the second target code file, the collaborative artboard server can generate display code content for each collaborative artboard client. Then, it can generate corresponding page update instructions based on the display code content for each collaborative artboard client. When synchronizing the display code content to the collaborative artboard clients, the collaborative artboard server can process the display code content in chunks to reduce the amount of data required for a single synchronization and improve data transmission speed.

[0190] Step 607: The collaborative whiteboard client receives the page update instruction and displays the corresponding code content in the code editing location.

[0191] In this embodiment, the collaborative whiteboard client receives a corresponding page update instruction, displays the code content at the corresponding code editing location based on the code content of the second target code file in the page update instruction, and can annotate the synchronized code content using highlighting or other annotation methods, generating a code modification record corresponding to this code editing operation. The code modification record may include the account information of the collaborative whiteboard client participating in the code collaboration process, its corresponding code editing operation, and the last updated and synchronized code content.

[0192] Step 608: The collaborative whiteboard server receives a code execution instruction sent by any collaborative whiteboard client, deploys a code execution environment according to the code execution instruction, runs the code file in the code execution environment, and obtains the code execution result.

[0193] In this embodiment, any collaborative canvas client can receive code execution operations in the code editing area of ​​the collaborative canvas interface and generate code execution instructions based on these operations. The collaborative canvas server can receive code execution instructions sent by any collaborative canvas client and deploy a code execution environment according to these instructions. The specific code execution environment has been described in the preceding steps and will not be repeated here. Finally, the collaborative canvas server can run the code file in the code execution environment to obtain the code execution results.

[0194] Step 609: The collaborative drawing board client receives and displays the code execution results.

[0195] After the collaborative canvas server generates the code execution result, it can send it to the corresponding collaborative canvas client. The collaborative canvas client can receive the code execution result and output it through the code output console. This disclosure provides a code processing device based on a collaborative canvas, enabling a code editor for multi-user collaborative code processing. Please refer to... Figure 7 The collaborative whiteboard-based code processing device can include a real-time synchronization module, a conflict detection and resolution module, and an intelligent debugging module. The real-time synchronization module enables real-time code sharing and editing among multiple developers; the conflict detection and resolution module automatically detects and resolves conflicts that occur during editing; and the intelligent debugging module provides developers with real-time code analysis and debugging suggestions.

[0196] Specifically, the real-time synchronization module stores the code versions of all collaborative artboard clients through a central server. This central server can be deployed using cloud computing technology to ensure high availability and scalability. Each collaborative artboard client's local workspace can communicate and synchronize with the central server in real time. To achieve real-time synchronization, a local proxy can be created for each collaborative artboard client to handle communication with the central server. The local proxy can run in the background, detecting code changes in the collaborative artboard clients in real time and transmitting these changes to the central server. The real-time synchronization module communicates with the collaborative artboard server using the WebSocket protocol. In this way, the real-time synchronization module enables real-time bidirectional communication between the collaborative artboard clients and the collaborative artboard server, ensuring that code changes made by developers are transmitted to the local workspaces of other collaborative artboard clients in real time. To further optimize the real-time synchronization process, the module can employ efficient data transmission strategies, such as splitting code files into blocks or using incremental synchronization technology to reduce network latency and bandwidth consumption.

[0197] The conflict detection and resolution module can detect code changes in real time, enabling immediate identification of conflicts when multiple developers are simultaneously modifying the same code segment. To achieve real-time conflict detection, an event-driven programming model can be employed, triggering corresponding events during code editing operations to update the code state in real time. Furthermore, abstract syntax trees (ASTs) can be used to structurally represent the code, facilitating precise location and scope of conflicts. To better support human intervention, the conflict resolution module also provides developers with a visual conflict resolution interface. This interface displays detailed conflict warnings, and the module can generate conflict resolution suggestions based on its algorithm. The merged code file is then sent to the collaboration board client for preview. Developers can use the preview results to confirm or make further modifications to ensure proper handling of code editing conflicts.

[0198] The intelligent debugging module integrates static code analysis tools to perform real-time code inspection. Static code analysis tools can check code for syntax, logic, and style without executing the code. For example, it checks for syntax errors, unused variables, and duplicate code blocks. This helps developers identify and fix potential problems during the coding process, improving code quality. The intelligent debugging module can also monitor the code's execution status in real time using dynamic code analysis technology, capturing runtime anomalies and errors. Furthermore, it leverages artificial intelligence and machine learning technologies to provide developers with more intelligent and personalized debugging support. For example, it predicts potential problems by analyzing developers' historical code modification records and provides solutions in advance. Simultaneously, it uses natural language processing technology to analyze developers' descriptions for a more accurate understanding of code processing needs. The intelligent debugging module can also collaborate with other modules (such as the real-time synchronization module and the conflict detection and resolution module) to provide more comprehensive support. For instance, in multi-person collaboration, the intelligent debugging module can analyze the code changes made by different developers in real time, providing personalized optimization suggestions and debugging support.

[0199] In other embodiments, artificial intelligence technology can be used for real-time code review, automatically detecting potential problems and providing modification suggestions to improve collaboration and code processing efficiency. Blockchain technology can also be used to build a code collaboration platform. In this way, multiple developers can simultaneously edit and debug code, and modification records can be stored on the blockchain to ensure data integrity and traceability.

[0200] Description of apparatus and devices according to embodiments of this disclosure

[0201] It is understood that although the steps in the above flowcharts are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated in this embodiment, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the above flowcharts may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps.

[0202] It should be noted that in the various specific embodiments of this disclosure, when processing is required based on data related to the characteristics of the target object, such as target object attribute information or a set of attribute information, the permission or consent of the target object will be obtained first. Furthermore, the collection, use, and processing of this data will comply with the relevant laws, regulations, and standards of the relevant regions. In addition, when this application embodiment needs to obtain target object attribute information, separate permission or consent from the target object will be obtained through pop-up windows or redirection to a confirmation page. Only after obtaining the target object's separate permission or consent will the necessary target object-related data for the normal operation of this application embodiment be obtained.

[0203] Figure 8 A schematic diagram of the structure of a collaborative whiteboard-based code processing device 800 provided in this embodiment of the disclosure. The device includes:

[0204] The receiving unit 801 is used to receive multiple code editing instructions sent by multiple collaborative whiteboard clients, the code editing instructions including code editing operations for collaborative editing of a first target code file;

[0205] The detection unit 802 is used to obtain the abstract syntax tree of the first target code file, and to perform conflict detection on multiple code editing operations based on the abstract syntax tree to obtain the conflict detection result;

[0206] The update unit 803 is used to merge multiple code editing operations based on the conflict detection results, and update the first target code file according to the merged target code editing operations to obtain the second target code file;

[0207] The sending unit 804 is used to generate a page update instruction based on the second target code file and send the page update instruction to multiple collaborative artboard clients, so that the multiple collaborative artboard clients update the code content displayed in the code editing area of ​​the collaborative artboard based on the page update instruction.

[0208] Optionally, in some embodiments, the code processing apparatus based on a collaborative canvas provided in this disclosure further includes:

[0209] The display subunit is used to display the collaboration board interface in the collaboration board client. The collaboration board interface includes a code editing area, in which the first target code file is displayed.

[0210] The first generation subunit is used to receive code editing operations on the first target code file and generate code editing instructions based on the code editing operations.

[0211] Optionally, in some embodiments, the first display subunit includes:

[0212] The first display module is used to display the collaboration board interface in the collaboration board client. The collaboration board interface includes a code editing area.

[0213] The second display module is used to display a list of code files in response to a code file open operation received in the code editing area;

[0214] The third display module is used to display the first target code file in the code editing area in response to the selection operation of the first target code file in the code file list.

[0215] Optionally, in some embodiments, the first display subunit includes:

[0216] The fourth display module is used to display the collaboration board interface in the collaboration board client. The collaboration board interface includes a code editing area.

[0217] The fifth display module is used to display text box elements in the collaborative canvas client. The text box elements contain code text.

[0218] The sixth display module is used to generate a first target code file based on the code text in response to a drag operation that moves a text box element to the code editing area, and to display the first target code file in the code editing area.

[0219] Optionally, in some embodiments, the sixth display module includes:

[0220] The `Get` submodule is used to retrieve the element attribute data of the text box element in response to a drag operation where the text box element is dragged to the code editing area.

[0221] The conversion submodule is used to extract code text from element attribute data and perform format conversion on the code text to generate the first target code file;

[0222] The display submodule is used to display the first target code file in the code editing area.

[0223] Optionally, in some embodiments, generating sub-units includes:

[0224] The determination module is used to receive code editing operations on the first target code file and determine the modified content of the target code based on the code editing operations;

[0225] The sharding module is used to shard the modified target code to obtain multiple target code fragments;

[0226] The generation module is used to generate code editing instructions based on code editing operations and multiple target code snippets.

[0227] Optionally, in some embodiments, the detection unit includes:

[0228] The first determining subunit is used to determine the code structure node in the abstract syntax tree corresponding to each code editing operation;

[0229] The detection subunit is used to perform conflict detection on multiple code editing operations based on the code structure node corresponding to each code editing operation, and obtain the conflict detection result.

[0230] Optionally, in some embodiments, the code processing apparatus based on a collaborative canvas provided in this disclosure further includes:

[0231] The receiving subunit is used to receive code execution instructions sent by any collaborative canvas client. The code execution instructions include code execution operations on the code file in the code editing area.

[0232] The execution subunit is used to run code files based on code execution instructions, obtain code execution results, and send the code execution results to the collaborative drawing board client.

[0233] Optionally, in some embodiments, the running subunit includes:

[0234] Create a module to create a preset runtime container based on code execution instructions, and deploy the code execution environment in the preset runtime container;

[0235] The run module is used to run code files in the code execution environment and obtain the code execution results.

[0236] Optionally, in some embodiments, the updating unit includes:

[0237] The sending subunit is used to update the first target code file based on a preset code conflict resolution strategy when the conflict detection result indicates that there is a conflict between multiple code editing operations, obtain a candidate code conflict resolution file, and send the conflict detection result and the candidate code conflict resolution file to multiple collaborative canvas clients.

[0238] The fusion subunit is used to receive code conflict resolution instructions returned by the collaborative canvas client based on the candidate code conflict resolution file, and to fuse multiple code editing operations based on the code conflict resolution instructions;

[0239] The update subunit is used to update the code of the first target code file according to the target code editing operation obtained by fusion, so as to obtain the second target code file.

[0240] Optionally, in some embodiments, the updating unit includes:

[0241] The second determining subunit is used to obtain the code editing operation of each collaborative canvas client and determine the code editing position in the first target code file based on the code editing operation;

[0242] The third determining subunit is used to determine the content of the displayed code based on the code editing location and the second target code file;

[0243] The second generation subunit is used to generate page update instructions for each collaborative canvas client based on the displayed code content.

[0244] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0245] Reference Figure 9 , Figure 9 To implement the structural block diagram of a portion of the terminal 140 for the code processing method based on a collaborative drawing board according to an embodiment of this disclosure, the terminal 140 includes: a radio frequency (RF) circuit 910, a memory 915, an input unit 930, a display unit 940, a sensor 950, an audio circuit 960, a wireless fidelity (WiFi) module 970, a processor 980, and a power supply 990, etc. Those skilled in the art will understand that... Figure 9 The terminal 140 structure shown does not constitute a limitation on a mobile phone or computer, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0246] The RF circuit 910 can be used to receive and transmit signals during information transmission or calls. In particular, it receives downlink information from the base station and processes it with the processor 980; in addition, it transmits uplink data to the base station.

[0247] The memory 915 can be used to store software programs and modules. The processor 980 executes various terminal functions and document editing by running the software programs and modules stored in the memory 915.

[0248] The input unit 930 can be used to receive input numeric or character information, and to generate key signal inputs related to the terminal's settings and function control. Specifically, the input unit 930 may include a touch panel 931 and other input devices 932.

[0249] The display unit 940 can be used to display input or provided information, as well as various menus of the terminal. The display unit 940 may include a display panel 941.

[0250] Audio circuitry 960, speaker 961, and microphone 962 provide an audio interface.

[0251] In this embodiment, the processor 980 included in the terminal 140 can execute the code processing method based on the collaborative drawing board in the previous embodiment.

[0252] The terminal 140 in this disclosure includes, but is not limited to, mobile phones, computers, smart voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc.

[0253] Figure 10 This is a partial structural block diagram of a server 110 implementing the collaborative whiteboard-based code processing method of this disclosure. The server 110 can vary significantly due to different configurations or performance characteristics, and may include one or more central processing units (CPUs) 1022 (e.g., one or more processors) and storage devices 1032, and one or more storage media 1030 (e.g., one or more mass storage devices) storing application programs 1042 or data 1044. The storage devices 1032 and storage media 1030 can be temporary or persistent storage. The program stored in the storage media 1030 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the server 110. Furthermore, the CPU 1022 may be configured to communicate with the storage media 1030 and execute the series of instruction operations in the storage media 1030 on the server 110.

[0254] Server 110 may also include one or more power supplies 1026, one or more wired or wireless network interfaces 1050, one or more input / output interfaces 1058, and / or one or more operating systems 1041, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0255] The central processing unit 1022 in server 110 can be used to execute the code processing method based on collaborative drawing board according to the embodiments of this disclosure.

[0256] This disclosure also provides a storage medium for storing program code, which is used to execute the code processing methods based on collaborative drawing boards in the foregoing embodiments.

[0257] This disclosure also provides a computer program product comprising a computer program. A processor of a computer device reads and executes the computer program, causing the computer device to perform the code processing method based on the collaborative drawing board described above.

[0258] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in this disclosure and the foregoing drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “including,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatuses.

[0259] It should be understood that in this disclosure, "at least one item" means one or more, and "more than one" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0260] It should be understood that in the description of the embodiments disclosed herein, "multiple" means two or more, "greater than", "less than", "exceeding" etc. are understood to exclude the number itself, and "above", "below", "within" etc. are understood to include the number itself.

[0261] In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.

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

[0263] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0264] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0265] It should also be understood that the various implementation methods provided in this disclosure can be combined arbitrarily to achieve different technical effects.

[0266] The above is a detailed description of the embodiments of this disclosure. However, this disclosure is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this disclosure. All such equivalent modifications or substitutions are included within the scope defined by the claims of this disclosure.

Claims

1. A code processing method based on a collaborative canvas, characterized in that, The method includes: Receive multiple code editing instructions sent by multiple collaborative whiteboard clients, wherein the code editing instructions include code editing operations for collaborative editing of a first target code file; Obtain the abstract syntax tree of the first target code file, and perform conflict detection on multiple code editing operations based on the abstract syntax tree to obtain the conflict detection results; Based on the conflict detection results, the multiple code editing operations are fused together, and the first target code file is updated according to the fused target code editing operations to obtain the second target code file; A page update instruction is generated based on the second target code file and sent to the plurality of collaborative artboard clients, so that the plurality of collaborative artboard clients update the code content displayed in the code editing area of ​​the collaborative artboard based on the page update instruction.

2. The method according to claim 1, characterized in that, The process of generating the code editing instructions includes the following steps: The collaboration board interface is displayed in the collaboration board client. The collaboration board interface includes a code editing area, in which a first target code file is displayed. Receive code editing operations on the first target code file, and generate code editing instructions based on the code editing operations.

3. The method according to claim 2, characterized in that, The process of displaying a collaboration board interface in the collaboration board client, the collaboration board interface including a code editing area, and displaying a first target code file in the code editing area, includes: The collaboration board interface is displayed in the collaboration board client, and the collaboration board interface includes a code editing area; In response to a code file open operation received in the code editing area, a list of code files is displayed; In response to the selection of a first target code file in the code file list, the first target code file is displayed in the code editing area.

4. The method according to claim 2, characterized in that, The process of displaying a collaboration board interface in the collaboration board client, the collaboration board interface including a code editing area, and displaying a first target code file in the code editing area, includes: The collaboration board interface is displayed in the collaboration board client, and the collaboration board interface includes a code editing area; A text box element containing code text is displayed in the collaborative canvas client. In response to a drag operation that moves the text box element to the code editing area, a first target code file is generated based on the code text, and the first target code file is displayed in the code editing area.

5. The method according to claim 4, characterized in that, The step of generating a first target code file based on the code text and displaying the first target code file in the code editing area in response to a drag operation of dragging the text box element to the code editing area includes: In response to a drag operation that moves the text box element to the code editing area, the element attribute data of the text box element is obtained; Extract code text from the element attribute data, and perform format conversion on the code text to generate a first target code file; The first target code file is displayed in the code editing area.

6. The method according to claim 2, characterized in that, The step of receiving a code editing operation on the first target code file and generating code editing instructions based on the code editing operation includes: Receive code editing operations on the first target code file, and determine the target code modification content based on the code editing operations; The modified target code is segmented to obtain multiple target code fragments; Code editing instructions are generated based on the code editing operation and the multiple target code fragments.

7. The method according to claim 1, characterized in that, The conflict detection based on the abstract syntax tree for multiple code editing operations, to obtain conflict detection results, includes: Determine the corresponding code structure node in the abstract syntax tree for each code editing operation; Conflict detection is performed on the multiple code editing operations based on the code structure node corresponding to each code editing operation, and the conflict detection result is obtained.

8. The method according to claim 2, characterized in that, The method further includes: Receive code execution instructions sent by any collaborative canvas client, the code execution instructions including code execution operations on code files in the code editing area; The code file is executed based on the code execution instructions, the code execution result is obtained, and the code execution result is sent to the collaborative drawing board client.

9. The method according to claim 8, characterized in that, The process of running the code file based on the code execution instructions to obtain the code execution result includes: A preset execution container is created based on the code execution instructions, and a code execution environment is deployed in the preset execution container; Run the code file in the code execution environment to obtain the code execution result.

10. The method according to any one of claims 7 to 9, characterized in that, The process of fusing the multiple code editing operations based on the conflict detection results, and updating the first target code file according to the fused target code editing operations to obtain the second target code file, includes: When the conflict detection result indicates that there is a conflict between the multiple code editing operations, the first target code file is updated based on the preset code conflict resolution strategy to obtain a candidate code conflict resolution file, and the conflict detection result and the candidate code conflict resolution file are sent to the multiple collaborative canvas clients; Receive code conflict resolution instructions returned by the collaborative canvas client based on the candidate code conflict resolution file, and merge the multiple code editing operations based on the code conflict resolution instructions; The first target code file is updated based on the edit operations of the merged target code to obtain the second target code file.

11. The method according to any one of claims 1 to 10, characterized in that, The step of generating page update instructions based on the second target code file includes: Obtain the code editing operations of each collaborative canvas client, and determine the code editing position in the first target code file based on the code editing operations; The code content to be displayed is determined based on the code editing location and the second target code file; Generate a page update instruction corresponding to each collaborative whiteboard client based on the displayed code content.

12. A code processing device based on a collaborative canvas, characterized in that, The device includes: The receiving unit is used to receive multiple code editing instructions sent by multiple collaborative whiteboard clients, wherein the code editing instructions include code editing operations for collaborative editing of a first target code file; The detection unit is used to obtain the abstract syntax tree of the first target code file, and to perform conflict detection on multiple code editing operations based on the abstract syntax tree to obtain conflict detection results; An update unit is used to fuse the multiple code editing operations based on the conflict detection results, and update the first target code file according to the fused target code editing operations to obtain a second target code file; The sending unit is configured to generate a page update instruction based on the second target code file and send the page update instruction to the plurality of collaborative canvas clients, so that the plurality of collaborative canvas clients update the code content displayed in the code editing area of ​​the collaborative canvas based on the page update instruction.

13. A storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the code processing method based on the collaborative drawing board as described in any one of claims 1 to 11.

14. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the code processing method based on a collaborative drawing board as described in any one of claims 1 to 11.

15. A computer program product comprising a computer program that is read and executed by a processor of a computer device, causing the computer device to perform the code processing method based on a collaborative drawing board as described in any one of claims 1 to 11.