CN117709329A - Content comparison method and device, readable medium and electronic equipment - Google Patents

Content comparison method and device, readable medium and electronic equipment Download PDF

Info

Publication number
CN117709329A
CN117709329A CN202311727632.3A CN202311727632A CN117709329A CN 117709329 A CN117709329 A CN 117709329A CN 202311727632 A CN202311727632 A CN 202311727632A CN 117709329 A CN117709329 A CN 117709329A
Authority
CN
China
Prior art keywords
content
text
difference
comparison
compared
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.)
Pending
Application number
CN202311727632.3A
Other languages
Chinese (zh)
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 Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network 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 Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to CN202311727632.3A priority Critical patent/CN117709329A/en
Publication of CN117709329A publication Critical patent/CN117709329A/en
Pending legal-status Critical Current

Links

Landscapes

  • User Interface Of Digital Computer (AREA)

Abstract

The disclosure relates to a content comparison method, a device, a readable medium and an electronic device, which can avoid the problem of contrast difference caused by structural dislocation and improve the accuracy and the comparison effect of content comparison. The method comprises the following steps: displaying a content comparison page; responding to the selection operation of the reference content of the content to be compared, performing text comparison on the content to be compared and the reference content, and determining text comparison content; determining first comparison content according to the difference text content aiming at the difference text content in the text comparison content; aiming at the same text content in the text comparison content, carrying out display comparison on the same text content, and determining second comparison content according to the difference display content when the difference display content is compared; and displaying target contrast content according to the first contrast content and/or the second contrast content.

Description

Content comparison method and device, readable medium and electronic equipment
Technical Field
The disclosure relates to the technical field of data processing, and in particular relates to a content comparison method, a content comparison device, a readable medium and electronic equipment.
Background
With the popularization and application of computer technology, more and more document materials are generated and stored in the form of electronic documents. In practical applications, it is often necessary to compare documents and intuitively display differences between the different documents.
In the related art, document comparison is performed by comparing the contents of two documents line by line, if one of the documents is deleted or added newly, the two documents cannot be aligned, and further, the subsequent documents are considered to have differences, so that the comparison effect is poor.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
In a first aspect, the present disclosure provides a content comparison method, the content comparison method comprising:
displaying a content comparison page;
responding to the selection operation of the reference content of the content to be compared, performing text comparison on the content to be compared and the reference content, and determining text comparison content;
Determining first comparison content according to the difference text content aiming at the difference text content in the text comparison content;
aiming at the same text content in the text comparison content, carrying out display comparison on the same text content, and determining second comparison content according to the difference display content when the difference display content is compared;
and displaying target contrast content according to the first contrast content and/or the second contrast content.
In a second aspect, the present disclosure provides a content contrast device comprising:
the first display module is used for displaying the content comparison page;
the first determining module is used for responding to the selection operation of the reference content of the content to be compared, carrying out text comparison on the content to be compared and the reference content, and determining text comparison content;
the second determining module is used for determining first comparison content according to the difference text content aiming at the difference text content in the text comparison content;
the third determining module is used for displaying and comparing the same text content aiming at the same text content in the text comparison content, and determining second comparison content according to the difference display content when the difference display content is compared;
And the second display module is used for displaying target comparison content according to the first comparison content and/or the second comparison content.
In a third aspect, the present disclosure provides a computer readable medium having stored thereon a computer program which, when executed by a processing device, implements the steps of the method of any of the first aspects.
In a fourth aspect, the present disclosure provides an electronic device comprising:
a storage device having a computer program stored thereon;
processing means for executing said computer program in said storage means to carry out the steps of the method according to any one of the first aspects.
According to the technical scheme, the content comparison page is displayed, text comparison is conducted on the content to be compared and the reference content in response to selection operation of the reference content of the content to be compared, text comparison content is determined, then, for different text content in the text comparison content, first comparison content is determined according to the different text content, the same text content in the text comparison content is displayed and compared, when the difference display content is compared, second comparison content is determined according to the difference display content, and finally, target comparison content is displayed according to the first comparison content and/or the second comparison content. By adopting the method, the text comparison is firstly carried out on the content to be compared and the reference content to determine the same text content and the difference text content, and then the display comparison is carried out on the difference text content to determine the difference display content, so that the text difference and the display difference between the content to be compared and the reference content can be determined and displayed, the comparison difference problem caused by structural dislocation due to content insertion and deletion can be reduced, the accuracy of content comparison is improved, and the content comparison effect is further improved.
Additional features and advantages of the present disclosure will be set forth in the detailed description which follows.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale. In the drawings:
FIG. 1 is a flow chart of a content comparison method provided in accordance with an exemplary embodiment;
FIG. 2 is a schematic diagram of a content comparison page provided in accordance with an exemplary embodiment;
FIG. 3 is a schematic diagram of a text contrast and display contrast provided in accordance with an exemplary embodiment;
FIG. 4 is a schematic diagram of a text difference provided in accordance with an exemplary embodiment;
FIG. 5 is a schematic diagram of a format difference provided in accordance with an exemplary embodiment;
FIG. 6 is a schematic diagram of a paragraph difference provided in accordance with an exemplary embodiment;
FIG. 7 is a schematic diagram of a content comparison page provided in accordance with an exemplary embodiment;
FIG. 8 is a block diagram of a content contrast device provided in accordance with an exemplary embodiment;
Fig. 9 is a block diagram of an electronic device provided in accordance with an exemplary embodiment.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
Meanwhile, it can be understood that the data (including but not limited to the data itself, the acquisition or the use of the data) related to the technical scheme should conform to the requirements of the corresponding laws and regulations and related regulations.
In the related art, there is a method of comparing documents based on user operation records, in addition to a method of comparing contents of two documents line by line. The method needs to record the document operation steps of a user, then compares the documents at two moments in all operation records, and can play back changed parts according to the operation records between the two documents. The method is only suitable for the condition that the same document is operated and operation records exist, different documents cannot be compared, and documents without operation records cannot be compared.
In view of the above, embodiments of the present disclosure provide a content comparison method, apparatus, readable medium and electronic device, so as to solve the above technical problems.
Embodiments of the present disclosure are further explained below with reference to the drawings.
Fig. 1 is a flow chart illustrating a content comparison method according to an exemplary embodiment of the present disclosure. Referring to fig. 1, the method includes:
s101: and displaying the content comparison page.
S102: and responding to the selection operation of the reference content of the content to be compared, performing text comparison on the content to be compared and the reference content, and determining the text comparison content.
For example, as shown in fig. 2, the content comparison page may select reference content for content comparison with the content to be compared. The reference content may be content of other versions of the content to be compared, or may be other content different from the content to be compared, which is not limited by the present disclosure.
For example, as shown in fig. 3, the reference text of the reference content and the text to be compared of the content to be compared may be extracted respectively, that is, the content such as format, paragraph is not required to be focused, and text comparison is performed on the reference text and the text to be compared, so as to obtain the same text content without text change and the difference text content including the added text and the deleted text.
It should be noted that the content comparison page may be a content comparison page provided by the content comparison tool, and the content comparison page may respectively select the reference content to be compared and the content to be compared for content comparison. The content comparison page can also be provided by a comparison function in the content editing tool, the content comparison page can select reference content to be compared with current editing content (content to be compared), and can also select the reference content to be compared and the content to be compared respectively for content comparison.
S103: and determining the first comparison content according to the difference text content aiming at the difference text content in the text comparison content.
S104: and aiming at the same text content in the text comparison content, carrying out display comparison on the same text content, and determining second comparison content according to the difference display content when the difference display content is compared.
For example, as shown in fig. 3, display comparisons may be made for the same text content to determine whether there is a differential display content.
S105: and displaying the target contrast content according to the first contrast content and/or the second contrast content.
By adopting the method, the text comparison is firstly carried out on the content to be compared and the reference content to determine the same text content and the difference text content, and then the display comparison is carried out on the difference text content to determine the difference display content, so that the text difference and the display difference between the content to be compared and the reference content can be determined and displayed, the problem of comparison difference caused by structural dislocation due to content insertion and deletion can be reduced, the accuracy of content comparison is improved, and the content comparison effect is further improved. And the user operation record is not needed to be relied on, so that the difference between different versions of the same content can be compared, and the difference between different contents can be compared.
In a possible manner, determining the first contrast content according to the difference text content may include: and determining the difference text type of the difference text content, and determining the difference text position of the difference text content according to the difference text type. Displaying the target contrast content according to the first contrast content may include: and displaying the target contrast content based on the difference text content, the difference text type and the difference text position.
For example, as shown in fig. 3, the difference text may be a new text or a deleted text, where the deleted text exists in the reference text, the new text exists in the text to be compared, and the position of the difference text content in the corresponding text may be determined according to different difference text types, so that the text difference between the content to be compared and the reference content may be determined and displayed.
In a possible manner, determining the difference text position of the difference text content according to the difference text type may include: and determining a first text position of the difference text content in the reference text corresponding to the reference content under the condition that the difference text type is the deletion type. Displaying the target contrast content based on the differential text content, the differential text type, and the differential text position may include: determining a reference content position according to the mapping relation between the first text position and the reference position, wherein the reference position mapping relation is used for representing the position mapping relation of the reference text in the reference content; and determining a first target position corresponding to the reference content position in the content to be compared, inserting the difference text content into the first target position, and displaying a deletion type mark for the difference text content mark.
For example, as shown in fig. 4, a reference position mapping relationship between the reference content and the reference text may be preset, and since the deleted text exists in the reference text, the position of the deleted text in the reference text may be determined first, and then the position of the deleted text in the reference content may be determined according to the reference position mapping relationship, for example, the reference text position numbers 2 and 3 corresponding to "one" and the reference content position numbers 3 and 4 corresponding to "one" and the deleted position corresponding to "one" in the content to be compared are 3 and 4.
For example, with continued reference to fig. 4, the differential text content is inserted into the first target location and a delete type marker is displayed for the differential text content marker, e.g., inserting "one" into the 3 and 4 locations in the content to be compared and a delete type marker, such as a strikethrough, is displayed. Therefore, the deleted content difference between the content to be compared and the reference content can be intuitively displayed.
In a possible manner, the method further comprises: based on the target comparison content, updating a comparison position mapping relation, wherein the comparison position mapping relation is used for representing the position mapping relation of the text to be compared corresponding to the content to be compared in the content to be compared.
For example, with continued reference to fig. 4, since the deleted text is inserted into the content to be compared, the length of the content to be compared is changed, and the original mapping relationship of the comparison position is also changed, so that the mapping relationship of the comparison position can be updated after the deleted text is inserted. For example, the original a contrast position mapping relation is changed from "content position 3- > text position 2" to "content position 5- > text position 2", so that the position of the subsequent text in the content to be compared can be located.
In a possible manner, determining the difference text position of the difference text content according to the difference text type may include: and under the condition that the difference text type is the newly added type, determining a second text position of the difference text content in the text to be compared corresponding to the content to be compared. Displaying target contrast content based on the difference text content, the difference text type, and the difference text position, including: determining a second target position according to a mapping relation between the second text position and the comparison position, wherein the comparison position mapping relation is used for representing the position mapping relation of the text to be compared in the content to be compared; and displaying the newly added type mark on the difference text content mark corresponding to the second target position in the content to be compared.
For example, since the new text exists in the content to be compared, the new text in the content to be compared can be found out and the new type mark can be marked. That is, a second text position of the newly added text in the text to be compared is determined, for example, the text position number as C in fig. 4 is 4. Further, the new position of the new text in the content to be compared is determined according to the comparison position mapping relationship, and it should be noted that, since the deleted text is inserted before, the new position is determined based on the updated comparison position mapping relationship, that is, the content position number of C should be 7. This displays a new type of mark, such as the underline shown in fig. 4, for the text mark with content position number 7 in the content to be compared. Therefore, the newly added content difference between the content to be compared and the reference content can be intuitively displayed.
It should be noted that, the position numbers in the reference position mapping relationship and the comparison position mapping relationship may be stored in the form of an index table, for example { node: { … }; pos is 0; …, where node represents node information, pos represents a location number, or other storage form, to which the present disclosure is not limited.
It should be noted that, in the above process, the deleted content is inserted first and then the position of the newly added content is determined, in other possible implementation manners, the position of the newly added content may be determined first and the new added type mark may be marked and displayed, then the position of the content before the deleted content in the content to be compared is determined, and further after the deleted content is inserted into the position, the deleted type mark may be marked and displayed.
In a possible manner, determining the second contrast content according to the differential display content may include: and determining the difference display type of the difference display content and the difference content position of the difference display content in the content to be compared. Displaying the target contrast content according to the second contrast content, including: and displaying the target contrast content based on the difference display type and the difference content position.
Illustratively, the display differences may be format display differences, such as font, font size, color, bold, title number change, special formats such as unordered list, addition and deletion of upper and lower corner marks, and the like, and paragraph display differences, such as paragraph merging and paragraph splitting, and the like, which the present disclosure is not limited to. The display difference between the content to be compared and the reference content can be determined and displayed according to the difference display type of the difference display content and the difference content position.
In a possible manner, displaying the target contrast content based on the differential display type and the differential content location may include: displaying a format change type mark at a difference content position mark in the content to be compared under the condition that the difference display type is a format change type; and/or displaying a paragraph change type mark at the difference content position mark in the content to be compared under the condition that the difference display type is a paragraph change type.
By way of example, referring to fig. 5, in the case where the difference display type is the format change type, for example, "a and B" are changed to bolded format in the content to be compared, the corresponding content position codes in the content to be compared are 9, 10, 11, the format change type mark may be marked at 9, 10, 11, for example, "a and B" may be square marked, or the format change type mark may be displayed in the vicinity of "a and B", as a black dot as shown in fig. 5, and the format change content specification may be visualized while the mouse is hovered over the black dot, or the like, which is not limited by the present disclosure. Thus, the format display difference between the content to be compared and the reference content can be intuitively displayed.
Accordingly, as shown in fig. 6, a paragraph change type mark may be displayed at a paragraph change position or in a region near the paragraph change position, and a paragraph change content description may be presented when a mouse is hovered over the paragraph change type mark, etc., which is not limited by the present disclosure. Thus, the paragraph display difference between the content to be compared and the reference content can be intuitively displayed.
In a possible manner, determining a differential display type of the differential display content may include: determining a first paragraph mark and a second paragraph mark of the same text content in the content to be compared and the reference content respectively; when the number of paragraphs corresponding to the first paragraph mark is greater than that of paragraphs corresponding to the second paragraph mark, determining that the difference display type of the difference display content is a paragraph splitting type; or when the number of paragraphs corresponding to the first paragraph mark is smaller than that of paragraphs corresponding to the second paragraph mark, determining that the difference display type of the difference display content is a paragraph merging type.
Illustratively, paragraph labels may be added to the position numbers, e.g., X, Y, etc., to represent different paragraphs, or the numerals 001, 002, etc., to represent different paragraphs, without limitation of the present disclosure. With continued reference to fig. 6, the paragraph marks of the reference content include X, which indicates that there is one paragraph, and the paragraph marks of the content to be compared include X and Y, which indicates that there are two paragraphs. The text content is the same, but the paragraphs belong to different paragraphs, indicating that there is a paragraph splitting, and conversely, indicating that there is a paragraph merging. Thus, whether the paragraph splitting and the paragraph merging exist or not can be judged based on the paragraph marks, and different change marks can be marked by the paragraph splitting and the paragraph merging, so that the paragraph splitting and the paragraph merging can be intuitively distinguished.
It should be noted that any one or more of the above text differences and display differences may exist in the above reference content and the content to be compared. The content representation of the no-mark in the target display content is not changed, and in addition, the mark representing the text difference and the display difference may also adopt other mark patterns, such as different background colors, different font colors, underlines of different patterns, and the like, in addition to the mark patterns provided in the above-described embodiments, as long as the present disclosure is capable of distinguishing different content differences.
In a possible manner, displaying the target contrast content may include: and displaying the target contrast content in a first display area of the content contrast page. The method further comprises the steps of: displaying the content to be compared in a second display area of the content comparison page; synchronously scrolling the target contrast content in the first display area in response to a scrolling operation for the content to be compared in the second display area; or, in response to a scrolling operation for the target contrast content in the first display area, synchronously scrolling the content to be compared in the second display area.
For example, referring to fig. 7, the target comparison content is displayed in a first display area of the content comparison page, the content to be compared is displayed in a second display area of the content comparison page, wherein the first display area and the second display area may be distributed left and right, up and down, etc., without limitation of the present disclosure. And, the first display area and the second display area may provide a scroll following function, such as scrolling the content of the first display area, the content of the second display area scrolling synchronously, and correspondingly, scrolling the content of the second display area, the content of the first display area scrolling synchronously. And, the top content of the display area may be used as an alignment reference, or the middle content of the display area may be used as an alignment reference, which is not limited in the present disclosure. Thereby facilitating the synchronous observation of the target comparison content and the content to be compared.
In addition, the second display area may be an editing area, editing operation may be performed on the content to be compared, and the first display area may synchronously display the difference between the edited content to be compared and the reference content, or may display the difference between the edited content to be compared and the reference content after triggering the comparison control.
Based on the same inventive concept, the present disclosure further provides a content comparison apparatus, referring to fig. 8, the content comparison apparatus 800 includes:
a first display module 801, configured to display a content comparison page;
a first determining module 802, configured to perform text comparison on the content to be compared and the reference content in response to a selection operation of the reference content for the content to be compared, and determine text comparison content;
a second determining module 803, configured to determine, for a difference text content in the text comparison content, a first comparison content according to the difference text content;
a third determining module 804, configured to display and compare the same text content with respect to the same text content in the text comparison content, and determine a second comparison content according to the difference display content when the difference display content is compared;
And a second display module 805, configured to display target contrast content according to the first contrast content and/or the second contrast content.
By adopting the device, the text comparison is firstly carried out on the content to be compared and the reference content so as to determine the same text content and the difference text content, and then the display comparison is carried out on the difference text content so as to determine the difference display content, thereby determining and displaying the text difference and the display difference between the content to be compared and the reference content, reducing the comparison difference problem caused by the structural dislocation caused by the content insertion and deletion, improving the accuracy of the content comparison, and further improving the content comparison effect. And the user operation record is not needed to be relied on, so that the difference between different versions of the same content can be compared, and the difference between different contents can be compared.
Optionally, the second determining module 803 is configured to:
determining a difference text type of the difference text content, and determining a difference text position of the difference text content according to the difference text type;
the second display module 805 is configured to:
and displaying the target contrast content based on the difference text content, the difference text type and the difference text position.
Optionally, the second determining module 803 is configured to:
determining a first text position of the difference text content in a reference text corresponding to the reference content under the condition that the difference text type is a deletion type;
the second display module 805 is configured to:
determining a reference content position according to the mapping relation between the first text position and the reference position, wherein the reference position mapping relation is used for representing the position mapping relation of the reference text in the reference content;
and determining a first target position corresponding to the reference content position in the content to be compared, inserting the difference text content into the first target position, and displaying a deletion type mark for the difference text content mark.
Optionally, the content comparison device 800 includes an update module, where the update module is configured to:
updating a comparison position mapping relation based on the target comparison content, wherein the comparison position mapping relation is used for representing the position mapping relation of the text to be compared corresponding to the content to be compared in the content to be compared.
Optionally, the second determining module 803 is configured to:
determining a second text position of the difference text content in the text to be compared corresponding to the content to be compared under the condition that the difference text type is a new type;
The second display module 805 is configured to:
determining a second target position according to the mapping relation between the second text position and the comparison position, wherein the comparison position mapping relation is used for representing the position mapping relation of the text to be compared in the content to be compared;
and displaying a new type mark on the difference text content mark corresponding to the second target position in the content to be compared.
Optionally, the third determining module 804 is configured to:
determining a difference display type of the difference display content and a difference content position of the difference display content in the content to be compared;
the second display module 805 is configured to:
and displaying the target contrast content based on the difference display type and the difference content position.
Optionally, the second display module 805 is configured to:
displaying a format change type mark at the position mark of the difference content in the content to be compared under the condition that the difference display type is a format change type; and/or the number of the groups of groups,
and displaying a paragraph change type mark on the difference content position mark in the content to be compared under the condition that the difference display type is a paragraph change type.
Optionally, the third determining module 804 is configured to:
determining a first paragraph mark of the same text content in the content to be compared and a second paragraph mark of the reference content respectively;
when the number of paragraphs corresponding to the first paragraph mark is greater than that of paragraphs corresponding to the second paragraph mark, determining that the difference display type of the difference display content is a paragraph splitting type; or alternatively, the first and second heat exchangers may be,
and when the number of the paragraphs corresponding to the first paragraph mark is smaller than that of the paragraphs corresponding to the second paragraph mark, determining that the difference display type of the difference display content is a paragraph merging type.
Optionally, the second display module 805 is configured to:
displaying the target comparison content in a first display area of the content comparison page;
the content contrast device 800 includes a scrolling module for:
displaying the content to be compared in a second display area of the content comparison page;
synchronously scrolling the target contrast content in the first display area in response to a scrolling operation for the content to be compared in the second display area; or alternatively, the first and second heat exchangers may be,
and synchronously scrolling the content to be compared in the second display area in response to a scrolling operation for the target comparison content in the first display area.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Based on the same conception, the embodiments of the present disclosure also provide a computer readable medium having stored thereon a computer program which when executed by a processing device realizes the steps of the content comparison method described above.
Based on the same concept, the embodiments of the present disclosure also provide an electronic device including:
a storage device having a computer program stored thereon;
processing means for executing said computer program in said storage means to implement the steps of the content comparison method described above.
Referring now to fig. 9, a schematic diagram of an electronic device 900 suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 9 is merely an example, and should not impose any limitations on the functionality and scope of use of embodiments of the present disclosure.
As shown in fig. 9, the electronic device 900 may include a processing means (e.g., a central processor, a graphics processor, etc.) 901, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 902 or a program loaded from a storage means 908 into a Random Access Memory (RAM) 903. In the RAM 903, various programs and data necessary for the operation of the electronic device 900 are also stored. The processing device 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904. An input/output (I/O) interface 905 is also connected to the bus 904.
In general, the following devices may be connected to the I/O interface 905: input devices 906 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 907 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 908 including, for example, magnetic tape, hard disk, etc.; and a communication device 909. The communication means 909 may allow the electronic device 900 to communicate wirelessly or by wire with other devices to exchange data. While fig. 9 shows an electronic device 900 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication device 909, or installed from the storage device 908, or installed from the ROM 902. When executed by the processing device 901, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, communications may be made using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: displaying a content comparison page; responding to the selection operation of the reference content of the content to be compared, performing text comparison on the content to be compared and the reference content, and determining text comparison content; determining first comparison content according to the difference text content aiming at the difference text content in the text comparison content; aiming at the same text content in the text comparison content, carrying out display comparison on the same text content, and determining second comparison content according to the difference display content when the difference display content is compared; and displaying target contrast content according to the first contrast content and/or the second contrast content.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented in software or hardware. The name of a module does not in some cases define the module itself.
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims. The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.

Claims (12)

1. A content comparison method, characterized in that the content comparison method comprises:
displaying a content comparison page;
responding to the selection operation of the reference content of the content to be compared, performing text comparison on the content to be compared and the reference content, and determining text comparison content;
determining first comparison content according to the difference text content aiming at the difference text content in the text comparison content;
aiming at the same text content in the text comparison content, carrying out display comparison on the same text content, and determining second comparison content according to the difference display content when the difference display content is compared;
And displaying target contrast content according to the first contrast content and/or the second contrast content.
2. The content comparison method according to claim 1, wherein the determining the first comparison content from the differential text content includes:
determining a difference text type of the difference text content, and determining a difference text position of the difference text content according to the difference text type;
displaying target contrast content according to the first contrast content, including:
and displaying the target contrast content based on the difference text content, the difference text type and the difference text position.
3. The content comparison method according to claim 2, wherein the determining a difference text position of the difference text content according to the difference text type includes:
determining a first text position of the difference text content in a reference text corresponding to the reference content under the condition that the difference text type is a deletion type;
the displaying the target contrast content based on the difference text content, the difference text type, and the difference text position includes:
Determining a reference content position according to the mapping relation between the first text position and the reference position, wherein the reference position mapping relation is used for representing the position mapping relation of the reference text in the reference content;
and determining a first target position corresponding to the reference content position in the content to be compared, inserting the difference text content into the first target position, and displaying a deletion type mark for the difference text content mark.
4. A content contrast method according to claim 3, characterized in that the method further comprises:
updating a comparison position mapping relation based on the target comparison content, wherein the comparison position mapping relation is used for representing the position mapping relation of the text to be compared corresponding to the content to be compared in the content to be compared.
5. The content comparison method according to claim 2 or 4, wherein the determining a difference text position of the difference text content according to the difference text type includes:
determining a second text position of the difference text content in the text to be compared corresponding to the content to be compared under the condition that the difference text type is a new type;
The displaying the target contrast content based on the difference text content, the difference text type, and the difference text position includes:
determining a second target position according to the mapping relation between the second text position and the comparison position, wherein the comparison position mapping relation is used for representing the position mapping relation of the text to be compared in the content to be compared;
and displaying a new type mark on the difference text content mark corresponding to the second target position in the content to be compared.
6. The content contrast method according to any one of claims 1 to 4, wherein the determining a second contrast content from the differential display content includes:
determining a difference display type of the difference display content and a difference content position of the difference display content in the content to be compared;
displaying target contrast content according to the second contrast content, including:
and displaying the target contrast content based on the difference display type and the difference content position.
7. The content contrast method according to claim 6, wherein the displaying the target contrast content based on the difference display type and the difference content position includes:
Displaying a format change type mark at the position mark of the difference content in the content to be compared under the condition that the difference display type is a format change type; and/or the number of the groups of groups,
and displaying a paragraph change type mark on the difference content position mark in the content to be compared under the condition that the difference display type is a paragraph change type.
8. The content contrast method according to claim 6, wherein the determining a difference display type of the difference display content includes:
determining a first paragraph mark of the same text content in the content to be compared and a second paragraph mark of the reference content respectively;
when the number of paragraphs corresponding to the first paragraph mark is greater than that of paragraphs corresponding to the second paragraph mark, determining that the difference display type of the difference display content is a paragraph splitting type; or alternatively, the first and second heat exchangers may be,
and when the number of the paragraphs corresponding to the first paragraph mark is smaller than that of the paragraphs corresponding to the second paragraph mark, determining that the difference display type of the difference display content is a paragraph merging type.
9. The method of any of claims 1-4, wherein displaying the target contrast comprises:
Displaying the target comparison content in a first display area of the content comparison page;
the method further comprises the steps of:
displaying the content to be compared in a second display area of the content comparison page;
synchronously scrolling the target contrast content in the first display area in response to a scrolling operation for the content to be compared in the second display area; or alternatively, the first and second heat exchangers may be,
and synchronously scrolling the content to be compared in the second display area in response to a scrolling operation for the target comparison content in the first display area.
10. A content contrast device, characterized in that the content contrast device comprises:
the first display module is used for displaying the content comparison page;
the first determining module is used for responding to the selection operation of the reference content of the content to be compared, carrying out text comparison on the content to be compared and the reference content, and determining text comparison content;
the second determining module is used for determining first comparison content according to the difference text content aiming at the difference text content in the text comparison content;
the third determining module is used for displaying and comparing the same text content aiming at the same text content in the text comparison content, and determining second comparison content according to the difference display content when the difference display content is compared;
And the second display module is used for displaying target comparison content according to the first comparison content and/or the second comparison content.
11. A computer readable medium on which a computer program is stored, characterized in that the program, when being executed by a processing device, carries out the steps of the method according to any one of claims 1-9.
12. An electronic device, comprising:
a storage device having a computer program stored thereon;
processing means for executing said computer program in said storage means to carry out the steps of the method according to any one of claims 1-9.
CN202311727632.3A 2023-12-14 2023-12-14 Content comparison method and device, readable medium and electronic equipment Pending CN117709329A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311727632.3A CN117709329A (en) 2023-12-14 2023-12-14 Content comparison method and device, readable medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311727632.3A CN117709329A (en) 2023-12-14 2023-12-14 Content comparison method and device, readable medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN117709329A true CN117709329A (en) 2024-03-15

Family

ID=90163337

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311727632.3A Pending CN117709329A (en) 2023-12-14 2023-12-14 Content comparison method and device, readable medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN117709329A (en)

Similar Documents

Publication Publication Date Title
US12045442B2 (en) Method and apparatus for browsing table in document, and electronic device and storage medium
CN111190520A (en) Menu item selection method and device, readable medium and electronic equipment
CN109492208B (en) Document editing method and device, equipment and storage medium thereof
US20240193352A1 (en) Electronic document processing method and apparatus, terminal and storage medium
CN111273830A (en) Data display method and device, electronic equipment and computer readable medium
EP4187490A1 (en) Method and apparatus for displaying text, electronic device, and computer-readable storage medium
CN113238688B (en) Form display method, device, equipment and medium
CN109558408B (en) Method and device for updating list, electronic equipment and readable storage medium
CN109683726B (en) Character input method, character input device, electronic equipment and storage medium
CN114327732B (en) Page configuration method, page configuration device, electronic equipment and computer readable medium
CN111177634A (en) Multi-language supporting file content loading method, device, equipment and medium
CN111273982A (en) Method, device, electronic equipment and medium for confirming default font of operating system
CN117709329A (en) Content comparison method and device, readable medium and electronic equipment
CN111338827B (en) Method and device for pasting form data and electronic equipment
CN115017110A (en) Information processing method, device, terminal and storage medium
CN114997115A (en) Document processing method, device, equipment and medium
CN112711457A (en) Method and device for field drawing and electronic equipment
CN113705190A (en) Text processing method, device and equipment
CN113296771A (en) Page display method, device, equipment and computer readable medium
CN112445478A (en) Graphic file processing method, device, equipment and medium
CN111753238A (en) Data mapping method and device and electronic equipment
CN115033148B (en) Document display method, device, electronic equipment and storage medium
CN111797591B (en) Layout recovery method and device and electronic equipment
CN114356311B (en) Interaction method, device, medium and electronic equipment of code performance data
CN114327188B (en) Form layout method, form layout device, electronic equipment and computer readable 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