CN112965741A - Method and device for identifying changed program - Google Patents

Method and device for identifying changed program Download PDF

Info

Publication number
CN112965741A
CN112965741A CN202110182912.5A CN202110182912A CN112965741A CN 112965741 A CN112965741 A CN 112965741A CN 202110182912 A CN202110182912 A CN 202110182912A CN 112965741 A CN112965741 A CN 112965741A
Authority
CN
China
Prior art keywords
source code
program
current
acquiring
historical
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110182912.5A
Other languages
Chinese (zh)
Inventor
贾国贤
温建波
廖定
李学优
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110182912.5A priority Critical patent/CN112965741A/en
Publication of CN112965741A publication Critical patent/CN112965741A/en
Pending legal-status Critical Current

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a method and a device for identifying a change program, and belongs to the technical field of cloud computing. The altered program identification method comprises the following steps: acquiring a current version source code and a historical version source code; determining a change line number according to the current version source code and the historical version source code; determining each storage process interval of the historical version source code; and respectively matching the change line number with each storage process interval, and outputting the storage process corresponding to the change line number according to the matching result. The method can quickly and accurately identify the change program, thereby ensuring the software quality.

Description

Method and device for identifying changed program
Technical Field
The invention relates to the technical field of cloud computing, in particular to a method and a device for identifying a change program.
Background
Continuous integration is an important practice to enable rapid value delivery. The continuous integration can automatically download the source code from the code hosting warehouse, then compile and deploy to a test environment, automatically execute code inspection and automatic test cases, and finally quickly and accurately feed back results, so that the traditional manual repeated operation is reduced, the compiling, deploying and executing time of the test can be greatly reduced, and a software quality report can be obtained more quickly.
A stored procedure is a set of SQL statements in a large database system to accomplish a specific function. It is an object of the database, stored in the database, permanently valid after one compilation, and it is executed by the user by specifying the name of the stored procedure and assigning parameters. In development practice, a developer generally puts a plurality of storage processes with similar functions into a box file, submits the box file to a code hosting warehouse as a program file, and then compiles and deploys the box file into a database. A development team may have multiple developers modifying stored procedures, and when obtaining the latest list of stored procedure changes, the developer typically manually logs into the ORACLE database server to view the code changes of the current software version with respect to the baseline (previous software version). With the increase of the code amount in the bag body file, the time consumed for performing static code inspection and executing an automatic test case on the full amount of codes is longer and longer, the waiting time for developers to obtain software quality reports is also increased with the increase of the full amount of codes, and the time consumed for obtaining the software quality reports is long and inaccurate. In addition, a plurality of versions are developed simultaneously by a software development company at present, the baseline of the current version is changed continuously, and comparison needs to be performed manually again after each code modification, which is time-consuming. For managers of large development teams, accurately acquiring the stored process change programs and then mainly guarding the change programs become important means for ensuring the software quality.
Disclosure of Invention
The embodiment of the invention mainly aims to provide a method and a device for identifying a change program, which can quickly and accurately identify the change program so as to ensure the software quality.
In order to achieve the above object, an embodiment of the present invention provides a method for identifying a changed program, including:
acquiring a current version source code and a historical version source code;
determining a change line number according to the current version source code and the historical version source code;
determining each storage process interval of the historical version source code;
and respectively matching the change line number with each storage process interval, and outputting the storage process corresponding to the change line number according to the matching result.
An embodiment of the present invention further provides a device for identifying a changed program, including:
the source code acquisition module is used for acquiring a current version source code and a historical version source code;
the change line number module is used for determining a change line number according to the current version source code and the historical version source code;
the storage process interval module is used for determining each storage process interval of the historical version source code;
and the change output module is used for matching the change line number with each storage process interval respectively and outputting the storage process corresponding to the change line number according to the matching result.
The embodiment of the invention also provides computer equipment which comprises a memory, a processor and a computer program which is stored on the memory and runs on the processor, wherein the step of changing the program identification method is realized when the processor executes the computer program.
The embodiment of the invention also provides a computer readable storage medium, on which a computer program is stored, and the computer program realizes the steps of the method for identifying the altered program when being executed by a processor.
According to the method and the device for identifying the change program, the change line number is determined according to the current version source code and the historical version source code, then the storage process corresponding to the change line number is output according to the matching result of the change line number and each storage process interval of the historical version source code, the change program can be identified quickly and accurately, and the software quality is further ensured.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without creative efforts.
FIG. 1 is a flow chart of a method of modifying program identification in accordance with an embodiment of the present invention;
fig. 2 is a flowchart of S101;
FIG. 3 is a flowchart of S102 in an embodiment of the present invention;
FIG. 4 is a data representation of a code warehouse metrics database in an embodiment of the present invention;
FIG. 5 is a data representation of a code warehouse metrics database according to another embodiment of the present invention;
FIG. 6 is a data representation of a code warehouse metrics database according to yet another embodiment of the present invention;
FIG. 7 is a stored process data representation view in an embodiment of the present invention;
FIG. 8 is a block diagram showing the structure of a modified program identifying apparatus according to the embodiment of the present invention;
fig. 9 is a block diagram of a computer device in the embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As will be appreciated by one skilled in the art, embodiments of the present invention may be embodied as a system, apparatus, device, method, or computer program product. Accordingly, the present disclosure may be embodied in the form of: entirely hardware, entirely software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
In view of the fact that the prior art is long in time-consuming and prone to errors, embodiments of the present invention provide a method for identifying a changed program, which can quickly and accurately identify the changed program, thereby ensuring software quality. The present invention will be described in detail below with reference to the accompanying drawings.
The invention can automatically identify the storage process of the current software version changed relative to the previous software version, regularly obtains the source codes of different code branches from the code hosting warehouse, and then compares the source codes according to a certain algorithm based on the latest source code to obtain the latest changed program list. After the developer obtains the changed program list, the developer focuses on the program quality, writes an automatic test case and executes static code inspection. After the management personnel obtain the software quality report, the program modification time and the corresponding program maintainer are found according to the changed program list, the program maintainer is informed to pay attention to the modified program quality, and the responsibility main body is implemented.
FIG. 1 is a flow chart of a method for modifying program identification in accordance with an embodiment of the present invention. As shown in fig. 1, the alteration program identification method includes:
s101: and acquiring a current version source code and a historical version source code.
In one embodiment, before executing S101, the method further includes:
and acquiring the current program file and the historical program file according to the baseline.
Fig. 2 is a flowchart of S101. As shown in fig. 2, S101 includes:
s201: and acquiring the hash value and the file path of the current program file and the hash value and the file path of the historical program file.
In specific implementation, a recently submitted program file record may be obtained from the code repository metrics database. The code warehouse metrics database is an ORACLE database that contains information for each program file submission. After the developer submits the code, the code warehouse measurement database records the submitted information, including the information of the version library, the code branch, the whole path of the program file, the submission time, the mailbox of the program author, the warehousing time and the like, and stores the information in a table of the database. When a new submitted code is available, the measurement database automatically records the submitted information, and takes the system time of the database server as the recorded warehousing time. The method can incrementally acquire newly-increased submission information (the hash value and the file path of the current program file) from the measurement database, and save the current maximum warehousing time as the baseline of the next pulling, thereby realizing incremental pulling. FIG. 4 is a data representation of a code warehouse metrics database in an embodiment of the present invention. The arrows in fig. 4 represent the currently pulled baseline.
Then, the invention traverses each newly added record, and uses the information of the version library, the full path of the program file and the like to search the software state of the previous version of the current program file. Fig. 5 is a data representation of a code warehouse metrics database illustrating recent submission information for the program file BTHPAMC2_ sql. When looking for a 12-month version change in 2020 (the data of the line where the code branch 2012B in fig. 5 is located is the data of the current program file), the latest state of the previous version (the historical program file) needs to be looked up to obtain the hash value and the file path of the historical program file. Data in the box indicates the latest state of the previous version of the program (data in the row of the code branch 2011B in FIG. 5 is data of the history program file)
S202: and acquiring the source code of the current version according to the hash value and the file path of the current program file.
In specific implementation, the code can be downloaded from the code hosting server, and the command format is as follows:
git show submits a hash of the full path of the program file.
FIG. 6 is a data representation of a code warehouse metrics database according to yet another embodiment of the present invention. The first line of data in fig. 6 is data of the current program file. The second line data in fig. 6 is data of a history program file. Taking the data in fig. 6 as an example, downloading the source code of the current version from the code hosting server is:
git show 40c6b538083fcfc1de346df3dc12798a0aa5a0c4:
PMSDB/PTCE2011B/data/ZhuHai/SAES/BTHPAMC2_Sql.sql.
s203: and acquiring a historical version source code according to the hash value and the file path of the historical program file.
Taking the data in fig. 6 as an example, downloading the historical version source code from the code hosting server is:
40c6b538083fcfc1de346df3dc1279009MQ5a0c4:
PMSDB/PTCE2011B/data/ZhuHai/SAES/BTHPAMC2_Sql.sql.
s102: and determining a change line number according to the current version source code and the historical version source code.
Fig. 3 is a flowchart of S102 in the embodiment of the present invention. As shown in fig. 3, S102 includes:
s301: and deleting the annotation codes in the source codes of the current version and the historical version according to the preset annotation characters.
Before executing S301, the method further includes:
analyzing the bag BODY source codes, acquiring the storage process information, traversing each line of source codes, removing spaces, judging whether the program starts with CREATE OR REPLACE PACKAGE BODY, if so, executing S301, otherwise, directly ending the process if the source codes are not the real bag BODY program.
The annotation code of the embodiment of the invention is as follows:
SELECT MAX (ID) intocnt FROM TABLE _ a; - -line Annotation mode 1
V. line Annotation 2
SELECT MAX(ID)INTO CNT FROM TABLE_A;
SELECT MAX (a.id) intocnt FROM/TABLE _ A A,/TABLE _ B B; - -partial Annotation
/*
INSERT intra TABLE _ a (ID, NAME, AGE) VALUES ('001', 'zhangsan', 18);
SELECT MAX(A.ID)INTO CNT FROM TABLE_A A;
DELETE FROM TABLE_A;
*/
as shown in the above code, Oracle's stored procedure annotation approach has line annotations and block annotations. There are two ways to annotate a line, which can be by a flag "-" or a flag/. star/annotation code. The mark "-" indicates that the source codes behind the mark are all annotated, and the codes contained by the/' mark/mark are all annotated. The block annotation may be annotated by flag/x/multiple lines.
S302: and determining the change line number according to the current version source code after the annotation code is deleted and the historical version source code after the annotation code is deleted.
In specific implementation, a command can be run on the code hosting server to obtain the text difference between the source code of the current version and the source code of the historical version, and the start line number and the end line number of the change block are obtained from the difference text. The command format is:
gitdiff-U0-w submission of historical version source code the submission hash of the current version source code-the full path of the program file.
The difference text codes of the embodiment of the invention are as follows:
diff--git a/ICMS/DB/program/pacakge/OAS_PKG_WF_RU.sql b/ICMS/DB/program/pacakge/OAS_PKG_WF_RU.sql
index 2dd6428..e78eb97 100644
---a/ICMS/DB/program/pacakge/OAS_PKG_WF_RU.sql
+++a/ICMS/DB/program/pacakge/OAS_PKG_WF_RU.sql
@@-1694+1694,2@@CREATE OR REPLACE PACKAGE BODY oas_pkg_wf_r u IS
-INTO v_count
+INTO v_count from(
+select a.task_id
@@-1697+1698,7@@CREATE OR REPLACE PACKAGE BODY oas_pkg_wf_r u IS
-AND a.proc_inst_id=i_inst_id;
+AND a.proc_inst_id=i_inst_id
+union all
+select a.task_id
+from oas_wf_ru_task_bak a
+WHERE a.execution_id<>a.proc_inst_id
+AND a.proc_inst_id=i_inst_id
+);
@@-1988+1995@@CREATE OR REPLACE PACKAGE BODY oas_pkg_wf_ru IS
-
+V_COUNT NUMBER(4);
as shown in the above code, @ -1694+1694,2@ indicates that the change block 1 is changed from the 1694 th line of the difference text and the 2 consecutive lines are changed, compared with the 1694 th line of the history version source code. The change line number of change block 1 is line 1694;
@ -1697+1698,7@ indicates that the change block 2 is changed from the 1698 th line of the difference text and the continuous 7 lines are changed, compared with the 1697 th line of the history version source code. The change line number of the change block 2 is line 1697.
@ 1988+1995@ @ indicates that the Change Block 3 started changing from line 1995 of the difference text, compared to line 1988 of the historical version source code, with only line 1 having changes. The change line number of change block 3 is line 1988.
S103: and determining each storage process interval of the historical version source code.
In one embodiment, S103 includes:
and determining the starting line number and the ending line number of each storage process of the historical version source code, and determining each storage process interval of the historical version source code according to the starting line number and the ending line number of each storage process.
In particular, the start flag of the stored PROCEDURE source code is the PROCEDURE XXX _ NAME or the FUNCTION XXX _ NAME, and the END flag is the END XXX _ NAME. And traversing each line of code of the historical version source code to identify the storage process starting line number and the storage process ending line number.
S104: and respectively matching the change line number with each storage process interval, and outputting the storage process corresponding to the change line number according to the matching result.
In specific implementation, when the change line number is matched with the storage process interval (the change line number is between the storage process start line number and the storage process end line number), the change line number is indicated to correspond to the storage process, and the storage process is changed.
In one embodiment, after executing S104, the method further includes: the baseline is updated according to the current program file.
In specific implementation, the current program file warehousing time (the current maximum warehousing time) is determined as the baseline of the next pulling.
The execution subject of the alteration program recognition method shown in fig. 1 may be a computer. As can be seen from the flow shown in fig. 1, the method for identifying a change program according to the embodiment of the present invention determines a change line number according to the current version source code and the historical version source code, and then outputs a storage process corresponding to the change line number according to a matching result between the change line number and each storage process section of the historical version source code, so that the change program can be identified quickly and accurately, and the software quality is ensured.
FIG. 7 is a stored process data representation of an embodiment of the present invention. As shown in fig. 7, after S103 is executed, the stored procedure (stored procedure change list) corresponding to the change line number may be stored in a table in the Oracle database. The caller can request the change list query interface of the storage process through http to obtain the change list of the storage process. The input parameters of the request are the version base and the current software version number.
The http interface is exemplified as follows:
http:// ip: port/icbc/xmb/pmo/service/prodetail/query changeprodacton/qrypregetailrepo ═ ccba/ccba & codeBranch ═ 202005.
An example of the return data of the stored procedure change list query interface is as follows:
{"progList":{"fileName":"pckg_auto_contract_detail_qry.sql","filePath":"Cmp_IAAS-DB/insu/PROGRAM/IAAS_CAR_INSU/pckg_auto_contract_detail_qry.sql",
"depth": development department "," app ": F-CCBA", "version": 202005"," progName ": PCKG _ AUTO _ CONTRACT _ DETAIL _ QRY, PRO _ AUTO _ CONTRACT _ DETAIL _ QRY", "change time": 20200320092300"
"repo" "," ccba/ccba "," author name "", "Zhang three" }, "message" "," success "," return code ": 0", "totalNum":1}
The specific process of the embodiment of the invention is as follows:
1. and acquiring the current program file and the historical program file according to the baseline.
2. And acquiring the hash value and the file path of the current program file and the hash value and the file path of the historical program file.
3. And acquiring a current version source code according to the hash value and the file path of the current program file, and acquiring a historical version source code according to the hash value and the file path of the historical program file.
4. And deleting the annotation codes in the source codes of the current version and the historical version according to the preset annotation characters.
5. And determining the change line number according to the current version source code after the annotation code is deleted and the historical version source code after the annotation code is deleted.
6. And determining each storage process interval of the historical version source code.
7. And respectively matching the change line number with each storage process interval, and outputting the storage process corresponding to the change line number according to the matching result.
8. The baseline is updated according to the current program file.
In conclusion, the invention can identify the stored process change program of each software version relative to the previous version, the corresponding development department, program modifier and other information in real time, and provide an interface for the outside. For departments or companies with large number of developers, the method can accurately, quickly and real-timely identify the latest stored process change program, and enables development teams to mainly guard the quality of the change program in the development and test process, so as to realize accurate test. The traditional mode of acquiring the change program is to manually log in an Oracle database of the test environment, manually click a certain database object to check a source code and compare the source code with a previous version, and is long in time consumption and easy to make mistakes. The invention adopts an automatic means to automatically identify the change program, and provides a practical scheme for developing the continuous integration compression test time.
Based on the same inventive concept, the embodiment of the present invention further provides a device for identifying a modified program, and because the principle of the device for solving the problem is similar to that of the method for identifying the modified program, the implementation of the device can refer to the implementation of the method, and repeated details are not repeated.
FIG. 8 is a block diagram showing the configuration of a modified program identifying apparatus according to the embodiment of the present invention. As shown in fig. 8, the alteration program identifying apparatus includes:
the source code acquisition module is used for acquiring a current version source code and a historical version source code;
the change line number module is used for determining a change line number according to the current version source code and the historical version source code;
the storage process interval module is used for determining each storage process interval of the historical version source code;
and the change output module is used for matching the change line number with each storage process interval respectively and outputting the storage process corresponding to the change line number according to the matching result.
In one embodiment, the source code obtaining module includes:
the hash value path acquisition unit is used for acquiring the hash value and the file path of the current program file and acquiring the hash value and the file path of the historical program file;
the current source code acquisition unit is used for acquiring a current version source code according to the hash value and the file path of the current program file;
and the history source code acquisition unit is used for acquiring the history version source code according to the hash value and the file path of the history program file.
In one embodiment, the method further comprises the following steps:
and the program file acquisition module is used for acquiring the current program file and the historical program file according to the baseline.
In one embodiment, the method further comprises the following steps:
and the baseline updating module is used for updating the baseline according to the current program file.
In summary, the change program identification device according to the embodiment of the present invention determines the change line number according to the current version source code and the historical version source code, and then outputs the storage process corresponding to the change line number according to the matching result between the change line number and each storage process interval of the historical version source code, so that the change program can be quickly and accurately identified, and the software quality is further ensured.
The embodiment of the present invention further provides a specific implementation manner of a computer device, which can implement all the steps in the method for identifying a modified program in the foregoing embodiment. Fig. 9 is a block diagram of a computer device in an embodiment of the present invention, and referring to fig. 9, the computer device specifically includes the following:
a processor (processor)901 and a memory (memory) 902.
The processor 901 is configured to call a computer program in the memory 902, and when the processor executes the computer program, the processor implements all the steps in the modified program identification method in the above embodiments, for example, when the processor executes the computer program, the processor implements the following steps:
acquiring a current version source code and a historical version source code;
determining a change line number according to the current version source code and the historical version source code;
determining each storage process interval of the historical version source code;
and respectively matching the change line number with each storage process interval, and outputting the storage process corresponding to the change line number according to the matching result.
In summary, the computer device according to the embodiment of the present invention determines the change line number according to the current version source code and the historical version source code, and then outputs the storage process corresponding to the change line number according to the matching result between the change line number and each storage process interval of the historical version source code, so that the change program can be identified quickly and accurately, and the software quality can be ensured.
An embodiment of the present invention further provides a computer-readable storage medium capable of implementing all the steps in the modified program identification method in the above embodiment, where the computer-readable storage medium stores a computer program, and the computer program implements all the steps in the modified program identification method in the above embodiment when being executed by a processor, for example, the processor implements the following steps when executing the computer program:
acquiring a current version source code and a historical version source code;
determining a change line number according to the current version source code and the historical version source code;
determining each storage process interval of the historical version source code;
and respectively matching the change line number with each storage process interval, and outputting the storage process corresponding to the change line number according to the matching result.
In summary, the computer-readable storage medium according to the embodiment of the present invention determines the change line number according to the current version source code and the historical version source code, and then outputs the storage process corresponding to the change line number according to the matching result between the change line number and each storage process interval of the historical version source code, so that the change program can be quickly and accurately identified, and the software quality can be further ensured.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.
Those of skill in the art will further appreciate that the various illustrative logical blocks, units, and steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate the interchangeability of hardware and software, various illustrative components, elements, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design requirements of the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present embodiments.
The various illustrative logical blocks, or elements, or devices described in connection with the embodiments disclosed herein may be implemented or performed with a general purpose processor, a digital signal processor, an Application Specific Integrated Circuit (ASIC), a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general-purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a digital signal processor and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a digital signal processor core, or any other similar configuration.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. For example, a storage medium may be coupled to the processor such the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC, which may be located in a user terminal. In the alternative, the processor and the storage medium may reside in different components in a user terminal.
In one or more exemplary designs, the functions described above in connection with the embodiments of the invention may be implemented in hardware, software, firmware, or any combination of the three. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media that facilitate transfer of a computer program from one place to another. Storage media may be any available media that can be accessed by a general purpose or special purpose computer. For example, such computer-readable media can include, but is not limited to, RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to carry or store program code in the form of instructions or data structures and which can be read by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. Additionally, any connection is properly termed a computer-readable medium, and, thus, is included if the software is transmitted from a website, server, or other remote source via a coaxial cable, fiber optic cable, twisted pair, Digital Subscriber Line (DSL), or wirelessly, e.g., infrared, radio, and microwave. Such discs (disk) and disks (disc) include compact disks, laser disks, optical disks, DVDs, floppy disks and blu-ray disks where disks usually reproduce data magnetically, while disks usually reproduce data optically with lasers. Combinations of the above may also be included in the computer-readable medium.

Claims (10)

1. A method for identifying a changed program, comprising:
acquiring a current version source code and a historical version source code;
determining a change line number according to the current version source code and the historical version source code;
determining each storage process interval of the historical version source code;
and respectively matching the change line number with each storage process interval, and outputting the storage process corresponding to the change line number according to the matching result.
2. The method for identifying a changed program according to claim 1, wherein the acquiring a current version source code and a history version source code includes:
acquiring a hash value and a file path of a current program file, and acquiring a hash value and a file path of a historical program file;
acquiring the current version source code according to the hash value and the file path of the current program file;
and acquiring the historical version source code according to the hash value and the file path of the historical program file.
3. The method for identifying a changing program according to claim 2, wherein before the obtaining of the source code of the current version and the source code of the historical version, the method further comprises:
and acquiring the current program file and the historical program file according to the baseline.
4. The method for identifying a changed program according to claim 3, further comprising, after outputting the acquisition and storage procedure corresponding to the changed line number according to the matching result:
and updating the baseline according to the current program file.
5. A modified program identifying apparatus, comprising:
the source code acquisition module is used for acquiring a current version source code and a historical version source code;
the change line number module is used for determining a change line number according to the current version source code and the historical version source code;
a storage process interval module used for determining each storage process interval of the historical version source code;
and the change output module is used for matching the change line number with each storage process interval respectively and outputting the storage process corresponding to the change line number according to a matching result.
6. The device according to claim 5, wherein the source code acquiring module includes:
the hash value path acquisition unit is used for acquiring the hash value and the file path of the current program file and acquiring the hash value and the file path of the historical program file;
a current source code obtaining unit, configured to obtain the current version source code according to the hash value and the file path of the current program file;
and the history source code acquisition unit is used for acquiring the history version source code according to the hash value and the file path of the history program file.
7. The change program identifying device according to claim 6, further comprising:
and the program file acquisition module is used for acquiring the current program file and the historical program file according to the baseline.
8. The change program identifying device according to claim 7, further comprising:
and the baseline updating module is used for updating the baseline according to the current program file.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and running on the processor, characterized in that the steps of altering the program identification method according to any of claims 1 to 4 are implemented by the processor when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the alteration program identification method of any one of claims 1 to 4.
CN202110182912.5A 2021-02-10 2021-02-10 Method and device for identifying changed program Pending CN112965741A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110182912.5A CN112965741A (en) 2021-02-10 2021-02-10 Method and device for identifying changed program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110182912.5A CN112965741A (en) 2021-02-10 2021-02-10 Method and device for identifying changed program

Publications (1)

Publication Number Publication Date
CN112965741A true CN112965741A (en) 2021-06-15

Family

ID=76284762

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110182912.5A Pending CN112965741A (en) 2021-02-10 2021-02-10 Method and device for identifying changed program

Country Status (1)

Country Link
CN (1) CN112965741A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109426604A (en) * 2017-08-22 2019-03-05 阿里巴巴集团控股有限公司 The monitoring method and equipment of code development
CN109977675A (en) * 2017-12-28 2019-07-05 华为技术有限公司 A kind of open source software recognition methods and device
CN110716739A (en) * 2019-09-19 2020-01-21 平安科技(深圳)有限公司 Code change information statistical method, system and readable storage medium
CN112181430A (en) * 2020-09-29 2021-01-05 北京云族佳科技有限公司 Code change statistical method and device, electronic equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109426604A (en) * 2017-08-22 2019-03-05 阿里巴巴集团控股有限公司 The monitoring method and equipment of code development
CN109977675A (en) * 2017-12-28 2019-07-05 华为技术有限公司 A kind of open source software recognition methods and device
CN110716739A (en) * 2019-09-19 2020-01-21 平安科技(深圳)有限公司 Code change information statistical method, system and readable storage medium
CN112181430A (en) * 2020-09-29 2021-01-05 北京云族佳科技有限公司 Code change statistical method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN111522816B (en) Data processing method, device, terminal and medium based on database engine
US9864793B2 (en) Language tag management on international data storage
CN109446218A (en) SQL statement generation method, device and computer readable storage medium
US20210224252A1 (en) Method and device for segmenting list, storage medium and terminal
WO2022012327A1 (en) Code analysis method and system, and computing device
CN109284126B (en) Automatic class library updating method and device, electronic equipment and storage medium
CN114528008A (en) Code control method, device and medium based on distributed version control system
CN111273942A (en) Code generation method, storage medium, electronic device and system
CN112162751A (en) Automatic generation method and system of interface document
CN110879808B (en) Information processing method and device
CN112068874A (en) Software project continuous integration method and device, terminal equipment and storage medium
CN113485744A (en) Code synchronization method and device
CN115328524A (en) Patch merging method and device, computer equipment and storage medium
CN109634845B (en) Method and device for generating context record text
CN112965741A (en) Method and device for identifying changed program
CN109947739B (en) Data source management method and device
CN110716737A (en) System application version management system and system application version management method
CN115408032A (en) Data model management method, device, server, medium and product
CN108628909B (en) Information pushing method and device
CN110795259A (en) Method and device for analyzing application collapse
US11256602B2 (en) Source code file retrieval
CN113901025A (en) Database management method, device, equipment and storage medium
US11100131B2 (en) Simulation of a synchronization of records
CN112699011A (en) Method and device for counting incremental code coverage rate, electronic equipment and storage medium
CN111399841B (en) Code processing method and device based on blockchain, storage medium and electronic equipment

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