CN117591165A - Code management system and method - Google Patents

Code management system and method Download PDF

Info

Publication number
CN117591165A
CN117591165A CN202311513075.5A CN202311513075A CN117591165A CN 117591165 A CN117591165 A CN 117591165A CN 202311513075 A CN202311513075 A CN 202311513075A CN 117591165 A CN117591165 A CN 117591165A
Authority
CN
China
Prior art keywords
control system
version control
code
code file
instruction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311513075.5A
Other languages
Chinese (zh)
Inventor
程鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fangzhu Wuhan Technology Co ltd
Original Assignee
Fangzhu Wuhan Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fangzhu Wuhan Technology Co ltd filed Critical Fangzhu Wuhan Technology Co ltd
Priority to CN202311513075.5A priority Critical patent/CN117591165A/en
Publication of CN117591165A publication Critical patent/CN117591165A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention provides a code management system and a method, wherein the system comprises the following steps: the code processing module is used for executing corresponding code processing operation according to the instructions of the different version control systems; the method comprises the steps of executing corresponding acquisition, submission or rollback operation of a cross-version control system according to an instruction of the version control system as an acquisition, submission or rollback instruction, and backing up an operation log; the code backup module is used for carrying out backup storage on codes of the version control system; and the log backup module is used for storing the operation log of the version control system. By the scheme, code management among different version control systems can be realized, and code management efficiency is greatly improved.

Description

Code management system and method
Technical Field
The invention belongs to the field of software development, and particularly relates to a code management system and method.
Background
To facilitate management of software developed code, a Version Control System (VCS) is typically employed to record historical versions of code files and compare differences in the code files or rollback to a particular version.
However, the existing version management basically adopts Git, which is very convenient on the premise that the same version control system is uniformly used in teams (i.e. all teams uniformly use the GitLab), but if the teams commonly use development projects, different version control systems or code management warehouses can be different among different teams, for example, SVN, gitHub, gitLab and the like are respectively used by different teams, at this time, the management operation of codes becomes very complex, manual operation and inspection are required, and the code management efficiency is greatly reduced.
Disclosure of Invention
In view of the above, the embodiments of the present invention provide a code management system and method for solving the problem of low efficiency of existing code management.
In a first aspect of an embodiment of the present invention, there is provided a code management system including:
the code processing module is used for executing corresponding code processing operation according to the instructions of the different version control systems;
when the instruction of the version control system is an acquisition instruction, acquiring a code file of a version corresponding to the version control system according to an operation log of the current version control system, and storing the code file into a code backup module;
when the instruction of the version control system is a submitting instruction, a first code file in the code backup module is obtained, the first code file is compared with a second code file of the current version control system in a difference ratio, after a user confirms a difference comparison result, submitting operation is carried out on the first code file, and an operation log is stored in the log backup module;
when the instruction of the version control system is a rollback instruction, a first code file in the code backup module is obtained, the first code file is submitted to the current version control system according to the instruction of the current version control system, and an operation log is stored in the log backup module;
the code backup module is used for carrying out backup storage on codes of the version control system;
and the log backup module is used for storing the operation log of the version control system.
In a second aspect of the embodiment of the present invention, there is provided a code management method, including:
executing corresponding code processing operation according to the instructions of different version control systems;
when the instruction of the version control system is an acquisition instruction, acquiring a code file of a version corresponding to the version control system according to an operation log of the current version control system;
when the instruction of the version control system is a submitting instruction, acquiring a backed-up first code file, comparing the difference between the first code file and a second code file of the current version control system, and executing submitting operation on the first code file after a user confirms the difference comparison result;
when the instruction of the version control system is a rollback instruction, acquiring a backup first code file, and submitting the first code file to the current version control system according to the instruction of the current version control system;
and backing up codes and operation logs of the version control system respectively.
In a third aspect of the embodiments of the present invention, there is provided an electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method according to the first aspect of the embodiments of the present invention when the computer program is executed by the processor.
In a fourth aspect of the embodiments of the present invention, there is provided a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of the method provided by the first aspect of the embodiments of the present invention.
In the embodiment of the invention, the code management operations such as cross-version acquisition, submission, rollback and the like are realized aiming at different version control systems, unified management of the different version control systems is convenient, the code management operation is simplified, and the code management efficiency is effectively improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings described below are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort to a person skilled in the art.
FIG. 1 is a schematic diagram of a code management system according to an embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating the operation of a code management system according to an embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating another working principle of a code management system according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating a code management method according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, features and advantages of the present invention more comprehensible, the technical solutions in the embodiments of the present invention are described in detail below with reference to the accompanying drawings, and it is apparent that the embodiments described below are only some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be understood that the term "comprising" and other similar meaning in the description of the invention or the claims and the above-mentioned figures is intended to cover a non-exclusive inclusion, such as a process, method or system, apparatus comprising a series of steps or elements, without limitation to the listed steps or elements. Furthermore, "first" and "second" are used to distinguish between different objects and are not used to describe a particular order.
Referring to fig. 1, a schematic structure diagram of a code management system according to an embodiment of the present invention includes:
a code processing module 110, configured to execute corresponding code processing operations according to instructions of different version control systems;
when the instruction of the version control system is an acquisition instruction, acquiring a code file of a version corresponding to the version control system according to an operation log of the current version control system, and storing the code file into a code backup module;
specifically, an operation log of a current version control system is obtained, and a code file of a corresponding version is obtained based on a submitting operation time point; and storing the code file into a code backup module, and storing the log file of the current acquisition operation into the log backup module.
When the instruction of the version control system is a submitting instruction, a first code file in the code backup module is obtained, the first code file is compared with a second code file of the current version control system in a difference ratio, after a user confirms a difference comparison result, submitting operation is carried out on the first code file, and an operation log is stored in the log backup module;
the first code file is a code file already backed up in the code backup module, and the corresponding version control system is different from the current version control system, for example, if the version control system of the first code file is GitHub, the current version control system may be GitLab or SVN. The current version control system is a version control system which sends out a commit instruction currently, and can commit the backed-up first code file to the current version control system through the commit instruction.
The method comprises the steps of submitting a first code file to a current version control system, and storing an operation log to a log backup module; the operation log at least comprises source version control system information, target version control system information, differential information and success or failure information submitted by cross-version control system codes.
When the instruction of the version control system is a rollback instruction, a first code file in the code backup module is obtained, the first code file is submitted to the current version control system according to the instruction of the current version control system, and an operation log is stored in the log backup module;
the rollback instructions are divided into a self-version control system rollback instruction and a cross-version control system rollback instruction.
The version control system can be SVN, gitHub, gitLab and other different code management systems, and corresponding code acquisition, submission, difference, rollback and other operations can be executed across versions according to instructions of the different version control systems.
In some embodiments, the code processing module 110 includes a code management command processor for parsing different version control system instructions.
Optionally, the code management system further includes:
and the external code library interface is used for establishing connection with different version control systems and at least providing a code library path, connection information, product information and an operation log path.
The code backup module 120 is configured to backup and store a code of the version control system;
the log backup module 130 is configured to store an operation log of the version control system.
In the embodiment, unified management of different version control systems can be realized, operations such as cross-version acquisition, difference, submission, rollback and the like are realized, excessive participation of manpower is avoided, and code management efficiency is effectively improved.
In some embodiments, code backup module 120 and log backup module 130 both belong to a code library file backup server that provides a backup storage interface that may provide a backup code path, a backup log path, a differential result path, a version control system operation log path, and the like.
In some embodiments, as shown in fig. 2, a code submitting process across version control systems is shown, that is, when an instruction of a version control system is a submitting instruction, a specified version code file in a version control system a is submitted to a version control system B across versions, and the specific process is as follows:
firstly, a code processing module can acquire a code file A stored in a backup mode of a version control system A and acquire a code file B of a version control system B;
then, carrying out differential comparison on the code file A and the code file B, and delivering the comparison result to a user for confirmation, and if the user confirms that the code file A can be submitted, submitting the code file A to a version control system B;
otherwise, the terminal processes and waits for the problem to be solved, and then executes the submitting operation again.
And finally, writing the log file submitted to the operation into a log backup module. If the user confirms that the differential result can not be submitted, the log file is also required to be written into the log backup module.
The log file content of the commit operation may include: the code gets the source version control system information (version number, file name, etc.), the target version control system information (version number, file name, etc.) for code submission, the difference information of the current submission, the success or failure information of code submission across the version control system.
In some embodiments, as shown in fig. 3, a code rollback process across version control systems is shown, when a problem occurs in code commit, a return to a specified version of a backup is required, i.e., a specified version code file in version control system B is rolled back to a specified version before commit, and the specific process is as follows:
the code processing module obtains the code file A which is already backed up and stored in the code backup module by the version control system A;
according to the rollback instruction of the version control system B, the code processing module will backup the obtained code file A in the version control system B submitted by the code file A and the log of the submitted operation.
When the rollback instruction comes from the version control system a, the code file a of the obtained previous version backup may be directly submitted to the version control system a.
It should be understood that the sequence number of each step in the above embodiment does not mean the sequence of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not be construed as limiting the implementation process of the embodiment of the present invention.
Fig. 4 is a flow chart of a code management method according to an embodiment of the present invention, where the method includes:
s401, executing corresponding code processing operation according to instructions of different version control systems;
when the instruction of the version control system is an acquisition instruction, acquiring a code file of a version corresponding to the version control system according to an operation log of the current version control system;
when the instruction of the version control system is a submitting instruction, acquiring a backed-up first code file, comparing the difference between the first code file and a second code file of the current version control system, and executing submitting operation on the first code file after a user confirms the difference comparison result;
when the instruction of the version control system is a rollback instruction, acquiring a backup first code file, and submitting the first code file to the current version control system according to the instruction of the current version control system;
s402, backing up codes and operation logs of the version control system respectively.
Specifically, the obtaining, according to the operation log of the current version control system, the code file of the version corresponding to the version control system includes:
acquiring an operation log of a current version control system, and acquiring a code file of a corresponding version based on an acquisition operation time point;
and backing up the code file and the log file of the acquisition operation respectively.
Wherein the performing a commit operation on the first code file includes:
submitting the first code file to a current version control system and backing up the submitted operation log;
the operation log at least comprises source version control system information, target version control system information, differential information and success or failure information submitted by cross-version control system codes.
The rollback instructions are divided into a self-version control system rollback instruction and a cross-version control system rollback instruction.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the above-described system and module may refer to the corresponding process in the foregoing method embodiment, which is not repeated herein.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. The electronic device is used for code management of a cross-version control system. As shown in fig. 5, the electronic apparatus 5 of this embodiment includes: the memory 510, the processor 520, and the system bus 530, the memory 510 including an executable program 5101 stored thereon, it will be understood by those skilled in the art that the electronic device structure shown in fig. 5 is not limiting of the electronic device and may include more or fewer components than illustrated, or may combine certain components, or a different arrangement of components.
The following describes the respective constituent elements of the electronic device in detail with reference to fig. 5:
the memory 510 may be used to store software programs and modules, and the processor 520 performs various functional applications and data processing of the electronic device by executing the software programs and modules stored in the memory 510. The memory 510 may mainly include a storage program area that may store an operating system, application programs required for at least one function (such as a sound playing function, an image playing function, etc.), and a storage data area; the storage data area may store data created according to the use of the electronic device (such as cache data), and the like. In addition, memory 510 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
An executable program 5101 containing a network request method on a memory 510, the executable program 5101 may be partitioned into one or more modules/units which are stored in the memory 510 and executed by a processor 520 for code management or the like, and the one or more modules/units may be a series of computer program instruction segments capable of accomplishing specific functions for describing execution of the computer program 5101 in the electronic device 5. For example, the computer program 5101 may be divided into functional modules such as a code processing module, a code backup module, and a log backup module.
Processor 520 is a control center of the electronic device that utilizes various interfaces and lines to connect various portions of the overall electronic device, perform various functions of the electronic device and process data by running or executing software programs and/or modules stored in memory 510, and invoking data stored in memory 510, thereby performing overall condition monitoring of the electronic device. Optionally, the processor 520 may include one or more processing units; preferably, the processor 520 may integrate an application processor that primarily handles operating systems, applications, etc., with a modem processor that primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 520.
The system bus 530 is used to connect functional components in the computer, and CAN transmit data information, address information, and control information, and the types of the system bus may be, for example, a PC I bus, an isa bus, and a CAN bus. Instructions from processor 520 are transferred to memory 510 via a bus, memory 510 feeds back data to processor 520, and system bus 530 is responsible for data and instruction interaction between processor 520 and memory 510. Of course, the system bus 530 may also access other devices, such as a network interface, display device, etc.
In an embodiment of the present invention, the executable program executed by the process 520 included in the electronic device includes:
executing corresponding code processing operation according to the instructions of different version control systems;
when the instruction of the version control system is an acquisition instruction, acquiring a code file of a version corresponding to the version control system according to an operation log of the current version control system;
when the instruction of the version control system is a submitting instruction, acquiring a backed-up first code file, comparing the difference between the first code file and a second code file of the current version control system, and executing submitting operation on the first code file after a user confirms the difference comparison result;
when the instruction of the version control system is a rollback instruction, acquiring a backup first code file, and submitting the first code file to the current version control system according to the instruction of the current version control system;
and backing up codes and operation logs of the version control system respectively.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described system, apparatus and module may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A code management system, comprising:
the code processing module is used for executing corresponding code processing operation according to the instructions of the different version control systems;
when the instruction of the version control system is an acquisition instruction, acquiring a code file of a version corresponding to the version control system according to an operation log of the current version control system, and storing the code file into a code backup module;
when the instruction of the version control system is a submitting instruction, a first code file in the code backup module is obtained, the first code file is compared with a second code file of the current version control system in a difference ratio, after a user confirms a difference comparison result, submitting operation is carried out on the first code file, and an operation log is stored in the log backup module;
when the instruction of the version control system is a rollback instruction, a first code file in the code backup module is obtained, the first code file is submitted to the current version control system according to the instruction of the current version control system, and an operation log is stored in the log backup module;
the code backup module is used for carrying out backup storage on codes of the version control system;
and the log backup module is used for storing the operation log of the version control system.
2. The system of claim 1, wherein the code management system further comprises:
and the external code library interface is used for establishing connection with different version control systems and at least providing a code library path, connection information, product information and an operation log path.
3. The system of claim 1, wherein the obtaining the code file of the version corresponding to the version control system according to the operation log of the current version control system and storing the code file in the code backup module comprises:
acquiring an operation log of a current version control system, and acquiring a code file of a corresponding version based on an acquisition operation time point;
and storing the code file into a code backup module, and storing the log file of the current acquisition operation into the log backup module.
4. The system of claim 1, wherein performing commit operations on the first code file and storing the operation log in the log backup module comprises:
submitting the first code file to a current version control system, and storing an operation log to a log backup module;
the operation log at least comprises source version control system information, target version control system information, differential information and success or failure information submitted by cross-version control system codes.
5. The system of claim 1, wherein the rollback instructions are divided into a self-versioning system rollback instruction and a cross-versioning system rollback instruction.
6. A code management method, comprising:
executing corresponding code processing operation according to the instructions of different version control systems;
when the instruction of the version control system is an acquisition instruction, acquiring a code file of a version corresponding to the version control system according to an operation log of the current version control system;
when the instruction of the version control system is a submitting instruction, acquiring a backed-up first code file, comparing the difference between the first code file and a second code file of the current version control system, and executing submitting operation on the first code file after a user confirms the difference comparison result;
when the instruction of the version control system is a rollback instruction, acquiring a backup first code file, and submitting the first code file to the current version control system according to the instruction of the current version control system;
and backing up codes and operation logs of the version control system respectively.
7. The method of claim 6, wherein the obtaining the code file of the corresponding version of the version control system according to the operation log of the current version control system comprises:
acquiring an operation log of a current version control system, and acquiring a code file of a corresponding version based on an acquisition operation time point;
and backing up the code file and the log file of the acquisition operation respectively.
8. The method of claim 6, wherein performing a commit operation on the first code file comprises:
submitting the first code file to a current version control system and backing up the submitted operation log;
the operation log at least comprises source version control system information, target version control system information, differential information and success or failure information submitted by cross-version control system codes.
9. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of a code management method according to any of claims 6 to 8 when the computer program is executed.
10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed implements the steps of a code management method according to any one of claims 6 to 8.
CN202311513075.5A 2023-11-10 2023-11-10 Code management system and method Pending CN117591165A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311513075.5A CN117591165A (en) 2023-11-10 2023-11-10 Code management system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311513075.5A CN117591165A (en) 2023-11-10 2023-11-10 Code management system and method

Publications (1)

Publication Number Publication Date
CN117591165A true CN117591165A (en) 2024-02-23

Family

ID=89910733

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311513075.5A Pending CN117591165A (en) 2023-11-10 2023-11-10 Code management system and method

Country Status (1)

Country Link
CN (1) CN117591165A (en)

Similar Documents

Publication Publication Date Title
CN110442560B (en) Log replay method, device, server and storage medium
CN108664359B (en) Database recovery method, device, equipment and storage medium
US6594676B1 (en) System and method for recovery of multiple shared database data sets using multiple change accumulation data sets as inputs
US7624309B2 (en) Automated client recovery and service ticketing
US20060224634A1 (en) Multiple log queues in a database management system
CN109542682B (en) Data backup method, device, equipment and storage medium
US8424009B2 (en) Lock resolution for distributed durable instances
CN110753084B (en) Uplink data reading method, cache server and computer readable storage medium
US6944635B2 (en) Method for file deletion and recovery against system failures in database management system
CN111930489B (en) Task scheduling method, device, equipment and storage medium
US7761424B2 (en) Recording notations per file of changed blocks coherent with a draining agent
CN108121774B (en) Data table backup method and terminal equipment
US9015116B2 (en) Consistent replication of transactional updates
CN111444208B (en) Data updating method and related equipment
CN111176907B (en) Hardware database rollback method, software database rollback method and device
CN117112522A (en) Concurrent process log management method, device, equipment and storage medium
CN117591165A (en) Code management system and method
CN111400128B (en) Log management method and device, computer equipment and storage medium
CN109740027B (en) Data exchange method, device, server and storage medium
CN110765144B (en) Distributed heterogeneous database data processing method and device
CN106844634B (en) Database transaction optimization method and system
CN112257004B (en) Method, device, server and storage medium for page backup
CN112286804B (en) System debugging method, device, equipment and medium
CN116302696A (en) Archive log generation method of database system, storage medium and computer device
CN114138746A (en) Database monitoring method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination