Information processing method and apparatus, electronic device, and computer-readable storage medium
By clustering and adjusting the parameters of the objective function in software version updates, the problem of software analysis consuming a lot of manpower and time was solved, and efficient software function evaluation and improvement were achieved.
Patent Information
- Application Number
- CN202210079841.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-24
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2042-01-24
AI Technical Summary
In existing technologies, analyzing software functions consumes a lot of manpower and time, resulting in low efficiency in software improvement.
By obtaining the target functions that have changed in the version update of the target object, clustering is performed based on function attributes under multiple dimensions to divide them into multiple initial functional modules, and the clustering parameter values are adjusted to reflect the degree of correlation between functional modules.
It automates software function analysis, saves time and manpower costs, provides accurate and reliable evaluation and analysis results, and improves software development and maintenance efficiency.
Smart Images

Figure CN114490291B_ABST
Abstract
Description
[0001] The present application relates to the technical field of computer software, and in particular to an information processing method and device, an electronic device, and a computer readable storage medium.
[0002] At present, software needs to be improved in the process of software development and maintenance. Generally, developers can manually analyze the functions of each part of the software and / or possible defects based on underlying information such as software code. However, this analysis method consumes a large amount of manpower and time cost, resulting in low software improvement efficiency.
[0003] Therefore, how to conveniently and efficiently analyze software functions to improve the efficiency of software improvement has become a technical problem to be solved.
[0004] Embodiments of the present application provide an information processing method and device, an electronic device, and a computer readable storage medium, aiming to solve the technical problem of low software improvement efficiency caused by the process of analyzing software functions consuming a large amount of manpower and time cost in the related art.
[0005] In a first aspect, the embodiments of the present application provide an information processing method, including: obtaining target functions that have been changed in version updates of a target object; clustering all target functions used by multiple versions based on function attributes of each target function in multiple dimensions to obtain multiple initial function modules; selecting a target function module with a clustering parameter value greater than a preset clustering threshold value from the multiple initial function modules; and adjusting the clustering parameter value of each target function module based on a modification association relationship between each two target function modules in all target function modules, wherein for each two target function modules, a difference between the adjusted clustering parameter values of the two target function modules is used to reflect the association degree of the two target function modules.
[0006] In the above embodiments of the present application, optionally, the obtaining of the target functions that have been changed in the version updates of the target object includes: for each version except a first version in multiple versions of the target object, obtaining a target file that has been changed with respect to a previous adjacent version of the version based on version information of the version and version information of the previous adjacent version; if a 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 that has been changed in the target object from the previous adjacent version to the version; and if the code format of the target file is an unrecognizable code format, determining the target file as the target function.
[0007] In the above embodiments of the present application, before the clustering of all the target functions used by the multiple versions based on the function attributes of each target function in multiple dimensions to obtain multiple initial function modules, the method further comprises: obtaining the function attributes of each target function in multiple dimensions, wherein the function attributes of each target function in the multiple dimensions comprise at least two of the following: a relative position parameter of a target file in which a current target function of all the target functions is located and other files in which other target functions other than the current target function are located; a difference between a traversal number from a project root to the target file and a lowest traversal number from a change of the target file to the other files; a file name similarity of the target file and the other files; a file directory similarity of the target file and the other files; a difference between a starting line number of the current target function and a starting line number of the other target functions; and a modification correlation degree of the current target function and the other target functions.
[0008] In the above embodiments of the present application, the manner of obtaining the relative position parameter comprises: if the target file and the other files are the same file, setting the relative position parameter as a first value, otherwise, setting the relative position parameter as a second value, wherein the first value is greater than the second value.
[0009] In the above embodiments of the present application, the manner of obtaining the file name similarity comprises: calculating a first modification distance between a file name of the target file and a file name of the other files based on a preset edit distance algorithm, and setting the first modification distance as the file name similarity; and the manner of obtaining the file directory similarity comprises: calculating a second modification distance between a file directory of the target file and a file directory of the other files based on a preset edit distance algorithm, and setting the second modification distance as the file directory similarity.
[0010] In the above embodiments of the present application, the manner of obtaining the modification correlation degree comprises: obtaining an initial correlation degree of the current target function; polling whether the current target function is changed with each of the other target functions in each version change, wherein each time the current target function is changed with any of the other target functions, the initial correlation degree of the current target function is increased by a third value to obtain the modification correlation degree, otherwise, the initial correlation degree of the current target function is reduced by a fourth value to obtain the modification correlation degree.
[0011] In the above embodiments of the present application, optionally, the adjusting the clustering parameter value of each target function module based on the modification association relationship between each two target function modules in all the target function modules comprises: when the target object changes from each version to a previous adjacent version of the each version, if at least two target function modules in all the target function modules change simultaneously, a fifth numerical value is added to the clustering parameter value of the at least two target function modules, and a sixth numerical value is subtracted from the clustering parameter value of other function modules except the at least two target function modules in all the target function modules.
[0012] In a second aspect, the embodiments of the present application provide an information processing apparatus, comprising: a target function obtaining unit configured to obtain a target function which has changed in version updating of a target object; a function module dividing unit configured to cluster all target functions used in multiple versions based on function attributes of each target function in multiple dimensions to obtain multiple initial function modules; a function module screening unit configured to select a target function module with a clustering parameter value greater than a preset clustering threshold value from the multiple initial function modules; and a clustering parameter value adjusting unit configured to adjust the clustering parameter value of each target function module based on a modification association relationship between each two target function modules in all the target function modules, wherein for each two target function modules, a difference between the adjusted clustering parameter values of the two target function modules is used to reflect an association degree of the two target function modules.
[0013] In the above embodiments of the present application, optionally, the target function obtaining unit is configured to: for each version except a first version in the multiple versions of the target object, obtain a target file which has changed relative to a previous adjacent version of the version based on version information of the version and version information of the previous adjacent version; if a code format of the target file is a recognizable code format, perform syntax tree analysis on the target file, and determine a function in an analysis result as the target function which has changed in the target object from the previous adjacent version to the version; and if the code format of the target file is an unrecognizable code format, determine the target file as the target function.
[0014] Optionally, the function attribute acquisition unit is configured to: if the target file and the other file are the same file, set the relative position parameter as a first value, otherwise, set the relative position parameter as a second value, where the first value is greater than the second value.
[0015] Optionally, the function attribute acquisition unit is configured to: if the target file and the other file are the same file, set the relative position parameter as a first value, otherwise, set the relative position parameter as a second value, where the first value is greater than the second value.
[0016] Optionally, the function attribute acquisition unit is configured to: calculate a first modification distance between the file name of the target file and the file name of the other file based on a preset edit distance algorithm, and set the first modification distance as the file name similarity; and calculate a second modification distance between the file directory of the target file and the file directory of the other file based on the preset edit distance algorithm, and set the second modification distance as the file directory similarity.
[0017] Optionally, the function attribute acquisition unit is configured to: acquire an initial correlation degree of the current target function; poll whether the current target function is changed with each of the other target functions in each version change, where each time the current target function is changed with any of the other target functions, a third value is added to the initial correlation degree of the current target function to obtain the modification correlation degree, otherwise, a fourth value is subtracted from the initial correlation degree of the current target function to obtain the modification correlation degree.
[0018] Optionally, in the above embodiments of the present application, the cluster parameter value adjusting unit is configured to: when the target object is changed from each version to a previous adjacent version of the each version, if at least two target function modules in all the target function modules are changed simultaneously, increasing a fifth numerical value to the cluster parameter value of the at least two target function modules, and decreasing a sixth numerical value to the cluster parameter value of other function modules except the at least two target function modules in all the target function modules.
[0019] In a third aspect, embodiments of the present application provide 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 the method of any one of the above first aspect.
[0020] In a fourth aspect, embodiments of the present application provide a computer readable storage medium, storing computer executable instructions, and the computer executable instructions are configured to execute the method of any one of the above first aspect.
[0021] The above technical solutions, in view of the technical problem of low software improvement efficiency caused by large amount of human and time cost in the process of analyzing software functions in the related art, can cluster the modification content of a target object such as software or system between multiple versions, thereby dividing the target object into multiple function modules, and effectively adjusting the cluster parameter values of the function modules to accurately express the relevance between the function modules. This not only realizes the automation of the evaluation and analysis of the target object, saves a large amount of time cost and human cost, but also accurately and reliably evaluates each function module of the target object through the relevance, provides a real and reliable evaluation and analysis result for subsequent analysis, testing and other steps, helps to maintain and improve the target object, and improves the development and maintenance efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0023] Figure 1 A flowchart of an information processing method according to an embodiment of the present application is shown;
[0024] Figure 2 A flowchart of an information processing method according to another embodiment of the present application is shown;
[0025] Figure 3 A block diagram of an information processing device according to an embodiment of the present application is shown.
[0026] Figure 4 A block diagram of an information processing device according to another embodiment of the present application is shown.
[0027] Figure 5 A block diagram of an electronic device according to an embodiment of the present application is shown.
DETAILED DESCRIPTION
[0028] For better understanding of the technical solutions of the present application, the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0029] It should be clear that the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.
[0030] The terms used in the embodiments of the present application are only for the purpose of describing the specific embodiments, and are not intended to limit the present application. The singular forms "a", "an" and "the" used in the embodiments of the present application and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise.
[0031] Figure 1 A flowchart of an information processing method according to an embodiment of the present application is shown.
[0032] As Figure 1 shown, the information processing method according to an embodiment of the present application comprises:
[0033] Step 102, obtaining version information of multiple versions of a target object.
[0034] The target object includes but is not limited to software or system to be analyzed, and can also be any other object integrated with multiple functions in code form.
[0035] To adapt to actual application scenarios, developers often update the target object such as software or system. The original target object can become the original version, and each updated target object becomes a new version. For any version of the target object, the difference between the version and the previous adjacent version is the change content of the version relative to the previous adjacent version. On this basis, the change content between versions can reflect the functional changes of the target object to some extent, and the functional changes of the target object are necessary parts of the functional analysis of the target object, which can effectively reflect the improvements required by the target object.
[0036] In other words, the differences between the multiple versions of the target object can effectively affect the analysis of the target object and are advantageous basis for software improvement. The differences between the multiple versions of the target object are embodied by the version information of each version.
[0037] Specifically, the version information of each version includes one or more of the version identifier of the each version, the version identifier of the preceding adjacent version of the each version, the version submitter identifier, the version submission date, the version submission time, the version submission type, the modification content set of the each version relative to the preceding adjacent version of the each version, and the file renaming information set.
[0038] The version submission type includes branch merge submission, normal submission, Tag submission, empty submission without substantial modification, etc. The modification content set of the each version relative to the preceding adjacent version of the each version includes newly added files, newly added file paths, modified files, modified file paths, deleted files, and deleted file paths.
[0039] In a possible design, the step 102 specifically includes: obtaining a version information configuration template from a code version management system of the target object; generating a command sequence for obtaining the version information based on the version information configuration template; and executing the command sequence to obtain the version information of each version of the target object.
[0040] The code version management system of the target object is used to manage version updates of the target object and store related data of the version updates. To ensure that complete and uniformly structured version information is obtained, a version information configuration template applicable to the target object can be set in the code version management system of the target object. The version information configuration template defines various types of version information required for functional analysis of the target object, so as to comprehensively obtain version information corresponding to various types of version information. Meanwhile, the version information configuration template can also define the data structure of various types of version information, so as to form uniformly structured data after various types of version information corresponding to the version information are obtained, thereby providing a unified and reasonable basis for subsequent application of the version information.
[0041] Then, 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, so as to obtain the version information corresponding to various types of version information of the target object in sequence according to the defined data structure.
[0042] In addition, in a possible design, before the command sequence is executed, the method further includes: obtaining an effective access path of the target object for access when the command sequence is executed.
[0043] Specifically, the effective access path of the target object can be a local path or an HTTP(S) access path of a remote repository. By accessing the effective access path when the command sequence is executed, the operation required by the commands in the command sequence on the target object can be effectively performed.
[0044] In a possible design, the first command in the command sequence can be an effective access path identification command, and a uniform resource identifier (URI) can be set for the template of the version information configuration to describe the effective access path of the target object. In this way, when the first command identifies the uniform resource identifier corresponding to the target object, the version information configuration template corresponding to the uniform resource identifier can be invoked to obtain and configure the version information in the data structure.
[0045] In another possible design, the step 102 specifically includes: obtaining local version data or remote version data of each version of the target object; and parsing version information of each version from the local version data or the remote version data of each version.
[0046] The version information of each version of the target object is often stored in the version data of the target object, which can be stored locally or in any device remotely, such as a code version management system (SVN) of the target object. Therefore, the local version data or the remote version data of each version of the target object can be obtained, and the corresponding version information can be parsed based on the local version data or the remote version data.
[0047] In the above, the version information of multiple versions of the target object can be obtained in a manner suitable for actual target object analysis requirements, so as to be used in subsequent target object analysis steps, thereby laying an effective foundation for efficient and reliable analysis of the target object.
[0048] In a possible design, the method further includes: performing deduplication processing on the version submitter identifier based on a preset version submitter identifier association relationship.
[0049] The same group of developers or developers in the same version development process can have the possibility of using different version submitter identifiers when submitting versions, in other words, the submission contents corresponding to different version submitter identifiers can be the change contents of the same version. Therefore, the version submitter identifier association relationship can be preset to identify which different version submitter identifiers are of the same source, and then the version submitter identifiers of the same source can be merged or replaced, so as to achieve the deduplication effect, thereby simplifying the data complexity caused by random naming of the version submitter identifier, and facilitating the arrangement of the version information and efficient performance of the target object analysis operation based on the version information.
[0050] In a possible design, the method further includes: deleting the specified file and / or the specified directory in the modified content set.
[0051] In the changed content of the version, some invalid content that is automatically generated or automatically synchronized under the specified file and / or the specified directory is often generated, and the invalid content has no effect on the analysis of the target object. Therefore, in order to reduce data redundancy, the specified file and / or the specified directory can be directly deleted in the modified content set, and the modification related to the specified file and / or the specified directory is not passed back.
[0052] In step 104, for each version except the first version in the plurality of versions, a target function changed in the target object from a previous adjacent version to the version is determined based on version information of the version and version information of the previous adjacent version of the version.
[0053] Since the version information of the version and the version information of the previous adjacent version of the version can reflect the difference between the two versions, the difference at least includes a modified content set of the version relative to the previous adjacent version. In other words, based on the modified content set, the content changed in the target object from the previous adjacent version to the version can be obtained, and the content includes the target function changed in the modification.
[0054] Specifically, the target file changed in the version relative to the previous adjacent version can be obtained based on the version information of the version and the version information of the previous adjacent version of the version. If the code format of the target file is a recognizable code format, syntax tree analysis is performed on the target file, and a function in an analysis result is determined as the target function changed in the target object from the previous adjacent version to the version. If the code format of the target file is an unrecognizable code format, the target file is determined as the target function.
[0055] The target function changed in the target object when the version is updated is necessarily in the target file related to the version update. Therefore, the target file changed in the version relative to the previous adjacent version can be first obtained as an object for searching the target function.
[0056] Then, the code format of the target file can be recognized in a predetermined manner, which includes but is not limited to one of using a file suffix name of the target file to recognize, using a keyword in the target file to recognize, or calling an open source tool such as libmagic to recognize.
[0057] 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 recognized by a predetermined manner, it indicates that the structure of the target file is of a type existing in the known structures, 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 functions in the analysis results are determined as the target functions changed in the target object from the preceding adjacent version to the version.
[0058] The syntax tree is a tree representation of the abstract syntax structure of the source code, and each node on the tree represents a structure in the source code. Through syntax tree analysis, the structure can be obtained, and the target functions involved at each node or finger are obtained.
[0059] 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 recognized by a predetermined manner, it indicates that the structure of the target file is not of a type existing in the known structures, and the type of the target function involved in the target file cannot be determined. At this time, the target file can be directly determined as the target function to comprehensively grasp the content involved in the target function and avoid missing information that has an effective impact on the analysis of the target object.
[0060] The specific process of syntax tree analysis includes: using a lexical analyzer and a syntax analyzer to process the target file to obtain its single tree structure syntax tree. The syntax tree can be divided into classes, named methods, and statements, and the smallest unit is a statement. The statement belongs to the named method, and the named method, that is, the target function, can directly belong to the root or belong to the class. In addition, if the statements not belonging to the function are ignored, the named method can be positioned to the line number range.
[0061] Specifically, for target files of types such as C and CPP, the syntax tree can be obtained through open source tools such as LLVM and GCC; for target files of types such as python, the syntax tree can be obtained through open source tools such as CPython; for target files of types such as golang, the syntax tree can be obtained through the go open source compiler; and for target files of types such as java, the syntax tree can be obtained through open source tools such as javac.
[0062] In step 106, based on all the target functions of the plurality of versions, the target object is divided into a plurality of target function modules.
[0063] Since the change content between versions can reflect the functional changes of the target object to some extent, the functional changes of the target object are necessary parts of the functional analysis of the target object, and can effectively reflect the distribution of each function involved in the modification of the target object.
[0064] In other words, the target function of the target object whose entire occurrence is changed can reflect the function implementation and function update of the target object, and can reflect which specific functions of the target object are associated with each other. Therefore, the target object can be divided into multiple target function modules based on the entire target function of the multiple versions of the target object, so that each target function module has a corresponding target function, which is equivalent to integrating each function of the target object into a corresponding module, and helps to conveniently and efficiently analyze the target object according to each function of the target object, and reasonably evaluate the use and development of the target object.
[0065] Specifically, the multiple versions of the entire target function can be clustered based on the function attribute of each target function to obtain multiple initial function modules, and a target function module with a clustering parameter value greater than a preset clustering threshold value is selected from the multiple initial function modules.
[0066] That is, the target object is divided into multiple initial function modules by clustering based on the function attribute of the entire target function involved in the change of the multiple versions of the target object. The initial function module is an integration of each function of the target object, but since the functions of the target object are various, not all functions are important for the actual use of the target object. In other words, only the part of the functions of the target object that effectively affects the application level of the target object is needed when analyzing and evaluating the target object. Therefore, the multiple initial function modules can be further screened.
[0067] Specifically, a preset clustering threshold value can be set, and the preset clustering threshold value is a clustering parameter value corresponding to a function of the target object that is not enough to affect the application level of the target object. Therefore, if the clustering parameter value of an initial function module is greater than the preset clustering threshold value, it means that it can effectively affect the application level of the target object and can be used as a target function module for evaluating and analyzing the target object.
[0068] Through the above technical solutions, the target object can be divided into multiple function modules based on the modification content of the target object such as software or system between multiple versions, and the function module that can effectively affect the application level of the target object is selected to evaluate and analyze the target object. Compared with manual evaluation and analysis, the target object evaluation and analysis is automated, a large amount of time and labor costs are saved, more accurate and reliable target object evaluation and analysis results can be obtained, the maintenance and improvement of the target object are facilitated, and the development and maintenance efficiency is improved.
[0069] In Figure 1 Based on the embodiment shown, Figure 2 A flowchart of an information processing method according to another embodiment of the present application is shown.
[0070] As Figure 2As shown, the information processing method according to another embodiment of the present application comprises:
[0071] In step 202, the target function changed in the version update of the target object is obtained.
[0072] After obtaining the version information of the multiple versions of the target object, for each version other than the first version in the multiple versions, the target function changed in the target object from the previous adjacent version to the version is determined based on the version information of the version and the version information of the previous adjacent version of the version. The specific target function obtaining manner is the same as that shown in the embodiment, which will not be described here. Figure 1
[0073] In step 204, based on the function attributes of each target function in multiple dimensions, all target functions used in the multiple versions are clustered to obtain multiple initial functional modules.
[0074] Based on the function attributes of all target functions involved in the multiple version changes of the target object, the target object is divided into multiple initial functional modules through clustering. The initial functional module is an integration of functions of the target object, but since the functions of the target object are various, not all functions are important for the actual use of the target object. In other words, only the functions that effectively affect the application level of the target object are needed when analyzing and evaluating the target object. Therefore, the multiple initial functional modules can be further screened.
[0075] For this purpose, before step 202, it also includes obtaining the function attributes of each target function in multiple dimensions.
[0076] The function attributes of each target function in the multiple dimensions include at least two of the following: the relative position parameter of the target file where the current target function in all target functions is located and other files where other target functions other than the current target function are located; the difference between the traversal number from the project root to the target file and the lowest traversal number from the target file to the other file; the file name similarity of the target file and the other file; the file directory similarity of the target file and the other file; the difference between the starting line number of the current target function and the starting line number of the other target function; and the modification correlation degree of the current target function and the other target function.
[0077] Firstly, the target file where the current target function is located indicates the storage path of the current target function, and the other file where the other target function is located indicates the storage path of the other target function, and the relative position parameters of the two reflect the difference in the storage positions of the two, and the two are stored in positions required for the smooth execution of their own functions due to their different functions, so the difference in the storage positions can reflect the difference and relevance of the two in functions to a certain extent.
[0078] In a possible design, the manner of obtaining the relative position parameter includes: if the target file and the other file are the same file, setting the relative position parameter as a first value, otherwise, setting the relative position parameter as a second value, where the first value is greater than the second value.
[0079] In a possible design, the first value is greater than the second value, indicating that the difference and relevance of the current target function and the other target function in the same file in functions are greater than the difference and relevance of the current target function and the other target function in different files in functions.
[0080] Secondly, the number of traversals from the project root to the target file indicates the minimum number of changes required for the storage position of the target function to change from the project root to the current storage position (i.e., the target file), and the minimum number of traversals from the target file to the other file indicates the minimum number of changes required for the storage position of the target function to change from the other file where the other target function is located to the current storage position (i.e., the target file). In other words, the difference between the maximum possible number of traversals of the current target function and the number of traversals to change to the other file where the other target function is located can reflect the difference and relevance of the current target function and the other target function in the other file in functions to a certain extent.
[0081] Thirdly, the file name similarity of the target file and the other file is a manner of converting the similarity of the file names of the target file and the other file into a value. Specifically, the manner of obtaining the file name similarity includes: calculating a first modification distance between the file name of the target file and the file name of the other file based on a preset edit distance algorithm, and setting the first modification distance as the file name similarity.
[0082] The distance editing algorithm refers to the minimum number of editing operations required to convert one object into another object between two objects. In the technical solution, the two objects are the file name of the target file and the file name of the other file, and the file name similarity indicates the number of changes required to convert the file name of the target file into the file name of the other file. The size of the number of changes is directly proportional to the functional correlation between the current target function and the other file.
[0083] Fourthly, the file directory similarity of the target file and the other file is a numerical representation of the similarity of the file directory (i.e. the storage path) where the target file and the other file are respectively located. Specifically, the way to obtain the file directory similarity includes: based on the preset editing distance algorithm, calculating the second modification distance of the file directory of the target file and the file directory of the other file, and setting the second modification distance as the file directory similarity.
[0084] The distance editing algorithm refers to the minimum number of editing operations required to convert one object into another object between two objects. In the technical solution, the two objects are the file name of the target file and the file name of the other file, and the file name similarity indicates the number of changes required to convert the file name of the target file into the file name of the other file. The size of the number of changes is directly proportional to the functional correlation between the current target function and the other file.
[0085] Fifthly, the bottom layer of the target object is implemented in code, and the current target function often occupies multiple lines of description, so each line of code can be numbered to obtain the starting line number of the current target function and other target functions. The starting line numbers of the two reflect the starting positions of the two, in other words, they also indicate the storage positions of the two. Therefore, the difference between the starting line number of the current target function and the starting line number of the other target function can reflect the difference and correlation in function between the current target function and the other target function to a certain extent.
[0086] Sixthly, the modification correlation between the current target function and the other target function can be obtained, which is a certain numerical value that whether the current target function is modified at the same time as the other target function in each modification of multiple version modifications. It should be noted that the higher the modification correlation between the current target function and the other target function, the more times the two are changed at the same time in a single update, and the closer the functional correlation between the two.
[0087] Specifically, the way of obtaining the modified correlation degree comprises: obtaining an initial correlation degree of the current target function; polling whether the current target function is changed with each of the other target functions in each version change, wherein, each time the current target function is changed with any of the other target functions, a third value is added to the initial correlation degree of the current target function to obtain the modified correlation degree, otherwise, a fourth value is subtracted from the initial correlation degree of the current target function to obtain the modified correlation degree.
[0088] In a possible design, the initial correlation degree of the current target function can be set as 0.
[0089] If the current target function is changed with any of the other target functions in a single version change, it indicates that the possibility of the functions of the current target function and the other target function being associated in the single version change is high, and therefore, for the other target function, a third value is added to the initial correlation degree of the current target function. Conversely, if the current target function is not changed with any of the other target functions in a single version change, it indicates that the possibility of the functions of the current target function and the other target function being associated in the single version change is low, and therefore, for the other target function, a fourth value is subtracted from the initial correlation degree of the current target function.
[0090] It should be noted that the other target functions in the context include one or more, and when there are multiple other target functions, the polling and the operation of the embodiment are performed for each of the other target functions. Figure 2 The operation of the embodiment is performed to obtain effective data as a clustering basis.
[0091] After obtaining the function attributes of each of the target functions in multiple dimensions, clustering can be performed by specifying a clustering method. The clustering method includes, but is not limited to, a shortest distance algorithm, a DBSCAN algorithm, a BIRCH algorithm, a K-Means algorithm, and the like.
[0092] In step 206, a target function module with a clustering parameter value greater than a preset clustering threshold is selected from the multiple initial function modules.
[0093] The initial function modules are integrations of functions of the target object, but the functions of the target object are various, and not all the functions are important for the actual use of the target object. In other words, when the target object is analyzed and evaluated, only the functions of the target object that effectively affect the application level of the target object are used. Therefore, the multiple initial function modules can be further screened.
[0094] Specifically, a preset clustering threshold value corresponding to a functional deficiency of the target object that does not affect the application level of the target object can be set. Therefore, if the clustering parameter value of an initial functional module is greater than the preset clustering threshold value, it means that the initial functional module can effectively affect the application level of the target object and can be used as a target functional module for evaluating and analyzing the target object.
[0095] In step 208, the clustering parameter value of each target functional module is adjusted based on the modification correlation between each two target functional modules. For each two target functional modules, the difference between the adjusted clustering parameter values of the two target functional modules is used to reflect the correlation degree between the two target functional modules.
[0096] Further, the clustering parameter value of each target functional module can be further adjusted so that the clustering parameter value of each target functional module can more accurately reflect the correlation between the target functional modules, thereby improving the accuracy of evaluating and analyzing the target object. For any two target functional modules, the difference between the adjusted clustering parameter values of the two target functional modules is used to reflect the correlation degree between the two target functional modules. The greater the difference, the lower the correlation between the two target functional modules, and the lower the possibility of correlated failure. Conversely, the smaller the difference, the greater the correlation between the two target functional modules, and the greater the coupling degree between the two target functional modules. Once one of them has a problem or failure, it is likely to cause the other target functional module to also have a correlated problem or failure. Therefore, the two target functional modules with the low adjusted clustering parameter value need to be rectified.
[0097] The above technical solution can cluster the modification content between multiple versions of a target object such as software or a system, thereby dividing the target object into multiple functional modules and effectively adjusting the clustering parameter value of each functional module to accurately express the correlation between the functional modules. Compared with manual evaluation and analysis, the target object evaluation and analysis is automated, which saves a lot of time and labor costs. The correlation can accurately and reliably evaluate each functional module of the target object, providing a real and reliable evaluation and analysis result for subsequent analysis, testing, and other steps, which helps to maintain and improve the target object and improves the development and maintenance efficiency.
[0098] It should be noted that the specific way of adjusting the clustering parameter value of each target functional module in step 208 includes: when the target object changes from each version to the previous adjacent version, if at least two target functional modules in all target functional modules change at the same time, a fifth value is added to the clustering parameter value of the at least two target functional modules, and a sixth value is subtracted from the clustering parameter value of other functional modules except the at least two target functional modules in all target functional modules.
[0099] That is, in each version change, if two target function modules are changed at the same time, it indicates that the two target function modules have greater functional relevance, and the clustering parameter values of the two target function modules are increased by a fifth value. Then, the clustering parameter values of other target function modules are reduced by a sixth value. In this way, the clustering parameter values of the two target function modules can be further reflected by the relevance of the two target function modules. The adjustment of the clustering parameter values can be performed for each two target function modules in each version update.
[0100] It should be understood that the first value, the second value, the third value, the fourth value, the fifth value, and the sixth value in the context can be set based on actual software evaluation requirements and functional relevance levels, and are not specifically limited here.
[0101] Figure 3 A block diagram of an information processing apparatus according to an embodiment of the present application is shown.
[0102] As shown in Figure 3 The information processing apparatus 300 according to an embodiment of the present application includes a version information acquisition unit 302 configured to acquire version information of a plurality of versions of a target object, and a target function determination unit 304 configured to, for each version of the plurality of versions except a first version, determine a target function changed in the target object from a previous adjacent version to the version based on version information of the version and version information of the previous adjacent version.
[0103] In the above embodiments of the present application, the function module division unit 306 is configured to, based on a function attribute of each target function, cluster all target functions of the plurality of versions to obtain a plurality of initial function modules, and select a target function module with a clustering parameter value greater than a preset clustering threshold value from the plurality of initial function modules.
[0104] In the above embodiments of the present application, the method further includes an association distance detection unit configured to, for each two target function modules of all target function modules, calculate an association distance of the two target function modules based on respective clustering parameter values of the two target function modules, and an alarm unit configured to, if the association distance is less than a specified safety distance threshold value, generate alarm information for the two target function modules, the alarm information being used to reflect that the two target function modules are in an unsafe state of excessively close association.
[0105] In the foregoing embodiments of the present application, optionally, the version information of each version comprises one or more of a version identifier of the each version, a version identifier of a preceding adjacent version of the each version, a version submitter identifier, a version submission date, a version submission time, a version submission type, a set of modification contents of the each version relative to the preceding adjacent version of itself, and a set of file renaming information.
[0106] In the foregoing embodiments of the present application, optionally, the version information obtaining unit 302 is configured to: obtain a version information configuration template from a code version management system of the target object; generate a command sequence for obtaining the version information based on the version information configuration template; and execute the command sequence to obtain the version information of each version of the target object.
[0107] In the foregoing embodiments of the present application, optionally, further comprising: a pre-configuration unit configured to, before the execution of the command sequence, obtain an effective access path of the target object for access when the command sequence is executed; and perform deduplication processing on the version submitter identifier based on a preset version submitter identifier association relationship; and delete a specified file and / or a specified directory in the set of modification contents.
[0108] In the foregoing embodiments of the present application, optionally, the version information obtaining unit 302 is configured to: obtain local version data or remote version data of each version of the target object; and parse the version information of the each version from the local version data or the remote version data of the each version.
[0109] In the foregoing embodiments of the present application, optionally, the target function determining unit 304 is configured to: obtain a target file that has been changed relative to a preceding adjacent version of a version based on the version information of the version and the version information of the preceding adjacent version; perform syntax tree analysis on the target file if a code format of the target file is a recognizable code format, and determine a function in an analysis result as a target function of the target object that has been changed from the preceding adjacent version to the version; and determine the target file as the target function if the code format of the target file is an unrecognizable code format.
[0110] The information processing apparatus 300 uses the scheme of any one of the foregoing embodiments, and thus has all the technical effects described above, which will not be repeated here.
[0111] Figure 4 A block diagram of an information processing apparatus according to another embodiment of the present application is shown.
[0112] As Figure 4As shown, the information processing apparatus 400 according to another embodiment of the present application comprises: a target function obtaining unit 402 configured to obtain a target function that has been changed in version updating of a target object; a function module dividing unit 404 configured to cluster all target functions used in multiple versions based on function attributes of each target function in multiple dimensions, to obtain multiple initial function modules; a function module screening unit 406 configured to select a target function module with a clustering parameter value greater than a preset clustering threshold value from the multiple initial function modules; and a clustering parameter value adjusting unit 408 configured to adjust the clustering parameter value of each target function module based on a modification association relationship between each two target function modules in all target function modules, wherein for each two target function modules, a difference between the adjusted clustering parameter values of the two target function modules is used to reflect the association degree of the two target function modules.
[0113] In the above embodiments of the present application, optionally, the target function obtaining unit 402 is configured to: for each version except a first version in multiple versions of the target object, obtain a target file that has been changed with respect to a previous adjacent version of the version based on version information of the version and version information of the previous adjacent version; if a code format of the target file is a recognizable code format, perform syntax tree analysis on the target file, and determine a function in the analysis result as the target function that has been changed in the target object from the previous adjacent version to the version; and if the code format of the target file is an unrecognizable code format, determine the target file as the target function.
[0114] In the above embodiments of the present application, optionally, further comprising: a function attribute obtaining unit configured to obtain function attributes of each target function in multiple dimensions before the function module dividing unit 404 clusters all target functions used in the multiple versions to obtain multiple initial function modules, wherein the function attributes of each target function in the multiple dimensions comprise at least two of the following: a relative position parameter of a target file in which a current target function in all target functions and other files in which other target functions other than the current target function are located; a difference between a traversal number from a project root to the target file and a lowest traversal number from the target file to the other files; a file name similarity of the target file and the other files; a file directory similarity of the target file and the other files; a difference between a starting line number of the current target function and a starting line number of the other target functions; and a modification association degree of the current target function and the other target functions.
[0115] In the foregoing embodiments of the present application, optionally, the function attribute acquisition unit is configured to: if the target file and the other file are the same file, set the relative position parameter as a first value, and otherwise, set the relative position parameter as a second value, wherein the first value is greater than the second value.
[0116] In the foregoing embodiments of the present application, optionally, the function attribute acquisition unit is configured to: calculate a first modification distance between the file name of the target file and the file name of the other file based on a preset edit distance algorithm, and set the first modification distance as the file name similarity; and calculate a second modification distance between the file directory of the target file and the file directory of the other file based on the preset edit distance algorithm, and set the second modification distance as the file directory similarity.
[0117] In the foregoing embodiments of the present application, optionally, the function attribute acquisition unit is configured to: acquire an initial correlation degree of the current target function; poll whether the current target function is changed with each of the other target functions in each version change, wherein each time the current target function is changed with any of the other target functions, a third value is added to the initial correlation degree of the current target function to obtain the modified correlation degree, and otherwise, a fourth value is subtracted from the initial correlation degree of the current target function to obtain the modified correlation degree.
[0118] In the foregoing embodiments of the present application, optionally, the clustering parameter value adjustment unit 408 is configured to: when the target object is changed from each version to the previous adjacent version of each version, if at least two target function modules in all the target function modules are changed at the same time, a fifth value is added to the clustering parameter value of the at least two target function modules, and a sixth value is subtracted from the clustering parameter value of other function modules except the at least two target function modules in all the target function modules.
[0119] The information processing apparatus 400 uses the scheme of any one of the foregoing embodiments, and thus has all the technical effects described above, which will not be repeated here.
[0120] Figure 5 A block diagram of an electronic device of one embodiment of the present application is shown.
[0121] As Figure 5As shown, the electronic device 500 of one embodiment of the present application includes at least one memory 502; and a processor 504 connected with the at least one memory 502 in communication; wherein the memory stores instructions executable by the at least one processor 504, and the instructions are configured to execute the scheme described in any of the above embodiments. Therefore, the electronic device 500 has the same technical effects as any of the above embodiments, and will not be described here.
[0122] The electronic device of the embodiments of the present application exists in various forms, including but not limited to:
[0123] (1) Mobile communication device: This type of device is characterized by having mobile communication function, and providing voice and data communication as the main target. This type of terminal includes: smart phone (such as iPhone), multimedia phone, functional phone, and low-end phone, etc.
[0124] (2) Ultra-mobile personal computer device: This type of device belongs to the category of personal computers, and has computing and processing functions, and generally also has the characteristics of mobile Internet. This type of terminal includes: PDA, MID and UMPC devices, such as iPad.
[0125] (3) Portable entertainment device: This type of device can display and play multimedia content. This type of device includes: audio and video player (such as iPod), handheld game console, electronic book, and smart toy and portable car navigation device.
[0126] (4) Server: A device that provides computing services. The components of a server include a processor, a hard disk, a memory, a system bus, etc. The server is similar to a general-purpose computer in architecture, but requires higher processing power, stability, reliability, security, scalability, manageability, etc. due to the need to provide high-reliability services.
[0127] (5) Other electronic devices with data interaction function.
[0128] In addition, the embodiments of the present application provide a computer readable storage medium, which stores computer executable instructions, and the computer executable instructions are used to execute the method process described in any of the above embodiments.
[0129] The technical scheme of the present application is described in detail above in combination with the drawings. Through the technical scheme of the present application, the modification content between multiple versions of a target object based on software or a system can be clustered, thereby dividing the target object into multiple functional modules, and effectively adjusting the clustering parameter values of the functional modules to accurately express the relevance between the functional modules. This is relative to manual evaluation and analysis, and not only realizes the automation of target object evaluation and analysis, saves a large amount of time cost and labor cost, but also accurately and reliably evaluates each functional module of the target object through the relevance, provides a real and reliable evaluation and analysis result for subsequent analysis, testing and other steps, helps the maintenance and improvement of the target object, and improves the development and maintenance efficiency.
[0130] It should be understood that the term "and / or" used herein only describes the association relationship of the associated objects, and indicates that there can be three relationships, for example, A and / or B can represent the three cases of A existing alone, A and B existing together, and B existing alone. In addition, the character " / " herein generally represents an "or" relationship between the front and rear associated objects.
[0131] It should be understood that although the terms first, second, etc. can be used in the embodiments of the present application to describe values, these values should not be limited to these terms. These terms are only used to distinguish one value from another. For example, without departing from the scope of the embodiments of the present application, the first value can also be referred to as the second value, and similarly, the second value can also be referred to as the first value.
[0132] Depending on the context, the word "if" as used herein can be interpreted to mean "when" or "while" or "in response to determining" or "in response to detecting". Similarly, the phrase "if it is determined" or "if (a stated condition or event) is detected" can be interpreted to mean "when it is determined" or "in response to determining" or "when (a stated condition or event) is detected" or "in response to detecting (a stated condition or event)".
[0133] In several embodiments provided by the present application, it should be understood that the disclosed system, device and method can be implemented by other manners. For example, the device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units or components shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.
[0134] In addition, each function unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of hardware plus software function unit.
[0135] The integrated unit realized in the form of software function unit can be stored in a computer readable storage medium. The software function unit stored in a storage medium includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media capable of storing program codes.
[0136] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the scope of protection of the present application.
Claims
1. An information processing method characterized by comprising: The method comprises the following steps: acquiring target functions that have been changed in version updating of a target object, comprising: for each version except the first version of a plurality of versions of the target object, acquiring target files that have been changed in the version relative to a previous adjacent version based on version information of the version and version information of the previous adjacent version; if the code format of the target file is a recognizable code format, performing syntax tree analysis on the target file, and determining functions in the analysis results as the target functions that have been changed in the target object from the previous adjacent version to the version; if the code format of the target file is an unrecognizable code format, determining the target file as the target function; based on function attributes of each target function in multiple dimensions, clustering all target functions used in the plurality of versions to obtain a plurality of initial function modules; selecting a target function module with a clustering parameter value greater than a preset clustering threshold value from the plurality of initial function modules; based on a modification correlation between each two target function modules in all target function modules, adjusting the clustering parameter value of each target function module, wherein for each two target function modules, the difference between the adjusted clustering parameter values of the two target function modules reflects the correlation degree of the two target function modules.
2. The information processing method according to claim 1, characterized by, Before the step of clustering all target functions used in the plurality of versions based on function attributes of each target function in multiple dimensions to obtain a plurality of initial function modules, the method further comprises the following steps: acquiring function attributes of each target function in multiple dimensions, wherein the function attributes of each target function in the multiple dimensions comprise at least two of the following: a relative position parameter of a target file in which a current target function in all target functions is located and other files in which other target functions are located except the current target function; a difference between a traversal number from a project root to the target file and a lowest traversal number from the target file to the other files; a file name similarity of the target file and the other files; a file directory similarity of the target file and the other files; a difference between a starting line number of the current target function and a starting line number of the other target function; a modification correlation of the current target function and the other target function.
3. The information processing method according to claim 2, characterized by, The manner of acquiring the relative position parameter comprises: if the target file and the other file are the same file, setting the relative position parameter as a first value, otherwise, setting the relative position parameter as a second value, wherein the first value is greater than the second value.
4. The information processing method according to claim 2, characterized by, The manner of acquiring the file name similarity comprises: based on a preset edit distance algorithm, calculating a first modification distance of a file name of the target file and a file name of the other file, and setting the first modification distance as the file name similarity. The manner of acquiring the file directory similarity comprises: based on a preset edit distance algorithm, calculating a second modification distance of a file directory of the target file and a file directory of the other file, and setting the second modification distance as the file directory similarity.
5. The information processing method according to claim 2, characterized by, The way of obtaining the modified correlation degree comprises: obtaining an initial correlation degree of the current target function; polling whether the current target function is changed with each of the other target functions in each version change, wherein, whenever the current target function is changed with any of the other target functions, the initial correlation degree of the current target function is increased by a third value to obtain the modified correlation degree, otherwise, the initial correlation degree of the current target function is decreased by a fourth value to obtain the modified correlation degree.
6. The information processing method according to claim 2, characterized by, The adjusting of the clustering parameter value of each target function module based on the modified correlation relationship between each two target function modules in all the target function modules comprises: when the target object is changed from each version to the previous adjacent version of each version, if at least two target function modules in all the target function modules are changed simultaneously, the clustering parameter value of the at least two target function modules is increased by a fifth value, and the clustering parameter value of other function modules except the at least two target function modules in all the target function modules is decreased by a sixth value.
7. An information processing apparatus, characterized by comprising: comprise: a target function obtaining unit, configured to obtain a target function changed in version update of a target object, comprising: for each version except a first version in multiple versions of the target object, based on version information of the version and version information of a previous adjacent version of the version, a target file changed relative to the previous adjacent version in the version is obtained; if the code format of the target file is a recognizable code format, the target file is subjected to syntax tree analysis, and a function in an analysis result is determined as the target function changed in the target object from the previous adjacent version to the version; if the code format of the target file is an unrecognizable code format, the target file is determined as the target function; a function module dividing unit, configured to cluster all target functions used in the multiple versions based on function attributes of each target function in multiple dimensions to obtain multiple initial function modules; a function module screening unit, configured to select a target function module with a clustering parameter value greater than a preset clustering threshold value from the multiple initial function modules; a clustering parameter value adjusting unit, configured to adjust the clustering parameter value of each target function module based on a modified correlation relationship between each two target function modules in all the target function modules, wherein for each two target function modules, a difference value of the adjusted clustering parameter values of the two target function modules is used to reflect the correlation degree of the two target function modules.
8. An electronic device, comprising: comprise: at least one processor; and a memory in communication connection with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are configured to execute the method in 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 flow as claimed in any one of claims 1 to 6.
Citation Information
Patent Citations
Incremental software architecture updating method based on double classifiers
CN110162329A
Automated method and system for generating models from data
US7480640B1