Information processing method and device, electronic device and computer readable storage medium
By obtaining and analyzing the version information of the software version, determining the change objective function of the target application, and calculating the scope of activity of the submitter, the problem of lack of objective evaluation basis in the existing technology is solved, the accurate evaluation of the version submitter is achieved, and the software development and management is promoted.
Patent Information
- Application Number
- CN202210304607.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-21
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2042-03-21
AI Technical Summary
The lack of objective and effective basis in the prior art evaluates the software version submissioner, which leads to inaccurate evaluation and affects the development and management of the software.
By obtaining the version information of the current code version and adjacent historical code version, determine the objective function that has changed in the target application, and calculate the total activity range of the submitter based on the configuration information of the objective function.
It provides a more objective and accurate basis for the evaluation of version submitters, improves the automation and convenience of evaluation, solves the problem of lack of objective basis, and indirectly helps the development and improvement of software.
Smart Images

Figure CN114840206B_ABST
Abstract
Description
[Technical field]
[0001] The present application relates to the field of software development technology, and in particular to an information processing method and device, an electronic device, and a computer-readable storage medium. [Background technology]
[0002] At present, in the process of software development and maintenance, it is often necessary to update the software version to improve the software. For the same software, different development teams or personnel may update the software as version submitters. Therefore, in the subsequent evaluation of software development and improvement, it is often necessary to evaluate and analyze different submitters in order to clarify the degree of influence of different submitters on software development and improvement.
[0003] However, in related technologies, this goal is often achieved through manual evaluation. Due to the high precision of software development and improvement work, manual evaluation often lacks objectivity, which results in inaccurate evaluation and analysis of different submitters, affecting the evaluation and management of the software itself.
[0004] Therefore, how to obtain more objective and effective information about version submitters has become a technical problem that needs to be solved urgently. [Summary of the invention]
[0005] The embodiments of the present application provide an information processing method and device, an electronic device, and a computer-readable storage medium, which aim to solve the technical problem in the related art that there is a lack of objective and effective basis for evaluating version submitters.
[0006] In a first aspect, an embodiment of the present application provides an information processing method, including: if a current code version of a target application has valid update content relative to an adjacent historical code version of the current code version, obtaining version information of the current code version and version information of the adjacent historical code version; based on the version information of the current code version and the version information of the adjacent historical code version, determining a target function that has changed in the target application when changing from the adjacent historical code version to the current code version; based on the configuration information of the target function, determining the total activity scope of the submitter of the current code version.
[0007] In the above embodiment of the present application, optionally, the determining, based on the version information of the current code version and the version information of the adjacent historical code version, the target function that has changed in the target application when the adjacent historical code version is changed to the current code version includes: based on the version information of the current code version and the version information of the adjacent historical code version, obtaining the target file in the current code version that has changed relative to the adjacent historical code version; if the code format of the target file is a recognizable code format, performing a syntax tree analysis on the target file, and determining the function in the analysis result as the target function; if the code format of the target file is an unrecognizable code format, determining the target file as the target function.
[0008] In the above embodiment of the present application, optionally, determining the total activity range of the submitter of the current code version based on the configuration information of the objective function includes: calculating the new activity range and the corresponding attenuated activity range corresponding to the objective function of the current code version based on the configuration information of the objective function; determining the total activity range of the submitter of the current code version based on the total activity range of the submitters of the adjacent historical code versions, the new activity range and the attenuated activity range.
[0009] In the above embodiment of the present application, optionally, calculating the newly added activity range corresponding to the objective function of the current code version includes: if the current code version adds the objective function relative to the adjacent historical code version, setting the total activity range of the objective function in the current code version to the newly added activity range corresponding to the objective function of the current code version; if the current code version modifies the objective function relative to the adjacent historical code version, determining the newly added activity range corresponding to the objective function of the current code version based on the total activity range of the objective function in the current code version and the total activity range of the objective function in the adjacent historical code version; if the current code version deletes the objective function relative to the adjacent historical code version, setting the total activity range of the objective function in the adjacent historical code version to the newly added activity range corresponding to the objective function of the current code version.
[0010] In the above embodiment of the present application, optionally, the method for obtaining the total activity range of the target function in the current code version includes: determining the total activity range of the target function in the current code version based on the configuration coefficient corresponding to the file path where the source code of the target function is located under the current code version, the configuration coefficient corresponding to the target function under the current code version, the cyclomatic complexity of the target function, the first cyclomatic complexity configuration coefficient of the target function, the second cyclomatic complexity configuration coefficient of the target function, the change value of the number of lines after the target function is changed from the adjacent historical code version of the current code version to the current code version, the first configuration coefficient of the change value of the number of lines, and the second configuration coefficient of the change value of the number of lines.
[0011] In the above embodiment of the present application, optionally, calculating the decay activity range corresponding to the objective function of the current code version includes: determining the time difference between the submission time of the current code version and the last activity time of the submitter of the current code version; if the time difference is less than a specified threshold, determining the decay activity range corresponding to the objective function of the current code version based on a predetermined time decay coefficient corresponding to the file path where the source code of the objective function in the current code version is located; if the time difference is greater than or equal to the specified threshold, then among all the time differences corresponding to the current code version and all adjacent historical code versions before the current code version, if only the time difference corresponding to the current code version is greater than the specified threshold, setting the total activity range of the objective function in the current code version to the decay activity range corresponding to the objective function of the current code version; otherwise, setting the decay activity range corresponding to the objective function of the current code version to zero.
[0012] In the above embodiment of the present application, optionally, it also includes: if the current code version of the target application is submitted for the first time, setting the total activity range of the version submitter of the current code version to zero; if the current code version of the target application is an empty submission or a tag submission relative to the adjacent historical code version of the current code version, setting the total activity range of the target function in the adjacent historical code version to the total activity range of the version submitter of the current code version; if the current code version of the target application is a branch merge submission relative to the adjacent historical code version of the current code version, determining the total activity range of the version submitter of the current code version based on the total activity range of the target function in the adjacent historical code version and a predetermined correction value.
[0013] In the second aspect, an embodiment of the present application provides an information processing device, including: a version information acquisition unit, used to acquire the version information of the current code version and the version information of the adjacent historical code version if the current code version of the target application has valid update content relative to the adjacent historical code version of the current code version; a target function determination unit, used to determine the target function that changes in the target application when the adjacent historical code version is changed to the current code version based on the version information of the current code version and the version information of the adjacent historical code version; an activity range determination unit, used to determine the total activity range of the submitter of the current code version based on the configuration information of the target function.
[0014] In the above embodiment of the present application, optionally, the target function determination unit is used to: based on the version information of the current code version and the version information of the adjacent historical code version, obtain the target file in the current code version that has been changed relative to the adjacent historical code version; if the code format of the target file is a recognizable code format, perform syntax tree analysis on the target file, and determine the function in the analysis result as the target function; if the code format of the target file is an unrecognizable code format, determine the target file as the target function.
[0015] In the above embodiment of the present application, optionally, the activity range determination unit is used to: calculate the newly added activity range and the corresponding attenuated activity range corresponding to the objective function of the current code version based on the configuration information of the objective function; determine the total activity range of the submitter of the current code version based on the total activity range of the submitter of the adjacent historical code version, the newly added activity range and the attenuated activity range.
[0016] In the above embodiment of the present application, optionally, the activity range determination unit is used to: when calculating the newly added activity range corresponding to the objective function of the current code version, if the current code version newly adds the objective function relative to the adjacent historical code version, set the total activity range of the objective function in the current code version to the newly added activity range corresponding to the objective function of the current code version; if the current code version modifies the objective function relative to the adjacent historical code version, determine the newly added activity range corresponding to the objective function of the current code version based on the total activity range of the objective function in the current code version and the total activity range of the objective function in the adjacent historical code version; if the current code version deletes the objective function relative to the adjacent historical code version, set the total activity range of the objective function in the adjacent historical code version to the newly added activity range corresponding to the objective function of the current code version.
[0017] In the above embodiment of the present application, optionally, the activity range determination unit is used to: when obtaining the total activity range of the target function in the current code version, determine the total activity range of the target function in the current code version based on the configuration coefficient corresponding to the file path where the source code of the target function is located under the current code version, the configuration coefficient corresponding to the target function under the current code version, the cyclomatic complexity of the target function, the first cyclomatic complexity configuration coefficient of the target function, the second cyclomatic complexity configuration coefficient of the target function, the change value of the number of lines after the target function is changed from the adjacent historical code version of the current code version to the current code version, the first configuration coefficient of the change value of the number of lines, and the second configuration coefficient of the change value of the number of lines.
[0018] In the above embodiment of the present application, optionally, the activity range determination unit is used to: when calculating the attenuation activity range corresponding to the objective function of the current code version, determine the time difference between the submission time of the current code version and the last activity time of the submitter of the current code version; if the time difference is less than a specified threshold, determine the attenuation activity range corresponding to the objective function of the current code version based on a predetermined time attenuation coefficient corresponding to the file path where the source code of the objective function in the current code version is located; if the time difference is greater than or equal to the specified threshold, then among all the time differences corresponding to the current code version and all adjacent historical code versions before the current code version, if only the time difference corresponding to the current code version is greater than the specified threshold, set the total activity range of the objective function in the current code version to the attenuation activity range corresponding to the objective function of the current code version; otherwise, set the attenuation activity range corresponding to the objective function of the current code version to zero.
[0019] In the above embodiment of the present application, optionally, it also includes: a first setting unit, which is used to set the total activity range of the version submitter of the current code version to zero if the current code version of the target application is submitted for the first time; a second setting unit, which is used to set the total activity range of the target function in the adjacent historical code version to the total activity range of the version submitter of the current code version if the current code version of the target application is an empty submission or a tag submission relative to the adjacent historical code version of the current code version; and a third setting unit, which is used to determine the total activity range of the version submitter of the current code version based on the total activity range of the target function in the adjacent historical code version and a predetermined correction value if the current code version of the target application is a branch merge submission relative to the adjacent historical code version of the current code version.
[0020] In a third aspect, an embodiment of the present application provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are configured to execute any of the methods described in the first aspect above.
[0021] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the method flow described in any one of the first aspects above.
[0022] The above technical solution, in order to solve the technical problem in related technologies that there is a lack of objective and effective basis for evaluating version submitters, can accurately and quickly calculate the total activity scope of version submitters as the basis for evaluating version submitters, thereby improving the automation and convenience of obtaining the evaluation basis for version submitters, and also increasing the accuracy and reliability of the obtained evaluation basis, thus solving the technical problem of lack of objective and effective basis for evaluating version submitters, and indirectly contributing to the development and improvement of software.
Brief Description of the Drawings
[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0024] Figure 1 A flowchart of an information processing method according to an embodiment of the present application is shown;
[0025] Figure 2 A block diagram of an information processing device according to an embodiment of the present application is shown;
[0026] Figure 3 A block diagram of an electronic device according to an embodiment of the present application is shown. [Specific implementation method]
[0027] In order to better understand the technical solution of the present application, the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0028] It should be clear that the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0029] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0030] Figure 1 A flow chart of an information processing method according to an embodiment of the present application is shown.
[0031] like Figure 1 As shown, the process of the information processing method according to an embodiment of the present application includes:
[0032] Step 102: If the current code version of the target application has valid update content relative to the adjacent historical code version of the current code version, obtain version information of the current code version and version information of the adjacent historical code version.
[0033] The target application refers to the software or system whose version submitter is to be understood. The current code version of the target application can be the latest version of the target application or any adjacent historical code version of the target application. The submission with valid updated content refers to the submission of the version after the content of the target application is updated, which is the most common submission type.
[0034] The adjacent historical code version is a previous version of the target application that is submitted before the current code version and is adjacent to the current code version.
[0035] In order to adapt to actual application scenarios, developers often update target applications such as software or systems. The original target application can be called the adjacent historical code version, and the updated target application becomes the current code version. For the target application, the difference between the current code version and the adjacent historical code version is the change content between the current code version and the adjacent historical code version. On this basis, the changes between versions can reflect the functional changes of the target application itself to a certain extent, and the functional changes of the target application are the necessary part of the functional analysis of the target application, which can effectively reflect the improvements of the target application, that is, the work content or scope of activities of the version submitter.
[0036] The version information of the current code version includes: the version identifier of the current code version, the version submitter identifier, the version submission date, the version submission time, the submission type, the version identifier of the adjacent historical code version corresponding to the current code version, the modified content set of the current code version relative to the adjacent historical code version, and one or more of the file rename information set. The version information of the adjacent historical code version can be obtained in the same way and will not be repeated here.
[0037] In one possible design, step 102 specifically includes: obtaining a version information configuration template from a code version management system of the target application; generating a command sequence for obtaining the version information based on the version information configuration template; and executing the command sequence to obtain version information of each version of the target application.
[0038] The code version management system of the target application is used to manage each version update of the target application and store the relevant data of the version update. In order to ensure that complete version information with a unified data structure is obtained, a version information configuration template applicable to the target application can be set in the code version management system of the target application. Among them, the version information configuration template defines the various types of version information required for functional analysis of the target application, so as to fully obtain the version information corresponding to various types of version information. At the same time, the version information configuration template can also define the data structure of various version information, so that after capturing the version information corresponding to various types of version information, data with a unified structure is formed, providing a unified and reasonable basis for the subsequent application of version information.
[0039] Next, based on the data structure defined by the version information configuration template, a command sequence for obtaining the version information can be generated. The command sequence matches the data structure defined by the version information configuration template, and the commands in the command sequence are executed in sequence to obtain the version information corresponding to various version information types of the target application in sequence according to the defined data structure.
[0040] Among them, in a possible design, before executing the command sequence, it also includes: obtaining a valid access path of the target application for access when executing the command sequence.
[0041] Specifically, the effective access path of the target application can be a local path or an HTTP(S) access path of a remote warehouse. By accessing the effective access path when executing the command sequence, the operations required by the commands in the command sequence to be performed on the target application can be effectively executed.
[0042] In one possible design, the first command in the command sequence can be set as a valid access path identification command, and a Uniform Resource Identifier (URI) can be set for the version information configuration template to describe the valid access path of the target application. In this way, when the first command identifies the uniform resource identifier corresponding to the target application, it can call the version information configuration template corresponding to the uniform resource identifier to obtain and configure the unified version information of the data structure.
[0043] In another possible design, step 102 specifically includes: obtaining local version data or remote version data of each version of the target application; and parsing the local version data or the remote version data of each version to obtain version information of each version.
[0044] The version information of each version of the target application is often stored in the target application's version data, which may be stored locally or in any remote device, such as the target application's code version management system (SVN). Therefore, the local version data or remote version data of each version of the target application can be obtained, and then the corresponding version information can be obtained based on the local version data or remote version data.
[0045] In a possible design, it also includes: deleting specified files and / or specified directories in the modified content set.
[0046] In the version changes, some invalid content that is automatically generated or automatically synchronized is often generated in the specified files and / or specified directories. These contents have no effect on the analysis of the target application. Therefore, in order to reduce data redundancy, the specified files and / or specified directories can be directly deleted from the modified content set, and the modifications involved in these specified files and / or specified directories will not be passed back.
[0047] In the above, a method suitable for the actual target application analysis needs can be selected to obtain the version information of the current code version and adjacent historical code versions of the target application, so as to use them in subsequent target application analysis steps, laying an effective foundation for efficient and reliable analysis of the target application.
[0048] Step 104 : Based on the version information of the current code version and the version information of the adjacent historical code version, determine the target function that changes in the target application when the adjacent historical code version is changed to the current code version.
[0049] The target function that changes in the target application when changing from the adjacent historical code version to the current code version reflects the difference between the adjacent historical code version and the current code version, and also reflects the changes made by the version submitter of the current code version, that is, reflects the total activity scope of the version submitter of the current code version.
[0050] Specifically, based on the version information of the current code version and the version information of the adjacent historical code version, the target file in the current code version that has been changed relative to the adjacent historical code version can be obtained; if the code format of the target file is a recognizable code format, a syntax tree analysis is performed on the target file, and the function in the analysis result is determined as the target function that has been changed in the target application when the change is from the adjacent historical code version to the current code version; if the code format of the target file is an unrecognizable code format, the target file is determined as the target function.
[0051] The target function that changes when the code version in the target application is updated must be in the target file involved in the code version update. Therefore, the target file in which the current code version has changed relative to the adjacent historical code version can be first obtained as the object for searching the target function.
[0052] Next, the code format of the target file may be identified in a predetermined manner, including but not limited to using the file suffix of the target file for identification, using keywords in the target file for identification, or calling open source tools such as libmagic for identification.
[0053] If the code format of the target file is a recognizable code format, that is, if the code format of the target file can be identified by a predetermined method, it means that the structure of the target file is a type existing in a known structure, and the target file has a target function of a known type. At this time, the target file can be subjected to syntax tree analysis, and the function in the analysis result is determined as the target function.
[0054] The syntax tree is a tree representation of the abstract syntax structure of the source code. Each node on the tree represents a structure in the source code. This structure can be obtained through syntax tree analysis, and the target function involved in each node or joint can be obtained from it.
[0055] On the contrary, if the code format of the target file is an unrecognizable code format, that is, the code format of the target file cannot be identified by a predetermined method, it means that the structure of the target file is not a type existing in a known structure, and the type of target function involved in the target file cannot be clearly determined. At this time, the target file can be directly determined as the target function to fully grasp the content involved in the target function and avoid missing information that has an effective impact on the analysis of the scope of activities of the version submitter.
[0056] The specific process of syntax tree analysis includes: using the lexical parser and the syntax parser to process the target file and obtain a syntax tree with a single-root tree structure. The syntax tree can be divided into classes, named methods, and statements. The smallest unit is a statement. A statement belongs to a named method, which is the target function. It can belong directly to the root or to a class. In addition, if statements that do not belong to a function are ignored, the named method can be located in a line number range.
[0057] Specifically, for target files of types such as C and CPP, their syntax trees can be obtained through open source tools such as LLVM and GCC; for target files of types such as python, their syntax trees can be obtained through open source tools such as CPython; for target files of types such as golang, their syntax trees can be obtained through the go open source compiler; for target files of types such as java, their syntax trees can be obtained through open source tools such as javac.
[0058] Step 106: Determine the total activity scope of the submitter of the current code version based on the configuration information of the target function.
[0059] The total activity scope of a version submitter refers to the internal scope of the target application involved in the modification made to the target application by the version submitter of the current code version when changing the adjacent historical code version to the current code version. Based on this, a target calculation method that meets its actual needs can be set for each of the above submission types to calculate the total activity scope of the version submitter under the submission type. Therefore, compared with the monotonous and unified manual evaluation method of version submitters in the related art, the present technical solution can calculate the total activity scope of the version submitter based on different submission types using a calculation method suitable for the actual submission situation as the basis for evaluating the version submitter, which improves the automation and convenience of obtaining the evaluation basis of the version submitter, and also increases the accuracy and reliability of the obtained evaluation basis, solving the technical problem of lack of objective and effective basis for evaluating version submitters, and thus indirectly contributing to the development and improvement of software.
[0060] The target function reflects the difference between the adjacent historical code versions and the current code version, that is, reflects the total activity range of the version submitter of the current code version. Therefore, the configuration information of the target function can be obtained, and the activity range of the submitter of the current code version can be calculated based on the configuration information of the target function. The configuration information includes: path configuration coefficient, function type configuration coefficient, line change configuration coefficient, cyclomatic complexity and cyclomatic complexity configuration coefficient.
[0061] Specifically, based on the configuration information of the objective function, the newly added activity range and the corresponding attenuated activity range corresponding to the objective function of the current code version may be calculated.
[0062] Next, based on the total activity range of the submitters of the adjacent historical code versions, the newly added activity range and the attenuated activity range, the total activity range of the submitters of the current code version is determined. In one possible design, the sum of the total activity range of the submitters of the adjacent historical code versions and the newly added activity range is calculated; the difference between the sum and the attenuated activity range is used as the activity range of the submitters of the current code version. In other words, the total activity range of the submitters of the adjacent historical code versions plus the newly added activity range of the current code version minus the attenuated activity range of the current code version is used as the activity range of the submitters of the current code version.
[0063] Among them, based on each change type of the objective function, the newly added activity range corresponding to the objective function of the current code version can be calculated in different ways.
[0064] If the current code version is newly added with the target function relative to the adjacent historical code version, the total activity range of the target function in the current code version is set as the newly added activity range corresponding to the target function of the current code version.
[0065] If the current code version modifies the target function relative to the adjacent historical code version, the newly added activity range corresponding to the target function of the current code version is determined based on the total activity range of the target function in the current code version and the total activity range of the target function in the adjacent historical code version. Specifically, the difference between the total activity range of the target function in the current code version and the total activity range of the target function in the adjacent historical code version can be obtained, and the absolute value of the difference is set as the newly added activity range corresponding to the target function of the current code version.
[0066] If the current code version deletes the target function relative to the adjacent historical code version, the total activity range of the target function in the adjacent historical code version is set as a newly added activity range corresponding to the target function of the current code version.
[0067] Among them, the method for obtaining the total activity range of the target function in the current code version includes: determining the total activity range of the target function in the current code version based on the configuration coefficient corresponding to the file path where the source code of the target function is located under the current code version, the configuration coefficient corresponding to the target function under the current code version, the cyclomatic complexity of the target function, the first cyclomatic complexity configuration coefficient of the target function, the second cyclomatic complexity configuration coefficient of the target function, the change value of the number of lines after the target function is changed from the adjacent historical code version of the current code version to the current code version, the first configuration coefficient of the change value of the number of lines, and the second configuration coefficient of the change value of the number of lines.
[0068] Specifically, the formula for calculating the total activity range of the target function in the current code version is:
[0069]
[0070] Among them, S now is the total active range of the target function in the current code version, k 文件路径 is the configuration coefficient corresponding to the file path where the source code of the target function is located in the current code version, k 函数路径 is the configuration coefficient corresponding to the objective function under the current code version, V s is the cyclomatic complexity of the objective function, G1 is the first cyclomatic complexity configuration coefficient of the objective function, G2 is the second cyclomatic complexity configuration coefficient of the objective function, P is the change in the number of lines of the objective function after the objective function is changed from the adjacent historical code version of the current code version to the current code version, X1 is the first configuration coefficient of the change in the number of lines, and X2 is the second configuration coefficient of the change in the number of lines.
[0071] It should be noted that the above-mentioned various configuration coefficients can be pre-configured based on actual needs.
[0072] For example, different configuration coefficients can be set for different file paths. After the file path where the source code of the target function is located in the current code version is determined, the configuration coefficient corresponding to the file path is used as k. 文件路径 .
[0073] For another example, multiple row number change value ranges can be set, and a corresponding first configuration coefficient and a second configuration coefficient can be set for each row number change value range. After determining the row number change value P after the objective function changes from the adjacent historical code version of the current code version to the current code version, determine the actual row number change value range to which P belongs, and add the first configuration coefficient and the second configuration coefficient corresponding to the actual row number change value range as X1 and X2 to the calculation.
[0074] The configuration methods of other configuration coefficients are the same as above and will not be repeated here.
[0075] The attenuation activity range corresponding to the objective function of the current code version may be calculated based on the time difference between the submission time of the current code version and the last activity time of the submitter of the current code version.
[0076] Specifically, the time difference between the submission time of the current code version and the last activity time of the submitter of the current code version is determined.
[0077] Next, if the time difference is less than a specified threshold, based on a predetermined time decay coefficient corresponding to the file path where the source code of the target function in the current code version is located, determine the decay activity range corresponding to the target function of the current code version. Specifically, the logarithm of the total activity range of the target function in the current code version can be determined based on the predetermined time decay coefficient corresponding to the file path where the source code of the target function in the current code version is located, and the logarithm is used as the decay activity range corresponding to the target function of the current code version.
[0078] If the time difference is greater than or equal to the specified threshold, then among all the time differences corresponding to the current code version and all adjacent historical code versions before the current code version, if only the time difference corresponding to the current code version is greater than the specified threshold, the total activity range of the objective function in the current code version is set to the attenuation activity range corresponding to the objective function of the current code version; otherwise, the attenuation activity range corresponding to the objective function of the current code version is set to zero.
[0079] Of course, the total activity range of the submitters of adjacent historical code versions can also be calculated in the above manner through the relevant information of the adjacent historical code versions. Finally, the activity range of the submitters of the current code version can be obtained by adding the total activity range of the submitters of the adjacent historical code versions to the newly added activity range of the current code version and subtracting the decayed activity range of the current code version.
[0080] In this way, the total activity scope of the version submitter can be calculated accurately and quickly, which can be used as the basis for evaluating the version submitter. This improves the automaticity and convenience of obtaining the evaluation basis for the version submitter, and also increases the accuracy and reliability of the obtained evaluation basis, solving the technical problem of lack of objective and effective basis for evaluating the version submitter, and indirectly helps the development and improvement of the software.
[0081] Through this technical solution, the total activity scope of the version submitters of the current code version can be automatically and accurately calculated based on the update content of the target application from the adjacent historical code versions to the current code version, and used as the basis for evaluating the version submitters. This improves the automation and convenience of obtaining the evaluation basis for the version submitters, and also increases the accuracy and reliability of the obtained evaluation basis, solving the technical problem of lack of objective and effective basis for evaluating version submitters, and indirectly helps the development and improvement of software.
[0082] In addition, it should be added that the code version has multiple submission types, such as the first submission, empty submission, tag submission, branch merge submission, and submission with valid updated content. Among them, the code version under each submission type has a different activity range calculation method.
[0083] The first submission means that the current code version is the first version of the target application, that is, there is no adjacent historical code version before the current code version. If the current code version of the target application is submitted for the first time, the total activity range of the version submitter of the current code version is set to zero.
[0084] Empty commits and tag commits often record the current stage of the target application in the form of submitted versions. They do not update the content of the target application. For example, tag commits can use git tags to label the target application with "3.0" to mark the target application as version 3.0. If the current code version of the target application is an empty commit or a tag commit relative to the adjacent historical code version of the current code version, the total activity range of the target function in the adjacent historical code version is set to the total activity range of the version submitter of the current code version.
[0085] A branch merge commit may or may not update the content of the target application, but this branch merge function often belongs to a submitter with higher authority, so it also appears as a separate submission type. If the current code version of the target application is a branch merge commit relative to the adjacent historical code version of the current code version, the total activity range of the version submitter of the current code version is determined based on the total activity range of the target function in the adjacent historical code version and the predetermined correction value. Specifically, the sum of the total activity range of the target function in the adjacent historical code version and the predetermined correction value can be set as the total activity range of the version submitter of the current code version.
[0086] The current code versions of the target application have various submission types. Clarifying the submission type helps you implement a strategy that adapts to actual needs for the unique submission type in subsequent steps.
[0087] At this point, an effective and appropriate calculation method is provided for each submission type of the version. Compared with the monotonous and unified manual evaluation method of version submitters in the related art, this technical solution can calculate the total activity scope of the version submitters based on different submission types using a calculation method suitable for the actual submission situation. This serves as the basis for evaluating the version submitters, thereby improving the automation and convenience of obtaining the evaluation basis for the version submitters, and also increasing the accuracy and reliability of the obtained evaluation basis. This solves the technical problem of lack of objective and effective basis for evaluating version submitters, and indirectly helps the development and improvement of software.
[0088] Figure 2 A block diagram of an information processing device according to an embodiment of the present application is shown.
[0089] like Figure 2As shown, according to an embodiment of the present application, an information processing device 200 includes: a version information acquisition unit 202, which is used to acquire the version information of the current code version and the version information of the adjacent historical code version if the current code version of the target application has valid update content relative to the adjacent historical code version of the current code version; a target function determination unit 204, which is used to determine the target function that changes in the target application when the adjacent historical code version is changed to the current code version based on the version information of the current code version and the version information of the adjacent historical code version; an activity range determination unit 206, which is used to determine the total activity range of the submitter of the current code version based on the configuration information of the target function.
[0090] In the above embodiment of the present application, optionally, the target function determination unit 204 is used to: based on the version information of the current code version and the version information of the adjacent historical code version, obtain the target file in the current code version that has been changed relative to the adjacent historical code version; if the code format of the target file is a recognizable code format, perform syntax tree analysis on the target file, and determine the function in the analysis result as the target function; if the code format of the target file is an unrecognizable code format, determine the target file as the target function.
[0091] In the above embodiment of the present application, optionally, the activity range determination unit 206 is used to: calculate the newly added activity range and the corresponding attenuated activity range corresponding to the objective function of the current code version based on the configuration information of the objective function; determine the total activity range of the submitter of the current code version based on the total activity range of the submitter of the adjacent historical code version, the newly added activity range and the attenuated activity range.
[0092] In the above embodiment of the present application, optionally, the activity range determination unit 206 is used to: when calculating the newly added activity range corresponding to the objective function of the current code version, if the current code version adds the objective function relative to the adjacent historical code version, set the total activity range of the objective function in the current code version to the newly added activity range corresponding to the objective function of the current code version; if the current code version modifies the objective function relative to the adjacent historical code version, determine the newly added activity range corresponding to the objective function of the current code version based on the total activity range of the objective function in the current code version and the total activity range of the objective function in the adjacent historical code version; if the current code version deletes the objective function relative to the adjacent historical code version, set the total activity range of the objective function in the adjacent historical code version to the newly added activity range corresponding to the objective function of the current code version.
[0093] In the above embodiment of the present application, optionally, the activity range determination unit 206 is used to: when obtaining the total activity range of the target function in the current code version, determine the total activity range of the target function in the current code version based on the configuration coefficient corresponding to the file path where the source code of the target function is located under the current code version, the configuration coefficient corresponding to the target function under the current code version, the cyclomatic complexity of the target function, the first cyclomatic complexity configuration coefficient of the target function, the second cyclomatic complexity configuration coefficient of the target function, the change value of the number of lines after the target function is changed from the adjacent historical code version of the current code version to the current code version, the first configuration coefficient of the change value of the number of lines, and the second configuration coefficient of the change value of the number of lines.
[0094] In the above embodiment of the present application, optionally, the activity range determination unit 206 is used to: when calculating the attenuation activity range corresponding to the objective function of the current code version, determine the time difference between the submission time of the current code version and the last activity time of the submitter of the current code version; if the time difference is less than a specified threshold, determine the attenuation activity range corresponding to the objective function of the current code version based on a predetermined time attenuation coefficient corresponding to the file path where the source code of the objective function in the current code version is located; if the time difference is greater than or equal to the specified threshold, then among all the time differences corresponding to the current code version and all adjacent historical code versions before the current code version, if only the time difference corresponding to the current code version is greater than the specified threshold, set the total activity range of the objective function in the current code version to the attenuation activity range corresponding to the objective function of the current code version; otherwise, set the attenuation activity range corresponding to the objective function of the current code version to zero.
[0095] In the above embodiment of the present application, optionally, it also includes: a first setting unit, which is used to set the total activity range of the version submitter of the current code version to zero if the current code version of the target application is submitted for the first time; a second setting unit, which is used to set the total activity range of the target function in the adjacent historical code version to the total activity range of the version submitter of the current code version if the current code version of the target application is an empty submission or a tag submission relative to the adjacent historical code version of the current code version; and a third setting unit, which is used to determine the total activity range of the version submitter of the current code version based on the total activity range of the target function in the adjacent historical code version and a predetermined correction value if the current code version of the target application is a branch merge submission relative to the adjacent historical code version of the current code version.
[0096] The information processing device 200 uses any of the solutions described in the above embodiments, and therefore has all the above technical effects, which will not be described in detail here.
[0097] Figure 3 A block diagram of an electronic device according to an embodiment of the present application is shown.
[0098] like Figure 3 As shown, an electronic device 300 of an embodiment of the present application includes at least one memory 302; and a processor 304 in communication with the at least one memory 302; wherein the memory stores instructions executable by the at least one processor 304, and the instructions are configured to execute the solution described in any of the above embodiments. Therefore, the electronic device 300 has the same technical effects as any of the above embodiments, which will not be described in detail here.
[0099] The electronic devices of the embodiments of the present application exist in various forms, including but not limited to:
[0100] (1) Mobile communication devices: These devices are characterized by their mobile communication functions and their main purpose is to provide voice and data communications. These terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.
[0101] (2) Ultra-mobile personal computer devices: These devices fall into the category of personal computers, have computing and processing capabilities, and generally also have mobile Internet access features. These terminals include: PDA, MID and UMPC devices, such as iPad.
[0102] (3) Portable entertainment devices: These devices can display and play multimedia content. They include audio and video players (such as iPods), handheld game consoles, e-books, as well as smart toys and portable car navigation devices.
[0103] (4) Server: A device that provides computing services. The server consists of a processor, hard disk, memory, system bus, etc. The server is similar to a general computer architecture, but because it needs to provide highly reliable services, it has higher requirements in terms of processing power, stability, reliability, security, scalability, and manageability.
[0104] (5) Other electronic devices with data interaction functions.
[0105] In addition, an embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the method flow described in any of the above embodiments.
[0106] The above describes in detail the technical solution of the present application in conjunction with the accompanying drawings. Through the technical solution of the present application, the total activity scope of the version submitter can be accurately and quickly calculated as the basis for evaluating the version submitter, which improves the automation and convenience of obtaining the evaluation basis for the version submitter, and also increases the accuracy and reliability of the obtained evaluation basis, solves the technical problem of lack of objective and effective basis for evaluating the version submitter, and indirectly contributes to the development and improvement of the software.
[0107] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0108] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0109] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0110] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (Processor) to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[0111] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. An information processing method, characterized in that: include: If the current code version of the target application has valid update content relative to the adjacent historical code version of the current code version, obtain version information of the current code version and version information of the adjacent historical code version; Determine, based on the version information of the current code version and the version information of the adjacent historical code version, a target function in the target application that is changed when the adjacent historical code version is changed to the current code version; Determining the total activity scope of the submitter of the current code version based on the configuration information of the target function; The determining, based on the configuration information of the target function, the total activity scope of the submitter of the current code version, comprises: Based on the configuration information of the objective function, calculating the newly added activity range and the corresponding attenuated activity range corresponding to the objective function of the current code version; Determine the total activity range of the submitter of the current code version based on the total activity range of the submitters of the adjacent historical code versions, the newly added activity range and the decayed activity range; Calculating the attenuation activity range corresponding to the objective function of the current code version includes: Determine the time difference between the submission time of the current code version and the last activity time of the submitter of the current code version; If the time difference is less than a specified threshold, the decay activity range corresponding to the target function of the current code version is determined based on a predetermined time decay coefficient corresponding to the file path where the source code of the target function in the current code version is located.
2. The information processing method according to claim 1, characterized in that: The determining, based on the version information of the current code version and the version information of the adjacent historical code version, of a target function that changes in the target application when the adjacent historical code version changes to the current code version includes: Based on the version information of the current code version and the version information of the adjacent historical code version, obtaining a target file in the current code version that has been changed relative to the adjacent historical code version; If the code format of the target file is a recognizable code format, performing syntax tree analysis on the target file, and determining a function in the analysis result as the target function; If the code format of the target file is an unrecognizable code format, the target file is determined as the target function.
3. The information processing method according to claim 1, characterized in that: Calculating the newly added activity range corresponding to the objective function of the current code version includes: If the current code version adds the target function relative to the adjacent historical code version, setting the total activity range of the target function in the current code version to the newly added activity range corresponding to the target function of the current code version; If the current code version modifies the target function relative to the adjacent historical code version, determining a newly added activity range corresponding to the target function of the current code version based on the total activity range of the target function in the current code version and the total activity range of the target function in the adjacent historical code version; If the current code version deletes the target function relative to the adjacent historical code version, the total activity range of the target function in the adjacent historical code version is set as a newly added activity range corresponding to the target function of the current code version.
4. The information processing method according to claim 3, characterized in that: Methods for obtaining the total activity range of the target function in the current code version include: Based on the configuration coefficient corresponding to the file path where the source code of the target function is located in the current code version, the configuration coefficient corresponding to the target function in the current code version, the cyclomatic complexity of the target function, the first cyclomatic complexity configuration coefficient of the target function, the second cyclomatic complexity configuration coefficient of the target function, the change in the number of lines of the target function after the target function is changed from the adjacent historical code version of the current code version to the current code version, the first configuration coefficient of the change in the number of lines and the second configuration coefficient of the change in the number of lines, the total activity range of the target function in the current code version is determined.
5. The information processing method according to claim 1, characterized in that: Calculating the attenuation activity range corresponding to the objective function of the current code version also includes: If the time difference is greater than or equal to the specified threshold, then among all the time differences corresponding to the current code version and all adjacent historical code versions before the current code version, If only the time difference corresponding to the current code version is greater than the specified threshold, the total activity range of the objective function in the current code version is set to the attenuation activity range corresponding to the objective function of the current code version, Otherwise, the decay activity range corresponding to the objective function of the current code version is set to zero.
6. The information processing method according to claim 1, characterized in that: Also includes: If the current code version of the target application is submitted for the first time, set the total activity scope of the version submitter of the current code version to zero; If the current code version of the target application is an empty submission or a tag submission relative to the adjacent historical code version of the current code version, the total activity range of the target function in the adjacent historical code version is set to the total activity range of the version submitter of the current code version; If the current code version of the target application is a branch merge submission relative to an adjacent historical code version of the current code version, the total activity scope of the version submitter of the current code version is determined based on the total activity scope of the target function in the adjacent historical code version and a predetermined correction value.
7. An information processing device, characterized in that: include: A version information acquisition unit, configured to acquire version information of the current code version and version information of the adjacent historical code version if the current code version of the target application has valid update content relative to the adjacent historical code version of the current code version; An objective function determination unit, configured to determine, based on the version information of the current code version and the version information of the adjacent historical code version, an objective function that changes in the target application when the adjacent historical code version changes to the current code version; An activity scope determination unit, configured to determine a total activity scope of a submitter of the current code version based on the configuration information of the target function; The activity range determination unit is used to perform the following steps: Based on the configuration information of the objective function, calculate the newly added activity range and the corresponding attenuated activity range corresponding to the objective function of the current code version; based on the total activity range of the submitters of the adjacent historical code versions, the newly added activity range and the attenuated activity range, determine the total activity range of the submitters of the current code version; When calculating the attenuation activity range corresponding to the objective function of the current code version: Determine the time difference between the submission time of the current code version and the last activity time of the submitter of the current code version; if the time difference is less than a specified threshold, determine the decay activity range corresponding to the target function of the current code version based on a predetermined time decay coefficient corresponding to the file path where the source code of the target function in the current code version is located.
8. An electronic device, characterized in that: include: at least one processor; and, a memory communicatively coupled to the at least one processor; The memory stores instructions executable by the at least one processor, wherein the instructions are configured to execute the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: Computer executable instructions are stored, and the computer executable instructions are used to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Function processing method and device and related equipment
CN108845843A
A method and device for counting the number of contributed codes
CN109271321A
Workload assessment method and device, computer equipment and storage medium
CN113077185A