CN115114900B - Text comment association method and device, electronic equipment, storage medium and product - Google Patents

Text comment association method and device, electronic equipment, storage medium and product Download PDF

Info

Publication number
CN115114900B
CN115114900B CN202211039243.7A CN202211039243A CN115114900B CN 115114900 B CN115114900 B CN 115114900B CN 202211039243 A CN202211039243 A CN 202211039243A CN 115114900 B CN115114900 B CN 115114900B
Authority
CN
China
Prior art keywords
text
information
version
interval
line number
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211039243.7A
Other languages
Chinese (zh)
Other versions
CN115114900A (en
Inventor
王长进
杨思萌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202211039243.7A priority Critical patent/CN115114900B/en
Publication of CN115114900A publication Critical patent/CN115114900A/en
Application granted granted Critical
Publication of CN115114900B publication Critical patent/CN115114900B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Library & Information Science (AREA)
  • Artificial Intelligence (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure relates to a text comment association method, a text comment association device, an electronic device, a storage medium and a product, wherein the method comprises the following steps: acquiring first version text information and second version text information; obtaining comment information corresponding to the first version of text information; determining text difference information between the first version text information and the second version text information; performing text line matching processing based on the first text line number and the text difference information to obtain a second text line number corresponding to the comment content; and associating the comment content with the second text line number to obtain comment information corresponding to the second version text information. By utilizing the embodiment of the disclosure, the comment content in the first version text information can be associated to the second version text information, the association of the text comments among the texts of all versions is improved, the occurrence of text comment omission is reduced, and the text review efficiency is improved.

Description

Text comment association method and device, electronic equipment, storage medium and product
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a text comment association method and apparatus, an electronic device, a storage medium, and a product.
Background
With the development of computer technology, the change of program codes in the software development process becomes more frequent and complex, so that the version control becomes a problem to be considered in software engineering.
In the related art, a developer submits codes by creating a development branch, and sends code contents of different versions submitted on the development branch to a code examiner through a branch combination request, and the code examiner can check the code contents of different versions so as to check and comment.
In the related art, code comments are easy to miss in the branch merging request, and the code checking efficiency is low.
Disclosure of Invention
The disclosure provides a text comment association method, a text comment association device, electronic equipment, a storage medium and a product, which are used for at least solving the problems that text comments are easy to miss in branch merging requests and text review efficiency is low in the related art. The technical scheme of the disclosure is as follows.
According to a first aspect of the embodiments of the present disclosure, there is provided a text comment associating method, including:
acquiring first version text information and second version text information;
obtaining comment information corresponding to the first version of text information, wherein the comment information comprises comment content and a first text line number corresponding to the comment content, and the first text line number is a text line number corresponding to a target text corresponding to the comment content in the first version of text information;
determining text difference information between the first version of text information and the second version of text information;
performing text line matching processing on the basis of the first text line number and the text difference information to obtain a second text line number corresponding to the comment content, wherein the second text line number is a text line number corresponding to the target text in the second version text information;
and associating the comment content with the second text line number to obtain comment information corresponding to the second version text information.
In one possible design, the text difference information includes at least one original text interval in the first version of text information, at least one altered text interval in the second version of text information, and pairing information between the at least one original text interval and the at least one altered text interval; performing text line matching processing based on the first text line number and the text difference information to obtain a second text line number corresponding to the comment content, including:
determining a target original text interval corresponding to the first text line number in the at least one original text interval;
determining a target change text interval corresponding to the target original text interval according to the pairing information;
acquiring corresponding information of a text line between the target original text interval and the target change text interval;
and determining the second text line number according to the text line corresponding information and the first text line number.
In one possible design, the determining a target original text interval corresponding to the first text line number in the at least one original text interval includes:
and under the condition that the at least one original text interval comprises the first text line number, determining the original text interval in which the first text line number is located as the target original text interval.
In one possible design, the determining a target original text interval corresponding to the first text line number in the at least one original text interval further includes:
determining a text line distance between the at least one original text interval and the first number of text lines, in the case that the at least one original text interval does not include the first number of text lines;
and determining the target original text interval according to the text line distance.
In a possible design, the determining the second text line number according to the text line correspondence information and the first text line number includes:
determining the offset direction between the first text line number and the target original text interval and a first offset starting line number corresponding to the target original text interval;
determining a second offset starting line number based on the text line corresponding information and the first offset starting line number, wherein the second offset starting line number is a text line number corresponding to the first offset starting line number in the target change text interval;
and determining the second text line number according to the second offset starting line number, the offset direction and the text line distance.
In one possible design, the obtaining of the comment information corresponding to the first version of text information includes:
acquiring previous version text information corresponding to the first version text information;
determining a modified text corresponding to the first version of text information based on the first version of text information and the last version of text information;
and extracting and processing comment information based on the changed text to obtain comment information corresponding to the first version of text information.
In one possible design, the obtaining the first version text information and the second version text information includes:
receiving a branch merging request corresponding to a first text development branch, wherein the first text development branch comprises at least two text submission nodes, and the at least two text submission nodes comprise a first text submission node and a second text submission node;
and responding to a text auditing instruction aiming at the branch merging request, and acquiring the first version text information and the second version text information, wherein the first version text information is text information corresponding to the first text submission node, and the second version text information is text information corresponding to the second text submission node.
In one possible design, the branch merge request is a request to point to a second text development branch to merge the text information corresponding to the first text development branch, and the second text submission node is the last text submission node in the first text development branch; the method further comprises the following steps:
acquiring target version text information corresponding to a target node in the second text development branch;
determining global text difference information corresponding to the branch combination request based on the target version text information and the second version text information, wherein the global text difference information comprises a difference text interval in the second version text information;
and adding the comment content to comment information corresponding to the global text difference information under the condition that the difference text interval comprises the second text line number.
In one possible design, the adding the comment content to the comment information corresponding to the global text difference information in the case that the difference text interval includes the second text line number includes:
under the condition that the difference text interval comprises the second text line number, performing content verification on a text corresponding to the second text line number in the second version text information to obtain a content verification result;
and adding the comment content to comment information corresponding to the global text difference information under the condition that the content verification result indicates that the text corresponding to the second text line number in the second version text information is consistent with the content of the target text.
According to a second aspect of the embodiments of the present disclosure, there is provided a text comment associating apparatus including:
a text information acquisition module configured to perform acquisition of a first version of text information and a second version of text information;
a comment information obtaining module configured to perform obtaining of comment information corresponding to the first version of text information, where the comment information includes comment content and a first text line number corresponding to the comment content, and the first text line number is a text line number corresponding to a target text corresponding to the comment content in the first version of text information;
a difference information determination module configured to perform determining text difference information between the first version of text information and the second version of text information;
a text line matching module configured to perform text line matching processing based on the first text line number and the text difference information to obtain a second text line number corresponding to the comment content, where the second text line number is a text line number corresponding to the target text in the second version text information;
and the comment associating module is configured to associate the comment content with the second text line number to obtain comment information corresponding to the second version text information.
In one possible design, the text difference information includes at least one original text interval in the first version of text information, at least one altered text interval in the second version of text information, and pairing information between the at least one original text interval and the at least one altered text interval; the text line matching module comprises:
a first interval determination submodule configured to perform determination of a target original text interval corresponding to the first text line number in the at least one original text interval;
a second interval determining submodule configured to perform determination of a target change text interval corresponding to the target original text interval according to the pairing information;
the corresponding information acquisition sub-module is configured to execute acquiring text line corresponding information between the target original text interval and the target change text interval;
and the text line determining sub-module is configured to determine the second text line number according to the text line corresponding information and the first text line number.
In one possible design, the first interval determination submodule includes:
a target interval determination unit configured to determine, as the target original text interval, an original text interval in which the first text line number is located if the at least one original text interval includes the first text line number.
In one possible design, the first interval determination submodule further includes:
a distance determining unit configured to perform determining a text line distance between the at least one original text interval and the first text line number in a case where the at least one original text interval does not include the first text line number;
the target interval determining unit is further configured to determine the target original text interval according to the text line distance.
In one possible design, the text line determination sub-module includes:
an offset information determining unit configured to perform determining an offset direction between the first text line number and the target original text interval and a first offset start line number corresponding to the target original text interval;
a starting position determining unit configured to perform determining a second offset starting line number, which is a text line number corresponding to the first offset starting line number in the target change text interval, based on the text line correspondence information and the first offset starting line number;
a text line offset unit configured to determine the second text line number according to the second offset start line number, the offset direction, and the text line distance.
In one possible design, the comment information acquiring module includes:
the text acquisition sub-module is configured to execute acquisition of the previous version of text information corresponding to the first version of text information;
the modified text determination sub-module is configured to determine modified texts corresponding to the first version of text information based on the first version of text information and the last version of text information;
and the comment information extraction submodule is configured to execute comment information extraction processing based on the changed text to obtain comment information corresponding to the first version of text information.
In one possible design, the text information obtaining module includes:
the request receiving submodule is configured to execute receiving of a branch merging request corresponding to a first text development branch, wherein the first text development branch comprises at least two text submission nodes, and the at least two text submission nodes comprise a first text submission node and a second text submission node;
a text information obtaining sub-module configured to execute a text audit instruction for the branch merge request to obtain the first version of text information and the second version of text information, where the first version of text information is text information corresponding to the first text submission node, and the second version of text information is text information corresponding to the second text submission node.
In one possible design, the branch merge request is a request to point to a second text development branch to merge the text information corresponding to the first text development branch, and the second text submission node is the last text submission node in the first text development branch; the text information acquisition module is further configured to execute acquiring target version text information corresponding to a target node in the second text development branch;
the difference information determination module is further configured to perform determining global text difference information corresponding to the branch combination request based on the target version text information and the second version text information, where the global text difference information includes a difference text interval in the second version text information;
the comment associating module is further configured to add the comment content to comment information corresponding to the global text difference information when the difference text interval includes the second text line number.
In one possible design, the comment associating module includes:
the content verification sub-module is configured to perform content verification on a text corresponding to the second text line number in the second version text information under the condition that the difference text interval includes the second text line number, so as to obtain a content verification result;
a comment adding sub-module configured to add the comment content to comment information corresponding to the global text difference information if the content verification result indicates that the text corresponding to the second text line number in the second version text information is consistent with the content of the target text.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the text comment association method as described in any one of the above first aspects.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, wherein instructions of the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the text comment association method of any one of the first aspect of the embodiments of the present disclosure.
According to a fifth aspect of the embodiments of the present disclosure, there is provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the text comment associating method of any one of the first aspects of the embodiments of the present disclosure.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
according to the text difference information between the first version text information and the second version text information, the text line corresponding to the comment content corresponding to the target text in the first version text information in the second version text information can be determined, and the comment content in the first version text information can be associated with the text line, so that the relevance of the text comment in each version text is improved, the occurrence of text comment omission is reduced, and the text review efficiency is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a schematic diagram illustrating an application environment in accordance with an illustrative embodiment;
FIG. 2 is a flowchart one of a text comment association method shown in accordance with an exemplary embodiment;
FIG. 3 is a flowchart II illustrating a text comment association method in accordance with an exemplary embodiment;
FIG. 4 illustrates a diagram of a branch merge request;
FIG. 5 is a flowchart three illustrating a text comment association method in accordance with an exemplary embodiment;
FIG. 6 illustrates a first diagram of determining a target original code segment and a second code line;
FIG. 7 is a diagram illustrating another second example of determining a target original code segment and a second code line;
FIG. 8 illustrates a schematic diagram of a first code review page;
FIG. 9 illustrates a schematic diagram of a second code audit page;
FIG. 10 is a diagram illustrating an example of associating comment text between different versions of code;
FIG. 11 is a flow diagram illustrating code comment association in a branch merge scenario;
FIG. 12 is a block diagram illustrating a text comment association apparatus in accordance with an illustrative embodiment;
FIG. 13 is a block diagram illustrating an electronic device for text comment association in accordance with an illustrative embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the disclosure, as detailed in the appended claims.
It should be noted that, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for presentation, analyzed data, etc.) referred to in the present disclosure are information and data authorized by the user or sufficiently authorized by each party.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating an application environment according to an exemplary embodiment, and as shown in fig. 1, the application environment may include a terminal 100 and a server 200.
The terminal 100 may be used to provide text version management services, such as code version management services, to any user. Specifically, the terminal 100 may include, but is not limited to, a smart phone, a desktop computer, a tablet computer, a notebook computer, a smart speaker, a digital assistant, an Augmented Reality (AR)/Virtual Reality (VR) device, a smart wearable device, and other types of electronic devices, and may also be software running on the electronic devices, such as an application program. Optionally, the operating system running on the electronic device may include, but is not limited to, an android system, an IOS system, linux, windows, and the like.
In an alternative embodiment, the server 200 may provide a background service for the terminal 100, and receive text information, such as code information, sent by the terminal 100. Specifically, the server 200 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a CDN (Content Delivery Network), a big data and artificial intelligence platform, and the like.
In addition, it should be noted that fig. 1 shows only one application environment provided by the present disclosure, and in practical applications, other application environments may also be included, for example, more terminals may be included.
In the embodiment of the present specification, the terminal 100 and the server 200 may be directly or indirectly connected through a wired or wireless communication manner, and the disclosure is not limited herein.
Fig. 2 is a flowchart illustrating a text comment associating method according to an exemplary embodiment, where the text comment associating method is applied to an electronic device, where the electronic device may be a terminal or a server, and as shown in fig. 2, the text comment associating method may include the following steps (210 to 250).
Step 210, obtaining the first version text information and the second version text information.
Optionally, the first version text information and the second version text information correspond to different program versions respectively. Optionally, the text is a code. Optionally, the text information is code information, the first version text information is first version code information, and the second version text information is second version code information. The program version corresponding to the first version text information may be before the program version corresponding to the second version text information, or may be after the program version corresponding to the second version text information, which is not limited in this embodiment of the present application.
Alternatively, the second version text information may be text information modified based on the first version text information. Optionally, the first version text information and the second version text information correspond to the same original version of the program text. Optionally, the program text is program code.
The first version text information and the second version text information may correspond to different versions of program texts on the same development branch, or different versions of program texts on different development branches.
Optionally, the first version of program text is included in the first version of text information. Optionally, the second version text information includes a second version program text.
In an exemplary embodiment, as shown in fig. 3, the obtaining of the first version text information and the second version text information may include the following steps (211 to 212), and fig. 3 is a second flowchart of a text comment associating method according to an exemplary embodiment.
Step 211, receiving a branch merging request corresponding to the first text development branch.
Optionally, the first text development branch is a first code development branch.
Optionally, the branch merge request is a request for directing the second text development branch to merge the text information corresponding to the first text development branch. Optionally, the second text development branch is a second code development branch.
In practical applications, such as software development scenarios, version management of code texts may be implemented by git (distributed version control system). git reduces the cost of creating code branches, so the current development branch model is generally a multi-branch mode, and a branch merge request (merge request) is an important process node in the development process for ensuring the code text quality. In the flow node, code change information corresponding to multiple code text submissions (commit) related to the branch merge request is submitted to one or more persons for code review (code review). During the code review process in a merge request (merge request), the reviewer can review directly at some single code submission (commit).
Optionally, the first text development branch includes at least two text submission nodes, and the at least two text submission nodes include a first text submission node and a second text submission node. Optionally, the text submission node is a code submission node, the first text submission node is a first code submission node, and the second text submission node is a second code submission node.
The text submission node is a flow node corresponding to a text submission operation (e.g., a code submission operation), and the text submission node may be identified by information such as a version number and a submission time. The system executes a text submission operation once, which can be identified as a text submission node, and the text submission operation is used for submitting the currently written program text to a text warehouse (such as a code warehouse) and generating corresponding attribute information such as version number, submission time and the like for the program text submitted this time.
In one example, as shown in FIG. 4, a diagram illustrating a branch merge request is illustrated. Two code development branches are shown in fig. 4, a main branch (as a second code development branch) and a feature branch (as a first code development branch), respectively, and a start node (Base node) of the feature branch is one node in the main branch, and it can be seen that the feature branch is one development branch created from the node. The branch merge request is used to merge the code content on the feature branch with the main branch. The feature branch comprises three code submitting nodes which are a first node, a second node and a third node respectively, correspondingly, the branch merging request comprises program codes of corresponding versions submitted by each node, and a request receiver can review and comment the program codes corresponding to the three nodes. And under the condition that the audit is passed, the branch merging request is received, and the last code in the characteristic branch can be submitted to the node when the codes are merged, namely the program code corresponding to the third node is merged with the program code corresponding to the target node on the main branch to obtain a merged code. Optionally, the target node is the most recent node on the primary branch, corresponding to the most recent version of the program code on the primary branch.
Step 212, in response to the text audit instruction for the branch merge request, obtaining the first version text information and the second version text information.
Optionally, the first version of text information is text information corresponding to the first text submission node, and the second version of text information is text information corresponding to the second text submission node. Optionally, the text audit instruction is a code audit instruction.
After receiving the text review instruction, the target account may perform text review (e.g., code review) to obtain text information corresponding to at least two text submission nodes in the first text development branch, where the text information may include text information corresponding to the first text submission node (i.e., the first version of text information) and text information corresponding to the second text submission node (i.e., the second version of text information).
Optionally, the branch merge request includes a version number and a text storage address (e.g., a code storage address) corresponding to at least two text submission nodes, and the program text file corresponding to the text storage address and the version number may be obtained based on the version number and the text storage address.
Based on the configuration, under the scene of text branch combination, the text comments in the corresponding version program texts submitted by a certain node in the text development branch can be associated to different version program texts submitted by other nodes, and the text review efficiency is improved.
Step 220, obtaining comment information corresponding to the first version of text information.
Optionally, the comment information includes comment content and a first text line number corresponding to the comment content. The first text line number refers to a text line number corresponding to the target text corresponding to the comment content in the first version of text information. Optionally, the text line number is a code line number. Optionally, the target text is target code.
In an exemplary embodiment, as shown in fig. 3, the obtaining of the comment information corresponding to the first version of text information includes the following steps (221 to 223).
Step 221, obtaining the previous version of text information corresponding to the first version of text information.
Optionally, the first version of text information is text information obtained by modifying and updating on the basis of a previous version of text information corresponding to the first version of text information.
Optionally, it is determined that the first version of text information is at a corresponding first text submission node, a previous text submission node corresponding to the first text submission node is obtained, and text information corresponding to the previous text submission node, that is, the previous version of text information corresponding to the first version of text information is obtained.
Step 222, determining a modified text corresponding to the first version of text information based on the first version of text information and the last version of text information.
Optionally, the modified text refers to a text in the first version of text information that is different from a text in the previous version of text information. Optionally, the change text is a change code.
Optionally, the text in the first version of text information is compared with the text in the previous version of text information, so that the modified text in the first version of text information can be obtained.
And step 223, extracting and processing the comment information based on the changed text to obtain the comment information corresponding to the first version of text information.
Optionally, the comment information extraction processing includes: determining the text line number corresponding to the changed text in the first version text information, acquiring the corresponding relationship information between the text line and the text comment in the first version text information, and determining the comment content corresponding to the changed text and the text line number corresponding to the comment content according to the corresponding relationship information.
Optionally, the comment information of the first version of text information includes comment content corresponding to the changed text and a text line number corresponding to the comment content. Optionally, the comment content is a comment added to the modified text by a target object corresponding to the target text review account. Optionally, the comment content includes a code error, a code question, a code optimization suggestion, and the like, and optionally, the comment content includes interactive comments corresponding to at least two accounts.
According to the method and the device, the change text corresponding to the first version of text information is determined, and the comment content corresponding to the change text is obtained, so that the comment content in the change text can be associated with the text information of other versions, and the text review efficiency can be improved. In general, when a reviewer performs text review, the text information of the current version is usually compared with the text information of the previous version, so that the changed texts of the current version compared with the changed texts of the previous version are determined, comments can be directly added to the changed texts if relevant problems exist, and based on the configuration, the added comments can be displayed in other versions, and the text review efficiency is effectively improved.
In step 230, text difference information between the first version text information and the second version text information is determined.
Optionally, the program text in the first version of text information is compared with the program text in the second version of text information, so as to obtain the text difference information. Optionally, the text difference information is code difference information.
Optionally, the text difference information includes at least one original text interval in the first version of text information, at least one altered text interval in the second version of text information, and pairing information between the at least one original text interval and the at least one altered text interval. Optionally, the original text interval is an original code interval. Optionally, the change text section is a change code section.
Optionally, the pairing information represents a pairing relationship between at least one original text interval and at least one modified text interval. The above-mentioned pairing relationship may be a modification change relationship.
Optionally, the original text interval is an interval in which the original text segment in the first version of text information is located, and the modified text interval paired with the original text interval is an interval in which the modified text segment corresponding to the original text segment in the second version of text information is located. Optionally, the original text segment is an original code segment, and the modified text segment is a modified code segment.
And 240, performing text line matching processing based on the first text line number and the text difference information to obtain a second text line number corresponding to the comment content.
Optionally, the second text line number is a text line number corresponding to the target text in the second version text information. Optionally, the target text is target code. Optionally, the text difference information is code difference information.
Alternatively, in the case where the text difference information is empty, that is, the program text in the first version text information and the second version text information is represented to be the same, the first text line number may be directly determined as the second text line number.
Optionally, when the text difference information is not empty, it is characterized that there is a difference between the first version text information and the second version text information, and a relationship corresponding to line numbers corresponding to the same text (for example, the same code) in the first version text information and the second version text information may be obtained according to the text difference (code difference) between the first version text information and the second version text information, so that a text line number corresponding to a target text in the first version text information in the second version text information may be found, and the text line number is determined as a second text line number corresponding to the comment content.
In an exemplary embodiment, as shown in fig. 3, the performing text line matching processing based on the first text line number and the text difference information to obtain a second text line number corresponding to the comment content may include the following steps (241 to 244).
Step 241, determining a target original text interval corresponding to the first text line number in at least one original text interval.
The target original text interval may be an original text interval including the first text line number, or an original text interval closest to the first text line number. Optionally, the original text interval is an original code interval, and the target original text interval is a target original code interval.
In an exemplary embodiment, as shown in fig. 5, the determining of the target raw text interval corresponding to the first text line number in the at least one raw text interval includes the following steps (2411 to 2413), and fig. 5 is a flowchart three of a text comment association method shown according to an exemplary embodiment.
Step 2411, determining an original text interval in which the first text line number is located as a target original text interval under the condition that at least one original text interval comprises the first text line number.
Based on the configuration, the text interval where the text line corresponding to the comment content is located can be accurately determined, so that accurate text line matching can be performed according to the corresponding relation between the original text interval and the corresponding change interval in the difference information, and the accuracy of text line matching is improved.
Step 2412, determining a text line distance between the at least one original text interval and the first text line number under the condition that the at least one original text interval does not comprise the first text line number.
Optionally, the text line distance is a code line distance. In this case, a text line distance between each original text interval in the at least one original text interval and the first text line number may be determined, and optionally, the text line distance may be a shortest distance from the first text line number to the distance between the two sides of the original text interval.
And 2413, determining a target original text interval according to the text line distance.
Optionally, after obtaining the text line distance between each original text interval and the first text line number, the minimum text line distance may be determined, and the original text interval corresponding to the minimum text line distance is determined as the target original text interval.
Based on the configuration, under the condition that each original text interval does not include the text line where the comment content is located, the target original text interval can be determined according to the distance between each original text interval and the text line where the comment content is located, so that text line matching can be performed according to the relative position between the target original text interval and the text line where the comment content is located, and the accuracy of text line matching is improved.
And 242, determining a target change text interval corresponding to the target original text interval according to the pairing information.
Since the pairing information may represent a pairing relationship between the at least one original text interval and the at least one modified text interval, when a target original text interval is determined, a modified text interval corresponding to the target original text interval may be found from the pairing information and determined as a target modified text interval.
And 243, acquiring text line corresponding information between the target original text interval and the target change text interval.
Optionally, the text line correspondence information is code line correspondence information. Optionally, in the process of comparing the program text in the first version of text information with the program text in the second version of text information, the text line correspondence information between the original text interval and the modified text interval that are paired with each other may be determined. That is, the text difference information includes text line correspondence information between the original text section and the modified text section that are paired with each other.
Optionally, the text line correspondence information represents a correspondence between texts corresponding to the original text interval and the modified text interval that are paired with each other. Optionally, the text line correspondence information includes the text line number of the same text in the original text interval and the modified text interval paired with each other in the first version of text information, and the text line number of the same text in the second version of text information.
Step 244, determining the second text line number according to the text line corresponding information and the first text line number.
In the case of determining the first text line number, a text line number corresponding to the first text line number in the second version text information may be found from the text line correspondence information, and determined as a second text line number corresponding to the comment content.
In one example, as shown in FIG. 6, a first diagram illustrating a determination of a target original code segment and a second code line is shown. The code difference information between the first code 61 and the second code 62 is shown in fig. 6, and specifically includes a first original code segment 611 and a second original code segment 612 in the first code 61, and a first alteration code segment 621 and a second alteration code segment 622 in the second code 62. The first original code segment 611 corresponds to the first change code segment 621, and the second original code segment 612 corresponds to the second change code segment 622. Since the comment text 63 in the first code 61 corresponds to the first code row 104 in the first code, and the second original code segment 612 includes the row 104, the second original code segment 612 can be determined as the target original code segment corresponding to the comment text 63. Since the second original code segment 612 and the second change code segment 622 correspond to each other, it can be determined that the code corresponding to the line 104 in the second original code segment 612 is the line 106 in the code corresponding to the second change code segment 622, and further, the line 106 in the second change code segment 622 can be determined as the second code line corresponding to the comment text 63.
In another example, as shown in FIG. 7, another schematic diagram II of determining a target original code segment and a second code line is illustrated. The code difference information between the third code 71 and the fourth code 72 is shown in fig. 7, and specifically comprises a third original code segment 711 and a fourth original code segment 712 in the third code 71, and a third altered code segment 721 and a fourth altered code segment 722 in the fourth code 72. The third original code segment 711 corresponds to the third modifying code segment 721, and the fourth original code segment 712 corresponds to the fourth modifying code segment 722. Since neither the third original code segment 711 nor the fourth original code segment 712 in the third code 71 includes the 90 th line corresponding to the comment text 73, it is necessary to determine a code line distance between the 90 th line corresponding to the comment text 73 and each original code segment, where the code line distance between the 90 th line corresponding to the comment text 73 and the fourth original code segment 712 is closest, so that the fourth original code segment 712 is determined as the target original code segment corresponding to the comment text 73, and since the fourth original code segment 712 and the fourth alteration code segment 722 correspond to each other, the code line distance 10 is shifted upwards from the 102 th line of the starting line of the fourth alteration code segment 722, and the shift result is the 92 th line, and further, the 92 th line in the fourth alteration code segment 722 is determined as the second code line corresponding to the comment text 73.
Based on the configuration, the number of new lines corresponding to the comment content in the second version of text information can be determined according to the corresponding relation between the difference text interval corresponding to the comment content in the first version of text information and the difference text interval between different versions, so that text line matching is realized, and the accuracy and efficiency of text line matching are improved.
In an exemplary embodiment, as shown in fig. 5, the determining the second text line number according to the text line correspondence information and the first text line number includes the following steps (2441 to 2443).
Step 2441, determine the offset direction between the first text line number and the target original text interval and the first offset starting line number corresponding to the target original text interval.
Under the condition that each original text interval does not include the text line where the comment content is located, the target original text interval corresponding to the comment content can be determined according to the distance between each original text interval and the text line where the comment content is located, and therefore the new text line corresponding to the comment content in the second version text information can be determined according to the relative position between the text line where the comment content is located and the target original text interval.
Optionally, the relative position between the first text line number and the target original text interval may be determined by the offset direction, the first offset starting line number, and the target text line distance between the target original text interval and the first text line number.
Optionally, the first offset starting line number may be a text line number corresponding to a target interval boundary line corresponding to the target text line distance in two interval boundary lines of the target original text interval.
Optionally, in a case that the first text line number is located above the target original text interval, the offset direction is an upward offset, and the corresponding operation is line number subtraction.
Optionally, in a case that the first text line number is located below the target original text interval, the offset direction is a downward offset, and the corresponding operation is line number addition.
Step 2442 determines a second offset starting line number based on the text line correspondence information and the first offset starting line number.
Optionally, the second offset starting line number is a text line number corresponding to the first offset starting line number in the target change text interval.
Optionally, a text line number corresponding to the offset start line number in the text line correspondence information is determined as the second offset start line number.
And 2443, determining a second text line number according to the second offset starting line number, the offset direction and the text line distance.
Optionally, when the first text line number is located above the target original text interval, subtracting the target text line distance from the second offset start line number to obtain the second text line number.
Optionally, when the first text line number is located below the target original text interval, adding the second offset start line number to the target text line distance to obtain the second text line number.
Based on the configuration, under the condition that each original text interval does not comprise the text line where the comment content is located, the text line matching is carried out according to the relative position between the target original text interval and the text line where the comment content is located, and the accuracy of the text line matching is improved.
And step 250, associating the comment content with the second text line number to obtain comment information corresponding to the text information of the second version.
Optionally, the comment content is bound to the second text line number, that is, the comment content is bound to the target text corresponding to the second text line number, so that comment association between different versions of text is realized.
Optionally, a text review page corresponding to the second version of text information is displayed, and the comment content may be displayed in the text review page. Optionally, the comment content corresponding to the second text line number is displayed. The comment content is the comment content of the target text corresponding to the first text line in the first version of text information. The comment content is comment content issued by a text audit account.
In one example, as shown in FIG. 8, a diagram illustrating a first code audit page is shown. FIG. 8 illustrates a code review page 80 that includes a first version of program code 81 and a second version of program code 82. In code review page 80, the code with "-" identification in first version of program code 81 is a difference code in first version of program code 81 relative to second version of program code 82, and the code with "+" identification in second version of program code 82 is a difference code in second version of program code 82 relative to first version of program code 81. Wherein the code "111.111" on the 3 rd line in the second version of the program code 82 is a code modified on the basis of the code "111" on the 3 rd line in the first version of the program code 81; the code "222.222" on the 4 th line in the second version of the program code 82 is a code modified on the basis of the code "222" on the 4 th line in the first version of the program code 81; the code "add a line" in the 6 th line in the second version of the program code 82 is a new line code, and corresponds to the comment text 2 issued by the comment account 2.
In another example, as shown in FIG. 9, a diagram illustrating a second code audit page is shown. Code review page 90 shown in FIG. 9 includes first version of program code 81 and third version of program code 83 therein. The third version of the program code 83 is a code updated on the basis of the second version of the program code 82 described above. The code "// this is a comment" of line 5 in the third version of program code 83 is a new code relative to the second version of program code 82, and is also a difference code relative to the first version of program code 81. Due to the increase of the code of the line, the code line corresponding to the code "add a line" of the 6 th line in the program code 82 of the second version in the program code 83 of the third version is changed into the 7 th line, so that the code line corresponding to the comment text 2 issued by the comment account 2 is also updated to the 7 th line, and the code association is realized.
In an exemplary embodiment, the second text submission node is the last text submission node in the first text development branch; accordingly, as shown in fig. 3, the method may further include the following steps (260 to 280).
And step 260, acquiring target version text information corresponding to the target node in the second text development branch.
Optionally, the second text development branch is a target branch for merging the first text development branch. The target node may be a latest node corresponding to the second text development branch, and the latest version of text information in the second text development branch corresponds to the target version of text information. Optionally, the target version text information is target version code information. The target node may also be a start node corresponding to the first text development branch in the second text development branch.
Step 270, determining global text difference information corresponding to the branch combination request based on the target version text information and the second version text information.
Optionally, comparing the target version text information with the second version text information to obtain text difference information between the target version text information and the second version text information, where the branch combination request is used to combine the target version text information and the second version text information, and thus the text difference information between the target version text information and the second version text information is the global text difference information corresponding to the branch combination request. Optionally, the global text difference information is global code difference information.
Optionally, the global text difference information comprises a difference text interval in the second version of text information. Optionally, the difference text interval is an interval in which a difference text segment in the second version text information is different from the text in the target version text information. Optionally, the difference text interval is a difference code interval, and the difference text segment is a difference code segment.
Step 280, adding the comment content to the comment information corresponding to the global text difference information under the condition that the difference text interval comprises the second text line number.
Optionally, when the difference text segment includes the target text corresponding to the second text line number, the comment content is displayed in association with the second text line number.
Optionally, in response to the comment viewing instruction for the second text line number, the comment content is displayed in a comparison review page of the second version text information and the target version text information.
In one example, as shown in FIG. 10, a diagram illustrating associating comment text between different versions of code is illustrated. Shown in FIG. 10 are program code 101 corresponding to a first code commit operation, program code 102 corresponding to a second code commit operation, and code difference information between program code 101 and program code 102. Code difference information between program code 101 and program code 102 includes original code section 1011 and altered code section 1021 paired with each other. The code of line 120 in change code segment 1021 corresponds to comment text 1022. After being updated, the program code 102 can be submitted to the code warehouse through the third code submitting operation, so as to obtain the program code 103 corresponding to the third code submitting operation. In the program code 103, the code of the 120 th line in the change code segment 1021 corresponds to the new line number 130 in the program code 103, so that the comment text 1022 can be associated with the 130 th line in the program code 103. In this way, in the process of comparing the program code 101 and the program code 103, the above-described comment text 1022 can be seen in the code difference information between the program code 101 and the program code 103. The code difference information between the program code 101 and the program code 103 includes an original code segment 1011 and a change code segment 1031, and since the change code segment 1031 includes the 130 th line, the comment text 1022 may be displayed in the change code segment 1031.
Based on the configuration, the comment content corresponding to the modified text of the first version corresponding to the first version of the first version information can be associated to the difference text between the text of the second version to be merged and the text of the target version, and the text review efficiency is improved.
In a possible implementation manner, under the condition that the difference text interval includes the second text line number, performing content verification on the text corresponding to the second text line number in the second version text information to obtain a content verification result; and under the condition that the content verification result indicates that the text corresponding to the second text line number in the second version text information is consistent with the content of the target text, adding the comment content to the comment information corresponding to the global text difference information.
Based on the configuration, before the comment content is associated to the new text line, the text content of the new text line and the content of the original target text are verified, and association is performed under the condition of consistent verification, so that the accuracy of text comment association can be effectively improved.
In one example, as shown in FIG. 11, a flow diagram illustrating code comment association in a branch merge scenario is illustrated. Two code development branches are shown in fig. 11, a main branch (as a second code development branch) and a feature branch (as a first code development branch), respectively, with the start node (Base node) of the feature branch being one node in the main branch, and it can be seen that the feature branch is one development branch created from this node. The branch merge request is used to merge the code content on the feature branch with the main branch. The feature branch comprises three code submitting nodes which are a first node, a second node and a third node respectively, correspondingly, the branch merging request comprises program codes of corresponding versions submitted by each node, and a request receiver can review and comment the program codes corresponding to the three nodes. The reviewer may add a comment for the change code to the code information corresponding to the second node, where the change code may be a difference code corresponding to the second node with respect to the first node. Besides the second node, the auditor can also check the code information corresponding to other nodes, for example, when the codes are merged, the last code in the feature branch needs to be submitted to the node, that is, the program code corresponding to the third node is merged with the program code corresponding to the target node on the main branch, so that the auditor can also audit the code information corresponding to the third node. Specifically, code review can be performed by comparing global differences between code information corresponding to the third node and code information corresponding to the first node, and if a change code corresponding to the second node exists in the global differences, relevant comments added by a reviewer at the second node for the change code can be associated to the global difference information for display through the code review association method provided by the disclosure, so that the reviewer can see comments added at the second node when reviewing the code information corresponding to the third node, thereby reducing the situations of missing code reviews and improving the code review efficiency.
In summary, according to the technical scheme provided by the embodiment of the disclosure, according to text difference information between the first version text information and the second version text information, a text line corresponding to comment content corresponding to a target text in the first version text information in the second version text information can be determined, and by associating the comment content with the text line, the comment content in the first version text information can be associated with the second version text information, so that the association of text comments among versions of text is improved, the occurrence of text comment omission is reduced, and text review efficiency is improved.
FIG. 12 is a block diagram illustrating a text comment associating apparatus in accordance with an exemplary embodiment. Referring to fig. 12, the apparatus 1200 includes: a text information obtaining module 1210, a comment information obtaining module 1220, a difference information determining module 1230, a text line matching module 1240 and a comment associating module 1250.
A text information obtaining module 1210 configured to perform obtaining the first version text information and the second version text information.
The comment information obtaining module 1220 is configured to perform obtaining of comment information corresponding to the first version of text information, where the comment information includes comment content and a first text line number corresponding to the comment content, and the first text line number is a text line number corresponding to a target text corresponding to the comment content in the first version of text information.
A difference information determination module 1230 configured to perform determining text difference information between the first version of text information and the second version of text information.
A text line matching module 1240 configured to perform text line matching processing based on the first text line number and the text difference information to obtain a second text line number corresponding to the comment content, where the second text line number is a text line number corresponding to the target text in the second version text information.
And the comment associating module 1250 is configured to associate the comment content with the second text line number to obtain comment information corresponding to the second version text information.
In one possible design, the text difference information includes at least one original text interval in the first version of text information, at least one altered text interval in the second version of text information, and pairing information between the at least one original text interval and the at least one altered text interval; the text line matching module 1240 includes:
a first interval determination submodule configured to perform determining a target original text interval of the at least one original text interval corresponding to the first text line number.
And the second interval determining submodule is configured to execute the step of determining a target change text interval corresponding to the target original text interval according to the pairing information.
And the corresponding information acquisition sub-module is configured to execute acquisition of text line corresponding information between the target original text interval and the target changed text interval.
And the text line determining sub-module is configured to determine the second text line number according to the text line corresponding information and the first text line number.
In one possible design, the first interval determination submodule includes:
a target interval determining unit configured to determine, in a case that the at least one original text interval includes the first text line number, an original text interval in which the first text line number is located as the target original text interval.
In one possible design, the first interval determination submodule further includes:
a distance determining unit configured to perform determining a text line distance between the at least one original text interval and the first text line number if the at least one original text interval does not include the first text line number.
The target interval determining unit is further configured to determine the target original text interval according to the text line distance.
In one possible design, the text line determination sub-module includes:
an offset information determining unit configured to perform determining an offset direction between the first text line number and the target original text interval and a first offset start line number corresponding to the target original text interval.
A starting position determination unit configured to perform determining a second offset starting line number, which is a text line number corresponding to the first offset starting line number in the target change text interval, based on the text line correspondence information and the first offset starting line number.
A text line offset unit configured to determine the second text line number according to the second offset start line number, the offset direction, and the text line distance.
In one possible design, the comment information obtaining module 1220 includes:
and the text acquisition sub-module is configured to acquire the previous version of text information corresponding to the first version of text information.
And the modified text determining sub-module is configured to determine modified text corresponding to the first version of text information based on the first version of text information and the last version of text information.
And the comment information extraction submodule is configured to execute comment information extraction processing based on the changed text to obtain comment information corresponding to the first version of text information.
In one possible design, the text information obtaining module 1210 includes:
the request receiving submodule is configured to execute receiving of a branch merging request corresponding to a first text development branch, wherein the first text development branch comprises at least two text submission nodes, and the at least two text submission nodes comprise a first text submission node and a second text submission node.
A text information obtaining sub-module configured to perform a text audit instruction for the branch merge request, and obtain the first version text information and the second version text information, where the first version text information is text information corresponding to the first text submission node, and the second version text information is text information corresponding to the second text submission node.
In one possible design, the branch merge request is a request to point to a second text development branch to merge the text information corresponding to the first text development branch, and the second text submission node is the last text submission node in the first text development branch; the text information obtaining module 1210 is further configured to perform obtaining of target version text information corresponding to a target node in the second text development branch.
The difference information determining module 1230 is further configured to perform determining global text difference information corresponding to the branch merge request based on the target version text information and the second version text information, where the global text difference information includes a difference text interval in the second version text information.
The comment associating module 1250 is further configured to add the comment content to the comment information corresponding to the global text difference information if the difference text interval includes the second text line number.
In one possible design, the comment associating module 1250 includes:
and the content verification sub-module is configured to perform content verification on the text corresponding to the second text line number in the second version text information under the condition that the difference text interval includes the second text line number, so as to obtain a content verification result.
A comment adding sub-module configured to add the comment content to comment information corresponding to the global text difference information if the content verification result indicates that the text corresponding to the second text line number in the second version text information is consistent with the content of the target text.
In summary, according to the technical solution provided by the embodiment of the disclosure, according to the text difference information between the first version text information and the second version text information, the text line corresponding to the comment content corresponding to the target text in the first version text information in the second version text information can be determined, and by associating the comment content with the text line, the comment content in the first version text information can be associated with the second version text information, so that the association of the text comment in each version text is promoted, the occurrence of text comment omission is reduced, and the text review efficiency is promoted.
It should be noted that, when the apparatus provided in the foregoing embodiment implements the functions thereof, only the division of the functional modules is illustrated, and in practical applications, the functions may be distributed by different functional modules according to needs, that is, the internal structure of the apparatus may be divided into different functional modules to implement all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and specific implementation processes thereof are described in detail in the method embodiments, which are not described herein again.
Fig. 13 is a block diagram illustrating an electronic device for text comment association, which may be a terminal, according to an example embodiment, and an internal structure thereof may be as shown in fig. 13. The electronic device comprises a processor, a memory, a network interface, a display screen and an input device which are connected through a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic equipment comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the electronic device is used for connecting and communicating with an external terminal through a network. The computer program when executed by a processor implements a text comment association method. The display screen of the electronic equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the electronic equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 13 is merely a block diagram of some of the structures associated with the disclosed aspects and does not constitute a limitation on the electronic devices to which the disclosed aspects apply, as a particular electronic device may include more or less components than those shown, or combine certain components, or have a different arrangement of components.
In an exemplary embodiment, there is also provided an electronic device including: a processor; wherein the processor is configured to execute the instructions to implement a text comment association method as in embodiments of the present disclosure.
In an exemplary embodiment, a computer-readable storage medium is also provided, in which instructions, when executed by a processor of an electronic device, enable the electronic device to perform a text comment association method in the disclosed embodiments.
In an exemplary embodiment, a computer program product containing instructions that, when executed on a computer, cause the computer to perform a text comment association method in an embodiment of the present disclosure is also provided.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (11)

1. A text comment association method is characterized by comprising the following steps:
acquiring first version text information and second version text information;
obtaining comment information corresponding to the first version of text information, wherein the comment information comprises comment content and a first text line number corresponding to the comment content, and the first text line number is a text line number corresponding to a target text corresponding to the comment content in the first version of text information;
determining text difference information between the first version of text information and the second version of text information, the text difference information including at least one original text interval in the first version of text information, at least one altered text interval in the second version of text information, and pairing information between the at least one original text interval and the at least one altered text interval;
determining a target original text interval corresponding to the first text line number in the at least one original text interval;
determining a target change text interval corresponding to the target original text interval according to the pairing information;
acquiring corresponding information of a text line between the target original text interval and the target change text interval;
determining a second text line number corresponding to the comment content according to the information corresponding to the text line and the first text line number, wherein the second text line number is the text line number corresponding to the target text in the text information of the second version;
and associating the comment content with the second text line number to obtain comment information corresponding to the second version text information.
2. The method of claim 1, wherein determining a target original text interval of the at least one original text interval corresponding to the first line of text comprises:
and under the condition that the at least one original text interval comprises the first text line number, determining the original text interval in which the first text line number is located as the target original text interval.
3. The method of claim 2, wherein determining a target original text interval of the at least one original text interval corresponding to the first line of text further comprises:
determining a text line distance between the at least one original text interval and the first number of text lines, in the case that the at least one original text interval does not include the first number of text lines;
and determining the target original text interval according to the text line distance.
4. The method of claim 3, wherein the determining a second text line number corresponding to the comment content according to the text line correspondence information and the first text line number comprises:
determining an offset direction between the first text line number and the target original text interval and a first offset starting line number corresponding to the target original text interval;
determining a second offset starting line number based on the text line corresponding information and the first offset starting line number, wherein the second offset starting line number is a text line number corresponding to the first offset starting line number in the target change text interval;
and determining the second text line number according to the second offset starting line number, the offset direction and the text line distance.
5. The method according to any one of claims 1 to 4, wherein the obtaining of comment information corresponding to the first version of text information includes:
acquiring previous version text information corresponding to the first version text information;
determining a modified text corresponding to the first version of text information based on the first version of text information and the last version of text information;
and extracting and processing comment information based on the changed text to obtain comment information corresponding to the first version of text information.
6. The method according to any one of claims 1 to 4, wherein the obtaining the first version text information and the second version text information comprises:
receiving a branch merging request corresponding to a first text development branch, wherein the first text development branch comprises at least two text submission nodes, and the at least two text submission nodes comprise a first text submission node and a second text submission node;
and responding to a text auditing instruction aiming at the branch merging request, and acquiring the first version text information and the second version text information, wherein the first version text information is text information corresponding to the first text submission node, and the second version text information is text information corresponding to the second text submission node.
7. The method of claim 6, wherein the branch merge request is a request to point to a second text development branch to merge text information corresponding to the first text development branch, the second text submission node being a last text submission node in the first text development branch; the method further comprises the following steps:
acquiring target version text information corresponding to a target node in the second text development branch;
determining global text difference information corresponding to the branch combination request based on the target version text information and the second version text information, wherein the global text difference information comprises a difference text interval in the second version text information;
and adding the comment content to comment information corresponding to the global text difference information under the condition that the difference text interval comprises the second text line number.
8. The method of claim 7, wherein in the case that the difference text interval includes the second text line number, adding the comment content to comment information corresponding to the global text difference information includes:
under the condition that the difference text interval comprises the second text line number, performing content verification on a text corresponding to the second text line number in the second version text information to obtain a content verification result;
and under the condition that the content verification result indicates that the text corresponding to the second text line number in the second version text information is consistent with the content of the target text, adding the comment content to comment information corresponding to the global text difference information.
9. A text comment associating apparatus, characterized by comprising:
a text information acquisition module configured to perform acquisition of a first version of text information and a second version of text information;
a comment information obtaining module configured to perform obtaining of comment information corresponding to the first version of text information, where the comment information includes comment content and a first text line number corresponding to the comment content, and the first text line number is a text line number corresponding to a target text corresponding to the comment content in the first version of text information;
a difference information determination module configured to perform determining text difference information between the first version of text information and the second version of text information, the text difference information including at least one original text interval in the first version of text information, at least one altered text interval in the second version of text information, and pairing information between the at least one original text interval and the at least one altered text interval;
a first interval determination submodule configured to perform determining a target original text interval corresponding to the first text line number in the at least one original text interval;
a second interval determining submodule configured to perform determination of a target change text interval corresponding to the target original text interval according to the pairing information;
a corresponding information obtaining sub-module configured to perform obtaining of text line corresponding information between the target original text interval and the target changed text interval;
a text line determining sub-module configured to determine a second text line number corresponding to the comment content according to the text line corresponding information and the first text line number, where the second text line number is a text line number corresponding to the target text in the second version text information;
and the comment associating module is configured to associate the comment content with the second text line number to obtain comment information corresponding to the second version text information.
10. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the text comment association method of any one of claims 1 to 8.
11. A computer-readable storage medium having instructions stored thereon which, when executed by a processor of an electronic device, enable the electronic device to perform the text comment association method of any one of claims 1 to 8.
CN202211039243.7A 2022-08-29 2022-08-29 Text comment association method and device, electronic equipment, storage medium and product Active CN115114900B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211039243.7A CN115114900B (en) 2022-08-29 2022-08-29 Text comment association method and device, electronic equipment, storage medium and product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211039243.7A CN115114900B (en) 2022-08-29 2022-08-29 Text comment association method and device, electronic equipment, storage medium and product

Publications (2)

Publication Number Publication Date
CN115114900A CN115114900A (en) 2022-09-27
CN115114900B true CN115114900B (en) 2022-12-27

Family

ID=83336249

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211039243.7A Active CN115114900B (en) 2022-08-29 2022-08-29 Text comment association method and device, electronic equipment, storage medium and product

Country Status (1)

Country Link
CN (1) CN115114900B (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109918114A (en) * 2019-02-03 2019-06-21 广州视源电子科技股份有限公司 Comment information acquisition methods, device, computer equipment and the storage medium of code
US11741055B2 (en) * 2019-10-24 2023-08-29 Docscorp Group Pty Ltd Managing file revisions from multiple reviewers
CN112328927B (en) * 2020-11-27 2023-09-01 抖音视界有限公司 Document processing method and device, readable medium and electronic equipment
CN114329005A (en) * 2021-09-26 2022-04-12 腾讯科技(深圳)有限公司 Information processing method, information processing device, computer equipment and storage medium
CN114741088A (en) * 2022-04-15 2022-07-12 天津大学 App source code linking method based on user comments and developer intelligence

Also Published As

Publication number Publication date
CN115114900A (en) 2022-09-27

Similar Documents

Publication Publication Date Title
CN110782240B (en) Business data processing method and device, computer equipment and storage medium
CN109474578B (en) Message checking method, device, computer equipment and storage medium
CN108804159B (en) Javascript module loading method and preprocessing method and device thereof, and computer equipment
CN110688598B (en) Service parameter acquisition method and device, computer equipment and storage medium
CN109189799B (en) Service data query method, device, computer equipment and storage medium
CN108073429B (en) Payment mode configuration method, device, equipment and storage medium
CN110597511A (en) Page automatic generation method, system, terminal equipment and storage medium
CN115827084A (en) Data processing method, device, equipment and storage medium
CN113918738B (en) Multimedia resource recommendation method and device, electronic equipment and storage medium
CN114461217A (en) Code compiling method and device, electronic equipment and storage medium
CN109462661B (en) Data synchronization method and device, computer equipment and storage medium
CN112181437B (en) Gray release method and device based on Devops, computer equipment and storage medium
CN115114900B (en) Text comment association method and device, electronic equipment, storage medium and product
CN108632348B (en) Service checking method and device
CN115934129A (en) Software project updating method and device, computer equipment and storage medium
CN113157722B (en) Data processing method, device, server, system and storage medium
CN115220731A (en) Index data acquisition method and device, computer equipment and storage medium
CN109711809B (en) Merchant attribute setting method and device, computer equipment and storage medium
CN114491093A (en) Multimedia resource recommendation and object representation network generation method and device
CN113486283A (en) Page merging method, device, server, medium and product
CN107741951B (en) Page data processing method and device and electronic equipment
CN111124932A (en) Scheme verification method, system, device, computer equipment and storage medium
CN110728584B (en) Information processing method and device, readable storage medium and electronic equipment
CN112817848B (en) Test information display method and device, electronic equipment and storage medium
CN113204477B (en) Application testing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant