CN115617635B - Code statistics method, system and equipment supporting cross-code warehouse - Google Patents
Code statistics method, system and equipment supporting cross-code warehouse Download PDFInfo
- Publication number
- CN115617635B CN115617635B CN202211617928.5A CN202211617928A CN115617635B CN 115617635 B CN115617635 B CN 115617635B CN 202211617928 A CN202211617928 A CN 202211617928A CN 115617635 B CN115617635 B CN 115617635B
- Authority
- CN
- China
- Prior art keywords
- code
- software developer
- statistics
- data
- warehouses
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 62
- 238000007726 management method Methods 0.000 claims description 39
- 230000008569 process Effects 0.000 claims description 18
- 238000012545 processing Methods 0.000 claims description 17
- 230000008859 change Effects 0.000 claims description 16
- 238000004364 calculation method Methods 0.000 claims description 13
- 230000009849 deactivation Effects 0.000 claims description 5
- 238000012986 modification Methods 0.000 claims description 4
- 230000004048 modification Effects 0.000 claims description 4
- 238000013500 data storage Methods 0.000 claims description 3
- 238000010606 normalization Methods 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000013507 mapping Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 230000007547 defect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
- G06F11/3452—Performance evaluation by statistical analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3604—Analysis of software for verifying properties of programs
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Software Systems (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Evolutionary Biology (AREA)
- Probability & Statistics with Applications (AREA)
- Bioinformatics & Computational Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Computer Security & Cryptography (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Stored Programmes (AREA)
Abstract
The invention provides a code statistics method supporting a cross-code warehouse, which comprises the following steps: s1: deploying a code statistics client and a server, and initializing link information and other information of each code warehouse; s2: unifying the identity information of the software developer among the code warehouses; s3: acquiring non-submitted code statistic information of a software developer, and calculating code quantity statistic information by combining code quantity log information in each code warehouse; s4: and providing the code quantity statistical result outwards. The method can solve the problem that the software developer unifies the identity marks among a plurality of or a plurality of code warehouses, and the problem that the code warehouses can only count the submitted code amount of the software developer and the problem of code amount statistics across the code warehouses. The invention also provides a code statistics system and equipment supporting the cross-code warehouse.
Description
Technical Field
The invention relates to the technical field of information statistics, in particular to a code statistics method supporting a cross-code warehouse.
Background
With the development of information technology, the code amount generated by programming work is exponentially improved, and in order to meet the requirement of code management, various source code version management software (also called code warehouse) such as Svn, git, TFS and the like are sequentially generated. Typically, these code repositories provide simple code statistics functions, such as counting the number of lines of variation of source code from different dimensions of time, project, personnel, etc., to evaluate the complexity of software engineering and the work efficiency of software developers. The code amount statistics process of the code repository is typically: when a software developer submits codes to a code warehouse, the code warehouse can record the number of newly added files, the number of modified files, the number of deleted files, the number of code lines contained in the newly added files, the number of code lines changed in the modified files, the number of code lines contained in the deleted files, the time of submission, the remarks submitted and the like in the code warehouse into source code change logs in addition to replacing source code files in the warehouse with newly submitted source code files of the software developer, and the change logs are associated with the identity of the software developer in the code warehouse. And when the code quantity is counted by the code warehouse, the recorded code change log data is summed and calculated in different dimensions to form a code quantity counting result.
The code amount statistics process described above has many limitations. First, the usual code statistics process can only count the code amounts of software items present in a single code repository. If a software developer submits codes in different code warehouses at a certain period, the identity of the software developer in the code warehouses needs to be subjected to unified label processing, and the code quantity statistical results in the code warehouses are respectively extracted and then summed up to form the final code quantity statistical result of the software developer. Therefore, a method and system for establishing cross-code repository identity mapping are needed to solve the problem of unification of software developer identities among different code repositories.
Secondly, the statistical process is performed on the premise that a software developer submits the work result to the code warehouse, and the statistical result only can cover the code amount submitted to the code warehouse by the software developer, but cannot cover the code amount formed by the software developer and not submitted to the code warehouse by the software developer. Therefore, the result data of the statistical process is poor in accuracy, and the workload and the working efficiency of software developers cannot be accurately evaluated.
Finally, the log record formats and record contents of different code warehouses are different, and the statistical process is only suitable for counting the code quantity in a single code warehouse, and can not count the code quantity across the code warehouses.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention provides a code statistics method supporting cross-code warehouse, which solves the problem that a software developer unifies identity marks among a plurality of or a plurality of code warehouses, solves the problem that the code warehouses can only count the submitted code amount of the software developer, and solves the problem of cross-code warehouse code amount statistics.
In order to achieve the above object, the present invention provides a code statistics method supporting a cross code repository, comprising the steps of:
s1: deploying a code statistics client and a server, and initializing link information and other information of each code warehouse;
s2: unifying the identity information of the software developer among the code warehouses;
s3: acquiring non-submitted code statistic information of a software developer, and calculating code quantity statistic information by combining code quantity log information in each code warehouse;
s4: and providing the code quantity statistical result outwards.
Further, in step S1, the initialized information of each code repository includes server address, IP, belonging software item, belonging IT company, department; and identify each code repository as CK1, CK2 … … CKN; when a new code warehouse is added, code warehouse link information and corresponding code warehouse identification are correspondingly added.
Further, in step S2, the process of unifying the identity information of the software developer further includes the following steps:
s201: the developer identity management module/system periodically acquires the identity information of all software developers in the code warehouses CK1, CK2 … … CKN through an operation command;
s202: the identity information of the same software developer in different code warehouses is marked by using the same identity tag, and a software developer identity tag data set is established;
when the identity information of the software developer needs to be newly added, firstly, selecting one or more code warehouses needing to be newly added from the code warehouses CK1, CK2 and … … CKN, and then, sending the identity information command of the newly added software developer to the selected code warehouses through an operation command to perform unified new addition of the identity information of the software developer;
when the identity information of the software developer is required to be edited, one or more code warehouses needing to be edited are selected from the code warehouses CK1 and CK2 … … CKN, and then an instruction for editing the identity information of the software developer is sent to the selected code warehouses through an operation instruction, so that unified editing of the identity information of the software developer is carried out;
when the identity information of the software developer needs to be deactivated, one or more code warehouses needing to be deactivated are selected from the code warehouses CK1 and CK2 … … CKN, and then an operation command is sent to the selected code warehouses to deactivate the identity information of the software developer, so that unified identity information deactivation of the software developer is carried out;
s203: and the unified identification information of the software developer is transmitted and shared to the code quantity statistics management module/system.
Further, in step S3, the process of obtaining the code statistic information not submitted by the developer further includes the following steps:
s301: the code statistics client records source code source warehouse identifiers CK1, CK2 … … CKN on a software developer machine;
s302: the software developer machine is marked as a machine PCN, and obtains the latest version numbers of source codes from code warehouses CK1, CK2 … … CKN on the machine PCN, and the latest version numbers are marked as versions B1, B2 … … BN;
s303: selecting a code version number from B1 and B2 … … BN, marking the code version number as BM, and marking a corresponding code warehouse as CKM;
s304: inquiring whether codes with the version numbers of BM exist in the code warehouse CKM, if not, acquiring a version number before the code version number BM in the code warehouse CKM on the PCN of the machine, marking the version number as BM-1, continuously inquiring whether codes with the version number of BM-1 exist in the code warehouse CKM, and repeating the process until finding a code version number which corresponds to the last code version number in the code warehouse CKM on the PCN of the machine, marking the code version number as BZ;
s305: comparing a source code file in a code warehouse CKM on a machine PCN with codes with a code version number BZ in the code warehouse CKM file by file and line by line, and recording code file change data and code line number change data on a PCN machine of a software developer;
s306: repeating the steps S303-S305 until the code quantity change data in all code warehouses on the PCN of the machine are calculated;
s307: the statistical results of S301-306 are marked as uncommitted code statistical data, and the original data and the statistical result data are sent to a code quantity statistical module/system.
Further, in step S305, a specific comparison method of the code file change data is as follows:
if a certain file exists on the machine PCN, the file does not exist in the code warehouse CKM and is recorded as a newly added file;
if a certain file does not exist on the machine PCN, the file exists in the code warehouse CKM and is recorded as a deleted file;
if a certain file exists in the machine PCN and the code warehouse CKM, if the file content is the same, recording the file as an unedited file;
if a certain file exists in the machine PCN and the code warehouse CKM, if the file contents are different, the file is recorded as an edited file;
and summing and counting the number of the added files, the deleted files and the edited files obtained by calculation in the steps to obtain the number of the added files, the number of the deleted files and the number of the edited files.
Further, in step S305, the comparison method of the code line number fluctuation data is as follows:
selecting a certain modification file, marking the file on the PCN as PCX, marking the file in a corresponding code warehouse CKM as CKX, and marking the PCX and the CKX as two character string texts; each line in the PCX file is marked as a character string sequence PCX [ K ], wherein K is a positive integer, and as a subscript of the character string sequence, each line in the CKX is similarly marked as a character string sequence CKX [ K ], and K is also a positive integer;
comparing PCX [ K ] with CKX [ K ] to find out the largest common subsequence of the PCX [ K ] and the CKX [ K ], and marking the maximum common subsequence as CX [ M ], wherein the number of lines of texts in CX [ M ] is the number of lines of codes which are not edited;
CX [ M ] divides PCX [ K ] and CKX [ K ] into a plurality of code blocks, which are respectively marked as PCX [ R ] and CKX [ S ], I is used as subscripts of the code blocks PCX [ R ] and CKX [ S ], and the following calculation is performed on PCX [ R ] and CKX [ S ]: if PCX [ I ] is not null and CKX [ I ] is null, PCX [ I ] is a newly added code block, and the corresponding code line number is a newly added code line; if PCX [ I ] is empty and CKX [ I ] is not empty, CKX [ I ] is a deleting code block, and the corresponding code line is a deleting code line; if PCK [ I ] is not null and CKX [ I ] is not null, CKX [ I ] is an editing code block, and the corresponding code line is an editing code line;
calculating all adjacent character string sequences in CX [ M ] according to the steps, and summing calculation results to obtain the number of newly added code lines, the number of edited code lines and the number of deleted code lines in the file PCX;
and calculating and summing all the modified files on the PCN of the machine according to the steps to obtain the statistical data of the codes which are not submitted by the code warehouse CKM on the PCN of the machine.
Further, in step S3, the process of calculating the code amount statistical information includes: the code quantity statistics management module/system performs code quantity statistics of various dimensions by acquiring the unified identification of the identity information of the developer in the developer identity identification management module/system, acquiring code statistics data which are transmitted by N code statistics clients and are not submitted by the developer, and acquiring submitted code statistics data in N code warehouses;
the method specifically comprises the following steps:
acquiring a unified identity of developer identity information in a developer identity management module/system;
acquiring code quantity statistical original data and statistical result data which are not submitted by N developers;
acquiring code log data submitted by developers in N code warehouses;
carrying out standardization processing on the obtained code log data, wherein standardized fields of the log data comprise: code warehouse identification (CK 1, CK2 … … CKN), software project identification, software project extension identification, software module extension identification (N), original developer identity information identification, standardized developer identity information identification, developer identity information extension identification, code submitting machine IP, code submitting region, code submitting time, number of newly added files, number of modified files, number of deleted files, number of newly added code lines, number of modified code lines and number of deleted code lines;
comparing the code quantity statistical original data and statistical result data before processing with the data obtained in the last step, and deleting repeated data;
and carrying out summation calculation on the result data of the last step to obtain code quantity statistical result data.
The invention also provides a code statistics system supporting the cross-code warehouse, which comprises:
n code warehouses of one or more types for storing program source codes submitted by software developers and recording submitted logs;
n code statistics clients: the code statistic information is used for counting code statistic information not submitted by a software developer;
developer identity management module/system: the system is used for uniformly managing the identity of the software developer among a plurality of or a plurality of code warehouses;
a code amount statistics management module/system comprising:
uncommitted code amount acquisition module: the method is used for acquiring and storing the code quantity not submitted by the software developer;
submitted code log acquisition module: the method comprises the steps of acquiring code quantity log information submitted by a software developer;
code log standardized processing module: the code quantity log information normalization processing is used for normalizing the code quantity log information among one or more code warehouses;
a code statistics calculation module: the method is used for calculating a code quantity statistical result;
a statistical data storage module: the code quantity statistics module is used for storing code quantity statistics results;
the statistical data display module: for exposing code amount statistics from various statistics dimensions to outside;
statistical data interface: the method comprises the steps of providing external calling and inquiring code quantity statistical results;
the code quantity statistics management module/system performs code quantity statistics of various dimensions by acquiring the unified identification of the identity information of the developer in the developer identity identification management module/system, acquiring code statistics data which are transmitted by N code statistics clients and are not submitted by the developer, and acquiring submitted code statistics data in N code warehouses;
the code amount statistics management module/system is specifically used for: acquiring a unified identity of developer identity information in a developer identity management module/system;
acquiring code quantity statistical original data and statistical result data which are not submitted by N developers;
acquiring code log data submitted by developers in N code warehouses;
carrying out standardized processing on the obtained code log data;
comparing the code quantity statistical original data and the statistical result data with the code log data subjected to standardized processing, deleting repeated data, and summing the obtained result data to obtain the code quantity statistical result data.
The invention also provides code statistics equipment supporting the cross-code warehouse, which comprises the following steps: the system comprises a network bus, a network interface, a processor and a memory, wherein the network bus and the network interface are used for establishing network connection with a code statistics client program, transmitting developer identity information and code statistics information, and the memory stores computer executable instructions or programs and code quantity statistics result data, the computer executable instructions or programs are used for executing the code statistics method supporting the cross-code warehouse, and the processor is used for executing the stored computer executable instructions or programs in the memory.
The code statistics method supporting the cross-code warehouse can manage the identity of the software developer in different code warehouses when the code quantity statistics of the cross-code warehouses is carried out, and does not need to add, edit or deactivate the identity of the software developer in different code warehouses respectively; meanwhile, the code quantity which is not submitted to the code warehouse by the software developer and the code quantity which is submitted to the code warehouse are counted, so that the stability of an information system is destroyed because the software developer is forced to submit unstable codes during the counting of the code quantity, and the work such as information system testing, operation and maintenance and the like caused by the stability is avoided; the work of preprocessing or data standardization processing and the like on code submission logs in different code warehouses is reduced; there is no concern about missing code statistics in the original code repository when the code repository software is replaced.
Drawings
The invention is further described and illustrated below with reference to the accompanying drawings.
FIG. 1 is a flow chart of the overall code statistics method supporting cross code warehouse in accordance with a preferred embodiment of the present invention.
Fig. 2 is a flowchart of the unification of the identity information of the software developer.
FIG. 3 is a flow chart of uncommitted code amount statistics.
Fig. 4 is a flowchart of code amount statistics management.
FIG. 5 is an architecture diagram of a code statistics system supporting cross code warehouses of the present invention.
Fig. 6 is an architecture diagram of a code amount statistics management module/system.
FIG. 7 is a block diagram of the architecture of the code statistics apparatus of the present invention supporting cross code warehouse.
Description of the embodiments
The technical solution of the present invention will be more clearly and completely explained by the description of the preferred embodiments of the present invention with reference to the accompanying drawings.
As shown in fig. 1, the code statistics method supporting cross-code warehouse of the present invention comprises the following steps:
s1: deploying a code statistics client and a server, initializing link information and other information of each code warehouse, wherein the initialized information of each code warehouse comprises a server address, IP, a software item, an IT company and a department; and identify each code repository as CK1, CK2 … … CKN; when a new code warehouse is added, correspondingly adding code warehouse link information and a corresponding code warehouse identifier;
s2: unifying the identity information of the software developer among the code warehouses;
s3: acquiring non-submitted code statistic information of a software developer, and calculating code quantity statistic information by combining code quantity log information in each code warehouse;
s4: and providing the code quantity statistical result outwards.
As shown in fig. 2, in step S2, the process of unifying the identification information of the software developer further includes the following steps:
s201: the developer identity management module/system periodically acquires the identity information of all software developers in the code warehouses CK1, CK2 … … CKN through an operation command;
s202: the identity information of the same software developer in different code warehouses is marked by using the same identity tag, and a software developer identity tag data set is established;
when the identity information of the software developer needs to be newly added, firstly, selecting one or more code warehouses needing to be newly added from the code warehouses CK1, CK2 and … … CKN, and then, sending the identity information command of the newly added software developer to the selected code warehouses through an operation command to perform unified new addition of the identity information of the software developer;
when the identity information of the software developer is required to be edited, one or more code warehouses needing to be edited are selected from the code warehouses CK1 and CK2 … … CKN, and then an instruction for editing the identity information of the software developer is sent to the selected code warehouses through an operation instruction, so that unified editing of the identity information of the software developer is carried out;
when the identity information of the software developer needs to be deactivated, one or more code warehouses needing to be deactivated are selected from the code warehouses CK1 and CK2 … … CKN, and then an operation command is sent to the selected code warehouses to deactivate the identity information of the software developer, so that unified identity information deactivation of the software developer is carried out;
s203: and the unified identification information of the software developer is transmitted and shared to the code quantity statistics management module/system. The sending mode can be a mode of opening an information system interface, a mode of pushing messages, or a mode of sharing data files or a database between a developer identity management module/system and a code quantity statistics management module/system.
In step S202, the software developer or the system operation and maintenance personnel may not pass through the software developer identity management module/system, but directly perform the new addition, editing or deactivation on a certain code warehouse CKM, where the new addition, editing or deactivation of the software developer identity is only effective on the code warehouse CKM and not effective on other code warehouses, and if this happens, the software developer identity management module/system can perform unified management on the software developer identity as long as the software developer identity management module/system periodically performs the above steps S201 and S202.
As shown in fig. 3 and 4, in step S3, the process of acquiring the developer uncommitted code statistic information further includes the steps of:
s301: the code statistics client records source code source warehouse identifiers CK1, CK2 … … CKN on a software developer machine;
s302: the software developer machine is marked as a machine PCN, and obtains the latest version numbers of source codes from code warehouses CK1, CK2 … … CKN on the machine PCN, and the latest version numbers are marked as versions B1, B2 … … BN;
s303: selecting a code version number from B1 and B2 … … BN, marking the code version number as BM, and marking a corresponding code warehouse as CKM;
s304: inquiring whether codes with the version numbers of BM exist in the code warehouse CKM, if not, acquiring a version number before the code version number BM in the code warehouse CKM on the PCN of the machine, marking the version number as BM-1, continuously inquiring whether codes with the version number of BM-1 exist in the code warehouse CKM, and repeating the process until finding a code version number which corresponds to the last code version number in the code warehouse CKM on the PCN of the machine, marking the code version number as BZ;
s305: comparing a source code file in a code warehouse CKM on a machine PCN with codes with a code version number BZ in the code warehouse CKM file by file and line by line, and recording code file change data and code line number change data on a PCN machine of a software developer;
s306: repeating the steps S303-S305 until the code quantity change data in all code warehouses on the PCN of the machine are calculated;
s307: the statistical results of S301-306 are marked as uncommitted code statistical data, and the original data and the statistical result data are sent to a code quantity statistical module/system. The sending mode can be in a mode of opening an information system interface, can also be in a mode of pushing messages, and can also be in a mode of sharing data files or a shared database between a code statistics client and a code quantity statistics management module/system.
In step S305, a specific comparison method of the code file change data is as follows:
if a certain file exists on the machine PCN, the file does not exist in the code warehouse CKM and is recorded as a newly added file;
if a certain file does not exist on the machine PCN, the file exists in the code warehouse CKM and is recorded as a deleted file;
if a certain file exists in the machine PCN and the code warehouse CKM, if the file content is the same, recording the file as an unedited file;
if a certain file exists in the machine PCN and the code warehouse CKM, if the file contents are different, the file is recorded as an edited file;
and summing and counting the number of the added files, the deleted files and the edited files obtained by calculation in the steps to obtain the number of the added files, the number of the deleted files and the number of the edited files.
In step S305, the comparison method of the code line number fluctuation data is as follows:
selecting a certain modification file, marking the file on the PCN as PCX, marking the file in a corresponding code warehouse CKM as CKX, and marking the PCX and the CKX as two character string texts; each line in the PCX file is marked as a character string sequence PCX [ K ], wherein K is a positive integer, and as a subscript of the character string sequence, each line in the CKX is similarly marked as a character string sequence CKX [ K ], and K is also a positive integer;
comparing PCX [ K ] with CKX [ K ] to find out the largest common subsequence of the PCX [ K ] and the CKX [ K ], and marking the maximum common subsequence as CX [ M ], wherein the number of lines of texts in CX [ M ] is the number of lines of codes which are not edited;
CX [ M ] divides PCX [ K ] and CKX [ K ] into a plurality of code blocks, which are respectively marked as PCX [ R ] and CKX [ S ], I is used as subscripts of the code blocks PCX [ R ] and CKX [ S ], and the following calculation is performed on PCX [ R ] and CKX [ S ]: if PCX [ I ] is not null and CKX [ I ] is null, PCX [ I ] is a newly added code block, and the corresponding code line number is a newly added code line; if PCX [ I ] is empty and CKX [ I ] is not empty, CKX [ I ] is a deleting code block, and the corresponding code line is a deleting code line; if PCK [ I ] is not null and CKX [ I ] is not null, CKX [ I ] is an editing code block, and the corresponding code line is an editing code line;
calculating all adjacent character string sequences in CX [ M ] according to the steps, and summing calculation results to obtain the number of newly added code lines, the number of edited code lines and the number of deleted code lines in the file PCX;
and calculating and summing all the modified files on the PCN of the machine according to the steps to obtain the statistical data of the codes which are not submitted by the code warehouse CKM on the PCN of the machine.
In step S3, the process of calculating the code amount statistical information includes: the code quantity statistics management module/system performs code quantity statistics of various dimensions by acquiring the unified identification of the identity information of the developer in the developer identity identification management module/system, acquiring code statistics data which are transmitted by N code statistics clients and are not submitted by the developer, and acquiring submitted code statistics data in N code warehouses;
the method specifically comprises the following steps:
acquiring a unified identity of developer identity information in a developer identity management module/system;
acquiring code quantity statistical original data and statistical result data which are not submitted by N developers;
acquiring code log data submitted by developers in N code warehouses;
carrying out standardization processing on the obtained code log data, wherein standardized fields of the log data comprise: code warehouse identification (CK 1, CK2 … … CKN), software project identification, software project extension identification, software module extension identification (N), original developer identity information identification, standardized developer identity information identification, developer identity information extension identification, code submitting machine IP, code submitting region, code submitting time, number of newly added files, number of modified files, number of deleted files, number of newly added code lines, number of modified code lines and number of deleted code lines;
comparing the code quantity statistical original data and statistical result data before processing with the data obtained in the last step, and deleting repeated data;
and carrying out summation calculation on the result data of the last step to obtain code quantity statistical result data.
As shown in fig. 5 and 6, the code statistics system supporting cross code warehouse of the present invention includes:
n code warehouses of one or more types for storing program source codes submitted by software developers and recording submitted logs;
n code statistics clients: the method is used for counting the uncommitted code quantity of the developer;
developer identity management module/system: the system is used for uniformly managing the developer identity identifiers among a plurality of or a plurality of code warehouses;
a code amount statistics management module/system comprising:
uncommitted code amount acquisition module: the code quantity is used for acquiring and storing the code quantity not submitted by the developer;
submitted code log acquisition module: the code amount data is used for acquiring code amount data submitted by a developer;
code log standardized processing module: a code commit log data normalization process for normalizing code between the one or more code warehouses;
a code statistics calculation module: the method is used for calculating a code quantity statistical result;
a statistical data storage module: the code quantity statistics module is used for storing code quantity statistics results;
the statistical data display module: the data statistics device is used for displaying data statistics results from various statistics dimensions;
statistical data interface: for external calling and inquiring code quantity statistical result.
As shown in fig. 7, the code statistics apparatus supporting cross code warehouse of the present invention includes: the system comprises a network bus, a network interface, a processor and a memory, wherein the network bus and the network interface are used for establishing network connection with a code statistics client program, transmitting developer identity information and code statistics information, and the memory stores computer executable instructions or programs and code quantity statistics result data, the computer executable instructions or programs are used for executing the code statistics method supporting the cross-code warehouse, and the processor is used for executing the stored computer executable instructions or programs in the memory.
The code statistics method supporting the cross-code warehouse solves the problem that a software developer unifies identity marks among a plurality of or a plurality of code warehouses by establishing the user identity mark mapping relation among the code warehouses; the method comprises the steps of reading a code branch file not submitted by a software developer through a client program, comparing the code branch file with a latest branch file in a code warehouse, counting the code quantity not submitted by the software developer, and solving the problem that the code warehouse can only count the submitted code quantity of the software developer by combining a code counting function of the code warehouse; the code statistics information standard is established, code logs in different code warehouses are collected, and the code quantity statistics problem across the code warehouses is solved by combining the user identity mapping relation among the code warehouses.
The above detailed description is merely illustrative of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Various modifications, substitutions and improvements of the technical scheme of the present invention will be apparent to those skilled in the art from the description and drawings provided herein without departing from the spirit and scope of the invention. The scope of the invention is defined by the claims.
Claims (9)
1. A method of supporting code statistics across code warehouses, comprising the steps of:
s1: deploying a code statistics client and a server, and initializing link information and other information of each code warehouse;
s2: unifying the identity information of the software developer among the code warehouses;
s3: acquiring non-submitted code statistic information of a software developer, and calculating code statistic information by combining code quantity log information in each code warehouse, wherein the method comprises the following steps of: the code quantity statistics management module/system acquires submitted code statistics data in N code warehouses by acquiring unified identification of the identity information of the software developer in the software developer identity identification management module/system and acquiring code statistics data which are sent by N code statistics clients and are not submitted by the software developer, so as to carry out code quantity statistics of various dimensions;
the method specifically comprises the following steps:
acquiring unified identification of the identity information of the software developer in the identity identification management module/system of the software developer;
acquiring code quantity statistical original data and statistical result data which are not submitted by N software developers;
acquiring code log data submitted by software developers in N code warehouses;
carrying out standardized processing on the obtained code log data;
comparing the code quantity statistical original data and statistical result data with the code log data subjected to standardized processing, deleting repeated data, and summing the obtained result data to obtain a code quantity statistical result;
s4: and providing the code quantity statistical result outwards.
2. The method according to claim 1, wherein in step S1, the initialized information of each code repository includes server address, IP, belonging software item, belonging IT company, department; and identifying each of the code warehouses as CK1, CK2 … … CKN; when a new code warehouse is added, code warehouse link information and corresponding code warehouse identification are correspondingly added.
3. The method according to claim 2, wherein in step S2, the process of unifying software developer identification information comprises the steps of:
s201: the software developer identity management module/system periodically acquires the identity information of all software developers in the code warehouse CK1, CK2 … … CKN through an operation command;
s202: the identity information of the same software developer in different code warehouses is marked by using the same identity tag, and a software developer identity tag data set is established;
when the identity information of the software developer needs to be newly added, firstly, selecting one or more code warehouses needing to be newly added from the code warehouses CK1, CK2 and … … CKN, and then, sending the identity information command of the newly added software developer to the selected code warehouses through an operation command to perform unified new addition of the identity information of the software developer;
when the identity information of the software developer is required to be edited, one or more code warehouses needing to be edited are selected from the code warehouses CK1 and CK2 … … CKN, and then an instruction for editing the identity information of the software developer is sent to the selected code warehouses through an operation instruction, so that unified editing of the identity information of the software developer is carried out;
when the identity information of the software developer needs to be deactivated, one or more code warehouses needing to be deactivated are selected from the code warehouses CK1 and CK2 … … CKN, and then an operation command is sent to the selected code warehouses to deactivate the identity information of the software developer, so that unified identity information deactivation of the software developer is carried out;
s203: and the unified identification information of the software developer is transmitted and shared to the code quantity statistics management module/system.
4. The method of claim 1, wherein in step S3, the process of obtaining non-submitted code statistic information by a software developer comprises the steps of:
s301: the code statistics client records source code source warehouse identifiers CK1, CK2 … … CKN on a software developer machine;
s302: the software developer machine is marked as a machine PCN, the latest version numbers of source codes from code warehouses CK1, CK2 … … CKN on the machine PCN are obtained, and the latest version numbers are marked as versions B1, B2 … … BN;
s303: selecting a code version number from B1 and B2 … … BN, marking the code version number as BM, and marking a corresponding code warehouse as CKM;
s304: inquiring whether codes with the version numbers of BM exist in the code warehouse CKM, if not, acquiring a version number before the code version number BM in the code warehouse CKM on the PCN of the machine, marking the version number as BM-1, continuously inquiring whether codes with the version number of BM-1 exist in the code warehouse CKM, and repeating the process until finding a code version number which corresponds to the last code version number in the code warehouse CKM on the PCN of the machine, marking the code version number as BZ;
s305: comparing a source code file in a code warehouse CKM on a machine PCN with codes with a code version number BZ in the code warehouse CKM file by file and line by line, and recording code file change data and code line number change data on a PCN machine of a software developer;
s306: repeating the steps S303-S305 until the code quantity change data in all code warehouses on the PCN of the machine are calculated;
s307: the statistical results of the step S301-the step S306 are marked as uncommitted code statistical data, and the original data and the statistical result data are sent to a code quantity statistical module/system.
5. The method of claim 4, wherein in step S305, the specific comparison method of the code file change data is as follows:
if a certain file exists on the machine PCN, the file does not exist in the code warehouse CKM and is recorded as a newly added file;
if a certain file does not exist on the machine PCN, the file exists in the code warehouse CKM and is recorded as a deleted file;
if a certain file exists in the machine PCN and the code warehouse CKM, if the file content is the same, recording the file as an unedited file;
if a certain file exists in the machine PCN and the code warehouse CKM, if the file contents are different, the file is recorded as an edited file;
and summing the number of the newly added files, the deleted files and the edited files to count the number of the newly added files, the number of the deleted files and the number of the edited files.
6. The method of code statistics supporting cross code warehouses as recited in claim 4, wherein in step S305, the method of comparing code line number variation data is as follows:
selecting a certain modification file, marking the file on the PCN as PCX, marking the file in a corresponding code warehouse CKM as CKX, and marking the PCX and the CKX as two character string texts; each line in the PCX file is marked as a character string sequence PCX [ K ], wherein K is a positive integer, and as a subscript of the character string sequence, each line in the CKX is similarly marked as a character string sequence CKX [ K ], and K is also a positive integer;
comparing PCX [ K ] with CKX [ K ] to find out the largest common subsequence of the PCX [ K ] and the CKX [ K ], and marking the maximum common subsequence as CX [ M ], wherein the number of lines of texts in CX [ M ] is the number of lines of codes which are not edited;
CX [ M ] divides PCX [ K ] and CKX [ K ] into a plurality of code blocks, which are respectively marked as PCX [ R ] and CKX [ S ], I is used as subscripts of the code blocks PCX [ R ] and CKX [ S ], and the following calculation is performed on PCX [ R ] and CKX [ S ]: if PCX [ I ] is not null and CKX [ I ] is null, PCX [ I ] is a newly added code block, and the corresponding code line number is a newly added code line; if PCX [ I ] is empty and CKX [ I ] is not empty, CKX [ I ] is a deleting code block, and the corresponding code line is a deleting code line; if PCK [ I ] is not null and CKX [ I ] is not null, CKX [ I ] is an editing code block, and the corresponding code line is an editing code line;
calculating the code line number change data of all adjacent character string sequences in CX [ M ], and summing the calculation results to obtain the newly added code line number, the edited code line number and the deleted code line number in the file PCX;
and calculating and summing the code line number variation data of all the modified files on the machine PCN to obtain the statistical data of the codes which are not submitted by the code warehouse CKM on the machine PCN.
7. The method of claim 1, wherein in step S3, the standardized field of the code log data includes: the method comprises the steps of code warehouse identification CK1, CK2 … … CKN, software project identification, software project extension identification, software module identification, N software module extension identifications, original software developer identification information identification, standardized software developer identification information identification, software developer identification information extension identification, code submitting machine IP, code submitting area, code submitting time, newly-increased file number, modified file number, deleted file number, newly-increased code number, modified code number and deleted code number.
8. A code statistics system supporting cross code warehousing, comprising:
n code warehouses of one or more types: the system is used for storing program source codes submitted by software developers and recording a submitted log;
n code statistics clients: the code statistic information is used for counting code statistic information not submitted by a software developer;
software developer identity management module/system: the system is used for uniformly managing the identity of the software developer among a plurality of or a plurality of code warehouses;
a code amount statistics management module/system comprising:
uncommitted code amount acquisition module: the method is used for acquiring and storing code statistic information not submitted by a software developer;
submitted code log acquisition module: the method comprises the steps of acquiring code quantity log information submitted by a software developer;
code log standardized processing module: the code quantity log information normalization processing is used for normalizing the code quantity log information among the plurality of code warehouses;
a code statistics calculation module: the method is used for calculating a code quantity statistical result;
a statistical data storage module: the code quantity statistics module is used for storing code quantity statistics results;
the statistical data display module: for exposing code amount statistics from various statistics dimensions to outside;
statistical data interface: the method comprises the steps of providing external calling and inquiring code quantity statistical results;
the code quantity statistics management module/system acquires submitted code statistics data in N code warehouses by acquiring unified identification of the identity information of the software developer in the software developer identity identification management module/system and acquiring code statistics data which are sent by N code statistics clients and are not submitted by the software developer, so as to carry out code quantity statistics of various dimensions;
the code amount statistics management module/system is specifically used for:
acquiring unified identification of the identity information of the software developer in the identity identification management module/system of the software developer;
acquiring code quantity statistical original data and statistical result data which are not submitted by N software developers;
acquiring code log data submitted by software developers in N code warehouses;
carrying out standardized processing on the obtained code log data;
comparing the code quantity statistical original data and the statistical result data with the code log data subjected to standardized processing, deleting repeated data, and summing the obtained result data to obtain a code quantity statistical result.
9. A code statistics apparatus supporting a cross code repository, comprising: a network bus and network interface for establishing a network connection with a code statistics client for transmitting code statistics information, a processor and a memory, the memory storing computer-executable instructions or programs for executing the method of supporting code statistics across code repositories as claimed in any of claims 1 to 7, the processor being for executing the stored computer-executable instructions or programs in the memory.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211617928.5A CN115617635B (en) | 2022-12-16 | 2022-12-16 | Code statistics method, system and equipment supporting cross-code warehouse |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211617928.5A CN115617635B (en) | 2022-12-16 | 2022-12-16 | Code statistics method, system and equipment supporting cross-code warehouse |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115617635A CN115617635A (en) | 2023-01-17 |
CN115617635B true CN115617635B (en) | 2023-05-23 |
Family
ID=84880297
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211617928.5A Active CN115617635B (en) | 2022-12-16 | 2022-12-16 | Code statistics method, system and equipment supporting cross-code warehouse |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115617635B (en) |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB0114271D0 (en) * | 2001-06-12 | 2001-08-01 | Univ Manchester | Parameterisation |
JP4771288B2 (en) * | 2006-04-03 | 2011-09-14 | 富士ゼロックス株式会社 | Data processing apparatus and program |
CN103699637B (en) * | 2013-12-23 | 2017-02-08 | 国云科技股份有限公司 | Code productivity statistic method and system |
CN112416417A (en) * | 2020-12-03 | 2021-02-26 | 中国人寿保险股份有限公司 | Code amount statistical method and device, electronic equipment and storage medium |
-
2022
- 2022-12-16 CN CN202211617928.5A patent/CN115617635B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN115617635A (en) | 2023-01-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102713834B (en) | Management accounts format information | |
CN100375017C (en) | Method and apparatus for incrementally processing program annotations | |
US7103885B2 (en) | Comment driven processing | |
CN113326247B (en) | Cloud data migration method and device and electronic equipment | |
CN110096419A (en) | Acquisition methods, interface log management server and the service server of interface log | |
CN112925757A (en) | Method, equipment and storage medium for tracking operation log of intelligent equipment | |
CN110866024B (en) | Vector database increment updating method and system | |
CN114780370A (en) | Data correction method and device based on log, electronic equipment and storage medium | |
CN115617635B (en) | Code statistics method, system and equipment supporting cross-code warehouse | |
CN117909392B (en) | Intelligent data asset inventory method and system | |
CN117093556A (en) | Log classification method, device, computer equipment and computer readable storage medium | |
CN113641523B (en) | Log processing method and device | |
US10664501B2 (en) | Deriving and interpreting users collective data asset use across analytic software systems | |
CN116795486A (en) | Analysis method and device for container mirror image file purification, storage medium and terminal | |
CN112749197B (en) | Data fragment refreshing method, device, equipment and storage medium | |
CN111352824B (en) | Test method and device and computer equipment | |
CN113504904A (en) | User-defined function implementation method and device, computer equipment and storage medium | |
CN115658821B (en) | Method and device for managing digital entity and storage medium | |
US11797279B2 (en) | Systems and methods for dependency analysis | |
CN112749154B (en) | Data warehousing method, device and equipment and computer readable storage medium | |
CN114416700A (en) | Customer information management method and device | |
CN117194373A (en) | Data migration method, data migration system, electronic device and storage medium | |
CN118194824A (en) | Data standard conversion method, device, electronic equipment, storage medium and program product | |
CN118134381A (en) | Steel spare part information management and control method, system, terminal and storage medium | |
CN117743289A (en) | MBSE model library construction method and device |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |