Temporary error-free working area construction method suitable for real-time collaborative programming environment

By automatically identifying and saving the correct syntax code version in the real-time collaborative programming environment and generating a temporary error-free workspace, it solves the problem of compilation and debugging caused by syntax errors in real-time collaborative programming, and improves programming efficiency and quality.

CN118939306APending Publication Date: 2024-11-12TONGJI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411016981.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

In a real-time collaborative programming environment, due to dynamic changes in code state, syntax errors often lead to difficulties in compilation and debugging, affecting programming quality and efficiency.

Method used

By monitoring source code files in real-time in a real-time collaborative programming environment, automatically identifying and saving the syntax-correct version to the shadow repository, generating temporary error-free workspaces, allowing collaborative participants to independently compile and debug in silent mode, and after completion Restore collaborative mode.

Benefits of technology

Ensures flexibility and programming efficiency of real-time collaborative programming, allowing early detection and resolution of code problems, improving programming quality and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939306A_ABST
    Figure CN118939306A_ABST
Patent Text Reader

Abstract

The invention relates to a temporary error-free working area construction method suitable for a real-time collaborative programming environment, which comprises the following steps of: in the real-time collaborative programming environment, storing a source code file which is commonly edited by real-time collaborative participants as a latest working version in a basic warehouse; storing the newest source code file without the grammatical error in a shadow warehouse as a newest error-free version, and updating a file difference table according to the difference between the two versions; obtaining a request instruction of any one real-time cooperation participant, enabling the real-time cooperation participant to exit from the cooperation mode and enter a silent mode, generating a temporary error-free working area according to the file difference table, and supporting the real-time cooperation participant to carry out independent compiling and debugging work; and after the independent work is completed, quitting the silent mode, entering the collaborative mode, and continuing to carry out collaborative programming. Compared with the prior art, the method has the advantages of meeting the requirement of independently compiling and debugging codes in the real-time collaborative programming process, and has the technical characteristics of matched source code error-free version identification and maintenance and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of software development, and in particular to a temporary error-free workspace construction method suitable for a real-time collaborative programming environment. Background Art

[0002] Real-time collaborative programming is a technology that supports multiple programmers to edit source code simultaneously on the same code base. In this mode, participants can see each other's edits and changes in real time, and can communicate and coordinate through built-in communication tools, which greatly improves the team's collaboration efficiency and the iteration speed of the project. This method is particularly popular in remote work and distributed teams, and can effectively promote information sharing and problem solving. However, this technology also brings a significant challenge: when the code is edited by multiple developers at the same time, because the code status is dynamically changing, any syntax errors may hinder the compilation and debugging of the code.

[0003] In the process of real-time collaborative programming, each programmer's editing operation will be transmitted to other collaborative sites in real time and act on the source code copies of all clients; in this process, each programmer can see the latest changes made by other programmers to the code in real time. In traditional non-real-time collaborative programming, programmers often compile and debug immediately when there are no syntax errors in the code (for example, when a method / code block / sentence is just completed) to find problems as early as possible. However, when a group of programmers edit the code in real time, most of the time, it is difficult for any programmer to find a time point when all programmers have just completed the stage work, and unfinished statements, code blocks or methods (functions) will make the entire code in a grammatically incorrect state; in this state, the code cannot be compiled and debugged. Therefore, during most of the time of real-time collaboration, programmers can only continuously edit the source code and cannot find problems through compilation and debugging as early as possible, which deviates from the way programmers should work and has a negative impact on the quality and efficiency of programming work. Summary of the invention

[0004] The purpose of the present invention is to provide a method for constructing a temporary error-free workspace suitable for a real-time collaborative programming environment, which improves the flexibility of real-time collaboration.

[0005] The purpose of the present invention can be achieved by the following technical solutions:

[0006] A method for constructing a temporary error-free workspace suitable for a real-time collaborative programming environment comprises the following steps:

[0007] In the real-time collaborative programming environment, the source code files of the real-time collaborative programming performed by each real-time collaborative participant in the collaborative mode are stored in the basic warehouse as the latest working version;

[0008] The latest source code file without syntax errors in the real-time collaborative programming process is stored in the shadow repository as the latest error-free version, and the file difference table is updated according to the difference between the latest working version and the latest error-free version;

[0009] Obtain the request command independently issued by any real-time collaboration participant to make him exit the collaborative mode and enter the silent mode, and generate an isolated temporary error-free workspace according to the file difference table to support him to carry out independent compilation and debugging work;

[0010] After completing the independent work, the collaborative participant exits the silent mode, enters the collaborative mode, and continues to carry out collaborative programming work with other real-time collaborative participants.

[0011] Furthermore, the step of obtaining the latest error-free version includes:

[0012] Check whether the latest working version in the basic warehouse has no syntax errors. If so, synchronize the latest working version as the latest error-free version to the shadow warehouse; if not, do not synchronize, and the shadow warehouse still has the latest error-free version synchronized last time.

[0013] Furthermore, a code detector is used to check whether the latest working version in the basic repository has no syntax errors.

[0014] Furthermore, an identification and update mechanism is used to synchronize the latest error-free version to the shadow repository.

[0015] Furthermore, the identification and updating mechanism includes one or more of the following:

[0016] 1) When a source code file in the base repository is created or deleted, the corresponding file version in the shadow directory in the shadow repository is updated;

[0017] 2) When a source code file in the base repository is modified, the latest working version without syntax errors is updated to the shadow repository according to the shadow directory in the shadow repository;

[0018] 3) When all source code files in the base repository are successfully compiled, all source code files in the base repository are overwritten with the shadow repository;

[0019] 4) When the source code file is manually stored in the shadow repository, the corresponding file version in the shadow directory in the shadow repository is directly updated.

[0020] Furthermore, the file difference table records source code files with differences between the basic repository and the shadow repository and locations of the source code files with differences.

[0021] Furthermore, the specific steps for the collaborative participants to carry out independent work include:

[0022] In silent mode, the permission of the real-time collaboration participants to send information to the server is turned off;

[0023] According to the file difference table, source code files that differ between the base warehouse and the shadow warehouse are replaced with each other, so that the source code files in the base warehouse are the latest error-free versions;

[0024] Redirect the source code update operations of other real-time collaboration participants to the corresponding source code files in the shadow repository;

[0025] The file access permission in the base repository is set to read-only, so that the real-time collaboration participants can carry out independent work on the replaced base repository.

[0026] Furthermore, the real-time collaboration participant who carries out independent work is any one or any multiple real-time collaboration participants in the collaboration session.

[0027] Furthermore, the steps for resuming the real-time collaborative programming work with other real-time collaborative participants include:

[0028] Restore file access permissions in the base repository;

[0029] According to the file difference table, source code files that differ between the base warehouse and the shadow warehouse are replaced with each other, so that the source code files in the shadow warehouse are the latest error-free versions;

[0030] Redirect code editing operations of other real-time collaboration participants to the corresponding source code files in the base repository;

[0031] The permission of the real-time collaboration participant to send information to the server is restored.

[0032] Furthermore, the content of the independent work includes one or more of independent compilation and independent debugging of code. Compared with the prior art, the present invention has the following beneficial effects:

[0033] (1) The present invention monitors the source code files being collaboratively edited in real time, automatically identifies and saves the grammatically correct code versions into a shadow repository as a backup, so that when the real-time collaborative participants need to work independently, an independent temporary error-free workspace can be created for them, and the most recent error-free code version can be automatically replaced in the workspace, thereby ensuring the smooth progress of the independent work. When the real-time collaborative participants complete their independent work, they can resume the real-time collaborative programming, which significantly improves the flexibility of real-time collaborative programming.

[0034] (2) The present invention constructs a temporary error-free workspace for real-time collaboration participants who need to work independently, so that problems in code files can be discovered as early as possible through compilation and debugging, thereby solving the problem of untimely discovery and resolution of problems caused by real-time changes in code files in real-time collaboration, and improving the quality and efficiency of programming work.

[0035] (3) The present invention sets a collaborative mode and a silent mode. According to the mutual switching of the two modes, real-time collaborative participants can perform corresponding collaboration or independent work in different modes. In the silent mode, real-time collaborative participants working independently can perform independent work, while other real-time collaborative participants can still carry out real-time collaboration, thus taking into account both collaborative work and independent work, and further improving programming efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a schematic diagram of the process of the present invention;

[0037] Figure 2 The basic idea diagram of the method of the present invention is shown in FIG.

[0038] Figure 3 The overall working flow diagram of the embodiment of the present invention;

[0039] Figure 4 This is a schematic diagram of updating a shadow repository through grammar checking according to an embodiment of the present invention;

[0040] Figure 5 A schematic diagram of switching from collaborative mode to silent mode according to an embodiment of the present invention;

[0041] Figure 6 Schematic diagram of system modules and relationships between modules according to an embodiment of the present invention. DETAILED DESCRIPTION

[0042] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.

[0043] This embodiment provides a method for constructing a temporary error-free workspace suitable for a real-time collaborative programming environment. Figure 2 As shown, this method detects the latest working version in real-time collaborative work, and uses the files detected by the code detector as the latest error-free version, allowing programmers (real-time collaborative participants) to carry out temporary independent compilation and debugging work. Figure 3As shown, by real-time monitoring of the code files being collaboratively edited, the grammatically correct version of the code is automatically captured and saved as a backup. In this way, whenever a programmer needs to carry out independent compilation or debugging and other work, the system will immediately create an independent temporary workspace for them without syntax errors, and automatically replace the most recent error-free version of the code into the space, thereby ensuring the smooth compilation and debugging process; when the user is working in an independent workspace, the system continues to receive operation information from other sites obtained by the real-time collaborative programming environment (but does not directly act on the workspace at this time). When the programmer completes compilation and debugging, exit the temporary workspace, the system returns to the normal real-time collaborative programming state, presents the latest version of the code, and can re-participate in real-time collaborative programming. Specifically, as Figure 1 As shown, the method comprises the following steps:

[0044] Step 1: In a real-time collaborative programming environment, source code files of real-time collaborative programming performed by each real-time collaborative participant in a collaborative mode are stored in a basic warehouse as the latest working version.

[0045] During the collaboration process, each programmer views and edits the "Latest Working Version" of the shared source code in his or her own workspace as usual, which contains all the team's edits in real time.

[0046] The embodiments of the present invention involve the following core concepts:

[0047] 1. Working mode of real-time collaborative projects:

[0048] 1) Collaboration Mode: A mode in which programmers participate in real-time collaborative programming. In this case, the programmer's editing operations will act on the files in the basic repository.

[0049] 2) Silent Mode: The mode in which the programmer restores the project code to the latest error-free version. At this time, the programmer will see the source code files in the shadow repository and cannot edit these files.

[0050] 2. Storage location (warehouse) of source code files:

[0051] 1) Base Repository: A repository maintained locally by the client and used directly for real-time collaborative programming. The source code in the repository will be edited by all programmers participating in real-time collaborative programming.

[0052] 2) Shadow Repository: The "latest error-free version" of the files in the basic repository, stored locally on the client.

[0053] 3. Version of source code file:

[0054] 1) Base Version: The file version in the base repository in collaborative mode, i.e. the "latest working version".

[0055] 2) Shadow Version: The file version in the shadow repository in collaborative mode, that is, the "latest error-free version".

[0056] Step 2: Store the latest source code file without syntax errors in the real-time collaborative programming process as the latest error-free version in the shadow warehouse, and update the file difference table according to the difference between the latest working version and the latest error-free version.

[0057] Each client system will automatically maintain and update an additional "latest error-free version", which contains the latest changes made by the team as much as possible and removes all syntax errors. Therefore, this step is mainly a shadow version maintenance mechanism, such as Figure 4 As shown, it specifically includes the following sub-steps:

[0058] Step 2-1: When the user performs real-time collaborative programming, the collaborative mode is in place. At this time, the files in the base repository will be checked by the code detector to confirm that there are no syntax errors in the target code.

[0059] Step 2-2: If the check result shows no syntax errors, the current file will be saved to the shadow repository synchronously. The shadow version uses four mechanisms for identification and update.

[0060] Four mechanisms:

[0061] 1) When other files in the base repository are created / deleted, the corresponding file versions in the shadow directory are updated;

[0062] 2) When other files in the basic warehouse are modified, determine whether there is an error in the file. Here, the calling interface provided by the code language compiler can be used to perform syntax checking. When it meets the requirements without syntax errors, the file is updated to the shadow directory;

[0063] 3) After the user successfully compiles all source code files in collaborative mode, the entire project is directly overwritten into the shadow directory;

[0064] 4) When the user manually stores a shadow version of a file in the base repository, the corresponding file in the shadow directory is directly updated regardless of whether the code is correct.

[0065] Step 2-3: Update the difference table according to the location of the modified file. The difference table records which files have differences between the two repositories and the locations of the files with differences.

[0066] Step 3: Obtain a request command independently issued by any real-time collaboration participant to enable him to exit the collaborative mode and enter the silent mode, and generate an isolated temporary error-free workspace based on the file difference table to support him to carry out independent compilation and debugging work.

[0067] Whenever a programmer tries to carry out independent work (such as compiling and debugging code), the system will generate an isolated temporary error-free workspace, and the content in it will be temporarily restored to the content in the "latest error-free version". That is, when the user is about to debug the code, he exits the collaborative mode and enters the silent mode. At this time, the mode switching module is responsible for deciding to enable the corresponding files in the shadow repository based on the file difference information recorded in the file difference table. At the same time, the mode switching module also needs to store the corresponding files in the basic repository at this time, and ensure that these files still maintain coordination with the operations of other users on the server. The user sees the error-free version saved in the shadow repository and compiles this version. The user cannot edit the content in the basic repository at this time.

[0068] Specifically, Figure 5 As shown, this step includes the following sub-steps:

[0069] Step 3-1: Disable the current collaborator’s permission to send information to the server to prevent the switching operation from being synchronized to other collaborators.

[0070] Step 3-2: Replace the files with differences between the two warehouses through the file difference table;

[0071] At this time, the file content stored in the basic repository should be the content of the shadow version, and the content stored in the shadow repository should be the content of the basic version;

[0072] Step 3-3, redirect other users' collaborative work to the corresponding files in the shadow repository;

[0073] Step 3-4: Set the file access permission in the basic repository to read-only to prevent the correct version from being accidentally modified.

[0074] Step 4: After completing the independent work, the collaborative participant exits the silent mode and enters the collaborative mode to continue collaborative programming work with other real-time collaborative participants.

[0075] Whenever a programmer completes independent work (such as compiling and debugging code), the system restores the content to the latest version, and the programmer can continue collaborative programming. That is, after the user finishes debugging the code, he exits the silent mode and enters the collaborative mode. At this time, the mode switching module is responsible for restoring the previous operations and reactivating the basic version. Specifically, this step includes the following sub-steps:

[0076] Step 4-1: Restore file access permissions in the basic repository;

[0077] Step 4-2: Replace the files with differences between the two warehouses through the file difference table;

[0078] When switching modes twice, the files to be exchanged may not be exactly the same, so the files are exchanged through the contents of the file difference table both times;

[0079] Step 4-3: Redirect other users' collaborative work to the corresponding files in the basic repository;

[0080] Step 4-4: Restore the current collaborator's permission to send information to the server.

[0081] According to the above description, the method of this embodiment can be integrated into a corresponding system, such as Figure 6 As shown, the system includes:

[0082] a) Shadow version update module: responsible for maintaining and updating the file content of the shadow version, and updating the shadow version according to a variety of methods.

[0083] b) Code detection module: responsible for checking the syntax of the code in the specified file and determining whether there are any syntax errors in the file.

[0084] c) Synchronous comparison module: responsible for comparing the differences between the local basic version file and the shadow version file during the collaborative process, and implementing switching between modes and non-real-time shadow version updates according to the difference content.

[0085] d) Information management module: responsible for processing the operation information sent by users to the server and other user operation information from the server, and extracting information such as operation type, operation location, and operation content.

[0086] e) Mode switching module: responsible for switching the version of the working directory between silent mode and collaborative mode. In silent mode, the user will browse the shadow version and compile with this version; at the same time, the content update connection with the server is maintained normally in silent mode.

[0087] In summary, the method of the embodiment of the present invention exchanges the files of the basic warehouse and the shadow warehouse so that the shadow version without syntax errors is presented in the basic warehouse; at the same time, the operations of other programmers in the real-time collaboration are imported into the corresponding files of the shadow warehouse to ensure that the operations of other programmers are not lost; when the user returns to the collaborative mode, the files in the two warehouses are exchanged again. This method meets the needs of programmers who need to temporarily interrupt real-time collaboration to carry out independent development work during real-time collaboration, and provides a temporary isolation workspace construction mechanism for a single programmer in a real-time collaboration session to independently compile and debug code, as well as a supporting source code error-free version identification and maintenance technology.

[0088] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can essentially be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: hard disk, flash memory, mobile hard disk, read-only memory, magnetic disk or optical disk, etc., which can store program codes.

[0089] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, services, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, optical storage, etc.) containing computer-usable program codes. The schemes in the embodiments of the present invention may be implemented in various computer programming languages, such as object-oriented programming language Java and literal scripting language JavaScript, etc.

[0090] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0091] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0092] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0093] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0094] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A method for constructing a temporary error-free workspace suitable for a real-time collaborative programming environment, characterized in that: The following steps are involved: In the real-time collaborative programming environment, the source code files of the real-time collaborative programming performed by each real-time collaborative participant in the collaborative mode are stored in the basic warehouse as the latest working version; The latest source code file without syntax errors in the real-time collaborative programming process is stored in the shadow repository as the latest error-free version, and the file difference table is updated according to the difference between the latest working version and the latest error-free version; Obtain the request command independently issued by any real-time collaboration participant to make him exit the collaborative mode and enter the silent mode, and generate an isolated temporary error-free workspace according to the file difference table to support him to carry out independent compilation and debugging work; After completing the independent work, the collaborative participant exits the silent mode, enters the collaborative mode, and continues to carry out collaborative programming work with other real-time collaborative participants.

2. A method for constructing a temporary error-free workspace suitable for a real-time collaborative programming environment according to claim 1, characterized in that: The steps of obtaining the latest error-free version include: Check whether the latest working version in the basic warehouse has no syntax errors. If so, synchronize the latest working version as the latest error-free version to the shadow warehouse; if not, do not synchronize, and the shadow warehouse still has the latest error-free version synchronized last time.

3. A method for constructing a temporary error-free workspace suitable for a real-time collaborative programming environment according to claim 2, characterized in that: A code checker is used to check whether the latest working version in the base repository has no syntax errors.

4. A method for constructing a temporary error-free workspace suitable for a real-time collaborative programming environment according to claim 2, characterized in that: Use the identification and update mechanism to synchronize the latest error-free version to the shadow repository.

5. A method for constructing a temporary error-free workspace suitable for a real-time collaborative programming environment according to claim 4, characterized in that: The identification and update mechanism includes one or more of the following: 1) When a source code file in the base repository is created or deleted, the corresponding file version in the shadow directory in the shadow repository is updated; 2) When a source code file in the base repository is modified, the latest working version without syntax errors is updated to the shadow repository according to the shadow directory in the shadow repository; 3) When all source code files in the base repository are successfully compiled, all source code files in the base repository are overwritten with the shadow repository; 4) When the source code file is manually stored in the shadow repository, the corresponding file version in the shadow directory in the shadow repository is directly updated.

6. A method for constructing a temporary error-free workspace suitable for a real-time collaborative programming environment according to claim 1, characterized in that: The file difference table records source code files that differ between the base repository and the shadow repository and the locations of the source code files that differ.

7. A method for constructing a temporary error-free workspace suitable for a real-time collaborative programming environment according to claim 1, characterized in that: The specific steps for the collaborative participants to carry out independent work include: In silent mode, the permission of the real-time collaboration participants to send information to the server is turned off; According to the file difference table, source code files that differ between the base warehouse and the shadow warehouse are replaced with each other, so that the source code files in the base warehouse are the latest error-free versions; Redirect the source code update operations of other real-time collaboration participants to the corresponding source code files in the shadow repository; The file access permission in the base repository is set to read-only, so that the real-time collaboration participants can carry out independent work on the replaced base repository.

8. The method for constructing a temporary error-free workspace suitable for a real-time collaborative programming environment according to claim 1, characterized in that: The real-time collaboration participants who carry out independent work are any one or more real-time collaboration participants in the collaboration session.

9. The method for constructing a temporary error-free workspace suitable for a real-time collaborative programming environment according to claim 1, characterized in that: The steps for resuming the real-time collaborative programming work with other real-time collaborative participants include: Restore file access permissions in the base repository; According to the file difference table, source code files that differ between the base warehouse and the shadow warehouse are replaced with each other, so that the source code files in the shadow warehouse are the latest error-free versions; Redirect code editing operations of other real-time collaboration participants to the corresponding source code files in the base repository; The permission of the real-time collaboration participant to send information to the server is restored.

10. The method for constructing a temporary error-free workspace suitable for a real-time collaborative programming environment according to claim 1, characterized in that: The independent work includes one or more of independent compilation and independent debugging of codes.