Disclosure of Invention
In view of the above problems, embodiments of the present invention are proposed to provide an information processing method, apparatus, electronic device, and storage medium that overcome or at least partially solve the above problems.
In order to solve the above problem, an embodiment of the present invention discloses an information processing method, where the method includes:
acquiring target path information;
acquiring current version information corresponding to the target path information and historical version information;
and determining the version merging relationship between the current version information and the historical version information according to the difference between the current version information and the historical version information.
Preferably, the step of obtaining the target path information includes:
acquiring root directory information;
traversing the root directory information to acquire first key-value pair data containing merging characteristic information;
and extracting target path information in the first key-value pair data.
Preferably, the step of obtaining the current version information corresponding to the target path information and the historical version information includes:
traversing the target path information to obtain log information corresponding to the target path information; the log information records a current version number corresponding to the target path information and a historical version number before the current version number;
acquiring current version information corresponding to the current version number;
and acquiring historical version information corresponding to the historical version number.
Preferably, the current version information includes first source path information, a first merging version number corresponding to the first source path information; the historical version number information comprises the second source path information and a second combined version number corresponding to the second source path information; the step of determining the version merging relationship between the current version information and the historical version information according to the difference between the current version information and the historical version information includes:
determining target source path information and a target merging version number corresponding to the target source path information according to the difference between the first source path information and the second source path information;
and establishing the version merging relationship based on the current version number and the target merging version number.
Preferably, the target source path information includes first target source path information and second target source path information; the target merging version number comprises a first target merging version number and a second target merging version number; the current version information further comprises a first merging version number corresponding to the first source path information; the historical version number information further comprises a second merging version number corresponding to the second source path information; the step of determining target source path information and a target merging version number corresponding to the target source path information according to the difference between the first source path information and the second source path information includes:
traversing the first source path information and the second source path information;
determining first source path information which is not matched with the second source path information as first target source path information, and determining a first target merging version number corresponding to the first target source path information;
determining second source path information matched with the first target source path information as second target source path information; and determining that the version number which is not matched with the first merging version number in the second merging version numbers corresponding to the second target source path information is a second target merging version number.
Preferably, the step of establishing the version merging relationship based on the current version number and the target merging version number includes:
determining the current version number as key information;
determining the first target source path information and the first target merging version number as first value information;
determining the second target source path information and the second target merging version number as second value information;
and generating second key-value pair data by adopting the key information, the first value information and the second value information.
Preferably, the method further comprises:
and displaying the version merging relationship.
Preferably, the step of presenting the version merging relationship includes:
a version identification icon uniquely corresponding to the current version information and the historical version information is arranged;
and connecting the version identification icon by adopting a preset connection symbol and the version combination relation.
Preferably, the method further comprises:
collecting relation modification operation input by a user;
and modifying the version merging relationship by adopting the relationship modification operation.
The embodiment of the invention also discloses an information processing device, which comprises:
the target path acquisition module is used for acquiring target path information;
the version information acquisition module is used for acquiring current version information corresponding to the target path information and historical version information;
and the merging relationship determining module is used for determining the version merging relationship between the current version information and the historical version information according to the difference between the current version information and the historical version information.
Preferably, the target path obtaining module may include:
the root directory submodule is used for acquiring root directory information;
the first traversal submodule is used for traversing the root directory information and acquiring first key-value pair data containing merging characteristic information;
and the target path extraction sub-module is used for extracting the target path information in the first key-value pair data.
Preferably, the version information obtaining module may include:
the second traversal submodule is used for traversing the target path information and acquiring log information corresponding to the target path information; the log information records a current version number corresponding to the target path information and a historical version number before the current version number;
a current version information obtaining submodule for obtaining current version information corresponding to the current version number;
and the historical version information acquisition submodule is used for acquiring the historical version information corresponding to the historical version number.
Preferably, the current version information includes first source path information and a first merging version number corresponding to the first source path information; the historical version number information comprises the second source path information and a second combined version number corresponding to the second source path information; the mergerelationship determination module 303 may include:
the target information determining submodule is used for determining target source path information and a target merging version number corresponding to the target source path information according to the difference between the first source path information and the second source path information;
and the merging relationship establishing submodule is used for establishing the version merging relationship based on the current version number and the target merging version number.
Preferably, the target source path information includes first target source path information and second target source path information; the target merging version number comprises a first target merging version number and a second target merging version number; the current version information further comprises a first merging version number corresponding to the first source path information; the historical version number information further comprises a second combined version number corresponding to the second source path information; the target information determination sub-module may include:
a source path traversing unit, configured to traverse the first source path information and the second source path information;
a first target version determining unit, configured to determine that first source path information that does not match the second source path information is first target source path information, and determine a first target merging version number corresponding to the first target source path information;
a second target version determining unit, configured to determine that second source path information matched with the first target source path information is second target source path information; and determining that the version number which is not matched with the first merging version number in the second merging version numbers corresponding to the second target source path information is a second target merging version number.
Preferably, the merge relationship establishing sub-module may include:
a key information unit for determining the current version number as key information;
a first value information unit, configured to determine that the first target source path information and the first target merging version number are first value information;
a first value information unit, configured to determine that the second target source path information and the second target merging version number are second value information;
and the key value pair generating unit is used for generating second key value pair data by adopting the key information, the first value information and the second value information.
Preferably, the apparatus may further include:
and the display module is used for displaying the version merging relationship.
Preferably, the display module may include:
the icon identification setting unit is used for setting a version identification icon which is uniquely corresponding to the current version information and the historical version information;
and the icon identification connecting unit is used for connecting the version identification icon by adopting a preset connecting symbol and the version combination relation.
Preferably, the apparatus may further comprise:
the modification acquisition module is used for acquiring relationship modification operation input by a user;
and the relationship modifying module is used for modifying the version merging relationship by adopting the relationship modifying operation.
The embodiment of the invention also discloses an electronic device, which can comprise a processor, a memory and a computer program which is stored on the memory and can run on the processor, wherein the steps of the information processing method are realized when the computer program is executed by the processor.
The embodiment of the invention also discloses a computer readable storage medium, a computer program is stored on the computer readable storage medium, and the steps of the information processing method are realized when the computer program is executed by a processor.
The embodiment of the invention has the following advantages: the method comprises the steps of obtaining current version information corresponding to target path information and historical version information through the target path information, comparing the difference between the current version information and the historical version information, and determining source path information forming the current version and a combined version number corresponding to the source path information, so that the combined relation between different versions is confirmed through the target path information, the problem that in the prior art, the combined relation between different versions can be obtained only by inquiring log information submitted by different versions one by one is avoided, and the inquiring efficiency of a user on the version information is improved.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Referring to fig. 1, a flowchart illustrating steps of a first embodiment of an information processing method according to the present invention is shown, which may specifically include the following steps:
step 101, acquiring target path information;
the embodiment of the invention can be applied to a version control system (such as SVN), when a user carries out version combination in the version control system, the version control system can store combination information related to the version, and the path address stored by the combination information is the target path information.
102, acquiring current version information corresponding to the target path information and historical version information;
the merging information corresponding to the target path information may be acquired by a preset method, and the current version information and the historical version information corresponding to the target path information may be determined by the merging information.
And 103, determining a version merging relationship between the current version information and the historical version information according to the difference between the current version information and the historical version information.
The current version information comprises first source path information and a first merging version number corresponding to the first source path information; the historical version number information includes the second source path information and a second merged version number corresponding to the second source path information. The source path information constituting the current version and the merged version number corresponding to the source path information may be determined by comparing differences between the current version information and the historical version information.
In the embodiment of the invention, the current version information corresponding to the target path information and the historical version information are obtained through the target path information, the difference between the current version information and the historical version information is compared, and the source path information forming the current version and the combined version number corresponding to the source path information are determined, so that the combined relation between different versions is determined through the target path information, the condition that in the prior art, the combined relation between different versions can be obtained only by inquiring log information submitted by different versions one by one is avoided, and the inquiring efficiency of a user on the version information is improved.
Referring to fig. 2, a flowchart illustrating steps of a second embodiment of the information processing method according to the present invention is shown, which may specifically include the following steps:
step 201, acquiring target path information;
the embodiment of the invention can be applied to a version control system (such as SVN), when a user carries out version combination in the version control system, the version control system can store combination information related to the version, and the path address stored by the combination information is the target path information. The current version information may include first source path information, a first merging version number corresponding to the first source path information; the historical version number information may include the second source path information, a second merged version number corresponding to the second source path information. The source path information is a path address of a previous version used for acquiring the current version. The merging version number is one or more version numbers corresponding to the source path information.
In a preferred embodiment of the present invention, step 201 may include:
substep S11, obtaining root directory information;
the root directory information may be determined by customization, or by scanning the version control system. The root directory information may be a URL address.
Substep S12, traversing the root directory information, and acquiring first key-value pair data containing merging characteristic information;
the root directory information may include a plurality of branch address information, and the first key-value pair data including the merged feature information is obtained by traversing the root directory information in a recursive query manner.
The merging feature information may be information for identifying a merging feature, such as: in SVN, the merge feature information may refer to parameters of SVN mergeinfo attribute. The data containing the merging characteristic information is the merging information.
A key-value pair is a type of data consisting of key information and corresponding value information, which may be separated by a preset first symbol, may hold one or more kinds of information, and may be separated by a preset second symbol (e.g., key information is separated from value information by "-", information in value is separated by ": etc.). In this embodiment of the present invention, the key information of the first key-value pair data may be target path information, and the value information of the first key-value pair data may be composed of source path information and a merged version number.
And a substep S13 of extracting the target path information in the first key-value pair data.
Analyzing the acquired first key-value pair data, extracting key information, namely target path information, in the first key-value pair data, and storing the extracted target path information into a preset data table one by one.
Step 202, obtaining current version information corresponding to the target path information and historical version information;
the merging information corresponding to the target path information may be acquired by a preset method, and the current version information and the historical version information corresponding to the target path information may be determined by the merging information.
In a preferred embodiment of the present invention, step 202 may comprise:
step S21, traversing the target path information to obtain the log information corresponding to the target path information; the log information records a current version number corresponding to the target path information and a historical version number before the current version number;
the data table storing the target path information may be adopted, each target path information in the data table is traversed, and a preset function is adopted, and the log information corresponding to the target path information is adopted.
Substep S22, obtaining current version information corresponding to the current version number;
and acquiring current version information corresponding to the current version number by adopting a preset merging information acquisition function.
And a substep S23 of acquiring history version information corresponding to the history version number.
And acquiring historical version information corresponding to the historical version number by adopting a preset merging information acquisition function.
Step 203, determining a version merging relationship between the current version information and the historical version information according to the difference between the current version information and the historical version information.
The version merge relationship between different versions may be determined by comparing the difference between the current version information and the historical version information.
In a preferred embodiment of the present invention, step 203 may comprise:
substep S31, determining target source path information and a target merging version number corresponding to the target source path information according to a difference between the first source path information and the second source path information;
by comparing the difference between the first source path information and the second source path information, the version corresponding to the current version number can be determined, and the versions are generated by combining previous versions. Specifically, the version corresponding to the current version number is generated by merging versions corresponding to the target merging version number corresponding to the target source path information.
And a substep S32 of establishing the version merging relationship based on the current version number and the target merging version number.
And establishing a version merging relationship based on the current version number and the target merging version number, and clearly showing the version numbers of one or more historical versions merging and generating the current version.
In practical application, the version identification information, the branch identification information, the target merging version number identification information and the source branch identification information corresponding to the current version can be obtained and stored.
In a preferred embodiment of the present invention, the target source path information includes first target source path information and second target source path information; the target merging version number comprises a first target merging version number and a second target merging version number; the current version information further comprises a first merging version number corresponding to the first source path information; the historical version number information further comprises a second merging version number corresponding to the second source path information; the substep S31 includes:
substep S311, traversing the first source path information and the second source path information;
substep S312, determining first source path information not matching the second source path information as first target source path information, and determining a first target merging version number corresponding to the first target source path information;
the substep S313, determining the second source path information matched with the first target source path information as the second target source path information; and determining that the version number which is not matched with the first merging version number in the second merging version numbers corresponding to the second target source path information is a second target merging version number.
In practical applications, the first source path information and the first merged version information of the first source path information pair may be separated by a preset coincidence (e.g., colon ": and a line break may be set after the first merged version information; similarly, the second source path information and the second merging version information of the pair with the second source path information may be separated by a preset coincidence (e.g., colon: "), and the line break may be set after the second merging version information.
By traversing the first source path information and the second source path information, the difference between the first source path information and the second source path information can be judged.
When first source path information inconsistent with the second source path information exists, determining that the first source path information inconsistent with the second source path information is first target source path information, determining a first target merging version number corresponding to the first target source path information, namely extracting that the source path information which exists in the current version information and does not exist in the historical version information is the first target source path information, and determining a first target merging version number corresponding to the first target source path information.
When first source path information consistent with the second source path information exists, determining that the first source path information consistent with the second source path information is second target source path information, determining that a version number unmatched with the first merging version number in a second merging version number corresponding to the second target source path information is a second target merging version number, namely extracting that the source path information existing in the current version information and the historical version information is the second target source path information, comparing the second merging version number corresponding to the second target source path information with the second merging version number inconsistent with the first merging version number corresponding to the second target source path information, and determining that the version number is a second target merging version number.
In a preferred embodiment of the present invention, the sub-step S32 may include:
substep S321, determining the current version number as key information;
substep S322, determining the first target source path information and the first target merging version number as first value information;
substep S323, determining the second target source path information and the second target merging version number as second value information;
and a substep S324 of generating second key-value pair data by using the key information, the first value information and the second value information.
And forming second key value pair data by adopting the current version number, the first target source path information, the first target merging version number, the second target source path information and the second target merging version number, and determining the historical version forming the current version, namely determining the version merging relation through the second key value pair data.
In the embodiment of the present invention, after thesteps 201 to 203 are executed once, the first source path information is defined as new target path information, and thesteps 201 and 203 are executed again, and the process is sequentially cycled, so that the second key value pair data corresponding to each target path information can be obtained.
In a preferred embodiment of the present invention, the method may further include:
and step 204, displaying the version merging relationship.
The merge relationship may be presented in a preset page.
In a preferred embodiment of the present invention, step 204 may comprise:
a substep S41, setting a version identification icon uniquely corresponding to the current version information and the historical version information;
a uniquely matching version identification icon may be set for each version number.
And a substep S42 of connecting the version identification icons by using a preset connection symbol and the version combination relationship.
The preset connection symbols are connected with the version identification icons, so that the combination relation among different versions can be clearly and intuitively acquired. For example: and sorting according to version numbers by adopting a solid line, connecting different version identification icons, and connecting the version identification icons with different scores and having a merging relation by adopting a dotted line.
In a preferred embodiment of the present invention, the method may further include:
step 205, collecting the relationship modification operation input by the user;
after the merging relation is generated, a user can perform data verification on the merging relation, and when the merging relation is found to have an error, the correct merging relation can be manually input.
And step 206, modifying the version merging relationship by adopting the relationship modification operation.
The original version merging relation information can be modified by adopting the merging relation input by the user, and the modified version merging relation is displayed.
In practical application, a user can directly modify the connection symbols between the version identification icons and modify the version merging relationship.
In the embodiment of the invention, the current version information and the historical version information corresponding to the target path information are obtained through the target path information, the difference between the current version information and the historical version information is compared, the source path information forming the current version and the combined version number corresponding to the source path information are determined, so that the combined relation between different versions is confirmed through the target path information, the corresponding version identification icon is generated for each version information, and the combined relation is displayed through the version identification icon, the condition that in the prior art, the combined relation between different versions information can be obtained only by inquiring log information submitted by different versions one by one is avoided, and the inquiring efficiency of a user on the version information is improved.
Furthermore, the user can directly correct the version merging relationship aiming at the connection coincidence between the version identification icons, and the management of the user aiming at the merging relationship between the versions is provided.
Furthermore, the merging relation between different branches and versions can be visually displayed to the user through the icons and the connection symbols, and the management of the user on the version relation between different branches is improved.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 3, a block diagram of an embodiment of an information processing apparatus according to the present invention is shown, and may specifically include the following modules:
a targetpath obtaining module 301, configured to obtain target path information;
a versioninformation obtaining module 302, configured to obtain current version information corresponding to the target path information and historical version information;
a mergingrelationship determining module 303, configured to determine a version merging relationship between the current version information and the historical version information according to a difference between the current version information and the historical version information.
In a preferred embodiment of the present invention, the targetpath obtaining module 301 may include:
the root directory submodule is used for acquiring root directory information;
the first traversal submodule is used for traversing the root directory information and acquiring first key-value pair data containing merging characteristic information;
and the target path extraction sub-module is used for extracting the target path information in the first key-value pair data.
In a preferred embodiment of the present invention, the versioninformation obtaining module 302 may include:
the second traversal submodule is used for traversing the target path information and acquiring log information corresponding to the target path information; the log information records a current version number corresponding to the target path information and a historical version number before the current version number;
a current version information obtaining submodule, configured to obtain current version information corresponding to the current version number;
and the historical version information acquisition submodule is used for acquiring the historical version information corresponding to the historical version number.
In a preferred embodiment of the present invention, the current version information includes first source path information, a first merging version number corresponding to the first source path information; the historical version number information comprises the second source path information and a second combined version number corresponding to the second source path information; the mergerelationship determination module 303 may include:
the target information determining submodule is used for determining target source path information and a target merging version number corresponding to the target source path information according to the difference between the first source path information and the second source path information;
and the merging relationship establishing submodule is used for establishing the version merging relationship based on the current version number and the target merging version number.
In a preferred embodiment of the present invention, the target source path information includes first target source path information and second target source path information; the target merging version number comprises a first target merging version number and a second target merging version number; the current version information further comprises a first merging version number corresponding to the first source path information; the historical version number information further comprises a second combined version number corresponding to the second source path information; the target information determination sub-module may include:
a source path traversing unit, configured to traverse the first source path information and the second source path information;
a first target version determining unit, configured to determine that first source path information that does not match the second source path information is first target source path information, and determine a first target merging version number corresponding to the first target source path information;
a second target version determining unit, configured to determine that second source path information matched with the first target source path information is second target source path information; and determining that the version number which is not matched with the first merging version number in the second merging version numbers corresponding to the second target source path information is a second target merging version number.
In a preferred embodiment of the present invention, the merge relation establishing sub-module may include:
a key information unit for determining the current version number as key information;
a first value information unit, configured to determine that the first target source path information and the first target merging version number are first value information;
a first value information unit, configured to determine that the second target source path information and the second target merging version number are second value information;
and the key value pair generating unit is used for generating second key value pair data by adopting the key information, the first value information and the second value information.
In a preferred embodiment of the present invention, the apparatus may further include:
and the display module is used for displaying the version merging relationship.
In a preferred embodiment of the present invention, the display module may include:
the icon identification setting unit is used for setting a version identification icon which is uniquely corresponding to the current version information and the historical version information;
and the icon identification connecting unit is used for connecting the version identification icon by adopting a preset connecting symbol and the version combination relation.
In a preferred embodiment of the present invention, the apparatus may further include:
the modification acquisition module is used for acquiring relationship modification operation input by a user;
and the relationship modifying module is used for modifying the version merging relationship by adopting the relationship modifying operation.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
An embodiment of the present invention further provides an electronic device, which may include a processor, a memory, and a computer program stored in the memory and capable of running on the processor, and when being executed by the processor, the computer program implements the above information processing method embodiment.
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the embodiment of the information processing method is implemented.
The embodiments in the present specification are all described in a progressive manner, and each embodiment focuses on differences from other embodiments, and portions that are the same and similar between the embodiments may be referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The above detailed description is provided for an information processing method, an information processing apparatus, an electronic device, and a storage medium, and the principles and embodiments of the present invention are described herein by using specific examples, and the descriptions of the above examples are only used to help understand the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed, and in summary, the content of the present specification should not be construed as a limitation to the present invention.