CN110716739A - Code change information statistical method, system and readable storage medium - Google Patents

Code change information statistical method, system and readable storage medium Download PDF

Info

Publication number
CN110716739A
CN110716739A CN201910885915.8A CN201910885915A CN110716739A CN 110716739 A CN110716739 A CN 110716739A CN 201910885915 A CN201910885915 A CN 201910885915A CN 110716739 A CN110716739 A CN 110716739A
Authority
CN
China
Prior art keywords
change
information
version
change information
file
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.)
Granted
Application number
CN201910885915.8A
Other languages
Chinese (zh)
Other versions
CN110716739B (en
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910885915.8A priority Critical patent/CN110716739B/en
Publication of CN110716739A publication Critical patent/CN110716739A/en
Application granted granted Critical
Publication of CN110716739B publication Critical patent/CN110716739B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3604Software analysis for verifying properties of programs

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a code change information statistical method, a system and a readable storage medium, wherein the method comprises the following steps: receiving code change source data of a preset version interval; acquiring all changed files from the code change source data; acquiring version information of each change file with a change record in a preset version interval; analyzing the change information of two adjacent version intervals of each change file in the version information of each change file; and combining the change information of all adjacent two version intervals of each change file to obtain the change result information of each change file in the preset version interval. The invention can make the code review conference always focus on the changed code line and other related changed lines, and can quickly filter all changed files corresponding to a certain changer, thereby achieving the purpose of quickly filtering the target file and effectively improving the code review efficiency.

Description

Code change information statistical method, system and readable storage medium
Technical Field
The invention relates to the technical field of code processing, in particular to a code change information statistical method, a system and a readable storage medium.
Background
SVN (subversion) is used as a version control system of an open source code, and can enable a plurality of developers to record file versions submitted to a server through a central version control system, thereby achieving the purpose of ensuring file synchronization and being mainly used for source code maintenance in a multi-user development environment.
Code review, an important part of software development activities, aims to find and repair some problems overlooked in the initial stage of software development, so as to improve the software quality and improve the encoding capability of programmers. Currently, the following problems often need to be faced when evaluating code:
the first and the same source code file are modified by a plurality of persons at the same time, and when the process of reviewing the code of a certain person is turned, the changed code of the person is difficult to be rapidly displayed from hundreds of lines or even thousands of lines of code.
Secondly, files with codes changed by a certain person may be distributed in different packages (folders), all files need to be searched one by one, search time is wasted, and the files changed by the person cannot be filtered out quickly.
Based on the above problems, much time is often spent on searching for the code changed by the appointed personnel in the code review conference, the process easily causes the inconsistency of the development of the review conference, and the review efficiency is reduced.
Disclosure of Invention
In order to solve at least one technical problem, the invention provides a code change information statistical method, a system and a readable storage medium.
In order to achieve the above object, a first aspect of the present invention provides a code change information statistical method, including:
receiving code change source data of a preset version interval;
acquiring all changed files from the code change source data;
acquiring version information of each change file with a change record in a preset version interval;
analyzing the change information of two adjacent version intervals of each change file in the version information of each change file;
and combining the change information of all adjacent two version intervals of each change file to obtain the change result information of each change file in the preset version interval.
In the scheme, analyzing the change information of two adjacent version intervals of each change file in the version information thereof comprises the following steps:
analyzing the change information between the initial version and the first version corresponding to the version information, and taking the change information as the initial change information;
and analyzing the change information of all the adjacent two version intervals in the version information.
In this scheme, analyzing the change information of two adjacent version intervals in the version information of each change file further includes:
obtaining a first deviation value according to the difference value of the deleted data and the newly added data in the first change content;
calculating the sum of the first offset value and the initial offset value to obtain a first accumulated offset value, and storing the first changed content according to the first accumulated offset value;
obtaining a second deviation value according to the difference value between the deleted data and the newly added data in the second change content;
calculating the sum of the second deviation value and the first accumulative deviation value to obtain a second accumulative deviation value, and storing the second changed content according to the second accumulative deviation value;
and sequentially carrying out the two steps, analyzing all the change contents of the adjacent two version intervals, and storing.
In this scheme, merging the change information of all adjacent two version intervals of each change file further includes:
presetting a collection library, and initializing the collection library by using the maximum key value of a first group of change information in the change information;
merging the first group of change information into the collection library, and marking changers of the first group of change information in the collection library;
expanding the collection library according to the maximum key value of a second group of change information in the change information;
merging the second group of change information into the collection library, and marking changers of the second group of change information in the collection library;
and sequentially carrying out the two steps until all the change information is merged into the collection library.
In this scheme, after obtaining the change result information of each change file in the preset version interval, the method further includes:
and displaying the change result information according to a preset rule according to the user requirement, wherein the preset rule is used for changing the position sequence of the lines in the file or changing the set of the lines by artificial dimensionality.
In the scheme, the change information comprises one or more of a new line number, a modified line number and a deleted line number; the version information comprises one or more of version number, newly added record, modified record and deleted record; the change result information comprises one or more of a change file name, a change person and a change line.
The second aspect of the present invention further provides a code change information statistical system, where the code change information statistical system includes: the memory comprises a code change information statistical method program, and the code change information statistical method program realizes the following steps when being executed by the processor:
receiving code change source data of a preset version interval;
acquiring all changed files from the code change source data;
acquiring version information of each change file with a change record in a preset version interval;
analyzing the change information of two adjacent version intervals of each change file in the version information of each change file;
and combining the change information of all adjacent two version intervals of each change file to obtain the change result information of each change file in the preset version interval.
In this scheme, analyzing the change information of two adjacent version intervals in the version information of each change file further includes:
obtaining a first deviation value according to the difference value of the deleted data and the newly added data in the first change content;
calculating the sum of the first offset value and the initial offset value to obtain a first accumulated offset value, and storing the first changed content according to the first accumulated offset value;
obtaining a second deviation value according to the difference value between the deleted data and the newly added data in the second change content;
calculating the sum of the second deviation value and the first accumulative deviation value to obtain a second accumulative deviation value, and storing the second changed content according to the second accumulative deviation value;
and sequentially carrying out the two steps, analyzing all the change contents of the adjacent two version intervals, and storing.
In this scheme, merging the change information of all adjacent two version intervals of each change file further includes:
presetting a collection library, and initializing the collection library by using the maximum key value of a first group of change information in the change information;
merging the first group of change information into the collection library, and marking changers of the first group of change information in the collection library;
expanding the collection library according to the maximum key value of a second group of change information in the change information;
merging the second group of change information into the collection library, and marking changers of the second group of change information in the collection library;
and sequentially carrying out the two steps until all the change information is merged into the collection library.
The third aspect of the present invention also provides a computer-readable storage medium, which includes a code change information statistical method program, and when the code change information statistical method program is executed by a processor, the method implements the steps of the code change information statistical method as described above.
The method comprises the steps of receiving code change source data of a preset version interval; acquiring all changed files from the code change source data; acquiring version information of each change file with a change record in a preset version interval; analyzing the change information of two adjacent version intervals of each change file in the version information of each change file; and combining the change information of all adjacent two version intervals of each change file to obtain the change result information of each change file in the preset version interval. The invention can provide functional support for a code change evaluation tool so as to improve the efficiency of a code evaluation conference. The invention can make the review tool quickly jump to the change line of a certain file and mark the modifier of the change line, so that the review conference always focuses on the changed code line and other change lines related to the changed code line. Meanwhile, the invention can also obtain the data set which takes the dimension of the change person as the whole change version interval and takes the file as the corresponding dimension data, thus all the change files corresponding to a certain change person can be filtered out quickly, and the aim of quickly filtering the target file is achieved.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
FIG. 1 is a flow chart illustrating a statistical method of code change information according to the present invention;
FIG. 2 is a flow chart illustrating the analysis of change information between two adjacent versions according to the statistics of the change information of the code;
FIG. 3 is a flow chart illustrating the merging of change information between all adjacent two versions of code change information statistics according to the present invention;
FIG. 4 is a block diagram illustrating a code change information statistics system of the present invention;
FIG. 5 is a flow chart illustrating the storing of changed files in set A according to the code change information statistics of the present invention;
FIG. 6 is a flow chart illustrating the storing of version information for each changed file in the set B according to the code change information statistics of the present invention;
FIG. 7 is a flow chart illustrating analysis of change content between two adjacent versions according to the statistics of code change information of the present invention;
FIG. 8 is a diagram showing a structure of a file containing modified content between two adjacent versions in the statistics of code modification information according to the present invention;
FIG. 9 is a flow chart illustrating the calculation of two consecutive content changes in the code change information statistics of the present invention;
FIG. 10 is a flow chart illustrating the merging of parsing results of different versions of the same file in the code change information statistics of the present invention;
FIG. 11 is a flow chart illustrating the generation of data sets according to user requirements in the statistics of code change information in accordance with the present invention.
Detailed Description
In order that the above objects, features and advantages of the present invention can be more clearly understood, a more particular description of the invention will be rendered by reference to the appended drawings. It should be noted that the embodiments and features of the embodiments of the present application may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, however, the present invention may be practiced in other ways than those specifically described herein, and therefore the scope of the present invention is not limited by the specific embodiments disclosed below.
FIG. 1 is a flow chart illustrating a statistical method of code change information according to the present invention.
As shown in fig. 1, a first aspect of the present invention provides a statistical method for code change information, including:
s102, receiving code change source data of a preset version interval;
s104, acquiring all changed files from the code change source data;
s106, acquiring version information of each change file with change records in a preset version interval;
s108, analyzing the change information of two adjacent version intervals of each change file in the version information of each change file;
s110, combining the change information of all adjacent two version intervals of each change file to obtain the change result information of each change file in the preset version interval.
It should be noted that the technical solution of the present invention can be operated in a terminal device such as a PC, a mobile phone, a PAD, and the like.
It should be noted that the version described in the present invention is a global concept, and a new version is generated when a code is submitted to a server every time, and one version only corresponds to one submitter (i.e. a changer), and multiple files can be submitted by one submission.
It should be noted that the code change status of the present invention may include addition, modification, and deletion. But is not limited thereto. If the same file is changed by two persons at the same time, if the first person modifies the 10 th, 11 th and 12 th lines of the file and submits the modified file, and the second person adds two lines of data at the 8 th line of the file, the data modified by the first person finally is shifted to the 12 th, 13 th and 14 th lines; if the first person modifies lines 10, 11, 12 of the document and submits and the second person deletes lines 7, 8 of the document and submits, the data that the first person last modified is shifted to lines 8, 9, 10. It can be understood that the change of the same file by more people is the same as the change of the same file by two people.
It should be noted that the change information includes one or more of a new line number, a modified line number, and a deleted line number; the version information comprises one or more of version number, newly added record, modified record and deleted record; the change result information comprises one or more of a change file name, a change person and a change line. But is not limited thereto.
According to the embodiment of the invention, the method for analyzing the change information of the adjacent two version intervals in the version information of each change file comprises the following steps:
analyzing the change information between the initial version and the first version corresponding to the version information, and taking the change information as the initial change information;
and analyzing the change information of all the adjacent two version intervals in the version information.
It should be noted that since the version section may be configured by providing two versions, when processing the first version of the version information, it is necessary to process the first version of the version information as the start version (default version 1) and the first version of the version information as the end version.
FIG. 2 is a flow chart of analyzing change information between two adjacent versions in the statistics of code change information according to the present invention.
As shown in fig. 2, analyzing the change information of two adjacent version intervals in the version information of each change file further includes:
s202, obtaining a first deviation value according to the difference value of the deleted data and the newly added data in the first change content;
s204, calculating the sum of the first offset value and the initial offset value to obtain a first accumulated offset value, and storing the first changed content according to the first accumulated offset value;
s206, obtaining a second deviation value according to the difference value between the deleted data and the newly added data in the second change content;
s208, calculating the sum of the second offset value and the first accumulated offset value to obtain a second accumulated offset value, and storing the second change content according to the second accumulated offset value;
s210, the two steps are sequentially carried out, all the change contents of the adjacent two version intervals are analyzed, and the change contents are stored.
It should be noted that the two steps described in step S210 refer to step S206 and step S208, respectively.
FIG. 3 is a flow chart of merging change information of all adjacent two version intervals in the statistics of code change information according to the present invention.
As shown in fig. 3, merging the change information of all adjacent two-version intervals of each change file further includes:
s302, presetting a collection library, and initializing the collection library by using the maximum key value of a first group of change information in the change information;
s304, merging the first group of change information into the collection library, and marking changers of the first group of change information in the collection library;
s306, expanding the collection library according to the maximum key value of the second group of change information in the change information;
s308, merging the second group of change information into the collection library, and marking changers of the second group of change information in the collection library;
s310, the two steps are sequentially carried out until all the change information is merged into the collection library.
It should be noted that the two steps described in step S310 refer to step S306 and step S308, respectively.
According to the embodiment of the present invention, after obtaining the change result information of each changed file in the preset version interval, the method further includes:
and displaying the change result information according to a preset rule according to the user requirement, wherein the preset rule is used for changing the position sequence of the lines in the file or changing the set of the lines by artificial dimensionality.
FIG. 4 is a block diagram illustrating a code change information statistics system of the present invention.
The second aspect of the present invention further provides a code change information statistics system 4, where the code change information statistics system 4 includes: a memory 41 and a processor 42, wherein the memory 41 includes a statistical method program for code change information, and when the statistical method program for code change information is executed by the processor 42, the statistical method program for code change information implements the following steps:
receiving code change source data of a preset version interval;
acquiring all changed files from the code change source data;
acquiring version information of each change file with a change record in a preset version interval;
analyzing the change information of two adjacent version intervals of each change file in the version information of each change file;
and combining the change information of all adjacent two version intervals of each change file to obtain the change result information of each change file in the preset version interval.
It should be noted that the system of the present invention can be operated in a terminal device such as a PC, a mobile phone, a PAD, etc.
It should be noted that the Processor may be a Central Processing Unit (CPU), other general-purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, a discrete hardware component, and so on. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It should be noted that, the version-global concept described in the present invention is to submit a code to a server once as a new version, which is generated once, and one version only corresponds to one submitter (i.e., a changer), and multiple files can be submitted once.
It should be noted that the code change status of the present invention may include addition, modification, and deletion. But is not limited thereto. If the same file is changed by two persons at the same time, if the first person modifies the 10 th, 11 th and 12 th lines of the file and submits the modified file, and the second person adds two lines of data at the 8 th line of the file, the data modified by the first person finally is shifted to the 12 th, 13 th and 14 th lines; if the first person modifies lines 10, 11, 12 of the document and submits and the second person deletes lines 7, 8 of the document and submits, the data that the first person last modified is shifted to lines 8, 9, 10. It can be understood that the change of the same file by more people is the same as the change of the same file by two people.
It should be noted that the change information includes one or more of a new line number, a modified line number, and a deleted line number; the version information comprises one or more of version number, newly added record, modified record and deleted record; the change result information comprises one or more of a change file name, a change person and a change line. But is not limited thereto.
According to the embodiment of the present invention, analyzing the change information of two adjacent version intervals in the version information of each change file further includes:
analyzing the change information between the initial version and the first version in the version information, and taking the change information as the initial change information;
and analyzing the change information of all the adjacent two version intervals in the version information.
It should be noted that since the version section may be configured by providing two versions, when processing the first version of the version information, it is necessary to process the first version of the version information as the start version (default version 1) and the first version of the version information as the end version.
According to the embodiment of the present invention, analyzing the change information of two adjacent version intervals in the version information of each change file further includes:
obtaining a first deviation value according to the difference value of the deleted data and the newly added data in the first change content;
calculating the sum of the first offset value and the initial offset value to obtain a first accumulated offset value, and storing the first changed content according to the first accumulated offset value;
obtaining a second deviation value according to the difference value between the deleted data and the newly added data in the second change content;
calculating the sum of the second deviation value and the first accumulative deviation value to obtain a second accumulative deviation value, and storing the second changed content according to the second accumulative deviation value;
and sequentially carrying out the two steps, analyzing all the change contents of the adjacent two version intervals, and storing.
According to the embodiment of the present invention, merging the change information of all adjacent two version intervals of each change file, further includes:
presetting a collection library, and initializing the collection library by using the maximum key value of a first group of change information in the change information;
merging the first group of change information into the collection library, and marking changers of the first group of change information in the collection library;
expanding the collection library according to the maximum key value of a second group of change information in the change information;
merging the second group of change information into the collection library, and marking changers of the second group of change information in the collection library;
and sequentially carrying out the two steps until all the change information is merged into the collection library.
According to the embodiment of the present invention, after obtaining the change result information of each changed file in the preset version interval, the method further includes:
and displaying the change result information according to a preset rule according to the user requirement, wherein the preset rule is used for changing the position sequence of the lines in the file or changing the set of the lines by artificial dimensionality.
The third aspect of the present invention also provides a computer-readable storage medium, which includes a code change information statistical method program, and when the code change information statistical method program is executed by a processor, the method implements the steps of the code change information statistical method as described above.
In order to better explain the technical solution of the present invention, the following detailed description will be made by an embodiment.
Firstly, data needs to be input in the system, before the data is input, the version interval (1-100) of the code to be analyzed needs to be determined, and then the input data is determined according to the version interval (1-100).
Then, all source files changed in the version interval 1-100 are obtained and stored in the set A, as shown in FIG. 5, url shown in FIG. 5 is the root path address of the source file on the version server.
The version information of each changed file with the change records in the version interval 1-100 is obtained, and the version information of each file is stored in the set B, as shown in FIG. 6, and url shown in FIG. 6 is the address of the file on the version server.
Since a plurality of modified files are stored in the set a, it is necessary to process the modified files one by one, and to store version information in the set B with the modified files as dimensions.
Processing each file in the set B, and storing change information in each adjacent version interval, since two versions need to be provided to form a version interval, when processing a first version number (version 3 in this embodiment), it is necessary to take a start version 1 of an initial version interval as a start version, and take the first version number as an end version to process, so as to obtain a file 1 recording all change contents of the version interval; when processing the second version number (version 7 in this embodiment), it is necessary to process version 3 as the start version and version 7 as the end version to obtain file 2 in which all the changes in the version section are recorded. As shown in FIG. 7, the url shown in FIG. 7 is the address of the file on the version server.
The changed content of each file is read, and the partial content of the above-mentioned file 1 is shown in fig. 8.
As shown in fig. 9, an analyzed data segment starts with @ @ and ends with the next @ @ or file data line, the data segment is a content of a change, and a first offset value is 1 according to a difference between a deleted line number and a newly added line number in the content of the change for the first time; calculating the sum of the first offset value (1) and the initial offset value (0) to obtain a final offset value of 1, and storing the first changed content according to the final offset value; obtaining a second offset value of 2 according to the difference value between the number of the deleted lines and the number of the newly added lines in the second change content; calculating the sum of the second offset value (2) and the last final offset value (1) to obtain a new final offset value of 3, and storing the second changed content according to the new final offset value; and finally storing the related data of the first changed content and the second changed content into the set C. It should be noted that, the value a in the set C represents addition, the value D represents deletion, and the value M represents modification; if the same row is deleted first and then added, the table is considered to be more state-modified.
As shown in fig. 10, the analysis results of different versions of the same file are merged, that is, each version of the file data of the change version generates a set C, and finally all sets C are merged to be the change result of the file in the version interval 1-100, and all data are integrated into a set D.
Specifically, set D is initialized with the maximum key value (79) of the first set C, the files of the first set C are submitted by user U1, the data of the first set C are merged into set D, user U1 is saved into set D as the value of set D, the length of set D is expanded to the maximum length (99) of the second set C, the files of the second set C are submitted by user U2, and if the length of the second set C is smaller than that of set D (79), the step is omitted; the second set C and the extended length set D are merged and the user U2 is saved as the value of set D in set D.
Note that the rule for updating the user name to the set D is as follows:
if the value of the corresponding key in the set D is NULL and the value of the corresponding key in the set C is M or A, the value of the corresponding key in the set D is assigned as U1;
if the value of the corresponding key in the set D is not NULL, if the value of the corresponding key in the set C is M, the value of the corresponding key in the set C is merged to the value of the corresponding key in the original set D;
if the value of the corresponding key in set C is D, the key and value are removed from set D regardless of the value of the corresponding key in set D.
As shown in fig. 11, a final data set is generated by using the data in the set D according to the user's requirement. Specifically, the data in the set D may be integrated into a set E in which a certain person modifies the behavioral dimensions of the file; the data in set D may also be integrated into set F with rows modified by which people. If the same line is modified by multiple persons, the last person is the standard.
The method comprises the steps of receiving code change source data of a preset version interval; acquiring all changed files from the code change source data; acquiring version information of each change file with a change record in a preset version interval; analyzing the change information of two adjacent version intervals of each change file in the version information of each change file; and combining the change information of all adjacent two version intervals of each change file to obtain the change result information of each change file in the preset version interval. The invention can provide functional support for the code change review tool so as to improve the efficiency of the code review conference. The invention can make the review tool quickly jump to the change line of a certain file and mark the modifier of the change line, so that the review conference always focuses on the changed code line and other change lines related to the changed code line. Meanwhile, the invention can also obtain the data set which takes the dimension of the change person as the whole change version interval and takes the file as the corresponding dimension data, thus all the change files corresponding to a certain change person can be filtered out quickly, and the aim of quickly filtering the target file is achieved.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units; can be located in one place or distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all the functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: a mobile storage device, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Alternatively, the integrated unit of the present invention may be stored in a computer-readable storage medium if it is implemented in the form of a software functional module and sold or used as a separate product. Based on such understanding, the technical solutions of the embodiments of the present invention may be essentially implemented or a part contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media that can store program code.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (10)

1. A code change information statistical method is characterized by comprising the following steps:
receiving code change source data of a preset version interval;
acquiring all changed files from the code change source data;
acquiring version information of each change file with a change record in a preset version interval;
analyzing the change information of two adjacent version intervals of each change file in the version information of each change file;
and combining the change information of all adjacent two version intervals of each change file to obtain the change result information of each change file in the preset version interval.
2. The method of claim 1, wherein analyzing the change information of two adjacent version intervals in the version information of each change file comprises:
analyzing the change information between the initial version and the first version corresponding to the version information, and taking the change information as the initial change information;
and analyzing the change information of all the adjacent two version intervals in the version information.
3. The method of claim 1, wherein the analyzing of the change information between two adjacent versions of each change file in the version information further comprises:
obtaining a first deviation value according to the difference value of the deleted data and the newly added data in the first change content;
calculating the sum of the first offset value and the initial offset value to obtain a first accumulated offset value, and storing the first changed content according to the first accumulated offset value;
obtaining a second deviation value according to the difference value between the deleted data and the newly added data in the second change content;
calculating the sum of the second deviation value and the first accumulative deviation value to obtain a second accumulative deviation value, and storing the second changed content according to the second accumulative deviation value;
and sequentially carrying out the two steps, analyzing all the change contents of the adjacent two version intervals, and storing.
4. The statistical method for code change information according to claim 1, wherein merging change information of all adjacent two-version intervals of each change file comprises:
presetting a collection library, and initializing the collection library by using the maximum key value of a first group of change information in the change information;
merging the first group of change information into the collection library, and marking changers of the first group of change information in the collection library;
expanding the collection library according to the maximum key value of a second group of change information in the change information;
merging the second group of change information into the collection library, and marking changers of the second group of change information in the collection library;
and sequentially carrying out the two steps until all the change information is merged into the collection library.
5. The statistical method for code change information according to claim 1, further comprising, after obtaining change result information of each change file in a preset version interval:
and displaying the change result information according to a preset rule according to the user requirement, wherein the preset rule is used for changing the position sequence of the lines in the file or changing the set of the lines by artificial dimensionality.
6. The statistical method of a code change information according to claim 1, wherein the change information includes one or more of a new line number, a modified line number, and a deleted line number; the version information comprises one or more of version number, newly added record, modified record and deleted record; the change result information comprises one or more of a change file name, a change person and a change line.
7. A code change information statistics system, comprising: the memory comprises a code change information statistical method program, and the code change information statistical method program realizes the following steps when being executed by the processor:
receiving code change source data of a preset version interval;
acquiring all changed files from the code change source data;
acquiring version information of each change file with a change record in a preset version interval;
analyzing the change information of two adjacent version intervals of each change file in the version information of each change file;
and combining the change information of all adjacent two version intervals of each change file to obtain the change result information of each change file in the preset version interval.
8. The system of claim 7, wherein the parsing of the change information of two adjacent version intervals in the version information of each change file further comprises:
obtaining a first deviation value according to the difference value of the deleted data and the newly added data in the first change content;
calculating the sum of the first offset value and the initial offset value to obtain a first accumulated offset value, and storing the first changed content according to the first accumulated offset value;
obtaining a second deviation value according to the difference value between the deleted data and the newly added data in the second change content;
calculating the sum of the second deviation value and the first accumulative deviation value to obtain a second accumulative deviation value, and storing the second changed content according to the second accumulative deviation value;
and sequentially carrying out the two steps, analyzing all the change contents of the adjacent two version intervals, and storing.
9. The system of claim 7, wherein merging the change information of all adjacent two versions of each change file further comprises:
presetting a collection library, and initializing the collection library by using the maximum key value of a first group of change information in the change information;
merging the first group of change information into the collection library, and marking changers of the first group of change information in the collection library;
expanding the collection library according to the maximum key value of a second group of change information in the change information;
merging the second group of change information into the collection library, and marking changers of the second group of change information in the collection library;
and sequentially carrying out the two steps until all the change information is merged into the collection library.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium includes a code alteration information statistical method program, and when the code alteration information statistical method program is executed by a processor, the steps of a code alteration information statistical method according to any one of claims 1 to 6 are implemented.
CN201910885915.8A 2019-09-19 2019-09-19 Code change information statistical method, system and readable storage medium Active CN110716739B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910885915.8A CN110716739B (en) 2019-09-19 2019-09-19 Code change information statistical method, system and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910885915.8A CN110716739B (en) 2019-09-19 2019-09-19 Code change information statistical method, system and readable storage medium

Publications (2)

Publication Number Publication Date
CN110716739A true CN110716739A (en) 2020-01-21
CN110716739B CN110716739B (en) 2024-06-25

Family

ID=69210586

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910885915.8A Active CN110716739B (en) 2019-09-19 2019-09-19 Code change information statistical method, system and readable storage medium

Country Status (1)

Country Link
CN (1) CN110716739B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111367529A (en) * 2020-03-02 2020-07-03 浙江中控技术股份有限公司 Code contribution statistical method and device
CN112181430A (en) * 2020-09-29 2021-01-05 北京云族佳科技有限公司 Code change statistical method and device, electronic equipment and storage medium
CN112379888A (en) * 2020-12-02 2021-02-19 北京皮尔布莱尼软件有限公司 Code change analysis method
CN112965741A (en) * 2021-02-10 2021-06-15 中国工商银行股份有限公司 Method and device for identifying changed program
CN113204350A (en) * 2021-06-07 2021-08-03 中国银行股份有限公司 Code increment coverage rate statistical method and device, electronic equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106445476A (en) * 2015-08-11 2017-02-22 腾讯科技(深圳)有限公司 Code change information determination method and device and electronic equipment
CN106648636A (en) * 2016-12-08 2017-05-10 北京航空航天大学 Software function change prediction system and method based on graph mining
CN108268275A (en) * 2017-06-12 2018-07-10 平安普惠企业管理有限公司 Software version control method and software version control device
CN108446135A (en) * 2018-03-13 2018-08-24 中国银行股份有限公司 A kind of lines of code statistical method and device
CN109271321A (en) * 2018-09-20 2019-01-25 杭州安恒信息技术股份有限公司 A kind of contribution code number statistical method and device
CN109634679A (en) * 2018-10-16 2019-04-16 平安科技(深圳)有限公司 Block chain configures update method, device, equipment and storage medium
CN110083587A (en) * 2019-04-16 2019-08-02 会找房(北京)网络技术有限公司 A kind of databases comparison measures and procedures for the examination and approval based on Git
CN110209568A (en) * 2018-04-24 2019-09-06 腾讯科技(深圳)有限公司 Coverage rate test method, apparatus and storage equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106445476A (en) * 2015-08-11 2017-02-22 腾讯科技(深圳)有限公司 Code change information determination method and device and electronic equipment
CN106648636A (en) * 2016-12-08 2017-05-10 北京航空航天大学 Software function change prediction system and method based on graph mining
CN108268275A (en) * 2017-06-12 2018-07-10 平安普惠企业管理有限公司 Software version control method and software version control device
CN108446135A (en) * 2018-03-13 2018-08-24 中国银行股份有限公司 A kind of lines of code statistical method and device
CN110209568A (en) * 2018-04-24 2019-09-06 腾讯科技(深圳)有限公司 Coverage rate test method, apparatus and storage equipment
CN109271321A (en) * 2018-09-20 2019-01-25 杭州安恒信息技术股份有限公司 A kind of contribution code number statistical method and device
CN109634679A (en) * 2018-10-16 2019-04-16 平安科技(深圳)有限公司 Block chain configures update method, device, equipment and storage medium
CN110083587A (en) * 2019-04-16 2019-08-02 会找房(北京)网络技术有限公司 A kind of databases comparison measures and procedures for the examination and approval based on Git

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111367529A (en) * 2020-03-02 2020-07-03 浙江中控技术股份有限公司 Code contribution statistical method and device
CN112181430A (en) * 2020-09-29 2021-01-05 北京云族佳科技有限公司 Code change statistical method and device, electronic equipment and storage medium
CN112379888A (en) * 2020-12-02 2021-02-19 北京皮尔布莱尼软件有限公司 Code change analysis method
CN112965741A (en) * 2021-02-10 2021-06-15 中国工商银行股份有限公司 Method and device for identifying changed program
CN113204350A (en) * 2021-06-07 2021-08-03 中国银行股份有限公司 Code increment coverage rate statistical method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN110716739B (en) 2024-06-25

Similar Documents

Publication Publication Date Title
CN110716739A (en) Code change information statistical method, system and readable storage medium
US10366154B2 (en) Information processing device, information processing method, and computer program product
CN108228231B (en) Visualization drifting method of Git warehouse file annotation system
CN113778295B (en) Book recommendation method and device, computer equipment and storage medium
CN107145538B (en) Table data query method, device and system
CN112463149A (en) Software-defined satellite-oriented reusable code library construction method and device
CN112347142B (en) Data processing method and device
CN111176901B (en) HDFS deleted file recovery method, terminal device and storage medium
CN111045994B (en) File classification retrieval method and system based on KV database
CN110362540B (en) Data storage and visitor number acquisition method and device
CN111190896B (en) Data processing method, device, storage medium and computer equipment
CN116304189A (en) Image extraction method in excel file and electronic equipment
CN114258541A (en) Data merging method and device, electronic equipment and storage medium
CN111078753A (en) HBase database-based time sequence data storage method and device
CN116775372A (en) Misoperation data recovery method, device, storage medium and equipment
CN106469086B (en) Event processing method and device
CN114611039B (en) Analysis method and device of asynchronous loading rule, storage medium and electronic equipment
CN111444194B (en) Method, device and equipment for clearing indexes in block chain type account book
JP4527697B2 (en) Leaked personal information search system, leaked personal information search method, leaked personal information search device and program
JP2018181121A (en) Analyzer, analysis program, and analysis method
CN111831683A (en) Automatic auditing method and system based on dynamic extended scene matching
JP2011123652A (en) Data analysis system and method thereof
CN111078738A (en) Data processing method and device, electronic equipment and storage medium
CN118394405B (en) Traceability method and traceability system for low-code platform module
CN116166617B (en) Catalog generation method and device for combined open format document OFD

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