A code merge method and apparatus
By identifying the functional modules of target requirements in software projects and selecting target code from a pre-defined code library, the problem of low R&D efficiency in existing technologies is solved, code reuse is achieved, and development efficiency is improved.
Patent Information
- Application Number
- CN202111569673.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-21
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2041-12-21
AI Technical Summary
In existing technologies, programmers need to devise and write code from scratch when developing software projects, resulting in low R&D efficiency.
By identifying the functional modules involved in the target requirements of the software project to be developed, target code is selected from a pre-defined code library and merged into the target code library corresponding to the target requirements, thus achieving code reuse.
It reduces the amount of code writing work for programmers and improves the development efficiency of software projects.
Smart Images

Figure CN114237591B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a code integration method and device. BACKGROUND
[0002] A software project refers to a project of building a software system based on user requirements. When a new software project to be developed is established, the project requirements need to be sorted out and distributed to the corresponding programmers. When the programmers receive the project requirements, they write codes with the required functions of the project requirements to realize the project requirements by using the written codes.
[0003] At present, after a new software project to be developed is established, the programmers of the software project need to conceive and write codes with the required functions of the project requirements from scratch according to the allocated project requirements. The existing method requires programmers to spend a lot of time to write, review and test the codes even if they have experience in writing codes with the same functions, thus seriously affecting the development efficiency of the software project. SUMMARY
[0004] Therefore, the present application provides a code integration method and device, which aims to improve the development efficiency of the software project.
[0005] In order to achieve the above purpose, the present application mainly provides the following technical solutions:
[0006] In a first aspect, the present application provides a code integration method, which comprises:
[0007] determining a function module related to a target requirement item of a software project to be developed, wherein the function module related to the target requirement item is used to realize a requirement corresponding to the target requirement item;
[0008] selecting a target code corresponding to the function module from sample codes in a preset code library, wherein the preset code library stores a plurality of sample codes, and each sample code has its corresponding function module;
[0009] integrating the target code into a target code library corresponding to the target requirement item.
[0010] In a second aspect, the present application provides a code integration device, which comprises:
[0011] a determining unit configured to determine a function module related to a target requirement item of a software project to be developed, wherein the function module related to the target requirement item is used to realize a requirement corresponding to the target requirement item;
[0012] The selecting unit is configured to select target code corresponding to the function module from sample code in a preset code library, wherein the preset code library stores a plurality of sample codes, and each sample code has a corresponding function module;
[0013] The integrating unit is configured to integrate the target code into a target code library corresponding to the target requirement item.
[0014] In a third aspect, the present application provides a computer readable storage medium, which comprises a stored program, wherein the program controls a device where the storage medium is located to execute the code integration method in the first aspect when the program is running.
[0015] In a fourth aspect, the present application provides a storage management device, which comprises:
[0016] a memory configured to store a program;
[0017] a processor coupled to the memory and configured to run the program to execute the code integration method in the first aspect.
[0018] According to the above technical solution, when the target requirement item of the software project to be developed needs to be processed by code integration, the function module involved in the target requirement item is determined. Then, the target code corresponding to the function module is selected from the sample code stored in the preset code library. Finally, the selected target code is integrated into the target code library corresponding to the target requirement item. It can be seen that the scheme provided by the present application can directly retrieve the existing code in the preset code library according to the function module involved in the requirement item of the software project, realize code reuse, thereby reducing the workload of the programmer in code writing, and improving the development efficiency of the software project.
[0019] The above description is only a summary of the technical solution of the present application. In order to more clearly understand the technical means of the present application, the content of the specification can be implemented, and in order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific embodiments of the present application are described below. BRIEF DESCRIPTION OF DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiment or prior art description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creating any creative labor.
[0021] Figure 1 A flowchart of a code integration method provided by an embodiment of the present application is shown;
[0022] Figure 2 A flow chart of a code integration method provided by another embodiment of the present application is shown;
[0023] Figure 3 A structural schematic diagram of a code integration device provided by an embodiment of the present application is shown;
[0024] Figure 4 A structural schematic diagram of a code integration device provided by another embodiment of the present application is shown. DETAILED DESCRIPTION
[0025] Exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it is understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure can be more thoroughly understood and the scope of the present disclosure can be accurately conveyed to those skilled in the art.
[0026] Code, i.e. code, which is a source file written by a programmer in a language supported by a development tool, is a set of explicit rules for representing information in discrete form by characters, symbols or signal elements. The functions of a software system need to rely on code to implement, so code writing is an important part of a software project.
[0027] A software project refers to a project for building a software system based on user requirements. When a new software project to be developed is established, the project requirements need to be sorted out and distributed to the corresponding programmers. When the programmers receive the project requirements, they write code with the required functions of the project requirements to implement the project requirements using the written code.
[0028] Currently, after a new software project to be developed is established, the programmers of the software project need to conceive and write code with the required functions of the project requirements from scratch according to the allocated project requirements. This existing method requires programmers to spend a lot of time writing, reviewing and testing code even if they have experience writing code with the same functions, thus seriously affecting the development efficiency of the software project.
[0029] Embodiments of the present application provide a code integration method and device to directly retrieve existing code in a preset code library according to the function modules related to the requirements of a software project after a new software project to be developed is established, implement code reuse, thereby reducing the repetitive workload of programmers, and further improving the development efficiency of the software project. The code integration method and device provided by embodiments of the present application will be described in detail below.
[0030] As Figure 1As shown, the embodiment of the present application provides a code integration method, which mainly includes:
[0031] 101, determine the function module involved in the target requirement item of the software project to be developed, wherein the function module involved in the target requirement item is used to realize the requirement corresponding to the target requirement item.
[0032] In practical application, any new project based on user demand setting to build a software system can be used as a software project to be developed. The software project to be developed has multiple requirements, which are all based on user demand at the time of project establishment. Each requirement is a requirement item. Each requirement item involves one or more function modules, and the corresponding requirement is realized through the function modules involved. That is, the function module involved in the requirement item is used to realize the requirement corresponding to the requirement item.
[0033] In order to avoid confusion of the codes of each requirement item of the software project to be developed, the code integration operation needs to be performed separately for each requirement item. Therefore, each requirement item of the software project to be developed can be sequentially used as a target requirement item.
[0034] After the target requirement item is selected, the function module involved in the target requirement item needs to be determined, so as to extract reusable codes based on the determined function module. The specific method for determining the function module involved in the target requirement item of the software project to be developed is described below, which at least includes the following two methods:
[0035] Firstly, the project requirement table of the software project to be developed is obtained, and the function module involved in the target requirement item is extracted from the project requirement table.
[0036] The project requirement table is obtained based on the project establishment file, and records all the requirement items involved in the software project to be developed and all the function modules involved in each requirement item.
[0037] For example, the project requirement table includes a requirement item "wireless function requirement", and the "wireless function requirement" corresponds to function module 1, function module 2 and function module 3. Therefore, the function modules involved in the target requirement item "wireless function requirement" extracted from the project requirement table include "function module 1, function module 2 and function module 3".
[0038] Secondly, when the target address of the target code library corresponding to the target requirement item is obtained, the names of the function modules involved in the preset code library are displayed through a preset interactive interface. The function module corresponding to the selected name is determined as the function module involved in the target requirement item.
[0039] Each target requirement item has a corresponding target code library, which stores the code for all functional modules of the target requirement item. The target code library also has a corresponding target address, which can be used to merge code into the target code library.
[0040] When the target address of the target code library corresponding to the target requirement is obtained, it indicates that there is a need to merge code into the target code library. Therefore, the names of the functional modules involved in the preset code library are displayed through a preset interactive interface so that programmers can select the functional modules for which they need to reuse code.
[0041] A pre-defined interactive interface displays the names of functional modules involved in a pre-defined code library, allowing programmers to more easily and intuitively select the functional modules involved in the target requirement. When a programmer selects one or more names, the functional modules corresponding to the selected names are identified as the functional modules involved in the target requirement.
[0042] 102. Select the target code corresponding to the functional module from the sample code in the preset code library, wherein the preset code library stores multiple sample codes, each of which has its own corresponding functional module.
[0043] The pre-built code repository stores multiple sample codes, each with its own corresponding functional module. Each sample code can successfully implement the functionality involved in its corresponding module. The sample code in the pre-built code repository is based on historical code from already developed software projects. The purpose of setting up the pre-built code repository is to allow, after a new software project is initiated, to directly retrieve existing code from the pre-built code repository based on the functional modules involved in the target requirements of the new project, thereby achieving code reuse, reducing repetitive workload for programmers, and ultimately improving the development efficiency of software projects.
[0044] The following describes the specific process of selecting target code corresponding to the functional modules involved in the target requirement from the preset code library. This process involves at least the following two scenarios:
[0045] In the first scenario, where the functional module does not require a programming language, the process of selecting the target code corresponding to the functional module from the preset code library includes the following steps one through four:
[0046] Step 1: Locate the sample code corresponding to the functional module involved in the target requirement in the preset code library, and then proceed to Step 2 or Step 3 based on the search results.
[0047] The sample code in the preset code library has a corresponding relationship with the function module. After the function module involved in the target requirement item is determined, it is needed to check whether the determined function module exists in the preset code library. If it exists, the sample code corresponding to the determined function module can be found according to the above-mentioned corresponding relationship, and thus step two or step three is executed. If it does not exist, it indicates that the determined function module can be a new function module, and no sample code is available, and the programmer needs to perform code writing work for it, and thus step four is executed.
[0048] Step two, when the sample code corresponding to the function module exists in the preset code library and there are at least two versions of the sample code corresponding to the function module, a target code corresponding to the function module is selected from the at least two versions, and the current process is ended.
[0049] When there are at least two versions of the sample code corresponding to the function module, a target code corresponding to the function module needs to be selected from these versions. The method for selecting a target code corresponding to the function module from the at least two versions is described below, which includes the following two methods:
[0050] One is to select the latest version of the sample code as the target code corresponding to the function module.
[0051] The latest version of the sample code is the code updated most recently, which can be more in line with the functional requirements of the function module, and thus the latest version of the sample code is selected as the target code corresponding to the function module.
[0052] Two is, when the sample code corresponding to the function module exists in the preset code library and there are at least two versions of the sample code corresponding to the function module, a version selection prompt is issued. When at least one version of the sample code is selected under the version selection prompt, the sample code of the selected version is selected as the target code corresponding to the function module.
[0053] Different versions of the sample code have different writing emphases, and thus when there are at least two versions of the sample code corresponding to the function module, a version selection prompt is issued to allow the programmer to select the sample code corresponding to the version meeting the requirements of the programmer.
[0054] When at least one version of the sample code is selected under the version selection prompt, it indicates that the programmer selects the version meeting the requirements of the programmer, and thus the sample code of the selected version is selected as the target code corresponding to the function module.
[0055] Step three, when the sample code corresponding to the function module exists in the preset code library and there is one version of the sample code corresponding to the function module, the sample code of the version is directly selected as the target code corresponding to the function module.
[0056] Step four, when the sample code corresponding to the function module does not exist in the preset code library, issuing a code integration failure prompt for the function module.
[0057] When the sample code corresponding to the function module does not exist in the preset code library, it means that the function module may be a new function module, and there is no sample code available, and the programmer needs to write code for it. Therefore, a code integration failure prompt is issued for the function module to enable the programmer to start subsequent code writing work based on the prompt.
[0058] In the second case, when the function module has programming language requirements, the process of selecting the target code corresponding to the function module from the preset code library includes the following steps one to five:
[0059] Step one, find the sample code corresponding to the function module involved in the target requirement item in the preset code library, and execute step two or step six according to the search result.
[0060] Step two, when the sample code corresponding to the function module exists in the preset code library, detect whether the programming language of the sample code corresponding to the function module is the same as the programming language required by the function module. If they are the same, execute step three or step four; if they are different, execute step five.
[0061] In the case where the function module has programming language requirements, in order to ensure that the sample code corresponding to the function module is available in the software project to be developed, it is necessary to detect whether the programming language of the sample code corresponding to the function module is the same as the programming language required by the function module.
[0062] Step three, if the programming language of the sample code corresponding to the function module is the same as the programming language required by the function module, and there is one version of the sample code corresponding to the function module, the sample code corresponding to the function module is selected as the target code corresponding to the function module, and the current process is ended.
[0063] If the programming language of the sample code corresponding to the function module is the same as the programming language required by the function module, it means that the sample code corresponding to the function module is available in the software project to be developed. In the case where there is one version of the sample code corresponding to the function module, the sample code corresponding to the function module is selected as the target code corresponding to the function module.
[0064] Step four, if the programming language of the sample code corresponding to the function module is the same as the programming language required by the function module, and there are at least two versions of the sample code corresponding to the function module, select the target code corresponding to the function module from the at least two versions, and end the current process.
[0065] If the programming language of the sample code corresponding to a functional module is the same as the programming language required by the functional module, it means that the sample code corresponding to the functional module is usable in the software project to be developed. If there are at least two versions of the sample code corresponding to a functional module, the target code corresponding to the functional module needs to be selected from at least two versions. The selection method is based on the same detailed explanation in step two of the first case above, so it will not be repeated here.
[0066] Step 5: If the programming language of the sample code corresponding to the functional module is different from the programming language required by the functional module, issue a code merging failure prompt for the functional module and end the current process.
[0067] If the programming language of the sample code corresponding to the functional module is different from the programming language required by the functional module, it means that the sample code corresponding to the functional module is not available in the software project to be developed. Therefore, a code merging failure message is issued for the functional module so that the programmer can start the subsequent code writing work based on the message.
[0068] Step 6: If no sample code corresponding to the functional module exists in the preset code library, a code merging failure message for the functional module is issued.
[0069] If no sample code corresponding to the functional module is found in the preset code library, it indicates that the functional module may be a new functional module with no sample code available. Programmers need to write code for it. Therefore, a code merging failure prompt is issued for the functional module so that programmers can start subsequent code writing work based on the prompt.
[0070] 103. Merge the target code into the target code library corresponding to the target requirement item.
[0071] To facilitate unified management of the code for target requirements, a target code library is set up for each target requirement. This library stores the code for all functional modules involved in the target requirement. Therefore, the target code corresponding to each functional module is merged into the target code library, allowing programmers to access and modify the target code for rewriting or testing purposes related to the target requirement.
[0072] It should be noted that when merging target code into the target code library, it is necessary to establish a correspondence between the target code and the functional modules so that programmers can retrieve the target code based on this correspondence.
[0073] The code merging method provided in this embodiment of the invention, when requiring code merging of target requirements of a software project, first identifies the functional modules involved in the target requirements. Then, it selects the target code corresponding to the functional modules from sample code stored in a preset code library. Finally, it merges the selected target code into the target code library corresponding to the target requirements. Therefore, the solution provided in this embodiment of the invention can directly retrieve existing code from a preset code library based on the functional modules involved in the software project's requirements, achieving code reuse, thereby reducing the workload of programmers and improving the development efficiency of software projects.
[0074] Furthermore, according to Figure 1 The method shown in the figure, in another embodiment of the present invention, also provides a code merging method, such as Figure 2 As shown, the method mainly includes:
[0075] 201. Obtain the historical code of the developed software project, wherein the historical code is the code that can successfully implement the corresponding function.
[0076] The historical code of developed software projects serves as the source of sample code in the preset code library. Historical code consists of code that successfully implements the corresponding functionality; it can be added to the preset code library for reuse.
[0077] It should be noted that, in order to enrich the sample code in the preset code library, once there is historical code in an already developed software project, the historical code can be obtained and added to the preset code library.
[0078] 202. Based on the parsing results of the functional description information of the historical code, determine the functional module corresponding to the historical code, and execute step 203 or step 204.
[0079] The functional description information of historical codes is mainly used to describe their functions. Therefore, the functional module corresponding to the historical code can be determined based on the parsing results of the historical code's functional description information. The parsing process of the functional description information is as follows: extract keywords from the functional description information, and determine the functional module corresponding to the historical code based on the keywords. For example, if the keywords in the functional description information include password verification, then the functional module corresponding to the historical code is determined to be the password verification functional module.
[0080] 203. When there is no corresponding sample code for the determined functional module in the preset code library, the historical code is used as the sample code to establish a correspondence between the determined functional module and the sample code, and step 208 is executed.
[0081] When the determined function module does not have corresponding sample code in the preset code library, it indicates that the function module currently has no reusable code. In order to reuse the code for the function module in the future, the historical code is used as sample code to establish a corresponding relationship between the historical code and the determined function module, so as to add the historical code as sample code to the preset code library.
[0082] 204、When the determined function module has corresponding sample code in the preset code library, it is determined whether the historical code is a new version of the existing sample code. If yes, step 205 is performed; otherwise, steps 206 or 207 are performed.
[0083] 205、If the historical code is a new version of the existing sample code, version information is marked for the historical code. The historical code with the marked version information is used as sample code to establish a corresponding relationship between the historical code and the determined function module, and step 208 is performed.
[0084] Since different versions of code may have different writing emphases, in the case that the historical code is a new version of the existing sample code, version information is marked for the historical code. The historical code with the marked version information is used as sample code to establish a corresponding relationship between the historical code and the determined function module, so that multiple versions of sample code of the function module can exist in the preset code library for reuse.
[0085] 206、If the historical code is not a new version of the existing sample code, but the version of the historical code is the same as that of the existing sample code, the historical code is discarded, and the current process is ended.
[0086] In the case that the version of the historical code is the same as that of the existing sample code, it indicates that the sample code already exists in the preset code library, and it is not necessary to add it to the preset code library. Therefore, it is directly discarded.
[0087] 207、If the historical code is not a new version of the existing sample code, and the version of the historical code is different from that of the existing sample code, a function determination prompt for the historical code is issued, and the current process is ended.
[0088] In the case that the historical code is not a new version of the existing sample code, it indicates that the function module determination may be abnormal, and a function determination prompt for the historical code needs to be issued, so that the programmer can review and correct the function module corresponding to the historical code.
[0089] 208、The sample code and the function module with the established corresponding relationship are added to the preset code library.
[0090] 209. Determine the functional modules involved in the target requirement items of the software project to be developed, where the functional modules involved in the target requirement items are used to implement the requirements corresponding to the target requirement items.
[0091] 210. Select the target code corresponding to the functional module from the sample codes in the preset code library, where multiple sample codes are stored in the preset code library, and each sample code has its corresponding functional module.
[0092] 211. Incorporate the target code into the target code library corresponding to the target requirement item.
[0093] Further, according to the above method embodiments, another embodiment of the present invention also provides a code incorporation device, as Figure 3 shown, the device includes:
[0094] A determination unit 31, configured to determine the functional modules involved in the target requirement items of the software project to be developed, where the functional modules involved in the target requirement items are used to implement the requirements corresponding to the target requirement items;
[0095] A selection unit 32, configured to select the target code corresponding to the functional module from the sample codes in the preset code library, where multiple sample codes are stored in the preset code library, and each sample code has its corresponding functional module;The determining sub-unit 312 is configured to determine the function module corresponding to the selected name as the function module related to the target requirement item.
[0101] Optionally, as shown in Figure 4 The selecting unit 32 includes:
[0102] The first selecting sub-unit 321 is configured to, when the sample code corresponding to the function module exists in the preset code library, detect whether the programming language of the sample code corresponding to the function module is the same as the programming language required by the function module; and if the programming language of the sample code corresponding to the function module is the same as the programming language required by the function module, select the sample code corresponding to the function module as the target code corresponding to the function module.
[0103] Optionally, as shown in Figure 4 The selecting unit 32 further includes:
[0104] The first prompting sub-unit 322 is configured to, if the programming language of the sample code corresponding to the function module is different from the programming language required by the function module, issue a code integration failure prompt for the function module.
[0105] Optionally, as shown in Figure 4 The selecting unit 32 includes:
[0106] The second selecting sub-unit 323 is configured to, when the sample code corresponding to the function module exists in the preset code library and there are at least two versions of the sample code corresponding to the function module, select the sample code of the latest version as the target code corresponding to the function module.
[0107] Optionally, as shown in Figure 4 The selecting unit 32 includes:
[0108] The third selecting sub-unit 324 is configured to, when the sample code corresponding to the function module exists in the preset code library and there are at least two versions of the sample code corresponding to the function module, issue a version selection prompt; and when at least one version of the sample code is selected under the version selection prompt, select the sample code of the selected version as the target code corresponding to the function module.
[0109] Optionally, as shown in Figure 4 The apparatus further includes:
[0110] The adding unit 34 is configured to acquire historical code of the developed software project, wherein the historical code is code capable of successfully implementing corresponding functions; determine a function module corresponding to the historical code based on a result of analyzing function description information of the historical code; and establish a corresponding relationship between the historical code as sample code and the determined function module, and store the corresponding relationship in the preset code library.
[0111] Optionally, as shown in Figure 4 The adding unit 34 is further configured to, when the determined function module has corresponding sample code in the preset code library, determine whether the historical code is a new version of the existing sample code; if the historical code is a new version of the existing sample code, label version information for the historical code, and establish a corresponding relationship between the historical code as sample code and the determined function module; and if the historical code is not a new version of the existing sample code, issue a function determination prompt for the historical code.
[0112] The method used by each function module in the code integration device provided by the embodiment of the present application can be referred to the corresponding method detailed description of the method embodiment, which will not be repeated here. Figures 1-2 The method used by each function module in the code integration device provided by the embodiment of the present application can be referred to the corresponding method detailed description of the method embodiment, which will not be repeated here.
[0113] Further, according to the above-mentioned embodiments, another embodiment of the present application further provides a computer readable storage medium, the storage medium includes a stored program, wherein when the program runs, the device where the storage medium is located executes Figure 1 or Figure 2 The code integration method.
[0114] Further, according to the above-mentioned embodiments, another embodiment of the present application further provides a storage management device, the storage management device includes:
[0115] A memory for storing a program;
[0116] A processor coupled to the memory for running the program to execute Figure 1 or Figure 2 The code integration method.
[0117] In the above-mentioned embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.
[0118] It can be understood that the related features in the above-mentioned method and device can be mutually referred. In addition, the "first", "second" and the like in the above-mentioned embodiments are used to distinguish the embodiments, and do not represent the advantages and disadvantages of the embodiments.
[0119] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
[0120] The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems can be used with programs in accordance with the teachings herein, or it can prove convenient to construct more specialized apparatus to perform the required method steps. The required structure for a variety of these systems will be apparent from the description above. In addition, the present application is not intended to be limited to any particular programming language. It will be appreciated that there are many programming languages that can be used to implement the teachings herein, and any specific language can be chosen for use in this application.
[0121] In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the application can be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been described in detail in order to not obscure the understanding of this description.
[0122] Similarly, it is to be understood that the mechanical components of the application can be placed in any desired configuration according to the specific application. Further, it is to be understood that the application can employ various computer-implemented processes which include routines executed by computers. These computer-implemented processes can be used in many different systems and for many different purposes, encompassing one or more aspects of the application. Also, it is to be understood that such computer-implemented processes can be performed actively or passively, depending on the design of the computer system.
[0123] Those skilled in the art will appreciate that the modules in the apparatuses in the embodiments can be adapted and placed in one or more apparatuses other than the embodiments. The modules or units or components in the embodiments can be combined into one module or unit or component, and further can be divided into multiple sub-modules or sub-units or sub-components. Any combination of all the features disclosed in the specification (including the accompanying claims, abstract and drawings), and any method or apparatus so disclosed, can be used in any combination, except that at least some of such features and / or processes or units are mutually exclusive. Unless explicitly stated otherwise, each feature disclosed in the specification (including the accompanying claims, abstract and drawings) can be replaced by alternative features that serve the same, equivalent or similar purpose.
[0124] Furthermore, those skilled in the art will recognize that, while certain embodiments described herein include certain features that are not included in other embodiments, combinations of features of the different embodiments are meant to be within the scope of the application and form different embodiments. For example, in the claims below, any of the claimed embodiments can be used in any combination.
[0125] Various component embodiments of the present application can be implemented in hardware, or as software modules running in one or more processors, or combinations thereof. Those skilled in the art will appreciate that a microprocessor or a digital signal processor (DSP) can be used in practice to implement some or all of the functions of some or all of the components in the method, apparatus and framework for running a deep neural network model according to embodiments of the present application. The present application can also be implemented as a program (e.g., computer program and computer program product) for executing any or all of the methods described herein on a device or apparatus. Such a program implementing the present application can be stored on a computer readable medium, or can be in the form of one or more signals. Such a signal can be downloaded from an Internet website, or can be available for
[0126] It should be noted that the above-mentioned embodiments illustrate rather than limit the application, and that one skilled in the art will be able to design many alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word 'comprising' does not exclude the presence of elements or steps other than those listed in a claim. The word 'a' or 'an' preceding an element does not exclude the presence of a plurality of such elements. The application can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unitary claim, several of the apparatuses mentioned in the descriptive part can be present in a single item, implemented in one piece, or as separate pieces. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage. The use of relative terms such as 'about', 'approximately','substantially' and the like is intended to encompass variations that can exist in the values that have been tested and a range of modifications for each stated value or range of values.
Claims
1. A code merge method, characterized by, The method comprises: determining a function module related to a target requirement item of a software project to be developed, wherein the function module related to the target requirement item is used to implement a requirement corresponding to the target requirement item; determining the function module related to the target requirement item of the software project to be developed comprises: when a target address of a target code library corresponding to the target requirement item is acquired, displaying names of function modules related in the preset code library through a preset interactive interface; determining the function module corresponding to the selected name as the function module related to the target requirement item; and the target code library is used to store codes corresponding to all function modules of the target requirement item; selecting a target code corresponding to the function module from sample codes in a preset code library, wherein the preset code library stores a plurality of sample codes, and each sample code has a corresponding function module; selecting the target code corresponding to the function module from the sample codes in the preset code library comprises: when there is a sample code corresponding to the function module in the preset code library, and the programming language of the sample code corresponding to the function module is the same as the programming language required by the function module, selecting the latest version of the sample code or the selected version of the sample code corresponding to the function module as the target code corresponding to the function module; the selected version is a version selected under the condition of issuing a version selection prompt; integrating the target code into a target code library corresponding to the target requirement item, so as to enable a programmer to call the target code and perform rewriting or testing operations on the target code related to the target requirement item; The method further comprises: acquiring a historical code of a developed software project, wherein the historical code is a code capable of successfully implementing a corresponding function; determining a function module corresponding to the historical code based on a parsing result of function description information of the historical code; establishing a corresponding relationship between the historical code as a sample code and the determined function module, and adding the historical code to the preset code library.
2. The method of claim 1, wherein, Selecting the target code corresponding to the function module from the preset code library comprises: when there is a sample code corresponding to the function module in the preset code library, detecting whether the programming language of the sample code corresponding to the function module is the same as the programming language required by the function module; if the programming language of the sample code corresponding to the function module is the same as the programming language required by the function module, selecting the sample code corresponding to the function module as the target code corresponding to the function module.
3. The method of claim 2, wherein, The method further comprises: if the programming language of the sample code corresponding to the function module is different from the programming language required by the function module, issuing a code integration failure prompt for the function module.
4. The method according to any one of claims 1 to 3, characterized in that, Selecting the target code corresponding to the function module from the preset code library comprises: when there is a sample code corresponding to the function module in the preset code library, and there are at least two versions of the sample code corresponding to the function module, selecting the latest version of the sample code as the target code corresponding to the function module; or When the sample code corresponding to the function module exists in the preset code library and there are at least two versions of the sample code corresponding to the function module, a version selection prompt is sent out; When at least one version of the sample code is selected under the version selection prompt, the selected version of the sample code is selected as the target code corresponding to the function module.
5. The method of claim 1, wherein, After determining the function module corresponding to the historical code based on the analysis result of the function description information of the historical code, the method further comprises: When the determined function module already has corresponding sample code in the preset code library, it is judged whether the historical code is a new version of the existing sample code; If the historical code is a new version of the existing sample code, version information is marked for the historical code, and the historical code with the marked version information is used as sample code to establish a corresponding relationship between the determined function module; If the historical code is not a new version of the existing sample code, a function determination prompt for the historical code is sent out.
6. A code incorporation apparatus characterized by comprising: The device comprises: A determination unit is configured to determine a function module related to a target requirement item of a software project to be developed, wherein the function module related to the target requirement item is used to implement a requirement corresponding to the target requirement item; the determination unit is configured to: when a target address of a target code library corresponding to the target requirement item is acquired, display names of function modules related to the preset code library through a preset interactive interface; and determine a function module corresponding to a selected name as the function module related to the target requirement item; the target code library is used to store codes corresponding to all function modules of a target requirement item; A selection unit is configured to select a target code corresponding to the function module from sample codes of a preset code library, wherein the preset code library stores a plurality of sample codes, and each sample code has a corresponding function module; the selection unit is configured to: when the sample code corresponding to the function module exists in the preset code library and the programming language of the sample code corresponding to the function module is the same as the programming language required by the function module, select a latest version of the sample code or a selected version of the sample code in the sample code corresponding to the function module as the target code corresponding to the function module; the selected version is a version selected under a version selection prompt; An integration unit is configured to integrate the target code into a target code library corresponding to the target requirement item, so that a programmer can call the target code and perform rewriting or testing operations related to the target requirement item on the target code. The device further comprises an adding unit configured to acquire a historical code of a developed software project, wherein the historical code is a code that can successfully implement a corresponding function; determine a function module corresponding to the historical code based on an analysis result of function description information of the historical code; establish a corresponding relationship between the historical code and the determined function module as sample code, and add the historical code to the preset code library.
7. A computer readable storage medium characterized by The storage medium includes a stored program, wherein the program, when executed, controls a device in which the storage medium is located to perform the code incorporation method of any one of claims 1 to 5.
8. A storage management device, characterized by comprising: The storage management device includes: a memory for storing a program; a processor coupled to the memory for running the program to perform the code incorporation method of any one of claims 1 to 5.
Citation Information
Patent Citations
Visualized code generation method and system thereof
CN106445556A
Application development method and related device
CN108255481A