Difference information identification method, file generation method, related device and electronic equipment
By calculating the block and structural similarity indicators of the two files containing related content, automatically identify different information information, solve the problem of low information efficiency of identifying files in existing technology, and achieve efficient difference in information identification Essence
Patent Information
- Application Number
- CN202011083258.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-12
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2040-10-12
AI Technical Summary
The prior art is less efficient in identifying the difference information in two files containing the associated content, requiring manual reading of the files to find the difference.
By obtaining two images with the same identification information, the image segmentation blocks are performed, and the structural similarity indicators of each image block are calculated to automatically identify the different image block to determine the difference in the file.
The method of automatic identification file difference information is implemented, saving the time of manual comparison, and improving the efficiency of differential information recognition.
Smart Images

Figure CN114419344B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a difference information recognition method, a file generation method, related devices, electronic equipment and a computer-readable storage medium. Background Art
[0002] In some scenarios, such as iterative development scenarios, a common problem is that it is necessary to compare the difference information between two files containing related content to determine the modified content in the files.
[0003] At present, without knowing the related contents in the two files, it usually takes a lot of time to read the two files to find the difference information in the two files. It can be seen that the prior art has the problem of low efficiency in identifying the difference information in two files containing related contents. Summary of the invention
[0004] The embodiments of the present invention provide a difference information identification method, a file generation method, a related device, an electronic device and a computer-readable storage medium to solve the problem of low efficiency in identifying difference information in two files containing related content in the prior art.
[0005] In a first aspect, an embodiment of the present invention provides a method for identifying difference information, the method comprising:
[0006] Acquire a first image and a second image having the same identification information; wherein the first image is an image in a first file, the second image is an image in a second file, and the first file and the second file are two files containing related content;
[0007] Divide the first image into blocks based on the text format in the first image to obtain at least one first image block; divide the second image into blocks based on the text format in the second image to obtain at least one second image block;
[0008] For each of the first image blocks, respectively calculate a structural similarity index between the first image block and each of the second image blocks to obtain a structural similarity index corresponding to the first image block;
[0009] Based on the structural similarity index corresponding to each of the first image blocks, a first difference image block in the at least one first image block is determined; wherein the first difference image block is first difference information of the first file relative to the second file.
[0010] In a second aspect, an embodiment of the present invention further provides a file generation method, the method comprising:
[0011] Identify target difference information of a first file relative to a second file; wherein the first file and the second file are two files containing related content, and the target difference information includes incremental information and / or deleted information, wherein the incremental information is information added to the first file relative to the second file, and the deleted information is information deleted from the first file relative to the second file;
[0012] In a case where the target difference information includes the incremental information, marking the incremental information in the first file to obtain a first target file;
[0013] In the case that the target difference information includes the deletion information, the deletion information is inserted into the first file, and the deletion information is marked to obtain a second target file.
[0014] In a third aspect, an embodiment of the present invention further provides a difference information identification device, the device comprising:
[0015] A first acquisition module is used to acquire a first image and a second image with the same identification information; wherein the first image is an image in a first file, the second image is an image in a second file, and the first file and the second file are two files containing related content;
[0016] An image segmentation module, configured to segment the first image into blocks based on the text format in the first image to obtain at least one first image block; and segment the second image into blocks based on the text format in the second image to obtain at least one second image block;
[0017] a calculation module, configured to calculate, for each of the first image blocks, a structural similarity index between the first image block and each of the second image blocks, to obtain a structural similarity index corresponding to the first image block;
[0018] The first determination module is used to determine a first difference image block in the at least one first image block based on the structural similarity index corresponding to each of the first image blocks; wherein the first difference image block is first difference information of the first file relative to the second file.
[0019] In a fourth aspect, an embodiment of the present invention further provides a file generating device, the device comprising:
[0020] A first identification module is used to identify target difference information of a first file relative to a second file; wherein the first file and the second file are two files containing related content, and the target difference information includes incremental information and / or deleted information, wherein the incremental information is information added to the first file relative to the second file, and the deleted information is information deleted from the first file relative to the second file;
[0021] A first marking module, configured to mark the incremental information in the first file to obtain a first target file when the target difference information includes the incremental information;
[0022] an inserting module, configured to insert the deletion information into the first file when the target difference information includes the deletion information;
[0023] The second marking module is used to mark the deletion information to obtain a second target file.
[0024] In a fifth aspect, an embodiment of the present invention further provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the above-mentioned difference information identification method are implemented, or the steps of the above-mentioned file generation method are implemented.
[0025] In a sixth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned difference information identification method or the steps of the above-mentioned file generation method are implemented.
[0026] In an embodiment of the present invention, at least one first image block is obtained by performing image segmentation on the first image in the first file, and at least one second image block is obtained by performing image segmentation on the second image in the second file. The first image block and the second image block are compared by a structural similarity index, so that the first difference image block in the at least one first image block can be automatically identified, that is, the first difference information in the first file relative to the second file. In this way, the process of comparing the first file and the second file by human eyes can be avoided, the first difference information can be directly obtained, and the information change can be intuitively and quickly located based on the first difference information, so that a lot of time can be saved and the recognition efficiency of the difference information in the two files containing related content can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0028] Figure 1 It is one of the flow charts of the difference information identification method provided by the embodiment of the present invention;
[0029] Figure 2 is a flow chart of a file generation method provided by an embodiment of the present invention;
[0030] Figure 3 This is the second flow chart of the difference information identification method provided by the embodiment of the present invention;
[0031] Figure 4 It is one of the structural diagrams of the difference information identification device provided by the embodiment of the present invention;
[0032] Figure 5 This is the second structural diagram of the difference information identification device provided by the embodiment of the present invention;
[0033] Figure 6 This is the third structural diagram of the difference information identification device provided by the embodiment of the present invention;
[0034] Figure 7 This is the fourth structural diagram of the difference information identification device provided by the embodiment of the present invention;
[0035] Figure 8 is a structural diagram of a file generating device provided by an embodiment of the present invention;
[0036] Fig. 9 It is a structural diagram of an electronic device provided by the implementation of the present invention. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0038] The following is an explanation of the difference information identification method provided by the embodiment of the present invention.
[0039] It should be noted that the difference information identification method provided in the embodiment of the present invention can be applied to an electronic device. The electronic device can be a terminal device, which can be used to identify difference information between two files containing related content, so as to improve the efficiency of identifying difference information between two files containing related content.
[0040] In practical applications, it can compare the images of the first file and the second file developed in two iterative developments to automatically identify the difference information in the first file relative to the second file, thereby improving the efficiency of identifying new functions in the requirement documents used for iterative development.
[0041] The terminal devices may include mobile phones, tablet computers, laptop computers, personal digital assistants (PDA), mobile Internet devices (MID), wearable devices, etc.
[0042] See also Figure 1 , Figure 1 is a flow chart of a difference information identification method provided by an embodiment of the present invention. Figure 1 As shown, the following steps are included:
[0043] Step 101, obtaining a first image and a second image with the same identification information; wherein the first image is an image in a first file, the second image is an image in a second file, and the first file and the second file are two files containing related content;
[0044] Step 102, dividing the first image into blocks based on the text format in the first image to obtain at least one first image block; dividing the second image into blocks based on the text format in the second image to obtain at least one second image block;
[0045] Step 103: for each of the first image blocks, respectively calculate a structural similarity index between the first image block and each of the second image blocks to obtain a structural similarity index corresponding to the first image block;
[0046] Step 104: determine a first difference image block in the at least one first image block based on the structural similarity index corresponding to each of the first image blocks; wherein the first difference image block is first difference information between the first file and the second file.
[0047] In step 101, the first file and the second file are two files containing related content. The first file and the second file may both include images. In addition, the first file may also include text, and the second file may also include text.
[0048] In practical applications, the first file may be a file modified based on the content of the second file, wherein the first file is a file for the N+Mth iteration development, the second file is a file for the Nth iteration development, and N and M are both positive integers. In the following embodiments, M will be described in detail with 1.
[0049] That is, the first file and the second file are two requirement files that are developed iteratively one after another, the first image can be any image in the first file used for the N+1th iterative development, and the second image is an image in the second file used for the Nth iterative development. The identification information of the first image and the second image is the same, and the identification information can be the title of the image, for example, the titles of the first image and the second image are the same.
[0050] The type of the first file and the type of the second file can be set according to actual needs. If the first file is a requirement document for the N+1th iteration development and the second file is a requirement document for the Nth iteration development, the type of the first file and the type of the second file are usually document types, such as word document types.
[0051] The first file may include multiple first images, and correspondingly, the second file may also include multiple second images. If the first file and the second file are requirement documents, the first image and the second image may generally be wireframes, and the wireframes include text and some wireframe elements for describing iterative development requirements. Acquiring the first image and the second image with the same identification information may specifically include: acquiring two images with the same title from the first file and the second file in sequence.
[0052] In practical applications, the requirement documents for two iterative developments can be input, all images in the two requirement documents can be extracted, the image titles can be identified, and the images can be associated with the images and stored in their respective folders. Then, two images with the same title can be selected from the two folders in turn.
[0053] In step 102, the text format in the first image may include font size, length and width format of text paragraphs, and paragraph spacing, etc. The text format in the second image may also include font size, length and width format of text paragraphs, and paragraph spacing, etc.
[0054] The first image can be segmented into image blocks based on the text format in the first image. Taking font size as an example, the first image includes paragraphs with font sizes of five, four and three respectively. At this time, the first image can be preliminarily processed and divided into three first image blocks, namely, a first image block with a font size of five, a first image block with a font size of four and a first image block with a font size of three.
[0055] The second image may be divided into blocks based on the text format in the second image to obtain at least one second image block. The manner of dividing the second image into blocks is similar to the manner of dividing the first image into blocks, which will not be described in detail here.
[0056] In practical applications, a cross-platform computer vision library such as openCV can be connected to perform preliminary processing on the first image and the second image and perform image segmentation.
[0057] In step 103, for each of the first image blocks, the first image block may be compared with each of the second image blocks. Specifically, the first image block and the second image block may be compared by respectively calculating a structural similarity index between the first image block and each of the second image blocks.
[0058] It should be noted that before calculating the structural similarity index, in order to ensure the accuracy of the result, it is usually necessary to grayscale the first image block and the second image block. The formula for grayscale conversion is: Gray = R*0.299+G*0.587+B*0.114, Gray is the grayscale value of the pixel point in the image block after grayscale conversion, and R, G and B are the original grayscale of the pixel point in the image block.
[0059] In practical applications, openCV can be connected to compare the first image block and the second image block. The specific comparison process of the first image block and the second image block can be implemented by the following code:
[0060] imageOne=cv2.imread(args["one"]);
[0061] imageTwo=cv2.imread(args["two"]);
[0062] grayOne=cv2.cvtColor(imageOne,cv2.COLOR_BGR2GRAY);
[0063] grayTwo=cv2.cvtColor(imageTwo,cv2.COLOR_BGR2GRAY);
[0064] compare_ssim(grayOne,grayTwo,full=True).
[0065] Finally, a structural similarity index (SSIM) between the first image block and the second image block is obtained.
[0066] For each of the first image blocks, a structural similarity index between the first image block and each of the second images is calculated respectively, and finally a structural similarity index corresponding to the first image block is obtained. Wherein, when the second image includes multiple image blocks, the number of structural similarity indexes corresponding to the first image block is consistent with the number of second image blocks.
[0067] Furthermore, since the structural similarity index between the first image block and the second image block is the same as the structural similarity index between the second image block and the first image block, after calculating the structural similarity index between each of the first image blocks and each of the second image blocks, the structural similarity index corresponding to the second image block can also be obtained. Wherein, in the case where the first image includes multiple image blocks, the number of structural similarity indexes corresponding to the second image blocks is consistent with the number of the first image blocks.
[0068] In step 104, when the structural similarity index of the first image block and the second image block is closer to 1, it means that the first image block and the second image block are more similar, and when it is closer to 0, it means that the first image block and the second image block are more different. Therefore, based on the structural similarity index corresponding to each of the first image blocks, the first difference image block in the at least one first image block can be determined.
[0069] Specifically, a threshold value may be set, for example, the threshold value is 0.9, and when the structural similarity index of the first image block and the second image block is greater than 0.9, it indicates that the first image block and the second image block are similar. When the structural similarity index of the first image block and the second image block is less than or equal to 0.9, it indicates that there are differences between the first image block and the second image block.
[0070] Thus, for each first image block, it is determined whether the multiple structural similarity indices corresponding to the first image block are all less than or equal to 0.9, and the first image block is determined to be a first difference image block. Otherwise, the first image block is determined not to be a first difference image block.
[0071] The first difference image block is the first difference information of the first file relative to the second file. That is to say, the text in the first difference image block is the description of the newly added functions of the first file relative to the second file during the iterative development process. The newly added functions here refer to the functions that were not defined in the previous iterative development and are redefined in this iterative development.
[0072] In order to enable developers to intuitively and quickly locate functional changes according to the first difference information during the iterative development process, the first difference image block may be highlighted, for example, the first difference image block may be displayed using a white frame mark.
[0073] In this embodiment, at least one first image block is obtained by performing image segmentation on the first image in the first file, and at least one second image block is obtained by performing image segmentation on the second image in the second file. The first image block and the second image block are compared by using a structural similarity index, so that the first difference image block in the at least one first image block can be automatically identified, that is, the first difference information in the first file relative to the second file. In this way, the process of comparing the first file and the second file by human eyes can be avoided, the first difference information can be directly obtained, and the information change can be intuitively and quickly located based on the first difference information, so that a lot of time can be saved and the recognition efficiency of the difference information in the two files containing related content can be improved.
[0074] In actual application, at least one first image block is obtained by dividing the first image in the first file used for the N+1th iterative development into blocks, and at least one second image block is obtained by dividing the second image in the second file used for the Nth iterative development into blocks. The first image block and the second image block are compared by means of a structural similarity index, so that the first difference image block in the at least one first image block can be automatically identified, that is, the first difference information in the first file relative to the second file. In this way, the process of comparing the first file and the second file by the human eye can be avoided, so that the developers can intuitively and quickly locate the functional changes according to the first difference information during the iterative development process, thereby saving a lot of time, improving the efficiency of identifying new functions in the requirement document used for iterative development, and thus improving the speed of iterative development.
[0075] Furthermore, by automatically identifying the difference information in the first file relative to the second file, errors caused by human eye comparison of requirement documents can be avoided, thereby reducing the probability of errors in iterative development.
[0076] Optionally, the at least one first image block includes a first target image block, and the first target image block is any first image block in the at least one first image block; and step 104 specifically includes:
[0077] Determining a target structural similarity index from the structural similarity indexes corresponding to the first target image block; wherein the target structural similarity index is the largest structural similarity index among the structural similarity indexes corresponding to the first target image block;
[0078] When the target structure similarity index is less than a preset threshold, the first target image block is determined to be a first difference image block.
[0079] In this embodiment, the first target image block is any first image block among the at least one first image block, and for each first image block, the method of determining whether the first image block is a first difference image block is similar to the above. Therefore, only the first target image block is described here, and the processing methods of other first image blocks can be easily obtained by referring to the processing method of the first target image block.
[0080] Specifically, for the first target image block, the largest structural similarity index is first determined from the structural similarity indexes corresponding to the first target image block; when the largest structural similarity index is less than a preset threshold, the first target image block is determined to be the first difference image block. That is, if it is determined that there is a second image block that is most similar to the first target image block in the second file, and the structural similarity between the first target image block and the second image block does not meet the requirement, the first target image block is determined to be the first difference image block.
[0081] In this way, it is only necessary to compare whether the target structure similarity index is less than a preset threshold to determine whether the first target image block is the first difference image block, thereby reducing the computational complexity.
[0082] Optionally, after step 104, the method further includes:
[0083] Performing feature extraction on the first difference image block to obtain a first text area in the first difference image block;
[0084] Expand and connect the characters in the first character region to generate at least one first character sub-region;
[0085] For each of the first character sub-regions, recognize each character in the first character sub-region to obtain a character recognition result of the first character sub-region;
[0086] Based on the text recognition results of each of the first text sub-regions, second difference information between the first file and the second file is identified in the text description information other than the first image in the first file.
[0087] In this embodiment, the first file also includes text description information for explaining the first image. When the first image includes a description of a newly added function, the text description information usually provides a more detailed explanation and expansion of the newly added function. Therefore, it is possible to identify information that is different between the text description information of the first file and the second file, so as to further improve the efficiency of identifying new functions in the requirements document for iterative development.
[0088] Specifically, the text description in the first difference image block may be first identified, then keywords may be extracted from the identified text description to obtain keywords of the text description, and finally, the text description information containing the keywords may be searched in the first file.
[0089] The following is a detailed description of the recognition process of the text description in the first difference image block.
[0090] It should be noted that in order to accurately identify the text description in the first difference image block, the following assumptions can usually be made: the text in the first difference image block is regular; the spacing between each word is appropriate; the color of the same text is consistent and dark; there is a clear contrast between the text and the background.
[0091] Specifically, extracting features from the first difference image block may be understood as extracting text features from the first difference image block to obtain a first text region in the first difference image block.
[0092] The first text area may include multiple sentences. Accordingly, in order to identify multiple sentences in the first text area, the text in the first text area may be expanded and connected to generate at least one first text sub-area, and each of the first text sub-area may include a sentence.
[0093] A neighbor search algorithm may be used to expand the sub-region corresponding to each character in the first character region to connect the characters that may be adjacent, thereby generating at least one first character sub-region. When expanding the sub-region corresponding to the characters, the expansion distance may be set according to the spacing between the characters in the first character region. For example, the sub-region corresponding to the characters may be expanded to 20% of the sub-region. If there is another character in the expanded sub-region, the characters may be connected to finally generate at least one first character sub-region. The characters in each first character sub-region have a connection relationship, that is, the characters in each first character sub-region may form a sentence.
[0094] After generating at least one first text sub-region, each character in the first text sub-region may be recognized for each first text sub-region to obtain a text recognition result of the first text sub-region. Specifically, for each first text sub-region, the first text sub-region may be evenly cut to generate a sub-region corresponding to each character. Then, a single text recognition algorithm is used to recognize the sub-region text corresponding to each character, and finally a text recognition result of the first text sub-region is obtained.
[0095] Furthermore, for each of the first text sub-regions, a keyword extraction may be performed on the text recognition result in the first text sub-region to obtain the keyword of the text recognition result. The text description information containing the keyword is searched in the text description information other than the first image in the first file. The text description information containing the keyword is the second difference information between the first file and the second file.
[0096] In order to enable developers to intuitively and quickly locate functional changes based on the second difference information during the iterative development process, the second difference information can be highlighted. For example, keywords in the text description information of the first file can be highly annotated with color to mark the display of the second difference information.
[0097] In this embodiment, by identifying information in the text description information of the first file that is different from that of the second file, the efficiency of identifying new functions in the requirement document used for iterative development can be further improved, thereby increasing the speed of iterative development.
[0098] Optionally, the extracting features from the first difference image block to obtain a first text region in the first difference image block includes:
[0099] Performing region segmentation on the first difference image block to generate at least one connected region;
[0100] For each of the connected regions, performing corrosion treatment on the connected region to obtain the corrosion resistance parameter of the connected region;
[0101] Based on the anti-corrosion parameter of each of the connected areas, a target connected area in the at least one connected area is determined; wherein the target connected area is a connected area whose anti-corrosion parameter is within a preset range, and the first text area in the first difference image block includes the target connected area.
[0102] In this embodiment, at least one connected region can be generated by connecting the regions of the first difference image block and segmenting the regions of the first difference image block based on the connected boundary. Specifically, it can be determined by distance whether a subregion of an element in the first difference image block is connected to a subregion of another element. When the distance between the subregions of the two elements is less than a preset distance, it can be determined that the two subregions can be connected. After the subregions of each element in the first difference image block are connected, at least one connected region is finally generated by segmenting the regions.
[0103] For each of the connected regions, the connected regions are subjected to corrosion treatment to obtain the corrosion resistance parameter of the connected regions, wherein the corrosion resistance parameter = the area of the connected region after corrosion / the area of the connected region before corrosion.
[0104] Since dilation erosion has a great influence on Chinese recognition, and the anti-erosion parameter of the text area is usually between 0.1-0.9, the preset range can be set to 0.1-0.9, and the target connected area in the at least one connected area can be determined based on the anti-erosion parameter of each connected area. The first text area in the first difference image block includes the target connected area, that is, the elements in the target connected area are text.
[0105] Specifically, for each of the connected regions, it can be determined whether the anti-corrosion parameter of the connected region is between 0.1 and 0.9. If so, the connected region is determined to be a target connected region, otherwise, the connected region is not a target connected region. For the determined target connected region, the first text region in the first difference image block is finally obtained.
[0106] In this embodiment, the connected area is corroded to obtain the anti-corrosion parameters of the connected area. By taking advantage of the characteristics of dilation corrosion for Chinese recognition, it is possible to determine whether the connected area is a text area based on the anti-corrosion parameters of the connected area. In this way, the first text area can be identified from the first difference image block, making the algorithm for feature extraction of the first difference image block simple and the computational complexity relatively low.
[0107] Optionally, the step of expanding and connecting the characters in the first character region to generate at least one first character sub-region includes:
[0108] The characters in the first character region are expanded and connected horizontally to generate at least one first character sub-region.
[0109] Generally, the characters in the image of the iteratively developed requirement document are usually connected left and right. Therefore, in this embodiment, only the characters in the first text area are expanded and connected horizontally, which can avoid the wrong connection of the upper and lower rows of unrelated characters. This can improve the application scenario matching degree of the characters in the image of the requirement document, thereby effectively reducing the algorithm complexity and improving the overall speed of the algorithm.
[0110] Optionally, after step 103, the method further includes:
[0111] Obtaining a structural similarity index corresponding to the second image block;
[0112] Based on the structural similarity index corresponding to each of the second image blocks, a second difference image block in the at least one second image block is determined; wherein the second difference image block is third difference information of the first file relative to the second file.
[0113] Generally, the difference information between the first file and the second file includes not only the description of the newly added functions, but also the description of the modification of the existing functions. In this embodiment, the second difference image block is the third difference information between the first file and the second file, that is, the text in the second difference image block is the description of the modification of the first file relative to the existing functions in the second file during the iterative development process.
[0114] The difference between the first difference image block and the second difference image block is that the text in the first difference image block is a description of the newly added functions of the first file relative to the second file during the iterative development process, while the text in the second difference image block is a description of the modified functions of the first file relative to the existing functions in the second file during the iterative development process.
[0115] In addition, the method for determining the second difference image block is similar to the method for determining the first difference image block, and will not be described in detail here.
[0116] In order to enable developers to intuitively and quickly locate functional changes based on the first difference information and the third difference information during the iterative development process, the first difference image block and the second difference image block may be highlighted and displayed, and the marking colors of the first difference image block and the second difference image block may be different. For example, the first difference image block may be marked with a white frame, and the second difference image block may be marked with a black frame.
[0117] In this embodiment, by identifying the third difference information between the first file and the second file, the efficiency of identifying new functions in the requirement document used for iterative development can be further improved, thereby increasing the speed of iterative development.
[0118] Optionally, after determining the second difference image block in the at least one second image block based on the structural similarity index corresponding to each of the second image blocks, the method further includes:
[0119] performing feature extraction on the second difference image block to obtain a second text area in the second difference image block;
[0120] Expand and connect the characters in the second character region to generate at least one second character sub-region;
[0121] For each of the second character sub-regions, recognize each character in the second character sub-region to obtain a character recognition result of the second character sub-region;
[0122] Based on the text recognition results of each of the second text sub-regions, fourth difference information between the first file and the second file is identified in the text description information other than the second image in the second file.
[0123] In this embodiment, the second file also includes text description information that describes the second image. When the difference information between the first file and the second file includes a description of the modification of an existing function, the information in the text description information of the second file that differs from that of the first file can be identified, so as to further improve the efficiency of identifying new functions in the requirement document used for iterative development.
[0124] First, the text description in the second difference image block may be identified, and then keywords may be extracted from the identified text description to obtain keywords of the text description, and finally, the text description information containing the keywords may be searched in the second file. The method of identifying the fourth difference information in the second difference image block is similar to the method of identifying the second difference information in the first difference image block, and will not be described in detail here.
[0125] It should be noted that the various optional implementation modes introduced in the embodiments of the present invention may be implemented in combination with each other or may be implemented separately, and the embodiments of the present invention are not limited to this.
[0126] The following is an explanation of the file generation method provided by the embodiment of the present invention.
[0127] See also Figure 2 , Figure 2 is a flowchart of a method for generating a file according to an embodiment of the present invention, see Figure 2 As shown, the process is as follows:
[0128] Step 201, identifying target difference information of a first file relative to a second file; wherein the first file and the second file are two files containing related content, and the target difference information includes incremental information and / or deleted information, wherein the incremental information is information added to the first file relative to the second file, and the deleted information is information deleted from the first file relative to the second file;
[0129] Step 202: if the target difference information includes the incremental information, mark the incremental information in the first file to obtain a first target file;
[0130] Step 203: When the target difference information includes the deletion information, the deletion information is inserted into the first file, and the deletion information is marked to obtain a second target file.
[0131] In this embodiment, in order to enable the user to intuitively and quickly locate the difference information between the first file and the second file, after the target difference information is identified, the target difference information may be marked to facilitate the user's reading.
[0132] Specifically, the incremental information can be marked in the first file to obtain a first target file for output; the deleted information can also be inserted into the first file and marked to obtain a second target file for output. Of course, in the case where the target difference information includes incremental information and deleted information, the deleted information can be inserted into the first target file and marked to obtain a second target file, and finally a second target file is output.
[0133] Optionally, the method of marking the target difference information includes at least one of the following:
[0134] highlighting different difference information in the target difference information in colors with color differences;
[0135] Displaying different difference information in the target difference information in frames of different shapes;
[0136] Different difference information in the target difference information is displayed with different icons.
[0137] That is to say, there are multiple ways to mark the target difference information, for example, marking the target difference information with a color different from that of the same information in the two files. Optionally, when the target difference information includes multiple types of difference information, different difference information in the target difference information is highlighted with a color with a color difference.
[0138] For another example, the target difference information is selected in the form of a frame. Optionally, when the target difference information includes a plurality of types of difference information, different difference information in the target difference information is displayed in frames of different shapes.
[0139] For another example, the target difference information is displayed in an icon manner. Optionally, when the target difference information includes a plurality of types of difference information, different difference information in the target difference information is displayed in different icons.
[0140] In this way, the readability of the difference information can be improved, allowing users to locate the difference information more quickly.
[0141] Optionally, the incremental information includes the first difference information and / or the second difference information, and the deleted information includes the third difference information and / or the fourth difference information;
[0142] The first difference information is a first difference image block in at least one first image block of the first image of the first file relative to the second image of the second file, and the second difference information is difference information in the text description information other than the first image in the first file relative to the second file;
[0143] The third difference information is a second difference image block in at least one second image block of the second image relative to the first image, and the fourth difference information is difference information in the text description information other than the second image in the second file relative to the first file;
[0144] The identification information of the first image is the same as the identification information of the second image.
[0145] For example, in order to enable developers to intuitively and quickly locate functional changes based on the second difference information and the fourth difference information during the iterative development process, the second difference information and the fourth difference information may be highlighted, and the marking colors of the second difference information and the fourth difference information may be different. For example, the keywords in the text description information of the first file may be highly marked in yellow to mark the second difference information, and the keywords in the text description information of the second file may be highly marked in red to mark the fourth difference information.
[0146] Furthermore, in order to further improve the efficiency of identifying new functions in the requirement documents used for iterative development and increase the speed of iterative development, the third difference information and the fourth difference information can also be inserted into the first file, at the position of the first image consistent with the title of the second image corresponding to the third difference information, to generate a new requirement document. In this way, developers can locate functional changes more intuitively and quickly.
[0147] It should be noted that the various optional implementation modes introduced in the embodiments of the present invention may be implemented in combination with each other or may be implemented separately, and the embodiments of the present invention are not limited to this.
[0148] The following is an example to illustrate in detail the difference information identification method provided by the embodiment of the present invention.
[0149] See also Figure 3 , Figure 3 This is the second flowchart of the difference information identification method provided by the embodiment of the present invention, see Figure 3 As shown, the process is as follows:
[0150] Specifically, first, a first requirement document and a second requirement document for two successive iterative developments are input.
[0151] The first requirement document is a requirement document for the N+1th iterative development, and the second requirement document is a requirement document for the Nth iterative development.
[0152] Then, images in the first requirement document and the second requirement document are extracted respectively.
[0153] Next, the first image and the second image with the same title are selected in sequence.
[0154] Next, the first image is processed into blocks to obtain first image blocks; and the second image is processed into blocks to obtain second image blocks.
[0155] Next, grayscale processing is performed on each first image block and each second image block respectively.
[0156] Next, for each first image block, the structural similarity index of the first image block and each second image block is calculated respectively to obtain the structural similarity index corresponding to the first image block and the structural similarity index corresponding to the second image block.
[0157] Next, for each first image block, a maximum structural similarity index is obtained from the structural similarity indexes of the first image blocks; and for each second image block, a maximum structural similarity index is obtained from the structural similarity indexes of the second image blocks.
[0158] Next, when the maximum structural similarity index corresponding to the first image block is less than or equal to the threshold, the first image block is determined to be a first difference image block and is selected with a white frame; when the maximum structural similarity index corresponding to the second image block is less than or equal to the threshold, the second image block is determined to be a second difference image block and is selected with a black frame.
[0159] The first difference image block is first difference information between the first requirement document and the second requirement document, and the second difference image block is third difference information between the first requirement document and the second requirement document.
[0160] In other cases, both the first image block and the second image block may not be framed.
[0161] Next, the text in the first difference image block and the text in the second difference image block are respectively identified.
[0162] Next, keywords are extracted from the text in the first difference image block, and the keywords are used to search for the second difference information between the first requirement document and the second requirement document, and the second difference information is highlighted in yellow; keywords are extracted from the text in the second difference image block, and the keywords are used to search for the fourth difference information between the first requirement document and the second requirement document, and the fourth difference information is highlighted in red.
[0163] Finally, the third difference information and the fourth difference information are integrated into the first requirement document, and a new requirement document is output.
[0164] The following is a description of a difference information identification device provided by an embodiment of the present invention.
[0165] See also Figure 4 , Figure 4 This is one of the structural diagrams of the difference information identification device provided by the embodiment of the present invention, which can implement the details of the difference information identification method in the above embodiment and achieve the same effect. Figure 4 As shown, the difference information identification device 400 includes:
[0166] A first acquisition module 401 is used to acquire a first image and a second image with the same identification information; wherein the first image is an image in a first file, the second image is an image in a second file, and the first file and the second file are two files containing related content;
[0167] An image segmentation module 402 is configured to segment the first image into blocks based on the text format in the first image to obtain at least one first image block; and segment the second image into blocks based on the text format in the second image to obtain at least one second image block;
[0168] A calculation module 403 is used to calculate, for each of the first image blocks, a structural similarity index between the first image block and each of the second image blocks, to obtain a structural similarity index corresponding to the first image block;
[0169] The first determination module 404 is configured to determine a first difference image block in the at least one first image block based on a structural similarity index corresponding to each of the first image blocks; wherein the first difference image block is first difference information of the first file relative to the second file.
[0170] Optionally, the at least one first image block includes a first target image block, and the first target image block is any first image block in the at least one first image block; the first determination module 404 is specifically used to determine a target structure similarity index from the structure similarity indexes corresponding to the first target image blocks; wherein the target structure similarity index is the largest structure similarity index among the structure similarity indexes corresponding to the first target image blocks; when the target structure similarity index is less than a preset threshold, the first target image block is determined to be a first difference image block.
[0171] Optional, see Figure 5 , Figure 5 FIG. 2 is a second structural diagram of a difference information identification device provided by an embodiment of the present invention. Figure 5 As shown, based on Figure 4 In the device embodiment shown, the difference information identification device 400 further includes:
[0172] A first feature extraction module 405, configured to extract features from the first difference image block to obtain a first text region in the first difference image block;
[0173] A first expansion and connection module 406, configured to expand and connect the characters in the first character region to generate at least one first character sub-region;
[0174] A first recognition module 407 is used to recognize each character in each of the first character sub-regions to obtain a character recognition result of the first character sub-region;
[0175] The second recognition module 408 is configured to recognize second difference information between the first file and the second file in the text description information other than the first image in the first file based on the text recognition results of each of the first text sub-regions.
[0176] Optionally, the feature extraction module 405 is specifically used to perform region segmentation on the first difference image block to generate at least one connected area; for each of the connected areas, perform corrosion processing on the connected area to obtain the anti-corrosion parameters of the connected area; based on the anti-corrosion parameters of each of the connected areas, determine a target connected area in the at least one connected area; wherein the target connected area is a connected area whose anti-corrosion parameters are within a preset range, and the first text area in the first difference image block includes the target connected area.
[0177] Optionally, the expansion and connection module 406 is specifically configured to perform horizontal expansion and connection on the characters in the first character region to generate at least one first character sub-region.
[0178] Optional, see Figure 6 , Figure 6 FIG. 3 is a structural diagram of a difference information identification device provided by an embodiment of the present invention. Figure 6 As shown, based on Figure 4 In the device embodiment shown, the difference information identification device 400 further includes:
[0179] A second acquisition module 409 is used to acquire a structural similarity index corresponding to the second image block;
[0180] The second determination module 410 is used to determine a second difference image block in the at least one second image block based on the structural similarity index corresponding to each second image block; wherein the second difference image block is third difference information of the first file relative to the second file.
[0181] Optional, see Figure 7 , Figure 7 FIG. 4 is a structural diagram of a difference information identification device provided by an embodiment of the present invention. Figure 7 As shown, based on Figure 6 In the device embodiment shown, the difference information identification device 400 further includes:
[0182] A second feature extraction module 411 is used to extract features from the second difference image block to obtain a second text area in the second difference image block;
[0183] A second expansion and connection module 412, configured to expand and connect the characters in the second character region to generate at least one second character sub-region;
[0184] A third recognition module 413 is used to recognize each character in each of the second character sub-regions to obtain a character recognition result of the second character sub-region;
[0185] The fourth recognition module 414 is configured to recognize fourth difference information between the first file and the second file in the text description information other than the second image in the second file based on the text recognition results of each of the second text sub-regions.
[0186] The above-mentioned difference information identification device 400 can implement each process implemented by the electronic device in the above-mentioned difference information identification method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be described here.
[0187] The file generation device provided by the embodiment of the present invention is described below.
[0188] See also Figure 8 , Figure 8 1 is a structural diagram of a file generation device provided in an embodiment of the present invention, which can implement the details of the file generation method in the above embodiment and achieve the same effect. Figure 8 As shown, the file generating device 800 includes:
[0189] The first identification module 801 is used to identify target difference information of a first file relative to a second file; wherein the first file and the second file are two files containing related content, and the target difference information includes incremental information and / or deleted information, wherein the incremental information is information added to the first file relative to the second file, and the deleted information is information deleted from the first file relative to the second file;
[0190] A first marking module 802 is used for marking the incremental information in the first file to obtain a first target file when the target difference information includes the incremental information;
[0191] An inserting module 803, configured to insert the deletion information into the first file when the target difference information includes the deletion information;
[0192] The second marking module 804 is used to mark the deletion information to obtain a second target file.
[0193] Optionally, the method of marking the target difference information includes at least one of the following:
[0194] highlighting different difference information in the target difference information in colors with color differences;
[0195] Displaying different difference information in the target difference information in frames of different shapes;
[0196] Different difference information in the target difference information is displayed with different icons.
[0197] Optionally, the incremental information includes the first difference information and / or the second difference information, and the deleted information includes the third difference information and / or the fourth difference information;
[0198] The first difference information is a first difference image block in at least one first image block of the first image of the first file relative to the second image of the second file, and the second difference information is difference information in the text description information other than the first image in the first file relative to the second file;
[0199] The third difference information is a second difference image block in at least one second image block of the second image relative to the first image, and the fourth difference information is difference information in the text description information other than the second image in the second file relative to the first file;
[0200] The identification information of the first image is the same as the identification information of the second image.
[0201] See also Fig. 9 , Fig. 9 is a structural diagram of an electronic device provided by the present invention, such as Fig. 9 The electronic device shown includes: a processor 901, a memory 902, and a computer program stored in the memory 902 and executable on the processor 901. The components in the electronic device are coupled together via a first bus interface 903. When the computer program is executed by the processor 901, the following steps are implemented:
[0202] Acquire a first image and a second image having the same identification information; wherein the first image is an image in a first file, the second image is an image in a second file, and the first file and the second file are two files containing related content;
[0203] Divide the first image into blocks based on the text format in the first image to obtain at least one first image block; divide the second image into blocks based on the text format in the second image to obtain at least one second image block;
[0204] For each of the first image blocks, respectively calculate a structural similarity index between the first image block and each of the second image blocks to obtain a structural similarity index corresponding to the first image block;
[0205] Based on the structural similarity index corresponding to each of the first image blocks, a first difference image block in the at least one first image block is determined; wherein the first difference image block is first difference information of the first file relative to the second file.
[0206] Optionally, the at least one first image block includes a first target image block, and the first target image block is any first image block in the at least one first image block; the processor 901 is further configured to:
[0207] Determining a target structural similarity index from the structural similarity indexes corresponding to the first target image block; wherein the target structural similarity index is the largest structural similarity index among the structural similarity indexes corresponding to the first target image block;
[0208] When the target structure similarity index is less than a preset threshold, the first target image block is determined to be a first difference image block.
[0209] Optionally, the processor 901 is further configured to:
[0210] Performing feature extraction on the first difference image block to obtain a first text area in the first difference image block;
[0211] Expand and connect the characters in the first character region to generate at least one first character sub-region;
[0212] For each of the first character sub-regions, recognize each character in the first character sub-region to obtain a character recognition result of the first character sub-region;
[0213] Based on the text recognition results of each of the first text sub-regions, second difference information between the first file and the second file is identified in the text description information other than the first image in the first file.
[0214] Optionally, the processor 901 is further configured to:
[0215] Performing region segmentation on the first difference image block to generate at least one connected region;
[0216] For each of the connected regions, performing corrosion treatment on the connected region to obtain the corrosion resistance parameter of the connected region;
[0217] Based on the anti-corrosion parameter of each of the connected areas, a target connected area in the at least one connected area is determined; wherein the target connected area is a connected area whose anti-corrosion parameter is within a preset range, and the first text area in the first difference image block includes the target connected area.
[0218] Optionally, the processor 901 is further configured to:
[0219] The characters in the first character region are expanded and connected horizontally to generate at least one first character sub-region.
[0220] Optionally, the processor 901 is further configured to:
[0221] Obtaining a structural similarity index corresponding to the second image block;
[0222] Based on the structural similarity index corresponding to each of the second image blocks, a second difference image block in the at least one second image block is determined; wherein the second difference image block is third difference information of the first file relative to the second file.
[0223] Optionally, the processor 901 is further configured to:
[0224] performing feature extraction on the second difference image block to obtain a second text area in the second difference image block;
[0225] Expand and connect the characters in the second character region to generate at least one second character sub-region;
[0226] For each of the second character sub-regions, recognize each character in the second character sub-region to obtain a character recognition result of the second character sub-region;
[0227] Based on the text recognition results of each of the second text sub-regions, fourth difference information between the first file and the second file is identified in the text description information other than the second image in the second file.
[0228] In addition, the computer program may also implement the following steps when executed by the processor 901:
[0229] Identify target difference information of a first file relative to a second file; wherein the first file and the second file are two files containing related content, and the target difference information includes incremental information and / or deleted information, wherein the incremental information is information added to the first file relative to the second file, and the deleted information is information deleted from the first file relative to the second file;
[0230] In a case where the target difference information includes the incremental information, marking the incremental information in the first file to obtain a first target file;
[0231] In the case that the target difference information includes the deletion information, the deletion information is inserted into the first file, and the deletion information is marked to obtain a second target file.
[0232] Preferably, an embodiment of the present invention further provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the computer program implements the various processes of the above-mentioned difference information identification method, or implements the various processes of the above-mentioned file generation method, and can achieve the same technical effect. To avoid repetition, it will not be described here.
[0233] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned difference information identification method or each process of the above-mentioned file generation method is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0234] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0235] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0236] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0237] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.
[0238] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0239] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.
[0240] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for identifying difference information, characterized in that: The method comprises: Acquire a first image and a second image having the same identification information; wherein the first image is an image in a first file, the second image is an image in a second file, and the first file and the second file are two files containing related content; Divide the first image into blocks based on the text format in the first image to obtain at least one first image block; divide the second image into blocks based on the text format in the second image to obtain at least one second image block; For each of the first image blocks, respectively calculate a structural similarity index between the first image block and each of the second image blocks to obtain a structural similarity index corresponding to the first image block; Based on the structural similarity index corresponding to each of the first image blocks, determine a first difference image block in the at least one first image block; wherein the first difference image block is first difference information of the first file relative to the second file; Performing feature extraction on the first difference image block to obtain a first text area in the first difference image block; Expand and connect the characters in the first character region to generate at least one first character sub-region; For each of the first character sub-regions, recognize each character in the first character sub-region to obtain a character recognition result of the first character sub-region; Based on the text recognition results of each of the first text sub-regions, second difference information between the first file and the second file is identified in the text description information other than the first image in the first file.
2. The method according to claim 1, characterized in that The at least one first image block includes a first target image block, and the first target image block is any first image block in the at least one first image block; and determining a first difference image block in the at least one first image block based on a structural similarity index corresponding to each of the first image blocks includes: Determining a target structural similarity index from the structural similarity indexes corresponding to the first target image block; wherein the target structural similarity index is the largest structural similarity index among the structural similarity indexes corresponding to the first target image block; When the target structure similarity index is less than a preset threshold, the first target image block is determined to be a first difference image block.
3. The method according to claim 1, characterized in that The step of extracting features from the first difference image block to obtain a first text region in the first difference image block includes: Performing region segmentation on the first difference image block to generate at least one connected region; For each of the connected regions, performing corrosion treatment on the connected region to obtain the corrosion resistance parameter of the connected region; Based on the anti-corrosion parameter of each of the connected areas, a target connected area in the at least one connected area is determined; wherein the target connected area is a connected area whose anti-corrosion parameter is within a preset range, and the first text area in the first difference image block includes the target connected area.
4. The method according to claim 1, characterized in that: The step of expanding and connecting the characters in the first character region to generate at least one first character sub-region includes: The characters in the first character region are expanded and connected horizontally to generate at least one first character sub-region.
5. The method according to claim 1, characterized in that After calculating, for each of the first image blocks, a structural similarity index between the first image block and each of the second image blocks, and obtaining the structural similarity index corresponding to the first image block, the method further includes: Obtaining a structural similarity index corresponding to the second image block; Based on the structural similarity index corresponding to each of the second image blocks, a second difference image block in the at least one second image block is determined; wherein the second difference image block is third difference information of the first file relative to the second file.
6. The method according to claim 5, characterized in that After determining the second difference image block in the at least one second image block based on the structural similarity index corresponding to each of the second image blocks, the method further includes: performing feature extraction on the second difference image block to obtain a second text region in the second difference image block; Expand and connect the characters in the second character region to generate at least one second character sub-region; For each of the second character sub-regions, recognize each character in the second character sub-region to obtain a character recognition result of the second character sub-region; Based on the text recognition results of each of the second text sub-regions, fourth difference information between the first file and the second file is identified in the text description information other than the second image in the second file.
7. The method according to claim 1, characterized in that The first file is a file modified based on the content of the second file, wherein the first file is a file used for the N+Mth iterative development, the second file is a file used for the Nth iterative development, and N and M are both positive integers.
8. A file generation method, characterized in that: The method comprises: Identify target difference information of a first file relative to a second file; wherein the first file and the second file are two files containing related content, and the target difference information includes incremental information and / or deleted information, wherein the incremental information is information added to the first file relative to the second file, and the deleted information is information deleted from the first file relative to the second file; In a case where the target difference information includes the incremental information, marking the incremental information in the first file to obtain a first target file; In the case where the target difference information includes the deletion information, inserting the deletion information into the first file and marking the deletion information to obtain a second target file; The incremental information includes the first difference information and / or the second difference information, and the deleted information includes the third difference information and / or the fourth difference information; The first difference information is a first difference image block in at least one first image block of the first image of the first file relative to the second image of the second file, and the second difference information is difference information in the text description information other than the first image in the first file relative to the second file; The third difference information is a second difference image block in at least one second image block of the second image relative to the first image, and the fourth difference information is difference information in the text description information other than the second image in the second file relative to the first file; The identification information of the first image is the same as the identification information of the second image.
9. The method according to claim 8, characterized in that The method of marking the target difference information includes at least one of the following: Displaying different difference information in the target difference information in colors with color differences; Displaying different difference information in the target difference information in frames of different shapes; Different difference information in the target difference information is displayed with different icons.
10. A difference information identification device, characterized in that: The device comprises: A first acquisition module is used to acquire a first image and a second image with the same identification information; wherein the first image is an image in a first file, the second image is an image in a second file, and the first file and the second file are two files containing related content; An image segmentation module, configured to segment the first image into blocks based on the text format in the first image to obtain at least one first image block; and segment the second image into blocks based on the text format in the second image to obtain at least one second image block; a calculation module, configured to calculate, for each of the first image blocks, a structural similarity index between the first image block and each of the second image blocks, to obtain a structural similarity index corresponding to the first image block; A first determination module, configured to determine a first difference image block in the at least one first image block based on a structural similarity index corresponding to each of the first image blocks; wherein the first difference image block is first difference information of the first file relative to the second file; The difference information identification device also includes: A first feature extraction module, configured to extract features from the first difference image block to obtain a first text region in the first difference image block; A first expansion and connection module, used for expanding and connecting the characters in the first character region to generate at least one first character sub-region; A first recognition module, configured to recognize each character in each of the first character sub-regions, and obtain a character recognition result of the first character sub-region; The second recognition module is used to recognize second difference information between the first file and the second file in the text description information other than the first image in the first file based on the text recognition results of each of the first text sub-regions.
11. A file generating device, characterized in that: The device comprises: A first identification module is used to identify target difference information of a first file relative to a second file; wherein the first file and the second file are two files containing related content, and the target difference information includes incremental information and / or deleted information, wherein the incremental information is information added to the first file relative to the second file, and the deleted information is information deleted from the first file relative to the second file; A first marking module, configured to mark the incremental information in the first file to obtain a first target file when the target difference information includes the incremental information; an inserting module, configured to insert the deletion information into the first file when the target difference information includes the deletion information; A second marking module, used for marking the deletion information to obtain a second target file; The incremental information includes the first difference information and / or the second difference information, and the deleted information includes the third difference information and / or the fourth difference information; The first difference information is a first difference image block in at least one first image block of the first image of the first file relative to the second image of the second file, and the second difference information is difference information in the text description information other than the first image in the first file relative to the second file; The third difference information is a second difference image block in at least one second image block of the second image relative to the first image, and the fourth difference information is difference information in the text description information other than the second image in the second file relative to the first file; The identification information of the first image is the same as the identification information of the second image.
12. An electronic device, characterized in that: The invention comprises a processor, a memory and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the difference information identification method as claimed in any one of claims 1 to 7 are implemented, or the steps of the file generation method as claimed in any one of claims 8 to 9 are implemented.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the difference information identification method according to any one of claims 1 to 7 are implemented, or the steps of the file generation method according to any one of claims 8 to 9 are implemented.
Citation Information
Patent Citations
System and method for carrying out difference synchronization on compressed file
CN106874403A
Image comparison method and device, electronic equipment and storage medium
CN111353419A