Software continuous integration method, device and storage medium
Through the automated software continuous integration method, the source code is changed using task creation instructions and set parameters, which solves the problems of low manual operation efficiency and high error rate in the continuous integration of software versions, and achieves efficient product development and reduced development costs. cost.
Patent Information
- Application Number
- CN202111500983.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-09
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2041-12-09
AI Technical Summary
The process of continuous integration of software versions requires too many manual operations, which is inefficient and has a high error rate. This results in inefficient and serialized work between systems and is prone to problems due to busyness or human error.
Provide a software continuous integration method that automatically enters setting parameters by starting task creation instructions, and performs change operations on the source code based on these parameters, including scanning and analysis of identification tags and generating new source code, conducting static and dynamic testing, and finally Upload test results. The method includes integrated management tools, data interaction modules and target tools to achieve automated operations.
It realizes the automation of software integration, improves product development efficiency, reduces development costs, reduces human errors, and ensures test accuracy and efficiency.
Smart Images

Figure CN114281682B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device and storage medium for continuous integration of software. Background Art
[0002] For many software companies, software needs to be submitted for testing after the product development phase is completed, and needs to be compiled and released after testing. The usual practice is to use a script or continuous integration (CI) tool (such as Jenkins) to automatically compile, and then submit the compiled software for testing, or if it needs to be released, the configuration manager or product tester will send an email to release it and archive the code. However, these processes require too much manual intervention, and the links that need to be processed go through several manual processing links from source code management tools, compilation scripts or CI tools, version testing, code archiving, version release, etc. The work between systems is prone to not being efficiently connected due to busy work and other reasons, and manual operations are also prone to omissions or misoperations. Summary of the invention
[0003] The purpose of the present invention is to provide a method, device and storage medium for continuous integration of software, aiming to effectively solve the problem that continuous integration of software versions in the prior art requires manual operation, has low efficiency and high error rate.
[0004] According to one aspect of the present invention, there is provided a method for continuous integration of software, the method comprising: starting a task creation instruction; automatically entering corresponding setting parameters according to the task creation instruction; and performing a change operation on the source code in the software according to the setting parameters; wherein the setting parameters include an identification tag for recording the change items required for the source code.
[0005] Further, the initiating a task creation instruction includes: when a database is changed, initiating the task creation instruction, wherein the database is used to store the source code.
[0006] Furthermore, the setting parameters include: software project name, software version number and software release date; wherein the software version number includes the identification tag.
[0007] Furthermore, performing a change operation on the source code in the software according to the set parameters includes: obtaining the source code corresponding to the identification tag in the database; scanning and analyzing the source code corresponding to the identification tag to obtain an analysis result; and based on the analysis result, performing a change operation on the source code corresponding to the identification tag to generate a new source code.
[0008] Furthermore, the method further comprises: performing a test operation on the new source code to obtain a test result, wherein the test result comprises a static analysis result and a dynamic analysis result; and uploading the test result to a designated server.
[0009] Furthermore, the initiating a task creation instruction further includes: receiving a task creation instruction from a user or a controller.
[0010] According to another aspect of the present invention, the present invention provides a continuous integration system for software, including an integration management tool, wherein the integration management module is used to execute any continuous integration method for software described in the present invention; an entry tool is used to automatically enter corresponding setting parameters into the integration management tool when a task creation instruction is started; wherein the setting parameters include an identification tag for recording the change items required for the source code.
[0011] Furthermore, the system also includes: a data interaction module, which is a channel for the integrated management tool to interact with the target tool for data, wherein the data interaction module includes a code change detection module, a code editing module, a feedback module, a static analysis call module and a dynamic analysis call module, wherein the code change detection module and the code editing module are set in the same server.
[0012] Furthermore, the target tool includes at least one of the following tools: a database for storing the source code, the database interacting with the integrated management tool through the code change detection module; a code editing tool for performing change operations on the source code according to the set parameters, and interacting with the integrated management tool through the code editing module; an email management tool for receiving test results and feedback information of change operations, and interacting with the integrated management tool through the feedback module; a static analysis tool for scanning new source code to obtain static analysis results, and interacting with the integrated management tool through the static analysis call module; a dynamic testing tool for scanning the new source code to obtain dynamic analysis results, and interacting with the integrated management tool through the dynamic analysis call module; a server for receiving test results, and interacting with the integrated management tool through the feedback module.
[0013] According to another aspect of the present invention, the present invention provides a storage medium, wherein a plurality of instructions are stored in the storage medium, and the instructions are suitable for being loaded by a processor to execute any of the continuous integration methods for software.
[0014] The advantage of the present invention is that the present invention starts a task creation instruction by detecting a database or a user starts a task creation instruction, and automatically enters corresponding setting parameters according to the task creation instruction, and performs a change operation on the source code in the software according to the setting parameters, thereby realizing the automation of software integration, improving product development efficiency and reducing development costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The technical solutions and other beneficial effects of the present invention will be made apparent by describing in detail the specific embodiments of the present invention in conjunction with the accompanying drawings.
[0016] Figure 1 A flowchart of the steps of a continuous integration method for software provided in Embodiment 1 of the present invention.
[0017] Figure 2 A flowchart of the steps of a continuous integration method for software provided in Embodiment 2 of the present invention.
[0018] Figure 3 This is a schematic diagram of the structure of the continuous integration device for software provided in the third embodiment of the present invention. DETAILED DESCRIPTION
[0019] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0020] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection, an electrical connection, or mutual communication; it can be a direct connection, or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0021] like Figure 1 The figure is a flowchart of the steps of the continuous integration method of software provided in the first embodiment of the present invention.
[0022] S110: Start a task creation instruction.
[0023] Exemplarily, when a database is changed, the task creation instruction is started, wherein the database is used to store the source code. Or when a task creation instruction is received from a user or a controller, the task creation instruction is started.
[0024] S120: Automatically input corresponding setting parameters according to the task creation instruction.
[0025] Exemplarily, the setting parameters include an identification tag for recording the required change items of the source code. The setting parameters include: software project name, software version number and software release date; wherein the software version number includes the identification tag. Furthermore, when the setting parameters are entered incorrectly, an error feedback is triggered, thereby solving the problem of entering setting parameters incorrectly when manually triggering compilation (i.e., change operation), automatically triggering the compilation application, and eliminating the need for the user to submit the code to be changed and then manually trigger it, thereby improving efficiency.
[0026] S130: performing a change operation on the source code in the software according to the setting parameters.
[0027] Exemplarily, the integrated management tool remotely calls the script to scan and analyze the corresponding Tag information (i.e., identification tags) in the database. If the scan result fails, the failure information is fed back to the user via email, thereby solving the problem of asynchrony caused by manually triggering the scanning test of the code to be changed due to frequent submission of the code to be changed. The Tag information can ensure that the test scans the correct version of the code to be changed.
[0028] Embodiment 1 of the present invention starts a task creation instruction by detecting a database or a user starts a task creation instruction, and automatically enters corresponding setting parameters according to the task creation instruction, and performs a change operation on the source code in the software according to the setting parameters, thereby realizing automation of software integration, improving product development efficiency and reducing development costs.
[0029] like Figure 2 The figure is a flowchart of the steps of the continuous integration method of software provided in the second embodiment of the present invention.
[0030] Based on the continuous integration method of software described in the above embodiment 1, the continuous integration method of software provided by embodiment 2 will be further described here. The above step S110 may include step S210 of the present embodiment 2, and the above step S130 may include steps S230 to S250 of the present embodiment 2. The meanings of the terms in the present embodiment 2 are the same as those of the above embodiment 1, and the specific implementation details can refer to the description in embodiment 1.
[0031] Wherein, step S210: when the database is changed, the task creation instruction is started.
[0032] Exemplarily, the database is used to store the source code. In some other embodiments, the task creation instruction may also be received from a user or a controller.
[0033] Step S220: automatically inputting corresponding setting parameters according to the task creation instruction.
[0034] Exemplarily, the setting parameters include an identification tag for recording the change items required for the source code. The setting parameters include: software project name, software version number and software release date; wherein the software version number includes the identification tag. Furthermore, when the setting parameters are entered incorrectly, an error feedback is triggered, thereby solving the problem of entering setting parameters incorrectly when manually triggering compilation (i.e., change operation), automatically triggering the compilation application, and eliminating the need for the user to submit the code to be changed and then manually trigger it, thereby improving efficiency.
[0035] Step S230: Obtain source code corresponding to the identification tag in the database.
[0036] Exemplarily, when the source code in the database is changed, part of the source code retains the original data, that is, there is a part of the source code that does not need to be changed.
[0037] Step S240: Scan and analyze the source code corresponding to the identification tag to obtain an analysis result.
[0038] Exemplarily, the source code that needs to be changed is searched according to the identification tag, and the corresponding change operation is performed on the source code that needs to be changed according to the set parameters.
[0039] Step S250: Based on the analysis result, a change operation is performed on the source code corresponding to the identification tag to generate a new source code.
[0040] Exemplarily, the integrated management tool remotely calls the script to scan and analyze the corresponding Tag information (i.e., identification tags) in the database. If the scan result fails, the failure information is fed back to the user by email, thereby solving the problem of asynchrony caused by manually triggering the scan test of the code to be changed due to frequent submission of the code to be changed. The Tag information can ensure that the test scans the correct version of the code to be changed. Further, a change information is generated according to the change operation, and the change information includes the number of task compilations, the number of successes / failures, the last compilation time, the last compilation status, the upload version server address, the version information, and the compilation log information.
[0041] Step S260: performing a test operation on the new source code to obtain a test result, wherein the test result includes a static analysis result and a dynamic analysis result.
[0042] Step S270: Upload the test result to a designated server.
[0043] Exemplarily, the test results may be sent to the user's mailbox via email, so that the user can view the relevant test results conveniently.
[0044] In order to better implement the continuous integration method of software provided in the embodiment of the present application, the embodiment of the present application also provides a continuous integration device of software. The meaning of the terms is the same as that in the above-mentioned pixel brightness compensation method, and the specific implementation details can refer to the description in the method embodiment.
[0045] like Figure 3 FIG. 1 is a schematic diagram of the structure of a continuous software integration device provided in Embodiment 3 of the present invention, comprising: an integration management tool 10, a target tool, an input tool 20 and a data interaction module.
[0046] Exemplarily, the integration management module is used to execute the continuous integration method of software described in the embodiment of the present invention. The input tool is used to automatically input corresponding setting parameters into the integration management tool when starting a task creation instruction.
[0047] All modules in the data interaction module are used as channels for data interaction between the integrated management tool 10 and the target tool, wherein the data interaction module includes a code change detection module 11, a code editing module 12, a feedback module 13, a static analysis calling module 14 and a dynamic analysis calling module 15.
[0048] The target tool includes at least one of a database 30, a code editing tool 40, an email management tool 50, a static analysis tool 60, a dynamic testing tool 70, and a server 80. Of course, in some other embodiments, the code change detection module and the code editing module are arranged in the same server to improve the efficiency of code editing.
[0049] The database 30 is used to store the source code, and the database 30 exchanges data with the integrated management tool 10 through the code change detection module 11. The code editing tool 40 is used to perform a change operation on the source code according to the set parameters, and exchanges data with the integrated management tool 10 through the code editing module 12. The mail management tool 50 is used to receive test results and feedback information of the change operation, and exchanges data with the integrated management tool 10 through the feedback module 13. The static analysis tool 60 is used to scan the new source code to obtain static analysis results, and exchanges data with the integrated management tool 10 through the static analysis call module 14. The dynamic testing tool 70 is used to scan the new source code to obtain dynamic analysis results, and exchanges data with the integrated management tool 10 through the dynamic analysis call module 15. The server is used to receive test results, and exchanges data with the integrated management tool 10 through the feedback module 13.
[0050] It should be noted that the term "at least one" herein, when used with a series of items, means that different combinations of one or more of the listed items may be used, and only one of each item in the list may be required. For example, "at least one of item A, item B, and item C" may include, but is not limited to, item A or item A and item B. This example may also include item A, item B, and item C, or item B and item C. In other examples, "at least one" may be, for example, but not limited to, two items A, one item B and ten items C, four items B and seven items C, or some other suitable combination.
[0051] Embodiment 3 of the present invention starts a task creation instruction by detecting a database or a user starts a task creation instruction, automatically enters corresponding setting parameters according to the task creation instruction, and performs a change operation on the source code in the software according to the setting parameters. Thus, the automation of software integration is realized, the efficiency of product development is improved, and the development cost is reduced.
[0052] A person of ordinary skill in the art can understand that all or part of the steps in the method described in the above embodiment can be completed by instructions, or by controlling related hardware through instructions. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0053] To this end, an embodiment of the present application provides a storage medium in which multiple computer programs are stored. The computer program can be loaded by a processor to execute the steps in a software continuous integration method provided in any embodiment of the present application. For example, the computer program can execute the following steps:
[0054] Start a task creation instruction;
[0055] Automatically input corresponding setting parameters according to the task creation instruction; and
[0056] Performing a change operation on the source code in the software according to the set parameters;
[0057] The setting parameters include identification tags for recording the required changes to the source code.
[0058] The specific implementation of each of the above operations can be referred to the previous embodiments, which will not be described in detail here. The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0059] Since the instructions stored in the computer-readable storage medium can execute the steps in a continuous integration method for software provided in any embodiment of the present application, the beneficial effects that can be achieved by a continuous integration method for software provided in any embodiment of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0060] In summary, although the present invention has been disclosed as above in terms of preferred embodiments, the above preferred embodiments are not intended to limit the present invention. A person skilled in the art may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention shall be based on the scope defined in the claims.
Claims
1. A method for continuous integration of software, characterized in that: The method is applied to a continuous integration system of software, the system comprising an integrated management tool, an input tool, a data interaction module and a target tool, wherein the data interaction module comprises a code change detection module, a code editing module, a feedback module, a static analysis calling module and a dynamic analysis calling module; the target tool comprises at least one of a database, a code editing tool, an email management tool, a static analysis tool, a dynamic testing tool and a server, and the method comprises: The integrated management tool initiates a task creation instruction; Upon detecting the task creation instruction, the input tool automatically inputs corresponding setting parameters into the integrated management tool; wherein the setting parameters include identification tags for recording the required change items of the source code; The integrated management tool controls the target tool to perform a change operation on the source code to be changed according to the set parameters through the data interaction module; The process of the change operation at least includes: the integrated management tool determines the source code to be changed in the software based on the identification tag, and scans and analyzes the source code to be changed to obtain an analysis result; Based on the analysis result, the code editing tool performs a change operation on the source code to be changed according to the set parameters to generate a new source code, and performs data exchange with the integrated management tool through the code editing module.
2. The method according to claim 1, characterized in that The integrated management tool starts a task creation instruction, including: When the code change detection module detects that the database has changed, the integrated management tool initiates a task creation instruction.
3. The method according to claim 1, characterized in that The target tool performs a test operation on the new source code to obtain a test result, wherein the test result includes a static analysis result and a dynamic analysis result, including: The static analysis tool scans the new source code to obtain static analysis results, and exchanges data with the integrated management tool through the static analysis calling module; The dynamic testing tool scans the new source code to obtain dynamic analysis results, and performs data interaction with the integrated management tool through the dynamic analysis calling module.
4. The method according to any one of claims 2 or 3, characterized in that The email management tool receives the test results and feedback information of the change operation, and exchanges data with the integrated management tool through the feedback module.
5. The method according to claim 3, characterized in that: The server receives the test result and performs data exchange with the integrated management tool through the feedback module.
6. The method according to claim 1, characterized in that The code change detection module and the code editing module are arranged in the same server.
7. The method according to claim 1, characterized in that The integrated management tool starts a task creation instruction, further comprising: Upon receiving a task creation instruction from a user or a controller, the integrated management tool initiates a task creation instruction.
8. A storage medium, characterized in that: The storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the continuous integration method for software as claimed in any one of claims 1 to 7.
