Methods, apparatus, devices, and readable storage media for multiple users to edit code online.
By using a multi-user online code editing method and leveraging Git's resource allocation priority and interface configuration rules, the problem of complex and error-prone configuration code in software development was solved. This resulted in standardized and efficient interface configuration, thereby improving the quality of system development.
Patent Information
- Application Number
- CN202210212495.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-04
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2042-03-04
AI Technical Summary
In the process of developing software interface configurations, editing configuration code is complex and prone to errors. Version merging is inefficient and has a high error rate, making it difficult to effectively detect interface configuration conflicts and duplicates.
This paper provides a method for multiple users to edit code online. By obtaining user request information and preset Git operation resource allocation priorities, Git operation resources are synchronized to the local server. User operation information is judged and processed according to interface configuration rules. It supports automatic merging of non-conflicting parts and real-time detection of interface conflicts or duplications.
It improved the standardization and efficiency of interface configuration, reduced configuration errors, and enhanced the quality of system development. It also resolved interface configuration conflicts and duplicate detection issues through visualization tools and backend service modules.
Smart Images

Figure CN114564187B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of software technology development, and more specifically, to a method, apparatus, device, and readable storage medium for multiple users to edit code online. Background Technology
[0002] Currently, in the process of developing software interface configurations, developers generally need to manually edit the configuration code and then submit it to version control repositories such as Git. However, the configuration code is relatively complex and prone to errors. Furthermore, each person needs to perform version merging after editing. The efficiency of manually checking for interface configuration conflicts or duplications during the merging process is low, and the error rate is high. Summary of the Invention
[0003] The purpose of this invention is to provide a method, apparatus, device, and readable storage medium for multiple users to edit code online, thereby improving the aforementioned problems. To achieve the above objective, the technical solution adopted by this invention is as follows:
[0004] On the one hand, this application provides a method for multiple people to edit code online, the method comprising:
[0005] Obtain user request information and the priority of preset GIT operation resource allocation, wherein the user request information is information on at least two user request allocation operation directories;
[0006] Based on the user request information and the preset priority of GIT operation resource allocation, the GIT operation resources are allocated, and the allocated GIT operation resources are synchronized to the local server.
[0007] Obtain user operation information and interface configuration rule information, wherein the user operation information is information about the user's addition or modification operations on Git operation resources;
[0008] The interface configuration information in the user operation information is judged according to the interface configuration rules to obtain the judgment result of the interface configuration information, and the configuration code in the GIT operation resource library is processed according to the judgment result.
[0009] Optionally, allocating the GIT operation resources according to the user request information and the preset priority of GIT operation resource allocation includes:
[0010] The user level for allocating the Git operation resources in the user request information is determined based on the preset priority of Git operation resource allocation.
[0011] Initialize the GIT operation resources according to the user request information, and construct at least one directory file for the GIT operation resources, with each directory file corresponding to one user request information;
[0012] The directory files are allocated according to the user level of the Git operation resources to obtain the Git operation resource allocation information.
[0013] Optionally, synchronizing the allocated GIT operation resources to the local server includes:
[0014] Send a control command to restore the local server file to a preset version;
[0015] The allocated Git operation resources are compared with the Git operation resources in the local server to obtain the newly added Git operation resources.
[0016] The Git operation resources in the local server are updated at different time periods according to a preset update interval.
[0017] Optionally, the step of judging the interface configuration information in the user operation information according to the interface configuration rules to obtain the judgment result of the interface configuration information includes:
[0018] Call the submission ID of the user operation from the user operation information obtained above;
[0019] The resource version of the local server is synchronized and set according to the submission ID version in the user operation information to obtain local server resources that are consistent with the submission ID version of the user operation.
[0020] Based on the interface configuration rules, determine whether the interface configuration information contains conflicting or duplicate information, and obtain the judgment result of the interface configuration information.
[0021] Optionally, processing the configuration code in the Git operation repository based on the judgment result includes:
[0022] If the judgment result of the interface configuration information is that the interface configuration information does not conflict, then the newly added or modified content in the user operation information is merged with the configuration code of the directory to obtain the merged directory configuration code.
[0023] The merged directory configuration code is sent to the Git operation resource repository to update the configuration code, and a command to release the Git operation resource is sent.
[0024] If the determination result of the interface configuration information is that the interface configuration information has a conflict, then the result of the interface configuration information having a conflict is sent to the communication device of the maintenance personnel, and a command to release the GIT operation resources is sent.
[0025] Optionally, determining whether the interface configuration information contains conflicting or duplicate information based on the interface configuration rules includes:
[0026] Log information of the modified file when calling the interface configuration information, the log information of the modified file includes log information of modifying the code in the file and log information of modifying the directory in the file;
[0027] Based on the log information of the modified file, determine whether at least two users modified the same file directory or whether at least two users modified the same line of code in the file;
[0028] If at least two users modify the same file directory or at least two users modify the same line of code in a file, then the interface configuration information is determined to have conflicting or duplicate information.
[0029] Secondly, embodiments of this application provide a device for multiple users to edit code online, comprising:
[0030] The first acquisition unit is used to acquire user request information and the priority of preset GIT operation resource allocation. The user request information is information on at least two user request allocation operation directories.
[0031] The first processing unit is used to allocate the GIT operation resources according to the user request information and the preset priority of GIT operation resource allocation, and synchronize the allocated GIT operation resources to the local server.
[0032] The second acquisition unit is used to acquire user operation information and interface configuration rule information, wherein the user operation information is information about the user's addition or modification of GIT operation resources.
[0033] The second processing unit is used to judge the interface configuration information in the user operation information according to the interface configuration rules, obtain the judgment result of the interface configuration information, and process the configuration code in the GIT operation resource library according to the judgment result.
[0034] Optionally, the device includes:
[0035] The first processing subunit is used to determine the user level of the user request information that allocates the GIT operation resources according to the preset priority of GIT operation resource allocation;
[0036] The second processing subunit is used to initialize GIT operation resources according to the user request information, and to construct at least one directory file for the GIT operation resources, with each directory file corresponding to one user request information.
[0037] The third processing subunit is used to allocate the directory files according to the user level of the Git operation resources, and obtain the Git operation resource allocation information.
[0038] Optionally, the device includes:
[0039] The first sending subunit is used to send a control command to restore the local server file to a preset version;
[0040] The fourth processing subunit is used to compare the allocated Git operation resources with the Git operation resources in the local server to obtain the newly added Git operation resources.
[0041] The fifth processing subunit is used to update the GIT operation resources in the local server at different time periods according to a preset update time interval.
[0042] Optionally, the device includes:
[0043] The first calling subunit is used to call the submission ID of the user operation in the process of obtaining user operation information;
[0044] The sixth processing subunit is used to synchronize the resource version of the local server according to the submission ID version in the user operation information, so as to obtain local server resources that are consistent with the submission ID version of the user operation.
[0045] The seventh processing subunit is used to determine whether the interface configuration information has conflicting or duplicate information according to the interface configuration rules, and to obtain the judgment result of the interface configuration information.
[0046] Optionally, the device includes:
[0047] The first judgment subunit is used to detect the judgment result of the interface configuration information. If the judgment result of the interface configuration information is that the interface configuration information does not conflict, then the newly added or modified content in the user operation information is merged with the configuration code of the directory to obtain the merged directory configuration code.
[0048] The second sending subunit is used to send the merged directory configuration code to the GIT operation resource repository to update the configuration code, and to send a command to release the GIT operation resource;
[0049] The second judgment subunit is used to send the result of the interface configuration information conflict to the communication device of the maintenance personnel if the judgment result of the interface configuration information is that the interface configuration information has a conflict, and send a command to release the GIT operation resources.
[0050] Optionally, the device includes:
[0051] The second calling subunit is used to call the log information of the modified file of the interface configuration information. The log information of the modified file includes log information of modifying the code in the file and log information of modifying the directory in the file.
[0052] The third judgment subunit is used to determine, based on the log information of the modified file, whether at least two users have modified the same file directory or whether at least two users have modified the same line of code in the file.
[0053] The fourth judgment subunit is used to determine whether the interface configuration information has conflicting or duplicate information if at least two users modify the same file directory or at least two users modify the same line of code file.
[0054] Thirdly, embodiments of this application provide a device for multiple users to edit code online, the device including a memory and a processor. The memory is used to store a computer program; the processor is used to execute the computer program to implement the steps of the above-described method for multiple users to edit code online.
[0055] Fourthly, embodiments of this application provide a readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described method for multi-user online code editing.
[0056] The beneficial effects of this invention are as follows:
[0057] This invention addresses the problem of complex and error-prone configuration code editing during software development by providing a visual editing tool, making interface configuration more standardized and efficient. Simultaneously, the backend service module is developed based on Git's functionality, resolving the issues of detecting interface configuration conflicts and duplications. Furthermore, this invention supports automatic merging of non-conflicting parts of configuration code modified by different personnel, and can detect and report interface conflicts or duplications in real time, reducing interface configuration problems and improving the quality of system development.
[0058] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing embodiments of the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description
[0059] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0060] Figure 1 This is a schematic flowchart of a method for multiple people to edit code online, as described in an embodiment of the present invention.
[0061] Figure 2 This is a schematic diagram of a device for multi-user online code editing as described in an embodiment of the present invention;
[0062] Figure 3 This is a schematic diagram of a device structure for online code editing by multiple users, as described in an embodiment of the present invention. Detailed Implementation
[0063] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0064] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this invention, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0065] Example 1
[0066] like Figure 1 As shown, this embodiment provides a method for multiple people to edit code online, the method including steps S1, S2, S3 and S4.
[0067] Step S1: Obtain user request information and the priority of preset GIT operation resource allocation. The user request information is information on at least two user request allocation operation directories.
[0068] Step S2: Allocate the GIT operation resources according to the user request information and the preset priority of GIT operation resource allocation, and synchronize the allocated GIT operation resources to the local server;
[0069] Step S3: Obtain user operation information and interface configuration rule information. The user operation information is the information on the user's addition or modification of GIT operation resources.
[0070] Step S4: Judge the interface configuration information in the user operation information according to the interface configuration rules, obtain the judgment result of the interface configuration information, and process the configuration code in the GIT operation resource library according to the judgment result.
[0071] It is understood that this invention addresses the problem of complex and error-prone configuration code editing during software development by providing a visual editing tool, making interface configuration more standardized and efficient. Simultaneously, the backend service module is developed based on Git's functionality, resolving the issues of detecting interface configuration conflicts and duplications. Furthermore, this invention supports automatic merging of non-conflicting parts of configuration code modified by different personnel, and can detect and report errors in real time for interface conflicts or duplications, reducing interface configuration problems and improving the quality of system development.
[0072] In one specific embodiment of this disclosure, step S2 includes steps S21, S22 and S23.
[0073] Step S21: Determine the user level for allocating the GIT operation resources in the user request information according to the preset priority of GIT operation resource allocation;
[0074] Step S22: Initialize the GIT operation resources according to the user request information, and construct at least one directory file for the GIT operation resources, with each directory file corresponding to one user request information;
[0075] Step S23: Allocate the directory files according to the user level of the GIT operation resources to obtain the GIT operation resource allocation information.
[0076] It is understood that this invention creates multiple directory files according to the number of users, and then allocates the directory files according to the priority of each user. When each user issues a request to modify the previously modified directory file again, the priority level will be increased. This can slow down the switching of directory file branches, reduce the consumption of file synchronization, and improve the efficiency of editing configuration code.
[0077] In one specific embodiment of this disclosure, step S2 includes steps S24, S25 and S26.
[0078] Step S24: Send a control command to restore the local server file to a preset version;
[0079] Step S25: Compare the allocated GIT operation resources with the GIT operation resources in the local server to obtain the newly added GIT operation resources;
[0080] Step S26: Update the GIT operation resources in the local server at different time periods according to the preset update time interval.
[0081] It is understood that the present invention cleans up dirty data in the local server by restoring the local server file to a preset version to prevent operational anomalies, and improves execution efficiency by updating the GIT operation resources in the local server at different time periods to prevent the local server from lacking some GIT operation resources updated by other users.
[0082] In one specific embodiment of this disclosure, step S4 includes steps S41, S42 and S43.
[0083] Step S41: Call the submission ID of the user operation from the obtained user operation information;
[0084] Step S42: Synchronize the resource version of the local server according to the submission ID version in the user operation information to obtain local server resources that are consistent with the submission ID version of the user operation.
[0085] Step S43: Determine whether the interface configuration information has conflicting or duplicate information according to the interface configuration rules, and obtain the judgment result of the interface configuration information.
[0086] It is understood that this invention detects whether the version of a local file is consistent with the version in the remote service system, makes a judgment, and obtains a judgment result to determine how to proceed to the next step. This can prevent file conflicts caused by inconsistent file versions.
[0087] In one specific embodiment of this disclosure, step S4 includes steps S44, S45, and S46.
[0088] Step S44: Detect the judgment result of the interface configuration information. If the judgment result of the interface configuration information is that the interface configuration information does not conflict, then merge the newly added or modified content in the user operation information with the configuration code of the directory to obtain the merged directory configuration code.
[0089] Step S45: Send the merged directory configuration code to the GIT operation resource repository to update the configuration code, and send a command to release the GIT operation resource;
[0090] Step S46: If the judgment result of the interface configuration information is that the interface configuration information has a conflict, then send the result of the interface configuration information having a conflict to the communication device of the maintenance personnel, and send a command to release the GIT operation resources.
[0091] It is understood that the present invention processes the code based on the judgment result of the interface configuration information. If the interface configuration information is conflicting, an error is directly reported and maintenance is performed. If there is no conflict, the code is merged and the configuration code is updated to obtain the edited configuration code file.
[0092] In one specific embodiment of this disclosure, step S43 includes steps S431, S432 and S433.
[0093] Step S431: Call the log information of the modified file of the interface configuration information. The log information of the modified file includes log information of modifying the code in the file and log information of modifying the directory in the file.
[0094] Step S432: Based on the log information of the modified file, determine whether at least two users have modified the same file directory or whether at least two users have modified the same line of code in the file;
[0095] Step S433: If at least two users modify the same file directory or at least two users modify the same line of code in a file, then it is determined that the interface configuration information has conflicting or duplicate information.
[0096] It is understood that the present invention detects the log information of the modified file, determines whether the modified file directory information in the log information of the modified file is the same, and then determines whether the modified code in the log information of the modified file is the same. If they are the same, it proves that the two people modified the same directory file and edited the same operation resource, causing a code conflict. This judgment is simple, quick and easy to handle.
[0097] Example 2
[0098] like Figure 2 As shown, this embodiment provides a device for multiple users to edit code online. The device includes a first acquisition unit 701, a first processing unit 702, a second acquisition unit 703, and a second processing unit 704.
[0099] The first acquisition unit 701 is used to acquire user request information and the priority of preset GIT operation resource allocation, wherein the user request information is information on at least two user request allocation operation directories.
[0100] The first processing unit 702 is used to allocate the GIT operation resources according to the user request information and the preset priority of GIT operation resource allocation, and synchronize the allocated GIT operation resources to the local server.
[0101] The second acquisition unit 703 is used to acquire user operation information and interface configuration rule information, wherein the user operation information is information about the user's addition or modification of GIT operation resources.
[0102] The second processing unit 704 is used to judge the interface configuration information in the user operation information according to the interface configuration rules, obtain the judgment result of the interface configuration information, and process the configuration code in the GIT operation resource library according to the judgment result.
[0103] In one specific embodiment of this disclosure, the first processing unit 702 includes a first processing subunit 7021, a second processing subunit 7022, and a third processing subunit 7023.
[0104] The first processing subunit 7021 is used to determine the user level of the user request information that allocates the GIT operation resources according to the preset priority of GIT operation resource allocation.
[0105] The second processing subunit 7022 is used to initialize GIT operation resources according to the user request information, and to construct at least one directory file from the GIT operation resources, with each directory file corresponding to one user request information.
[0106] The third processing subunit 7023 is used to allocate the directory files according to the user level of the Git operation resources and obtain the Git operation resource allocation information.
[0107] In one specific embodiment of this disclosure, the first processing unit 702 includes a first sending subunit 7024, a fourth processing subunit 7025, and a fifth processing subunit 7026.
[0108] The first sending subunit 7024 is used to send a control command to restore the local server file to a preset version;
[0109] The fourth processing subunit 7025 is used to compare the allocated GIT operation resources with the GIT operation resources in the local server to obtain the newly added GIT operation resources.
[0110] The fifth processing subunit 7026 is used to update the GIT operation resources in the local server at different time periods according to a preset update time interval.
[0111] In one specific embodiment of this disclosure, the second processing unit 704 includes a first calling subunit 7041, a sixth processing subunit 7042, and a seventh processing subunit 7043.
[0112] The first calling subunit 7041 is used to call the submission ID of the user operation in the process of obtaining user operation information;
[0113] The sixth processing subunit 7042 is used to synchronize the resource version of the local server according to the submission ID version in the user operation information, so as to obtain local server resources that are consistent with the submission ID version of the user operation.
[0114] The seventh processing subunit 7043 is used to determine whether the interface configuration information has conflicting or duplicate information according to the interface configuration rules, and to obtain the judgment result of the interface configuration information.
[0115] In one specific embodiment of this disclosure, the second processing unit 704 includes a first judgment subunit 7044, a second sending subunit 7045, and a second judgment subunit 7046.
[0116] The first judgment subunit 7044 is used to detect the judgment result of the interface configuration information. If the judgment result of the interface configuration information is that the interface configuration information does not conflict, then the newly added or modified content in the user operation information is merged with the configuration code of the directory to obtain the merged directory configuration code.
[0117] The second sending subunit 7045 is used to send the merged directory configuration code to the GIT operation resource library for configuration code update, and send a command to release the GIT operation resource;
[0118] The second judgment subunit 7046 is used to send the result of the interface configuration information having a conflict to the communication device of the maintenance personnel if the judgment result of the interface configuration information is that the interface configuration information has a conflict, and send a command to release the GIT operation resources.
[0119] In one specific embodiment of this disclosure, the seventh processing subunit 7043 includes a second calling subunit 70431, a third judging subunit 70432, and a fourth judging subunit 70433.
[0120] The second calling subunit 70431 is used to call the log information of the modified file of the interface configuration information. The log information of the modified file includes log information of modifying the code in the file and log information of modifying the directory in the file.
[0121] The third judgment subunit 70432 is used to determine, based on the log information of the modified file, whether at least two users have modified the same file directory or whether at least two users have modified the same line of code in the file.
[0122] The fourth judgment subunit 70433 is used to determine whether the interface configuration information has conflicting or duplicate information if at least two users modify the same file directory or at least two users modify the same line of code file.
[0123] It should be noted that the specific manner in which each module performs its operation in the apparatus described in the above embodiments has been described in detail in the embodiments of the method, and will not be elaborated here.
[0124] Example 3
[0125] Corresponding to the above method embodiments, this disclosure also provides a device for multiple users to edit code online. The device for multiple users to edit code online described below and the method for multiple users to edit code online described above can be referred to in correspondence with each other.
[0126] Figure 3 This is a block diagram illustrating a device 800 for multi-user online code editing according to an exemplary embodiment. Figure 3 As shown, the device 800 for multi-user online code editing may include: a processor 801 and a memory 802. The device 800 may also include one or more of the following: a multimedia component 803, an input / output (I / O) interface 804, and a communication component 805.
[0127] The processor 801 controls the overall operation of the multi-user online code editing device 800 to complete all or part of the steps in the aforementioned multi-user online code editing method. The memory 802 stores various types of data to support the operation of the multi-user online code editing device 800. This data may include, for example, instructions for any application or method operating on the multi-user online code editing device 800, and application-related data such as contact data, sent and received messages, images, audio, video, etc. The memory 802 can be implemented using any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The multimedia component 803 may include a screen and an audio component. The screen may be, for example, a touchscreen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in the memory 802 or transmitted via the communication component 805. The audio component also includes at least one speaker for outputting audio signals. I / O interface 804 provides an interface between processor 801 and other interface modules, such as keyboards, mice, and buttons. These buttons can be virtual or physical. Communication component 805 is used for wired or wireless communication between the multi-user online code editing device 800 and other devices. Wireless communication includes Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or a combination thereof. Therefore, the corresponding communication component 805 may include a Wi-Fi module, a Bluetooth module, or an NFC module.
[0128] In an exemplary embodiment, the device 800 for multiple users to edit code online can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the aforementioned method for multiple users to edit code online.
[0129] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, which, when executed by a processor, implement the steps of the method for multi-user online code editing described above. For example, the computer-readable storage medium may be the memory 802 including program instructions described above, which may be executed by the processor 801 of the device 800 for multi-user online code editing to complete the method for multi-user online code editing described above.
[0130] Example 4
[0131] Corresponding to the above method embodiments, this disclosure also provides a readable storage medium. The readable storage medium described below corresponds to and can be referred to in relation to the method for multi-user online code editing described above.
[0132] A readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the steps of the method for multi-user online code editing in the above-described method embodiments.
[0133] Specifically, the readable storage medium can be a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, or any other readable storage medium capable of storing program code.
[0134] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
[0135] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for multiple users to edit code online, characterized in that, include: Obtain user request information and the priority of preset GIT operation resource allocation, wherein the user request information is information on at least two user request allocation operation directories; The GIT operation resources are allocated according to the user request information and the preset priority of GIT operation resource allocation. If the user request information is a repeated operation on the same GIT operation resource, the user's priority for the GIT operation resource will be increased, and the allocated GIT operation resources will be synchronized to the local server. Obtain user operation information and interface configuration rule information, wherein the user operation information is information about the user's addition or modification operations on Git operation resources; The interface configuration information in the user operation information is judged according to the interface configuration rules to obtain the judgment result of the interface configuration information, and the configuration code in the GIT operation resource library is processed according to the judgment result; The step of synchronizing the allocated Git operation resources to the local server includes: Send a control command to restore the local server file to a preset version; The allocated Git operation resources are compared with the Git operation resources in the local server to obtain the newly added Git operation resources. The Git operation resources in the local server are updated at different time periods according to a preset update interval; The process of processing the configuration code in the Git operation repository based on the judgment result includes: If the judgment result of the interface configuration information is that the interface configuration information does not conflict, then the newly added or modified content in the user operation information is merged with the configuration code of the directory to obtain the merged directory configuration code. The merged directory configuration code is sent to the Git operation resource repository to update the configuration code, and a command to release the Git operation resource is sent. If the determination result of the interface configuration information is that the interface configuration information has a conflict, then the result of the interface configuration information having a conflict is sent to the communication device of the maintenance personnel, and a command to release the GIT operation resources is sent.
2. The method for multi-user online code editing according to claim 1, characterized in that, The step of allocating the GIT operation resources according to the user request information and the preset priority of GIT operation resource allocation includes: The user level for allocating the GI T operation resources in the user request information is determined based on the preset priority of GI T operation resource allocation; Initialize the GIT operation resources according to the user request information, and construct at least one directory file for the GIT operation resources, with each directory file corresponding to one user request information; The directory files are allocated according to the user level of the Git operation resources to obtain the Git operation resource allocation information.
3. The method for multi-user online code editing according to claim 1, characterized in that, The step of judging the interface configuration information in the user operation information according to the interface configuration rules to obtain the judgment result of the interface configuration information includes: Call the submission ID of the user operation from the user operation information obtained above; The resource version of the local server is synchronized and set according to the submission ID version in the user operation information to obtain local server resources that are consistent with the submission ID version of the user operation. Based on the interface configuration rules, determine whether the interface configuration information contains conflicting or duplicate information, and obtain the judgment result of the interface configuration information.
4. The method for multi-user online code editing according to claim 3, characterized in that, The step of determining whether the interface configuration information contains conflicting or duplicate information according to the interface configuration rules includes: Log information of the modified file when calling the interface configuration information, the log information of the modified file includes log information of modifying the code in the file and log information of modifying the directory in the file; Based on the log information of the modified file, determine whether at least two users modified the same file directory or whether at least two users modified the same line of code in the file; If at least two users modify the same file directory or at least two users modify the same line of code in a file, then the interface configuration information is determined to have conflicting or duplicate information.
5. A device for multiple users to edit code online, characterized in that, include: The first acquisition unit is used to acquire user request information and the priority of preset GIT operation resource allocation. The user request information is information on at least two user request allocation operation directories. The first processing unit is configured to allocate the GIT operation resources according to the user request information and the preset priority of GIT operation resource allocation, wherein if the user request information is a repeated operation on the same GIT operation resource, the user's priority for the GIT operation resource will be increased, and the allocated GIT operation resources will be synchronized to the local server. The second acquisition unit is used to acquire user operation information and interface configuration rule information, wherein the user operation information is information about the user's addition or modification of GIT operation resources. The second processing unit is used to judge the interface configuration information in the user operation information according to the interface configuration rules, obtain the judgment result of the interface configuration information, and process the configuration code in the GIT operation resource library according to the judgment result. The device includes: The first sending subunit is used to send a control command to restore the local server file to a preset version; The fourth processing subunit is used to compare the allocated Git operation resources with the Git operation resources in the local server to obtain the newly added Git operation resources. The fifth processing subunit is used to update the GIT operation resources in the local server at different time periods according to a preset update time interval; The device further includes: The first judgment subunit is used to detect the judgment result of the interface configuration information. If the judgment result of the interface configuration information is that the interface configuration information does not conflict, then the newly added or modified content in the user operation information is merged with the configuration code of the directory to obtain the merged directory configuration code. The second sending subunit is used to send the merged directory configuration code to the GIT operation resource repository to update the configuration code, and to send a command to release the GIT operation resource; The second judgment subunit is used to send the result of the interface configuration information conflict to the communication device of the maintenance personnel if the judgment result of the interface configuration information is that the interface configuration information has a conflict, and send a command to release the GIT operation resources.
6. The apparatus for multi-user online code editing according to claim 5, characterized in that, The device includes: The first processing subunit is used to determine the user level of the user request information that allocates the GIT operation resources according to the preset priority of GIT operation resource allocation; The second processing subunit is used to initialize GIT operation resources according to the user request information, and to construct at least one directory file from the GIT operation resources, with each directory file corresponding to one user request information. The third processing subunit is used to allocate the directory files according to the user level of the Git operation resources, and obtain the Git operation resource allocation information.
7. The apparatus for multi-user online code editing according to claim 5, characterized in that, The device includes: The first calling subunit is used to call the submission ID of the user operation in the process of obtaining user operation information; The sixth processing subunit is used to synchronize the resource version of the local server according to the submission ID version in the user operation information, so as to obtain local server resources that are consistent with the submission ID version of the user operation. The seventh processing subunit is used to determine whether the interface configuration information has conflicting or duplicate information according to the interface configuration rules, and to obtain the judgment result of the interface configuration information.
8. The apparatus for multi-user online code editing according to claim 5, characterized in that, The device includes: The second calling subunit is used to call the log information of the modified file of the interface configuration information. The log information of the modified file includes log information of modifying the code in the file and log information of modifying the directory in the file. The third judgment subunit is used to determine, based on the log information of the modified file, whether at least two users have modified the same file directory or whether at least two users have modified the same line of code in the file. The fourth judgment subunit is used to determine whether the interface configuration information has conflicting or duplicate information if at least two users modify the same file directory or at least two users modify the same line of code file.
9. A device for multiple users to edit code online, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the method for multi-user online code editing as described in any one of claims 1 to 4 when executing the computer program.
10. A readable storage medium, characterized in that: The readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method for multi-user online code editing as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Collaborative software development tool for resolving potential code-change conflicts in real time
US20200285462A1