CN112783839A - Method and device for storing document, electronic equipment and storage medium - Google Patents

Method and device for storing document, electronic equipment and storage medium Download PDF

Info

Publication number
CN112783839A
CN112783839A CN202010511139.8A CN202010511139A CN112783839A CN 112783839 A CN112783839 A CN 112783839A CN 202010511139 A CN202010511139 A CN 202010511139A CN 112783839 A CN112783839 A CN 112783839A
Authority
CN
China
Prior art keywords
images
image
image group
target document
group
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
CN202010511139.8A
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 Kingsoft Office Software Inc
Zhuhai Kingsoft Office Software Co Ltd
Original Assignee
Beijing Kingsoft Office Software Inc
Zhuhai Kingsoft Office Software 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 Kingsoft Office Software Inc, Zhuhai Kingsoft Office Software Co Ltd filed Critical Beijing Kingsoft Office Software Inc
Priority to CN202010511139.8A priority Critical patent/CN112783839A/en
Publication of CN112783839A publication Critical patent/CN112783839A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the application provides a method and a device for storing documents, electronic equipment and a storage medium, and relates to the technical field of computers, wherein the method comprises the following steps: a target document is obtained, the target document including a plurality of images. According to a preset identification rule, dividing the plurality of images into at least one image group, wherein an overlapping part exists between any one image in the image group and at least one image in other images in the image group. And carrying out image combination processing on the images contained in the image group to obtain a combined image corresponding to each image group. And storing the document after the image merging processing. By adopting the method and the device, the storage space occupied by the target document can be effectively reduced, and the analyzing and rendering speed when the target document is opened is improved.

Description

Method and device for storing document, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for storing a document, an electronic device, and a storage medium.
Background
Currently, most people store information collected in their lives, works, or studies in documents in the form of words or pictures. When storing a document, the electronic device stores all the contents contained in the document, that is, the electronic device stores each picture contained in the document.
In practice, there may be multiple pictures superimposed on the same document. Based on the technical scheme, the electronic equipment can store the superposed pictures one by one, and the storage space of the electronic equipment can be wasted.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method, an apparatus, an electronic device, and a storage medium for storing a document, which can effectively reduce a storage space occupied by a target document and improve parsing and rendering speeds when the target document is opened. The specific technical scheme is as follows:
in a first aspect, a method of storing a document is provided, the method comprising:
a target document is obtained, the target document including a plurality of images.
According to a preset identification rule, dividing the plurality of images into at least one image group, wherein an overlapping part exists between any one image in the image group and at least one image in other images in the image group.
And carrying out image combination processing on the images contained in the image group to obtain a combined image corresponding to each image group.
And storing the document after the image merging processing.
Optionally, the dividing, according to a preset identification rule, the plurality of images into at least one image group, where an overlapping portion exists between any one image in the image group and at least one image in other images in the image group, includes:
determining the data size, the dimension size and the position information in the target document of all the images in the target document page.
And judging whether any image in the plurality of images has an overlapping part with at least one image in other images in the plurality of images according to the position information and the size of the plurality of images in the target document.
And if no overlapping part exists between any one of the images and the other images in the images, judging that the images do not form the image group.
And if any image in the plurality of images has an overlapping part with at least one image in other images in the plurality of images, judging that the plurality of images form the image group.
And dividing the images with the overlapped areas in the target document into the same image group to obtain at least one image group.
Optionally, the image merging processing on each image included in the image group to obtain a merged image corresponding to each image group includes:
and creating a blank image at the image group position.
And pasting the images into the blank images according to the display sequence of the images in the image group and the relative positions of the images to obtain the combined image.
Comparing the total data volume of the group of images with the data volume of the merged image.
And if the total data volume of the image group is larger than the data volume of the merged image, replacing the image group in the target document with the merged image.
Optionally, the method further includes:
and when a display instruction corresponding to the target document and input by a user is received, acquiring the combined image.
And displaying the merged image at the corresponding position according to the position information of the plurality of images in the target document.
In a second aspect, an apparatus for storing a document is provided, and the apparatus is applied to an electronic device, and the apparatus includes:
the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a target document, and the target document comprises a plurality of images.
The dividing module is used for dividing the plurality of images into at least one image group according to a preset identification rule, and an overlapping part exists between any one image in the image group and at least one image in other images in the image group.
And the merging module is used for carrying out image merging processing on the images contained in the image group to obtain a merged image corresponding to each image group.
And the storage module is used for storing the document after the image combination processing.
Optionally, the dividing module is specifically configured to:
determining the data size, the dimension size and the position information in the target document of all the images in the target document page.
And judging whether any image in the plurality of images has an overlapping part with at least one image in other images in the plurality of images according to the position information and the size of the plurality of images in the target document.
And if no overlapping part exists between any one of the images and the other images in the images, judging that the images do not form the image group.
And if any image in the plurality of images has an overlapping part with at least one image in other images in the plurality of images, judging that the plurality of images form the image group.
And dividing the images with the overlapped areas in the target document into the same image group to obtain at least one image group.
Optionally, the merging module is specifically configured to:
and creating a blank image at the image group position.
And pasting the images into the blank images according to the display sequence of the images in the image group and the relative positions of the images to obtain the combined image.
Comparing the total data volume of the group of images with the data volume of the merged image.
And if the total data volume of the image group is larger than the data volume of the merged image, replacing the image group in the target document with the merged image.
Optionally, the apparatus further comprises:
and the second acquisition module is used for acquiring the image group and the combined image according to the comparison result of the image group and the combined image when receiving a display instruction corresponding to the target document and input by a user.
And the display module is used for displaying the image group or the combined image at the corresponding position according to the position information of the plurality of images in the target document.
In a third aspect, an electronic device is provided, which includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of the first aspect when executing the program stored in the memory.
In a fourth aspect, a computer-readable storage medium is provided, having stored thereon a computer program which, when being executed by a processor, carries out the method steps of the first aspect.
In a fifth aspect, there is provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of the first aspect described above.
According to the method and the device for storing the document, the electronic equipment can acquire the target document to be stored, and the target document comprises a plurality of images. According to a preset identification rule, the electronic equipment can determine an image with an overlapped part in a plurality of images in the target document. The electronic equipment divides the images into an image group, and combines all the images in the image group to obtain a combined image. And the electronic equipment compares the total data volume of the image group with the data volume of the merged image, and if the total data volume of the image group is larger than the data volume of the merged image, the image group is deleted and the merged image is reserved, otherwise, the merged image is deleted and the image group is reserved. The electronic equipment stores the modified target document, and effectively reduces the storage space occupied by the target document.
Of course, not all advantages described above need to be achieved at the same time in the practice of any one product or method of the present application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flowchart of a method for storing documents according to an embodiment of the present application;
FIG. 2 is a schematic diagram of an image set provided in an embodiment of the present application;
fig. 3 is a schematic diagram of a merged image according to an embodiment of the present disclosure;
FIG. 4 is a flowchart of a method for storing documents according to an embodiment of the present application;
FIG. 5 is a schematic structural diagram of an apparatus for storing documents according to an embodiment of the present application;
FIG. 6 is a schematic structural diagram of an apparatus for storing documents according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a method for storing a document, which is applied to a terminal capable of reading the document. The terminals to which the method can be applied include mobile terminals and non-mobile terminals.
The method for storing documents provided in the embodiments of the present application will be described in detail below with reference to specific embodiments, as shown in fig. 1, the specific steps are as follows:
step 101, a target document is obtained, wherein the target document comprises a plurality of images.
In the embodiment of the application, the electronic device can acquire the target document to be stored. The electronic device may obtain the target document in a wireless data transmission manner, for example, the electronic device may download a certain document from a network as the target document to be stored; alternatively, the electronic device may acquire the target document by wired data transmission such as USB or data line. The target document may be an electronic document, such as a PDF document. The target document may include a plurality of images, and may also include other data such as text, tables, and the like, which is not limited in this embodiment of the application.
Step 102, according to a preset identification rule, determining that a plurality of images are divided into at least one image group, wherein an overlapping part exists between any one image in the image group and at least one image in other images in the image group.
In the embodiment of the present application, the preset identification rule is used to determine whether there is an overlapping region in the plurality of images, and as long as the function of determining whether there is an overlapping region in the plurality of images can be implemented, the preset identification rule may be used in the embodiment of the present application.
Optionally, according to a preset identification rule, the electronic device divides the plurality of images into at least one image group, and an overlapping portion exists between any one image in the image group and at least one image in other images in the image group, and a specific processing procedure may be as follows:
step one, determining the data size, the dimension and the position information in the target document of all images in the target document page.
In the embodiment of the application, the electronic equipment determines the data size, the size and the position information in the target document of all the images in the target document page. The size of the data volume is the size of a storage space occupied by the image, the size of the size may include a length and a width, the length and the width are parameters using pixels as units, and the position information includes a page index of the image and a relative position in a page.
And step two, judging whether any one of the images has an overlapping part with at least one of the other images in the images according to the position information and the size of the images in the target document.
In the embodiment of the application, the electronic equipment judges whether an overlapping area exists between two images according to the size of the images and the position information in the target document. The electronic equipment recognizes the images by taking a page as a unit, judges whether the image and other images have an overlapping area or not by starting from the first image of the first page, and judges that the two images have the overlapping area when the two images are tangent or intersected. When any one of the images has an overlapping part with at least one of the other images in the images, the images are divided into an image group, and any one of the images in the image group should have at least one overlapping area with one or more other images in the same group. As shown in fig. 2, fig. 2 illustrates a schematic diagram of an image group in an electronic device, which includes an image 201, an image 202, and an image 203. The image 201 and the image 202 have an overlapping area, and the image 202 and the image 203 have an overlapping area, so that the electronic device divides the image 201, the image 202 and the image 203 into an image group.
If the first image of the first page does not have an overlapping area with other images, judging whether the second image of the first page has an overlapping area with other images except the first image of the first page, and if so, dividing the first image of the first page and other images into an image group.
The electronic equipment continuously judges whether the images in the image group and the images outside the image group have overlapping areas or not, if so, the images outside the image group and the images in the image group having overlapping areas are drawn into the image group and continuously judged until the images in the image group and the images outside the image group do not have overlapping areas, and if not, the image group is reserved and the next image outside the image group is continuously judged until all the images of the page are judged.
And step three, if any image in the plurality of images and other images in the plurality of images do not have overlapped parts, judging that the plurality of images do not form the image group.
In the embodiment of the application, the area occupied by the image is determined by the relative area occupied by the image in the target document and the relative position of the image in the document, the areas can be overlapped, and when the areas occupied by the plurality of images do not have the overlapped area, the situation that the plurality of images do not overlap with each other is judged, namely the plurality of images do not form an image group.
And step four, if any image in the plurality of images has an overlapping part with at least one image in other images in the plurality of images, judging that the plurality of images form an image group.
In the embodiment of the application, the area occupied by the image is determined by the relative area occupied by the image in the target document and the relative position of the image in the document, the areas occupied by different images can be mutually overlapped, and when an overlapping part exists between any one of the images and at least one of the other images in the images, the situation that the images are mutually overlapped (namely, one image in the image group can be overlapped with one or more of the other images in the image group) is judged, namely, the images form the image group.
And step five, dividing the images with the overlapped areas in the target document into the same image group to obtain at least one image group.
In the embodiment of the application, the electronic equipment divides the images with the overlapped areas in the target document into the same image group, and in the same image group, any one image and at least one image in other images in the image group have overlapped parts. After obtaining the image group, the electronic device will prepare to merge the images within the image group.
And 103, carrying out image combination processing on the images contained in the image group to obtain a combined image corresponding to each image group.
In the embodiment of the application, after obtaining the image group, the electronic device performs merging processing on images in the image group, and the merging processing is performed in a superposition manner. The electronic device superimposes all the images in the image group together in sequence to generate a new image, wherein the image is called a combined image, the combined image is an image, and the displayed content is consistent with the content displayed in the image group.
Optionally, the electronic device performs image merging processing on each image included in the image group, and the specific processing procedure may be as follows:
step one, a blank image is created at the position of the image group.
In the embodiment of the application, the electronic device creates a blank image at the position of the image group, determines four pixel points of the top, bottom, left and right of the original position of the image in the image group, and uses the four pixel points as four boundary points of the blank image to form the boundary of the blank image, so that the merged image does not affect other contents in the target document and the contents of the merged image.
And step two, pasting the images into blank images according to the display sequence of the images in the image group and the relative positions of the images to obtain combined images.
In this embodiment of the application, the electronic device pastes an image into a blank image according to the display sequence of the images in the image group and the relative position between the images, and merges the blank image and the image in the blank image into one image to obtain a merged image, as shown in fig. 3, fig. 3 shows a schematic diagram of a merged image in the electronic device, where the schematic diagram includes an image 204. The image 204 is a merged image obtained by merging the images 201, 202, and 203 in fig. 2. At this time, both the image group and the combined image exist in the target document.
And step three, comparing the total data volume of all the images in the image group with the data volume of a combined image obtained after the image group is combined and processed.
In the embodiment of the application, after the electronic device obtains the combined image, the data volume of the combined image can be obtained, the total data volume of the image group is the total data volume of all images in the image group, and the data volume of each image in the image group is summed by the electronic device to obtain the total data volume of the image group. The electronic equipment compares the total data volume of the image group with the data volume of the combined image, the comparison aims to delete the part with large data volume and reserve the part with small data volume, and the purpose of reducing the storage space occupied by the target document is achieved.
And step four, if the total data volume of the image group is larger than the data volume of the combined image, replacing the image group in the target document with the combined image.
In the embodiment of the application, after the electronic device obtains the merged image, the image group and the merged image generated by combining the image group are compared in the target document, and if the total data amount of the image group is larger than the data amount of the merged image, the image group is deleted, and the image group in the target document is replaced by the merged image.
And after the electronic equipment obtains the combined image, comparing the image group and the combined image generated by combining the image group in the target document, and if the total data volume of the image group is less than or equal to the data volume of the combined image, deleting the combined image and reserving the image group in the target document.
And 104, storing the document after the image combination processing.
In the embodiment of the application, the electronic equipment merges the images with the overlapped areas in the target document. When storing the document, the user can obtain a target document with smaller data size and unchanged content compared with the data size before storing. In the embodiment of the application, the final purpose of the method for using the stored document by the electronic device is to reduce the size of the storage space occupied by the target document on the basis of not changing the display of each image in the target document, so that after the method for storing the document is used, the display content of the document is the same as the display content before the method for using the stored document.
Optionally, an embodiment of the present application further provides a process for displaying a target document, which specifically includes the following steps:
step one, when a display instruction corresponding to the target document and input by a user is received, acquiring the combined image.
In the embodiment of the application, the image group and the combined image which are compared by the electronic equipment can be reserved on the side with small data amount, and the side with large data amount is deleted, so that only one combined image or image group can be reserved on the position of the image group when the document is displayed.
And step two, displaying the merged image at the corresponding position according to the position information of the plurality of images in the target document.
In the embodiment of the application, when the electronic equipment displays the target document, the image group is replaced by the merged image, and the number of images in the target document is reduced, so that the purpose of improving the analyzing and rendering speed when the document is opened is achieved while the data volume of the target document is reduced.
An example of a method for storing a document is also provided in the embodiments of the present application, and as shown in fig. 4, the example includes:
step 401, traversing the whole document, and confirming the position information, the size and the data size of each page of image.
Step 402, taking any one image as a target image.
Step 403, determining whether the target image and the other images in the page have an overlapping area, if so, executing step 404, and if not, executing step 409.
In step 404, the images with the overlapped area are divided into an image group.
Step 405, performing image merging processing on each image included in the image group to obtain a merged image corresponding to each image group.
Step 406 is executed to determine whether the data amount of the merged image is smaller than the data amount of the image group, and if the data amount of the merged image is smaller than the data amount of the image group, step 407 is executed, and if the data amount of the merged image is not smaller than the data amount of the image group, step 408 is executed.
Step 407, delete the group of images.
Step 408, delete the merged image.
Step 409, judging whether all the images are processed or not, and returning to step 402 if all the images are not processed.
In the embodiment of the application, the electronic device can acquire a target document to be stored, and the target document comprises a plurality of images. According to a preset identification rule, the electronic equipment can determine an image with an overlapped part in a plurality of images in the target document. The electronic equipment divides the images into an image group, and combines all the images in the image group to obtain a combined image. And the electronic equipment compares the total data volume of the image group with the data volume of the merged image, and if the total data volume of the image group is larger than the data volume of the merged image, the image group is deleted and the merged image is reserved, otherwise, the merged image is deleted and the image group is reserved. The electronic equipment stores the modified target document, and effectively reduces the storage space occupied by the target document.
Based on the same technical concept, an embodiment of the present application further provides an apparatus for storing a document, as shown in fig. 5, where the apparatus is applied to an electronic device, and the apparatus includes:
the first obtaining module 501 is configured to obtain a target document, where the target document includes a plurality of images.
The dividing module 502 is configured to divide the plurality of images into at least one image group according to a preset identification rule, where an overlapping portion exists between any one image in the image group and at least one image in other images in the image group.
The merging module 503 is configured to perform image merging processing on the images included in the image group to obtain a merged image corresponding to each image group.
And the storage module 504 is configured to store the document after the image merging processing.
Optionally, the dividing module 502 is specifically configured to:
the data size, and position information in the target document are determined for all images within the target document page.
And judging whether any one of the images has an overlapping part with at least one of the other images in the plurality of images according to the position information and the size of the plurality of images in the target document.
If there is no overlapping portion between any of the plurality of images and the other of the plurality of images, it is determined that the plurality of images do not constitute the image group.
If any one of the plurality of images has an overlapping portion with at least one of the other images of the plurality of images, it is determined that the plurality of images constitute an image group.
And dividing the images with the overlapped areas in the target document into the same image group to obtain at least one image group.
Optionally, the merging module 503 is specifically configured to:
a blank image is created at the image group location.
And pasting the images into blank images according to the display sequence of the images in the image group and the relative positions of the images to obtain a combined image.
The total amount of data of the group of images is compared with the amount of data of the merged image.
And if the total data amount of the image group is larger than the data amount of the merged image, replacing the image group in the target document with the merged image.
Optionally, as shown in fig. 6, the apparatus further includes:
a second obtaining module 505, configured to, when receiving a display instruction of a corresponding target document input by a user, obtain an image group and a merged image according to a comparison result of the image group and the merged image.
And a display module 506, configured to display the image group or the combined image at the corresponding position according to the position information of the multiple images in the target document.
In the embodiment of the application, the electronic device can acquire a target document to be stored, and the target document comprises a plurality of images. According to a preset identification rule, the electronic equipment can determine an image with an overlapped part in a plurality of images in the target document. The electronic equipment divides the images into an image group, and combines all the images in the image group to obtain a combined image. And the electronic equipment compares the total data volume of the image group with the data volume of the merged image, and if the total data volume of the image group is larger than the data volume of the merged image, the image group is deleted and the merged image is reserved, otherwise, the merged image is deleted and the image group is reserved. The electronic equipment stores the modified target document, and effectively reduces the storage space occupied by the target document.
The embodiment of the present application further provides an electronic device, as shown in fig. 7, which includes a processor 701, a communication interface 702, a memory 703 and a communication bus 704, where the processor 701, the communication interface 702, and the memory 703 complete mutual communication through the communication bus 704,
a memory 703 for storing a computer program;
the processor 701 is configured to implement the following steps when executing the program stored in the memory 703:
a target document is obtained, the target document including a plurality of images.
According to a preset identification rule, a plurality of images are divided into at least one image group, and any one image in the image group and at least one image in other images in the image group have an overlapping part.
And carrying out image combination processing on the images contained in the image group to obtain a combined image corresponding to each image group.
And storing the document after the image merging processing.
Optionally, dividing the plurality of images into at least one image group according to a preset identification rule, where an overlapping portion exists between any one image in the image group and at least one image in other images in the image group, includes:
the data size, and position information in the target document are determined for all images within the target document page.
And judging whether any one of the images has an overlapping part with at least one of the other images in the plurality of images according to the position information and the size of the plurality of images in the target document.
If there is no overlapping portion between any of the plurality of images and the other of the plurality of images, it is determined that the plurality of images do not constitute the image group.
If any one of the plurality of images has an overlapping portion with at least one of the other images of the plurality of images, it is determined that the plurality of images constitute an image group.
And dividing the images with the overlapped areas in the target document into the same image group to obtain at least one image group.
Optionally, the image merging processing is performed on each image included in the image group to obtain a merged image corresponding to each image group, and the method includes:
a blank image is created at the image group location.
And pasting the images into blank images according to the display sequence of the images in the image group and the relative positions of the images to obtain a combined image.
The total amount of data of the group of images is compared with the amount of data of the merged image.
And if the total data amount of the image group is larger than the data amount of the merged image, replacing the image group in the target document with the merged image.
Optionally, the method further includes:
and when a display instruction corresponding to the target document and input by a user is received, acquiring the combined image.
And displaying the merged image at the corresponding position according to the position information of the plurality of images in the target document.
The communication bus mentioned in the network device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the network device and other devices.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), or other Programmable logic devices, discrete Gate or transistor logic devices, or discrete hardware components.
Based on the same technical concept, the embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the method steps of storing the document.
Based on the same technical concept, embodiments of the present application also provide a computer program product containing instructions, which when run on a computer, causes the computer to perform the above method steps for storing a document.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (10)

1. A method of storing a document, the method comprising:
acquiring a target document, wherein the target document comprises a plurality of images;
dividing the plurality of images into at least one image group according to a preset identification rule, wherein an overlapping part exists between any one image in the image group and at least one image in other images in the image group;
carrying out image merging processing on each image contained in the image group to obtain a merged image corresponding to each image group;
and storing the document after the image merging processing.
2. The method according to claim 1, wherein the dividing the plurality of images into at least one image group according to a preset identification rule, wherein the overlapping part of any one image in the image group and at least one image in other images in the image group comprises:
determining the data size, the dimension size and the position information in the target document of all images in the target document page;
judging whether any one of the images has an overlapping part with at least one of the other images in the plurality of images according to the position information and the size of the plurality of images in the target document;
if any image in the plurality of images does not have an overlapping part with other images in the plurality of images, judging that the plurality of images do not form the image group;
if any image in the plurality of images has an overlapping part with at least one image in other images in the plurality of images, judging that the plurality of images form the image group;
and dividing the images with the overlapped areas in the target document into the same image group to obtain at least one image group.
3. The method according to claim 1, wherein the image merging processing on the images included in the image group to obtain a merged image corresponding to each image group comprises:
creating a blank image at the image group position;
pasting the images into the blank images according to the display sequence of the images in the image group and the relative positions of the images to obtain the combined images;
comparing the total data volume of the group of images with the data volume of the merged image;
and if the total data volume of the image group is larger than the data volume of the merged image, replacing the image group in the target document with the merged image.
4. The method of claim 1, further comprising:
when a display instruction corresponding to the target document and input by a user is received, acquiring the combined image;
and displaying the merged image at the corresponding position according to the position information of the plurality of images in the target document.
5. An apparatus for storing a document, the apparatus comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a target document, and the target document comprises a plurality of images;
the dividing module is used for dividing the plurality of images into at least one image group according to a preset identification rule, and an overlapping part exists between any one image in the image group and at least one image in other images in the image group;
the merging module is used for merging the images contained in the image group to obtain a merged image corresponding to each image group;
and the storage module is used for storing the document after the image combination processing.
6. The apparatus according to claim 5, wherein the partitioning module is specifically configured to:
determining the data size, the dimension size and the position information in the target document of all images in the target document page;
judging whether any one of the images has an overlapping part with at least one of the other images in the plurality of images according to the position information and the size of the plurality of images in the target document;
if any image in the plurality of images does not have an overlapping part with other images in the plurality of images, judging that the plurality of images do not form the image group;
if any image in the plurality of images has an overlapping part with at least one image in other images in the plurality of images, judging that the plurality of images form the image group;
and dividing the images with the overlapped areas in the target document into the same image group to obtain at least one image group.
7. The apparatus of claim 5, wherein the merging module is specifically configured to:
creating a blank image at the image group position;
pasting the images into the blank images according to the display sequence of the images in the image group and the relative positions of the images to obtain the combined images;
comparing the total data volume of the group of images with the data volume of the merged image;
and if the total data volume of the image group is larger than the data volume of the merged image, replacing the image group in the target document with the merged image.
8. The apparatus of claim 5, further comprising:
the second acquisition module is used for acquiring the merged image when receiving a display instruction which is input by a user and corresponds to the target document;
and the display module is used for displaying the merged image at the corresponding position according to the position information of the plurality of images in the target document.
9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 4 when executing a program stored in the memory.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 4.
CN202010511139.8A 2020-06-08 2020-06-08 Method and device for storing document, electronic equipment and storage medium Pending CN112783839A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010511139.8A CN112783839A (en) 2020-06-08 2020-06-08 Method and device for storing document, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010511139.8A CN112783839A (en) 2020-06-08 2020-06-08 Method and device for storing document, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112783839A true CN112783839A (en) 2021-05-11

Family

ID=75749270

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010511139.8A Pending CN112783839A (en) 2020-06-08 2020-06-08 Method and device for storing document, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112783839A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101853524A (en) * 2010-05-13 2010-10-06 北京农业信息技术研究中心 Method for generating corn ear panoramic image by using image sequence
CN105279735A (en) * 2015-11-20 2016-01-27 沈阳东软医疗系统有限公司 Fusion method, fusion device and fusion equipment of image splicing
CN106803899A (en) * 2015-11-26 2017-06-06 华为技术有限公司 The method and apparatus for merging image
CN109559270A (en) * 2018-11-06 2019-04-02 华为技术有限公司 A kind of image processing method and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101853524A (en) * 2010-05-13 2010-10-06 北京农业信息技术研究中心 Method for generating corn ear panoramic image by using image sequence
CN105279735A (en) * 2015-11-20 2016-01-27 沈阳东软医疗系统有限公司 Fusion method, fusion device and fusion equipment of image splicing
CN106803899A (en) * 2015-11-26 2017-06-06 华为技术有限公司 The method and apparatus for merging image
CN109559270A (en) * 2018-11-06 2019-04-02 华为技术有限公司 A kind of image processing method and electronic equipment

Similar Documents

Publication Publication Date Title
CN109783757B (en) Method, device and system for rendering webpage, storage medium and electronic device
CN111444750B (en) PDF document identification method and device and electronic equipment
CN113538450B (en) Method and device for generating image
CN111737618A (en) Vector diagram display method and device for Web end and computer equipment
WO2019018062A1 (en) Organizing images automatically into image grid layout
CN114579912A (en) Page layout method, device, equipment and medium
CN111767492B (en) Picture loading method and device, computer equipment and storage medium
CN109992580A (en) Processing method and processing device, storage medium, the computer equipment of table data
CN107193815B (en) Page code processing method, device and equipment
CN111931708A (en) Form generation method and device
CN111914517A (en) Document hyperlink creating method and device, electronic equipment and readable storage medium
CN111199136B (en) Document content display method, device and equipment
CN111754435A (en) Image processing method, image processing device, terminal equipment and computer readable storage medium
CN112783839A (en) Method and device for storing document, electronic equipment and storage medium
CN108989704B (en) Image generation method and device and terminal equipment
CN112445394A (en) Screenshot method and device
CN115659087A (en) Page rendering method, system, device, storage medium and program product
CN110807300A (en) Image processing method and device, electronic equipment and medium
CN112433778B (en) Mobile device page display method and device, electronic device and storage medium
CN114296852A (en) Method and device for displaying target page, electronic equipment and storage medium
CN113760154A (en) Page element display method and device
CN110019492B (en) Information display method and device
CN111475762A (en) Method for processing published page, computing device and storage medium
CN113032696A (en) Display method and display device of page picture
CN110990551B (en) Text content processing method, device, equipment and storage medium

Legal Events

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