Project research and development efficiency evaluation method and device, computer equipment and storage medium
By obtaining project information, cleaning code, calculating the number of effective code lines and combining R&D records, the problem of difficult to automate and efficiently evaluate the R&D efficiency of software projects in the existing technology is solved, and more accurate R&D efficiency evaluation and workflow optimization are achieved.
Patent Information
- Application Number
- CN202411573663.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-03-11
AI Technical Summary
The existing technology is difficult to automatically, efficiently and accurately evaluate the R&D efficiency of software projects, resulting in the inability to accurately reflect the actual R&D efficiency and optimize the workflow.
By obtaining project information, obtaining project code from the code warehouse, cleaning the code using preset cleaning rules, calculating the number of effective code lines, and determining the project R&D efficiency based on project R&D records.
It realizes automated and accurate assessment of project R&D efficiency, which can more accurately reflect the project R&D efficiency and work flow, and improves the overall performance of the team.
Smart Images

Figure CN119597617A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of software development technology, and in particular to a method, device, computer equipment and storage medium for evaluating project R&D efficiency. Background Art
[0002] In the process of software project development, evaluating R&D efficiency is a key link to ensure that the project is completed on time, with quality and on budget. Through effective evaluation, potential problems can be discovered, work processes can be optimized, and the overall performance of the team can be improved.
[0003] At present, a rough assessment is usually performed through simple lines of code and R&D hours. However, there are many factors that affect the number of lines of code, so it cannot accurately reflect the actual R&D efficiency. In addition, different projects and different development stages have different requirements for R&D efficiency.
[0004] Therefore, how to automatically evaluate project development efficiently and accurately in order to obtain project evaluation results efficiently and accurately has become an urgent problem to be solved. Summary of the invention
[0005] Based on this, the present invention provides a project R&D efficiency evaluation method, device, computer equipment and storage medium to solve the problem of how to automatically evaluate project R&D efficiently and accurately to obtain project evaluation results efficiently and accurately.
[0006] In a first aspect, an embodiment of the present invention provides a method for evaluating project R&D efficiency, comprising: Obtain project information of the project to be evaluated, and obtain project code corresponding to the project to be evaluated from a code repository according to the project information; Obtaining a preset cleaning rule, and using the cleaning rule to clean the project code to obtain a cleaned project code; Calculating the number of valid lines of the cleaned project code to obtain the corresponding number of valid code lines; The project development record is obtained from the project information, and the development efficiency of the project to be evaluated is determined according to the project development record and the number of valid code lines.
[0007] In a second aspect, an embodiment of the present invention provides a device for evaluating project R&D efficiency, including: A project code acquisition module is used to acquire project information of the project to be evaluated, and acquire the project code corresponding to the project to be evaluated from the code repository according to the project information; A cleaning module, used to obtain a preset cleaning rule, and use the cleaning rule to clean the project code to obtain a cleaned project code; A calculation module, used to calculate the number of valid lines of the cleaned project code to obtain the corresponding number of valid code lines; The evaluation module is used to obtain the project development record from the project information, and determine the development efficiency of the project to be evaluated according to the project development record and the number of valid code lines.
[0008] In a third aspect, an embodiment of the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the project R&D efficiency evaluation method described in the first aspect when executing the computer program.
[0009] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for evaluating the project R&D efficiency described in the first aspect above is implemented.
[0010] Compared with the prior art, the present invention has the following beneficial effects: by obtaining the project information of the project to be evaluated, according to the project information, obtaining the project code corresponding to the project to be evaluated from the code warehouse, obtaining the preset cleaning rules, using the cleaning rules, cleaning the project code, obtaining the cleaned project code, calculating the number of valid lines of the cleaned project code, obtaining the corresponding number of valid code lines, obtaining the project development record from the project information, and determining the development efficiency of the project to be evaluated according to the project development record and the number of valid code lines. The effectiveness of the project code is judged by an automated cleaning method, and the project is evaluated by the effective code, so as to more accurately calculate the research and development efficiency of the project. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0012] Figure 1 This is a schematic diagram of an application environment of a project R&D efficiency evaluation method provided in the first embodiment of the present invention; Figure 2 It is a flowchart of a method for evaluating project R&D efficiency provided by Embodiment 2 of the present invention; Figure 3 It is a flowchart of a method for evaluating project R&D efficiency provided by Embodiment 3 of the present invention; Figure 4It is a flowchart of a method for evaluating project R&D efficiency provided by Embodiment 4 of the present invention; Figure 5 It is a flowchart of a method for evaluating project R&D efficiency provided by Embodiment 5 of the present invention; Figure 6 It is a flowchart of a method for evaluating project R&D efficiency provided by Embodiment 6 of the present invention; Figure 7 It is a flowchart of a method for evaluating project R&D efficiency provided by Embodiment 7 of the present invention; Figure 8 It is a structural schematic diagram of a device for evaluating project R&D efficiency provided by Embodiment 8 of the present invention; Fig. 9 It is a structural diagram of a computer device provided in Embodiment 9 of the present invention. DETAILED DESCRIPTION
[0013] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0014] like Figure 1 As shown, it is a schematic diagram of the application environment of a method for evaluating project R&D efficiency provided in the first embodiment of the present invention, wherein the client and the server are connected for communication, and the user can provide the server with conditions, requirements and operation instructions for evaluating project R&D efficiency by operating the client, and the server is used to execute the method for evaluating project R&D efficiency of the present invention according to the relevant content sent by the client. Among them, the client includes but is not limited to computer devices such as various personal computers, laptops, smart phones, tablet computers and portable wearable devices. The computer device corresponding to the server can be implemented with an independent server or a server cluster composed of multiple servers.
[0015] like Figure 2 FIG. 1 is a flow chart of a method for evaluating project R&D efficiency provided by Embodiment 2 of the present invention, wherein the method for evaluating project R&D efficiency is applied in Figure 1 The evaluation method of the R&D efficiency of this project may include the following steps: Step S201, obtaining project information of the project to be evaluated, and obtaining the project code corresponding to the project to be evaluated from the code repository according to the project information.
[0016] First of all, you need to collect and understand various information related to the project. This project information usually includes the basic situation of the project, such as the project name, goals, the current status of the project (in progress, completed, suspended, etc.), the technology used, the project leader, etc., as well as technical details, such as the code repository address, programming language, framework, tools, etc.
[0017] Once you have the project information, especially the address and technical details of the code repository, you can obtain the source code of the project from the code repository, such as GitHub, GitLab, etc. By using version control tools, such as Git, you can download or clone the project code to the local environment.
[0018] Step S202, obtaining a preset cleaning rule, and using the cleaning rule to clean the project code to obtain a cleaned project code.
[0019] Before code cleaning, you first need to obtain the preset cleaning rules. These rules are usually formulated by project managers or technical leaders based on the characteristics of the project and evaluation requirements. Cleaning rules may include ignoring file types, ignoring directories, removing comments, standardizing formats, and exception handling.
[0020] Among them, ignoring file types may refer to certain types of files that need to be ignored during the cleaning process, such as .log files, binary files, image files, etc. Ignoring directories may refer to certain directories that need to be ignored during the cleaning process, such as node_modules, build, dist, etc. Removing comments may refer to whether it is necessary to remove comments in the code to reduce unnecessary interference. Standardized format may refer to code formatting rules, such as code indentation, spaces, line breaks, etc. Exception handling may refer to how to handle exceptions or non-standard parts in the code, such as unused variables, duplicate code, etc.
[0021] According to the obtained cleaning rules, the project code can be cleaned, or the project code can be marked according to the cleaning rules, or the project code can be removed through the cleaning rules. This is usually achieved by writing or using existing cleaning scripts or tools. According to the file type and directory ignore conditions in the cleaning rules, the code files that need to be processed are screened out, the comments in the code are removed, and the code is formatted to ensure the consistency of the code style. Code formatting tools, such as Prettier, clang-format, etc., can be used to remove redundant parts in the code (such as unused variables, repeated code snippets, etc.), so that the project code will be organized into a more standardized and clean version.
[0022] Optionally, before using the cleaning rules to clean the project code to obtain the cleaned project code in step S202, the method for evaluating the R&D efficiency of the project may further include the following steps: Create files based on the scrapy tool in Python language to get the files to be written; According to the files to be written, write the script to be run of the cleaning rules to obtain the cleaning framework; According to the cleaning framework, the project code is cleaned to obtain the cleaned project code.
[0023] Among them, building a cleaning framework based on the Scrapy tool in Python language can realize the automation of the whole process from web page data crawling to data cleaning. The files to be written created by scrapy provide a basis for the writing of subsequent scripts. The scripts written according to the cleaning framework are used to clean the project code to obtain the written project code. This automates the data cleaning process, reduces manual intervention, and enhances the accuracy of the evaluation of project R&D efficiency.
[0024] Step S203, calculating the number of valid lines of the cleaned project code to obtain the corresponding number of valid code lines.
[0025] Among them, valid code lines usually refer to those code lines that contain actual business logic or function implementation. Valid code lines do not include: blank lines, comment lines, code formatting compliance, etc.
[0026] Among them, a blank line may refer to a pure blank line without any code or comment, a comment line may refer to a comment line that has been cleaned, an import statement may refer to a language-specific import statement such as import and require, and a code formatting symbol may refer to formatting symbols in a separate line such as curly braces {} and brackets ().
[0027] You can use tools such as cloc, scc, CLOC, etc. to directly count the number of lines in the code base and automatically ignore comments, blank lines, etc. You can also write custom scripts to calculate the number of valid code lines. For example, according to the needs of the project, write a custom script to calculate the number of valid lines. The script usually traverses the code file and calculates the number of valid lines according to preset rules.
[0028] Step S204, obtaining the project development record from the project information, and determining the development efficiency of the project to be evaluated according to the project development record and the number of valid code lines.
[0029] Among them, project development records usually include various key information in the project development process. Common project development records include project time records, development time distribution, personnel input records, work time allocation, task and milestone records, and milestone achievement status.
[0030] Among them, project time records can refer to the start and end time of the project, which is used to calculate the total development cycle. Development time distribution can refer to the time spent on each development stage (such as requirements analysis, design, development, testing, deployment, etc.). Personnel input records can refer to the total number of developers involved in the project. Working time allocation can refer to the specific time each developer invests in the project, such as the number of working hours per day, overtime hours, etc. Task and milestone records can refer to the specific tasks that each developer is responsible for. Milestone achievement status can refer to the completion time and quality of key milestones of the project. These records can be obtained through project management tools such as Jira, Trello, Asana, etc., or the team's time recording system.
[0031] After obtaining the project development records and the number of effective code lines, the two can be combined to calculate the project's development efficiency. The development efficiency indicators include code productivity, the number of effective code lines for each task, and the development cycle efficiency. Among them, the code production efficiency can be calculated by dividing the total number of effective code lines by the total number of developers and the total number of development days, the number of effective code lines for each task can be calculated by dividing the total number of effective code lines by the number of completed tasks, and the development cycle efficiency can be calculated by dividing the total development cycle by the number of milestones.
[0032] In the embodiment of the present application, the project information of the project to be evaluated is obtained, and the project code corresponding to the project to be evaluated is obtained from the code warehouse according to the project information, and the preset cleaning rules are obtained. The project code is cleaned using the cleaning rules to obtain the cleaned project code, and the number of valid lines of the cleaned project code is calculated to obtain the corresponding number of valid code lines, and the project development record is obtained from the project information. According to the project development record and the number of valid code lines, the R&D efficiency of the project to be evaluated is determined. The validity of the project code is judged by an automated cleaning method, and the project is evaluated by the code of validity, so as to more accurately calculate the R&D efficiency of the project.
[0033] like Figure 3 As shown, it is a flow chart of a method for evaluating project R&D efficiency provided by Embodiment 3 of the present invention. In the preset cleaning rule of step S202, this step may also include a blank line cleaning rule. In step S202, the project code is cleaned using the cleaning rule to obtain the cleaned project code. This step may also include the following steps: Step S301, using the blank line cleaning rule, marking the blank line positions in the project code, and obtaining the project code after the blank line marking as the cleaned project code.
[0034] Among them, a blank line usually refers to a line without any characters (including blank characters). Blank lines usually need to be marked so that they can be identified and processed in subsequent analysis. Use blank line cleaning rules to mark the blank lines in the project code. Read the code files in the project one by one, use regular expressions or other text processing tools to identify blank lines in the code files, and add specific tags (such as comments) to the identified blank lines so that these blank lines can be identified in subsequent steps.
[0035] In step S203, the number of valid lines of the cleaned project code is calculated to obtain the corresponding number of valid code lines. This step may also include the following steps: Step S302, obtaining the first number of all lines and blank line marks in the cleaned project code.
[0036] Among them, all lines refer to all lines in the cleaned project code, including code lines, comment lines, blank line markers, etc. Read the cleaned code files one by one, and for each file, read and count line by line. You can use the built-in file reading function of the programming language, such as Python's readlines(), to get the total number of lines in the file.
[0037] For each file, find the position of the first blank line marker and count the number of all blank line markers from this position to the end of the file. These data will be used for subsequent R&D efficiency evaluation and analysis. For example, a Boolean variable can be used to mark whether counting has started, and the total number of lines and the first number of blank line markers calculated can be summed up and recorded.
[0038] Step S303: Calculate the number of valid code lines according to the number of lines and the first quantity.
[0039] Subtract the first number counted from all the lines in the above step, and the resulting number is the number of valid code lines.
[0040] In this embodiment, the blank lines in the project code are marked by using the blank line cleaning rule to obtain the cleaned project code, and the number of all lines in the cleaned project code is combined with the first number of blank line marks to calculate the number of valid code lines. This provides important data support for the project R&D efficiency evaluation.
[0041] like Figure 4 As shown, it is a flow chart of a method for evaluating project R&D efficiency provided by the fourth embodiment of the present invention. In step S202, a preset cleaning rule is obtained, and this step may also include a comment line cleaning rule. In step S202, the project code is cleaned using the cleaning rule to obtain the cleaned project code. This step may also include the following steps: Step S401, using comment line cleaning rules, marking comment lines at positions of comment lines in the project code, and obtaining the project code marked with comment lines as the cleaned project code.
[0042] Before marking comment lines, you first need to define the recognition rules for comment lines. Different programming languages have different comment syntaxes, such as single-line comments and multi-line comments. Read the project code files one by one, identify the comment lines therein, and mark them according to the defined comment line cleaning rules.
[0043] For each line of code, determine whether it is a comment line. If it is a comment line, add a specific comment line marker at the beginning or end of the line. For example, assuming the comment line marker is / / [COMMENT], a single-line comment line is marked by adding a [COMMENT] marker after the comment symbol (such as / / or #), and a multi-line comment line is marked by adding a [COMMENT] marker at the start and end of the multi-line comment.
[0044] Save the marked project code as a new file, or modify it directly in the original file. These files will become the "cleaned project code" for subsequent analysis and evaluation.
[0045] In step S203, the number of valid lines of the cleaned project code is calculated to obtain the corresponding number of valid code lines. This step may also include the following steps: Step S402, obtaining the second number of all lines and comment line marks in the cleaned project code.
[0046] The second number of comment line marks refers to the number of all comment line marks in the cleaned project code. The cleaned code files are read one by one to identify the comment line marks. The comment line marks are identified using regular expressions or other text processing tools. For example, for each file, the positions of all comment line marks are found and counted. The number of comment line marks can be counted using regular expression matching.
[0047] Step S403, calculating the number of valid code lines according to the number of lines and the second number.
[0048] The number obtained by subtracting the second number counted from the number of all the lines in the above step is the number of lines of valid code.
[0049] In this embodiment, the comment lines in the project code lines are marked by using the blank line cleaning rule to obtain the cleaned project code, and the number of all lines in the cleaned project code is combined with the second number of comment line marks to calculate the number of valid code lines. This further provides more detailed data support for the project R&D efficiency evaluation.
[0050] like Figure 5 As shown, it is a flow chart of a method for evaluating project R&D efficiency provided by Embodiment 5 of the present invention. The preset cleaning rules in step S202 may also include a first keyword cleaning rule, and the first keyword cleaning rule includes at least one first keyword representing an unfinished code line. In step S202, the project code is cleaned using the cleaning rules to obtain the cleaned project code. The following steps may also be included: Step S501: for any line of code in the project code, match the line of code with all first keywords respectively.
[0051] The first keyword is a set of keywords used to represent unfinished code lines, and these keywords usually include comment tags, placeholders, and incomplete syntax.
[0052] Among them, comment tags can refer to TODO, FIXME, HACK, etc., indicating logic that has not been completed in the code and needs to be modified or temporarily processed. Placeholders can refer to symbols "???" and "...", etc., indicating parts of the code that have not yet been implemented. Incomplete syntax can refer to incomplete if statements, missing semicolons, etc.
[0053] The matching process involves reading the project code line by line and matching each line of code with all the first keywords respectively, reading the project code files one by one, and for each line of code, using the regular expression or string matching function of the programming language to match with all the first keywords respectively.
[0054] Step S502: If the line of code matches any first keyword, the line of code is determined to be an unfinished code line.
[0055] If a line of code matches any of the first keywords, the line of code is determined to be an unfinished line of code. Specific identification and recording methods include recording unfinished lines, generating reports, and marking code lines. For example, the code lines that match the first keyword are recorded in a list for subsequent processing, and a report containing unfinished code lines is generated for developers and managers to review and process. In a code editor or version control system, unfinished code lines are marked to remind developers to process them.
[0056] Step S503, traverse all lines of code to obtain all unfinished lines of code, remove all unfinished lines of code from the project code, and obtain a cleaned project code.
[0057] Among them, it is necessary to traverse all lines of code in the project, identify unfinished lines of code, and remove these lines to obtain the cleaned project code. The specific operation can be to define the first keyword, then read the project code, then identify the unfinished lines of code, then remove the unfinished lines of code, and finally save the result. For example, list all keywords that identify unfinished lines of code, traverse all code files in the project, read the content line by line, use regular expressions or string matching technology to match the line code with the first keyword, retain the lines that do not match the first keyword, form the cleaned code, and write the cleaned project code back to the file or generate a new file.
[0058] In this embodiment, the project code is cleaned by the first keyword cleaning rule, any line of code in the project code is matched with the first keyword, the unfinished code lines are counted according to the matched first keyword, and the unfinished code lines are removed from the project code to obtain the cleaned project code. This provides a clearer code baseline, makes the project evaluation data more representative, and provides a clearer and more accurate basis for the evaluation of R&D efficiency.
[0059] like Figure 6 As shown, it is a flow chart of a method for evaluating project R&D efficiency provided by Embodiment 6 of the present invention. The preset cleaning rule in step S202 may also include a second keyword cleaning rule, and the second keyword cleaning rule includes at least one second keyword representing an unsafe code line. Using the cleaning rule in step S202 to clean the project code and obtain the cleaned project code may include the following steps: Step S601: for any line of code in the project code, match the line of code with all second keywords respectively.
[0060] The second keyword is used to identify potentially unsafe or problematic lines of code, for example, lines of code that may cause security vulnerabilities, logical errors, or performance issues. By defining these keywords and matching each line of code, these unsafe codes can be removed or marked from the project. Depending on the specific situation of the project, a set of keywords representing unsafe code can be defined. Examples include but are not limited to Unsafe, deprecated.
[0061] Among them, Unsafe is often used to indicate unsafe processing, for example, data processing without input validation, and deprecated can refer to the use of obsolete functions or APIs.
[0062] For each line of code in the project, read the code line by line, traverse all the code lines in the project, and match each line of code with the defined second keyword. If a line of code matches any of the second keywords, you can mark it as unsafe and choose whether to remove it or record it for subsequent review.
[0063] Step S602: If the line of code matches any second keyword, the line of code is determined to be an unsafe code line.
[0064] Once a line of code is determined to be an unsafe line of code, it can be processed according to project requirements. The processing flow can be marking the unsafe line of code, removing the unsafe line of code, and generating a report. For example, you can insert comments in the code or record it through logs, directly delete the unsafe line of code from the code file, and output a list of all unsafe lines of code to the report for further analysis and processing by developers.
[0065] Step S603, traverse all lines of code to obtain all unsafe code lines, remove all unsafe code lines from the project code, and obtain a cleaned project code.
[0066] The function traverses all files in the specified directory, checks each file line by line, identifies unsafe code lines and removes them, and then saves the cleaned code back to the original file. For example, write clean_project_code(project_directory) to identify and remove unsafe code lines.
[0067] In this embodiment, the project code is cleaned by the second keyword cleaning rule, and any line of code in the project code is matched. If the line of code matches any second keyword, the line of code is determined to be unsafe code, all unsafe codes are obtained, and the unsafe code lines are removed to obtain the cleaned project code. This reduces the time required for troubleshooting and repairing in the later stage of the project, thereby improving R&D efficiency and making the evaluation of project R&D efficiency more accurate.
[0068] like Figure 7 As shown, it is a flow chart of a method for evaluating project development efficiency provided by Embodiment 7 of the present invention. The project development record in step S204 may also include development time, team size factor, and development language factor. In step S204, the development efficiency of the project to be evaluated is determined according to the project development record and the number of valid lines of code, which may include the following steps: Step S701, multiply the project development time, the team size factor, and the development language factor to obtain the project development record.
[0069] The project development duration refers to the time it takes from the start to the end of the project, usually in hours, days, months or years. This time includes the entire development cycle from demand analysis, design, coding, testing to final delivery. For example, if a project takes 6 months from start to finish, then the development duration is 6 months.
[0070] The team size factor is used to quantify the impact of the size of the team on the project R&D efficiency. Generally, the larger the team size, the higher the communication cost and management complexity, which may affect the overall R&D efficiency. It can be directly quantified based on the number of team members. For example, the size factor of a small team (such as 1-5 people) is 1.0, the size factor of a medium team (such as 6-10 people) is 1.2, and the size factor of a large team (such as more than 11 people) is 1.5. For example, the project team has 8 people, and according to the definition of the size factor, it can be set to 1.2.
[0071] The development language factor is used to quantify the impact of different programming languages on R&D efficiency. The complexity of different programming languages, the support of development tools, and the developer's familiarity with the language will affect development efficiency. Common language factors include Python, JavaScript / TypeScript, Java, C++, and Assembly.
[0072] Among them, Python is used as a relative benchmark. Because of its high development efficiency, Python's language factor is set to 1.0, JavaScript / TypeScript's language factor is set to 1.1, Java's language factor is set to 1.2, C++ language is set to 1.3 due to its complexity and high debugging difficulty, Assembly development is difficult, and its language factor is set to 1.5. For example, if the project is mainly developed in Java, then the development language factor is 1.2.
[0073] By multiplying the three values of development time, team size factor and development language factor, a comprehensive project development record can be obtained. This project development record can be used as a quantitative indicator to evaluate the efficiency of project development. For example, assuming a project has the following parameters, development time of 6 months, team size of 8 people (team size factor is 1.2), development language Java (development language factor is 1.2), the project development record is calculated as: project development record = 6 months × 1.2 (team size factor) × 1.2 (development language factor) = 8.64, 8.64 is the comprehensive development record of the project, which reflects the effective development time of the project considering the team size and development language factors.
[0074] Step S702, compare the number of valid code lines with the project development record to obtain a ratio result, and determine the ratio result as the development efficiency of the project to be evaluated.
[0075] The ratio result is obtained by dividing the number of effective code lines of the project by the project R&D records. This ratio result can be understood as the number of code lines corresponding to each unit of project R&D records, reflecting the R&D output efficiency of the project. For example, a project has the following parameters, the number of effective code lines is 10,000 lines, and the project R&D records are 8.64. The ratio result is 1,157.41. The ratio result indicates that each unit of R&D records corresponds to approximately 1,157 lines of effective code, which is the R&D efficiency of the project to be evaluated.
[0076] In this embodiment, the product obtained by multiplying the development time, the team size factor and the development language factor is the project development record, and then the number of valid code lines is compared with the project development record to obtain the ratio result, which is the project development efficiency. In this way, the project development efficiency is evaluated in a quantitative way, so as to more accurately evaluate the project development efficiency.
[0077] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0078] like Figure 8 As shown, it is a schematic diagram of a project R&D efficiency evaluation device provided in the eighth embodiment of the present invention. The whole-house appliance simulation device corresponds one-to-one to the project R&D efficiency evaluation method in the above embodiment. The project R&D efficiency evaluation device includes a project code acquisition module 81, a cleaning module 82, a calculation module 83 and an evaluation module 84. The functional modules are described in detail as follows: The project code acquisition module 81 is used to acquire the project information of the project to be evaluated, and acquire the project code corresponding to the project to be evaluated from the code repository according to the project information; A cleaning module 82 is used to obtain a preset cleaning rule, and use the cleaning rule to clean the project code to obtain a cleaned project code; A calculation module 83 is used to calculate the number of valid lines of the cleaned project code to obtain the corresponding number of valid code lines; The evaluation module 84 is used to obtain the project development record from the project information, and determine the development efficiency of the project to be evaluated based on the project development record and the number of valid code lines.
[0079] Optionally, the cleaning module 82 includes: The blank line marking unit is used to use the blank line cleaning rule to mark the blank line positions in the project code, and the project code after the blank line marking is the cleaned project code.
[0080] Optionally, the calculation module 83 includes: A first quantity acquisition unit, used for acquiring a first quantity of all lines and blank line marks in the cleaned project code; The first valid code line number calculation unit is used to calculate the valid code line number according to the line number and the first quantity.
[0081] Optionally, the cleaning module 82 includes: The comment line cleaning unit is used to use the comment line cleaning rules to mark the comment line positions in the project code, and the project code after the comment line marking is the cleaned project code.
[0082] Optionally, the calculation module 83 includes: A second quantity acquisition unit is used to acquire a second quantity of all lines and comment line marks in the cleaned project code; The second valid code line number calculation unit calculates the valid code line number according to the line number and the second quantity.
[0083] Optionally, the cleaning module 82 includes: A first keyword matching unit is used to match any line of code in the project code with all first keywords respectively; an unfinished code line determination unit, configured to determine that the line of code is an unfinished code line if the line of code matches any first keyword; The unfinished code line elimination unit is used to traverse all lines of code to obtain all unfinished code lines, and eliminate all unfinished code lines from the project code to obtain the cleaned project code.
[0084] Optionally, the cleaning module 82 includes: A second keyword matching unit is used to match any line of code in the project code with all second keywords respectively; an unsafe code line determination unit, configured to determine that a line of code is an unsafe code line if the line of code matches any second keyword; The unsafe code line elimination unit traverses all lines of code to obtain all unsafe code lines, and eliminates all unsafe code lines from the project code to obtain the cleaned project code.
[0085] Optionally, the evaluation module 84 includes: The project development record calculation unit is used to multiply the project development time, team size factor and development language factor to obtain the project development record; The R&D efficiency calculation unit is used to compare the number of effective code lines with the project R&D records to obtain a ratio result, which is the R&D efficiency of the project to be evaluated.
[0086] Optionally, the evaluation device for the R&D efficiency of the project also includes: The framework building module is used to use the cleaning rules to clean the project code and build a cleaning framework based on the scrapy tool in the Python language before obtaining the cleaned project code; The module for creating files to be written is used to create files based on the scrapy tool to obtain the files to be written; The script writing module is used to write the script to be run of the cleaning rules according to the file to be written, so as to obtain the cleaning framework.
[0087] For the specific definition of the project R&D efficiency evaluation device, please refer to the definition of the project R&D efficiency evaluation method above, which will not be repeated here. Each module in the above-mentioned project R&D efficiency evaluation device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0088] like Fig. 9 As shown, it is a schematic diagram of the structure of a computer device provided in Embodiment 9 of the present invention. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for evaluating project R&D efficiency is implemented.
[0089] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for evaluating the project R&D efficiency in the above embodiment is implemented, for example Figures 2 to 7 Alternatively, when the processor executes the computer program, the functions of each module / unit in the embodiment of the project R&D efficiency evaluation device are realized, for example Figure 8The functions of the cleaning module 82 shown are not described here in detail to avoid repetition.
[0090] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for evaluating the project R&D efficiency in the above embodiment is implemented, such as Figures 2 to 7 Alternatively, when the computer program is executed by a processor, the functions of each module / unit in the embodiment of the device for evaluating project R&D efficiency are realized, for example Figure 8 The functions of the evaluation module 84 are not described here in detail to avoid repetition. The computer-readable storage medium may be non-volatile or volatile.
[0091] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0092] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0093] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A method for evaluating project R&D efficiency, characterized in that: include: Obtain project information of the project to be evaluated, and obtain project code corresponding to the project to be evaluated from a code repository according to the project information; Obtaining a preset cleaning rule, and using the cleaning rule to clean the project code to obtain a cleaned project code; Calculating the number of valid lines of the cleaned project code to obtain the corresponding number of valid code lines; The project development record is obtained from the project information, and the development efficiency of the project to be evaluated is determined according to the project development record and the number of valid code lines.
2. The method for evaluating project R&D efficiency according to claim 1, characterized in that: The preset cleaning rules include blank line cleaning rules; The step of using the cleaning rule to clean the project code to obtain the cleaned project code includes: Using the blank line cleaning rule, the blank line positions in the project code are marked as blank lines, and the project code after the blank line marking is the cleaned project code; The calculating the number of valid lines of the cleaned project code to obtain the corresponding number of valid code lines includes: Obtaining the first number of all lines and blank line marks in the cleaned project code; The number of valid code lines is calculated based on the number of lines and the first quantity.
3. The method for evaluating project R&D efficiency according to claim 1, characterized in that: The preset cleaning rules include comment line cleaning rules; The step of using the cleaning rule to clean the project code to obtain the cleaned project code includes: Using the comment line cleaning rule, marking the comment line position in the project code, and obtaining the project code after the comment line marking as the cleaned project code; The calculating the effective number of lines of the cleaned project code to obtain the corresponding effective number of lines code includes: Obtaining the second number of all lines and comment line marks in the cleaned project code; The number of valid code lines is calculated based on the number of lines and the second quantity.
4. The method for evaluating project R&D efficiency according to claim 1, characterized in that: The preset cleaning rule includes a first keyword cleaning rule, wherein the first keyword cleaning rule includes at least one first keyword representing an unfinished code line; The step of using the cleaning rule to clean the project code to obtain the cleaned project code includes: For any line of code in the project code, matching the line of code with all first keywords respectively; If the line of code matches any first keyword, determining that the line of code is an unfinished code line; All lines of code are traversed to obtain all unfinished lines of code, and all unfinished lines of code are removed from the project code to obtain a cleaned project code.
5. The method for evaluating project R&D efficiency according to claim 1, characterized in that: The preset cleaning rule includes a second keyword cleaning rule, and the second keyword cleaning rule includes at least one second keyword representing an unsafe code line; The step of using the cleaning rule to clean the project code to obtain the cleaned project code includes: For any line of code in the project code, matching the line of code with all second keywords respectively; If the line of code matches any second keyword, determining that the line of code is an unsafe code line; Traverse all lines of code to obtain all unsafe lines of code, and remove all unsafe lines of code from the project code to obtain a cleaned project code.
6. The method for evaluating project R&D efficiency according to claim 1, characterized in that: The project development records include development time, team size factor, and development language factor; Determining the R&D efficiency of the project to be evaluated according to the project R&D record and the number of valid code lines includes: Multiply the project development time, the team size factor, and the development language factor to obtain a project development record; The number of valid code lines is compared with the project R&D record to obtain a ratio result, and the ratio result is determined as the R&D efficiency of the project to be evaluated.
7. The method for evaluating project R&D efficiency according to any one of claims 1 to 6, characterized in that: Before the step of using the cleaning rule to clean the project code to obtain the cleaned project code, the method further includes: Create files based on the scrapy tool in Python language to get the files to be written; According to the file to be written, write the script to be run of the cleaning rule to obtain a cleaning framework; The step of using the cleaning rule to clean the project code to obtain the cleaned project code includes: The project code is cleaned according to the cleaning framework to obtain a cleaned project code.
8. A device for evaluating project R&D efficiency, characterized in that: include: A project code acquisition module is used to acquire project information of the project to be evaluated, and acquire the project code corresponding to the project to be evaluated from the code repository according to the project information; A cleaning module, used to obtain a preset cleaning rule, and use the cleaning rule to clean the project code to obtain a cleaned project code; A calculation module, used to calculate the number of valid lines of the cleaned project code to obtain the corresponding number of valid code lines; The evaluation module is used to obtain the project development record from the project information, and determine the development efficiency of the project to be evaluated according to the project development record and the number of valid code lines.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for evaluating the project R&D efficiency as described in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for evaluating the project R&D efficiency as claimed in any one of claims 1 to 7 is implemented.