Document processing method and device, equipment and storage medium

By receiving the size change operation in the electronic document, obtaining and applying the scaling rules of the content elements, performing grid division and cell scaling, the problem of incomplete or blank content display after the electronic document is resized is solved, and the display effect is improved.

CN118796076APending Publication Date: 2024-10-18HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202310954737.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-04-14
Filing Date
2023-07-31
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

After the electronic document is resized, the content is incompletely displayed or a large amount of white space appears, resulting in poor display effect.

Method used

By generating the display interface of the document, receiving the size change operation, obtaining the scaling rules of each content element, processing multiple content elements according to the adjusted document size and scaling rules of the element type, and performing grid division and cell scaling. , to adapt to size changes and ensure better display of content elements in the document.

Benefits of technology

It realizes the automatic adaptation of document content, avoids the problem of incomplete content display or blank space, and improves the document display effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796076A_ABST
    Figure CN118796076A_ABST
Patent Text Reader

Abstract

The invention provides a document processing method and device, equipment and a storage medium, and the method comprises the steps that a display interface of a document is generated, and the document comprises a plurality of content elements; receiving a size change operation on the document; adjusting the size of the document according to the size change operation; obtaining a zooming rule of an element type corresponding to each content element; and processing the plurality of content elements to adapt to the adjusted document according to the adjusted size of the document and the zooming rule of the element type corresponding to each content element. The problem that the document content display effect is poor due to the fact that the size of the document is changed can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This disclosure claims priority to Chinese patent application No. 202310403548.X filed on April 14, 2023, with invention name “Document content processing method, device, equipment and storage medium”, the entire contents of which are incorporated by reference in this disclosure. Technical Field

[0002] The present disclosure relates to the field of cloud technology, and in particular to a document processing method, apparatus, device and storage medium. Background Art

[0003] With the popularity of paperless office, more and more people use electronic documents instead of paper documents in their office. When using electronic documents, users can adjust the size of electronic documents according to actual needs.

[0004] Currently, after the user adjusts the size of the electronic document, the content of the document is not scaled, and is still displayed at the original size. In this case, the content may not be fully displayed or a large amount of blank space may appear in the document, resulting in a poor display effect of the content. Summary of the invention

[0005] The present disclosure provides a method, apparatus, device and storage medium for document content processing, which can solve the problem of poor document content display effect caused by document size change in related technologies. The corresponding technical solutions are as follows:

[0006] In a first aspect, a method for processing document content is provided, the method comprising:

[0007] A display interface of a document is generated, wherein the document includes a plurality of content elements. A size change operation on the document is received, and the size of the document is adjusted according to the size change operation. A scaling rule of an element type corresponding to each content element is obtained, and the plurality of content elements are processed to fit the adjusted document according to the adjusted size of the document and the scaling rule of the element type corresponding to each content element.

[0008] In the technical solution provided by the present disclosure, the terminal processes the multiple content elements in the document according to the scaling rules of the element types corresponding to the multiple content elements in response to the size change of the document. In this way, the content in the document can automatically adapt to the changed size, so that the content elements have a better display effect in the document. Among them, the size change of the document can refer to the change of paper size, such as from A4 to A5, from A4 to A3, etc., or it can refer to the change of the aspect ratio of the document, such as from 4:3 to 16:9, etc. In addition, the processing of multiple content elements here includes adjusting the size of at least a part of the content elements, and / or adjusting the coordinates of at least a part of the content elements (generally speaking, the coordinates of the content elements are calculated according to the coordinates of the center or the upper left corner and the lower left corner of the content element, and the size change easily leads to the change of the coordinates).

[0009] In a possible implementation, the content elements in the document may be processed at a cell granularity. Specifically, the document may be grid-divided into multiple cells according to the positions of multiple content elements in the document, and each content element is included in one cell after the division. Then, the content elements in each cell are processed according to the scaling rule of the cell.

[0010] In a possible implementation, after the document is divided into grids, a plurality of cells may be generated in a display interface of the document, so that the user can customize the scaling rules of the cells.

[0011] In a possible implementation, the method for determining the scaling rule of a cell may be as follows: determining the scaling rule of the first cell according to the scaling rule corresponding to the element type of the content element in the first cell.

[0012] In the technical solution provided in the present disclosure, if the first cell contains multiple content elements, the scaling rule of the element type corresponding to the content element with the highest scaling priority among the multiple content elements can be determined as the scaling rule of the first cell; if the first cell contains only one content element, the scaling rule of the element type corresponding to the content element can be determined as the scaling rule of the first cell.

[0013] In a possible implementation, the method for allowing the user to customize the zoom rule of the cell may be as follows: obtaining the user's zoom operation on the second cell, and confirming the zoom rule of the second cell according to the user's zoom operation on the second cell.

[0014] In the technical solution provided by the present disclosure, the user can choose whether to scale the cell containing the content element according to actual needs. For each cell containing the content element, if a scaling operation of the user on the cell is received, the scaling rule of the cell is determined according to the scaling operation of the user on the cell. Exemplarily, if the user scales down the cell so that the length and width of the scaled-down cell become half of the original size, the scaling rule of the cell is determined to be that the length and width are both reduced to half of the original size.

[0015] In a possible implementation, in order to prevent the individual scaling of content elements from affecting the display of other content elements, in the technical solution provided by the present disclosure, content elements that meet certain conditions are divided into the same cell and processed uniformly. Specifically, the conditions may be as follows:

[0016] Determine that the projections of the first content element and the second content element in the document have an overlapping portion at the bottom edge of the document, and / or have an overlapping portion at any side edge of the document. Divide the first content element and the second content element into the same cell.

[0017] In a possible implementation manner, the element type of each content element is a table, a picture, or text.

[0018] In a second aspect, a document processing device is provided, the device comprising:

[0019] A display module, used to generate a display interface of a document, wherein the document includes a plurality of content elements;

[0020] A receiving module, used for receiving a size change operation on the document;

[0021] An adjustment module, used for adjusting the size of the document according to the size change operation;

[0022] An acquisition module, used for acquiring a scaling rule of an element type corresponding to each content element;

[0023] The processing module is used to process the multiple content elements to adapt to the adjusted document according to the adjusted size of the document and the scaling rule of the element type corresponding to each content element.

[0024] In a possible implementation, the processing module is used to:

[0025] According to the positions of the multiple content elements in the document, the document is grid-divided to obtain multiple cells, and each content element is included in one cell after the division;

[0026] The content elements in each cell are processed according to the scaling rules of the cell.

[0027] In a possible implementation, the display module is further configured to: generate the multiple cells in a display interface of the document.

[0028] In a possible implementation manner, the device further includes a determining module, configured to:

[0029] The scaling rule of the first cell is determined according to the scaling rule corresponding to the element type of the content element in the first cell.

[0030] In a possible implementation, the acquisition module is further used to:

[0031] Get the user's zoom operation on the second cell;

[0032] The device also includes a determination module, which is used to determine a scaling rule of the second cell according to the user's scaling operation on the second cell.

[0033] In a possible implementation manner, dividing the document into grids according to positions of the multiple content elements in the document includes:

[0034] Determine that a first content element and a second content element in the document have overlapping projections on a bottom edge of the document, and / or have overlapping projections on any side edge of the document;

[0035] The first content element and the second content element are divided into the same cell.

[0036] In a possible implementation manner, the element type of each content element is a table, a picture, or text.

[0037] In a third aspect, a device is provided, comprising a processor and a memory, wherein the processor of the device is used to execute instructions stored in the memory of the device, so that the device executes the document processing method provided in the first aspect above.

[0038] In a fourth aspect, a computer program product comprising instructions is provided. When the instructions are executed by a device, the device executes the document processing method provided in the first aspect above.

[0039] In a fifth aspect, a computer-readable storage medium is provided, comprising computer program instructions. When the computer program instructions are executed by a computing device cluster, the device executes the document processing method as described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 This is an implementation scenario of document processing provided by an embodiment of the present disclosure;

[0041] Figure 2 The embodiment of the present disclosure provides a document schematic diagram;

[0042] Figure 3 The embodiment of the present disclosure provides a document schematic diagram;

[0043] Figure 4 The present invention provides a method flow chart of document processing according to an embodiment of the present invention;

[0044] Figure 5 The embodiment of the present disclosure provides a document schematic diagram;

[0045] Figure 6 The embodiment of the present disclosure provides a document schematic diagram;

[0046] Figure 7 The embodiment of the present disclosure provides a document schematic diagram;

[0047] Figure 8 The embodiment of the present disclosure provides a document schematic diagram;

[0048] Fig. 9 The embodiment of the present disclosure provides a document schematic diagram;

[0049] Fig.10 The embodiment of the present disclosure provides a document schematic diagram;

[0050] Fig.11 The embodiment of the present disclosure provides a document schematic diagram;

[0051] Fig.12 The embodiment of the present disclosure provides a document schematic diagram;

[0052] Fig.13 The embodiment of the present disclosure provides a document schematic diagram;

[0053] Fig.14 The embodiment of the present disclosure provides a document schematic diagram;

[0054] Fig.15 is a structural schematic diagram of a document processing device provided by an embodiment of the present disclosure;

[0055] Fig.16 is a schematic diagram of a computer device structure provided by an embodiment of the present disclosure;

[0056] Fig.17 is a schematic diagram of a computer device cluster structure provided by an embodiment of the present disclosure;

[0057] Fig.18 It is a schematic diagram of a computer device cluster structure provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0058] In order to facilitate the understanding of the embodiments of the present disclosure, the terms involved in the embodiments of the present disclosure are explained below.

[0059] Document content elements: Text, images, and tables displayed in a document are all document content elements. For text in a document, a paragraph of text is a content element, a title is a content element, for tables in a document, a table is a content element, and for images in a document, a picture is a content element.

[0060] Element type of content elements: In a document, element types of content elements include text, pictures, tables, etc.

[0061] The disclosed embodiment provides a method for document processing, which can be applied to various electronic documents, such as cloud documents, traditional offline documents, flow charts, network diagrams, Unified Modeling Language (UML) diagrams, etc. In the method, the terminal responds to the size change of the document and scales the content elements of different element types in the document using corresponding scaling rules. In this way, the content in the document can automatically adapt to the changed size, so that the content elements have a better display effect in the document.

[0062] The following uses the method applied to a cloud document as an example to illustrate the implementation scenario of the method:

[0063] See also Figure 1, which may include a cloud platform and a terminal in the implementation scenario. Among them, the cloud platform can provide backend services for cloud documents, store the data of cloud documents, and manage the scaling rules corresponding to different element types. The terminal is a user-side device, which can be a mobile phone, a computer device, etc. When using a cloud document, the user can access the cloud document service provided by the cloud platform through a browser, a cloud document application, a cloud document applet, etc. in the terminal, and then the terminal displays the cloud document. The user can edit text, pictures, tables, etc. in the cloud document, wherein text, pictures, tables, etc. can be referred to as content elements of the document. In the process of editing a cloud document, or after editing a cloud document, the user can adjust the size of the cloud document. For example, the original size of the cloud document is A4, and the size can be adjusted to A3, A5, etc. according to actual needs. After the size of the cloud document is adjusted, the terminal can use the document processing method provided in the embodiment of the present disclosure to scale the content elements of the cloud document using corresponding scaling rules. In this way, the content in the document can automatically adapt to the size of the document after the change, so that the content can have a better display effect in the document.

[0064] At present, in the related technologies, after the size of the document is adjusted, the content elements still maintain the original size, so that the content may not be fully displayed or a large amount of blank space may appear in the document. The following is a brief description of the problems that may occur in the related technologies under different circumstances through examples:

[0065] Case 1:

[0066] When the document size is changed, a lot of white space appears on both sides of the document. Figure 2 As shown, there are three content elements (content element 1, content element 2, and content element 3) in the document. After the size of the document changes, the three content elements maintain their original sizes. As the document becomes wider, a large amount of blank space appears on both sides of the document.

[0067] Case 2:

[0068] When the document size changes, the content elements are cropped, resulting in incomplete display of the content elements. Figure 3 As shown, there are three content elements (content element 1, content element 2 and content element 3) in the document. After the size of the document changes, the three content elements maintain their original sizes. Since the document becomes narrower, content element 1 and content element 3 are partially cropped and not fully displayed.

[0069] Compared with the related art, the document processing method provided by the embodiment of the present disclosure can respond to the size change of the document and use corresponding scaling rules to perform scaling processing for content elements of different element types in the document. In this way, the content elements in the document can automatically adapt to the size of the document after the size change, so that the content elements can have a better display effect in the document.

[0070] The document processing method provided by the embodiment of the present disclosure is described below with reference to the accompanying drawings. Figure 4 , the processing process of the method may include the following steps:

[0071] Step 401: Generate a display interface for a document.

[0072] The document may be a cloud document, a traditional offline document, a flowchart, a network diagram, a UML diagram, etc.

[0073] In implementation, when a user needs to use a document, he or she can open the document through the document's application, applet, browser, etc., and then the terminal generates a display interface for the document. The user can edit the document, such as editing text, pictures, tables, etc. Among them, the text, pictures, tables, etc. in the document are all content elements of the document.

[0074] Step 402: Receive a size change operation on the document.

[0075] In implementation, the user can adjust the size of the document through the terminal according to actual needs, and accordingly, the terminal can receive the size change operation of the document and then adjust the size of the document accordingly. For example, the size of the document can be adjusted from A4 to A5, A3, etc.

[0076] Step 403: Obtain a scaling rule for the element type corresponding to each content element.

[0077] In implementation, when the document is an offline local document, the scaling rules corresponding to each element type can be directly configured in the document application. When the document is a cloud document, the scaling rules of each element type can be stored in the cloud platform and obtained by the terminal from the cloud platform. When obtaining from the cloud platform, there can be multiple acquisition opportunities, and several of them are listed below for illustration:

[0078] Timing 1:

[0079] When the terminal detects the document opening operation, it sends a document service request to the cloud platform. After receiving the document service request, the cloud platform can send the scaling rules corresponding to each element type to the terminal. After receiving the scaling rules corresponding to each element type sent by the cloud platform, the terminal can store the scaling rules corresponding to each element type.

[0080] In a possible implementation, when the terminal detects a document opening operation, in addition to sending a document service request to the cloud platform, it can also send a scaling rule acquisition request to the cloud platform. Correspondingly, after receiving the scaling rule acquisition request, the cloud platform sends scaling rules for each element type to the terminal. Similarly, after receiving the scaling rules corresponding to each element type sent by the cloud platform, the terminal can store the scaling rules corresponding to each element type.

[0081] In the case of the first opportunity, when the terminal detects that the document is closed, the terminal may delete the stored scaling rules corresponding to each element type.

[0082] Opportunity 2

[0083] When the terminal determines that the size of the document has changed, it sends a scaling rule acquisition request to the cloud platform. Correspondingly, after receiving the scaling rule acquisition request, the cloud platform sends scaling rules for each element type to the terminal. Similarly, after receiving the scaling rules corresponding to each element type sent by the cloud platform, the terminal can store the scaling rules corresponding to each element type.

[0084] For the second opportunity, in a possible implementation, each element type corresponds to an element type identifier. Accordingly, in the case of the second opportunity, the element type identifier corresponding to the content element in the document can be carried in the scaling rule acquisition request. In this way, after receiving the scaling rule acquisition request, the cloud platform can only send the scaling rules of the element type corresponding to the content element in the document to the terminal. In this implementation, the storage space of the terminal can be saved to a certain extent, and the data transmission resources between the terminal and the cloud platform can be saved.

[0085] In addition, in the case of the second opportunity, when the terminal detects that the document is closed, the terminal may also delete the stored scaling rule of the element type.

[0086] Step 404: divide the document into grids according to the positions of the multiple content elements in the document to obtain multiple cells, and each content element is included in one cell after the division.

[0087] In implementation, before dividing the grid, it is possible to first determine whether the content elements meet the common scaling conditions based on the positions of the content elements in the document. For multiple content elements that meet the common scaling conditions, they can be divided into the same cell of the grid. For each content element that does not meet the common scaling conditions, the content element is divided into a separate cell, and a content element can only be contained in one cell.

[0088] The common zoom condition may include multiple sub-conditions. When the content element satisfies any one of the multiple sub-conditions, it is determined that the content element satisfies the common zoom condition.

[0089] Sub-condition 1: The projections of the first content element and the second content element on the bottom edge of the document overlap, and the projections on either side of the document overlap. Sub-condition 2: The projections of the first content element and the second content element on the bottom edge of the document overlap, and the projections on either side of the document do not overlap. Sub-condition 3: The projections of the first content element and the second content element on the bottom edge of the document do not overlap, and the projections on either side of the document overlap.

[0090] The multiple sub-conditions included in the common scaling condition may be sub-condition one and sub-condition two, or sub-condition one and sub-condition three, or sub-condition one, sub-condition two and sub-condition three.

[0091] In addition, based on determining that the first content element and the second content element in the document satisfy the common scaling condition, if the third content element and the first content element satisfy the common scaling condition, or the third content element and the second content element satisfy the common scaling condition, then it is determined that the first content element, the second content element, and the third content element satisfy the common scaling condition, and so on.

[0092] Several sub-conditions that satisfy the common scaling condition are described below by way of examples.

[0093] Sub-condition one: the projections of the first content element and the second content element on the bottom edge of the document have overlapping parts, and the projections on either side edge of the document have overlapping parts.

[0094] The lower left corner of the document is taken as the origin, and the two sides intersecting at the lower left corner are the x-axis and the y-axis respectively. The side of each content element parallel to the x-axis is projected to the x-axis, and the side of each content element parallel to the y-axis is projected to the y-axis. If the projections of the first content element and the second content element on both the x-axis and the y-axis have overlapping parts, it is determined that the first content element and the second content element have overlapping parts.

[0095] like Figure 5 As shown, the document includes content element 1, content element 2 and content element 3. The side of content element 1 parallel to the x-axis is projected to the x-axis, and the side of content element 1 parallel to the y-axis is projected to the y-axis. The same process is performed for content element 2 and content element 3. After the projection is completed, it can be determined that the projections of content element 1 and content element 2 on the x-axis have overlapping parts, and the projections on the y-axis also have overlapping parts. Furthermore, it is determined that content element 1 and content element 2 have overlapping parts, which meets the common scaling condition.

[0096] Sub-condition two: the projections of the first content element and the second content element on the bottom edge of the document have an overlapping portion, and the projections on any side edge of the document do not have an overlapping portion.

[0097] With the lower left corner of the document as the origin, the x-axis coincides with the bottom edge of the document, and the y-axis coincides with the left edge of the document. Project the edge of each content element parallel to the x-axis onto the x-axis. If the projections of the first content element and the second content element on the x-axis overlap, and the projections on the y-axis do not overlap, it is determined that the first content element and the second content element meet the common scaling condition.

[0098] like Figure 6 As shown, the document includes content element 4, content element 5 and content element 6. The side of content element 4 parallel to the x-axis is projected to the x-axis, and the side of content element 4 parallel to the y-axis is projected to the y-axis. The same process is performed for content element 5 and content element 6. After the projection is completed, it can be determined that the projections of content element 4 and content element 5 on the x-axis have overlapping parts, and the projections on the y-axis do not have overlapping parts. Further, it is determined that content element 4 and content element 5 meet the common scaling condition.

[0099] Sub-condition three: the projections of the first content element and the second content element on the bottom edge of the document do not overlap, and the projections on either side of the document do overlap.

[0100] With the lower left corner of the document as the origin, the x-axis coincides with the bottom edge of the document, and the y-axis coincides with the left edge of the document. Project the edge of each content element parallel to the x-axis onto the x-axis. If the projections of the first content element and the second content element on the x-axis have no overlap, and the projections on the y-axis have overlap, then it is determined that the first content element and the second content element meet the common scaling condition.

[0101] like Figure 7 As shown, the document includes content element 7, content element 8 and content element 9. The side of content element 7 parallel to the x-axis is projected to the x-axis, and the side of content element 7 parallel to the y-axis is projected to the y-axis. The same process is performed for content element 8 and content element 6. After the projection is completed, it can be determined that there is no overlap in the projection of content element 7 and content element 8 on the x-axis, but there is an overlap in the projection on the y-axis. Further, it is determined that content element 7 and content element 8 meet the common scaling condition.

[0102] After determining whether the content element meets the common scaling condition, the document is gridded. When performing grid division, the division can be performed according to the scope and position of the content element in the document. For each content element, the scope of the content element in the document is a rectangle, which is the smallest rectangle that can contain the content element in a rectangle whose four sides are parallel to the four sides of the document. For multiple content elements that meet the common scaling condition, the scope of these multiple content elements in the document is no longer the union of their respective scopes, but a rectangle, which is the smallest rectangle that can contain multiple content elements that meet the common scaling condition in a rectangle whose four sides are parallel to the four sides of the document. In this way, when dividing the grid, multiple content elements that meet the common scaling condition can be regarded as one content element.

[0103] The following example illustrates the grid division of a document:

[0104] See also Figure 8 , the document includes content element 10, content element 11 and content element 12. Draw six line segments line1, line2, line3, line4, line5 and line6, which overlap with the bottom edge of content element 10, the top edge of content element 10, the bottom edge of content element 11, the top edge of content element 11, the bottom edge of content element 12 and the top edge of content element 12 respectively.

[0105] See also Fig. 9 For each line segment, determine whether the line segment passes through any content element. If the line segment does not pass through any content element, do not translate the line segment. If the line segment passes through any content element, translate the line segment upward until the line segment no longer passes through any content element, then stop translating. In this example, line2 and line3 need to be translated upward to the position of line4. The overlapping line2, line3, and line4 can be regarded as one line segment.

[0106] See also Fig.10 After the translation is completed, for any two adjacent line segments, if there is no content element between the two line segments, the midline of the two line segments is taken as the grid division line, and the remaining line segments are directly used as the grid division line. In this example, the midline of line4 (i.e., lin2, line3) and line5 can be taken as the grid division line, and lin1 and lin6 can also be used as the grid division line.

[0107] See also Fig.11, draw six line segments line7, line8, line9, line10, line11, and line12. These six line segments overlap with the left side of content element 10, the right side of content element 10, the left side of content element 11, the right side of content element 11, the left side of content element 12, and the right side of content element 12 respectively.

[0108] See also Fig.12 For these six line segments, for any two adjacent line segments, if there is no content element to be scaled between these two line segments, the midline of these two line segments is taken as the grid division line, and for the remaining line segments, they are directly used as the grid division line. In this example, the midline of line10 and line7 can be taken as the grid division line, the midline of line8 and line11 can be taken as the grid division line, and line9 and line12 can be directly used as the grid division line. Finally, the grid division lines divide the document into multiple cells, and each content element is contained in one cell.

[0109] After the grid division is completed, the document can be converted into a grid layout or a table layout according to the divided grid. After the conversion, each content element is contained in a cell of the grid layout or the table layout. Here, the position and size of the divided cells and the grid layout or the table layout are the same.

[0110] Step 405: For each cell containing a content element, determine a scaling rule for the cell.

[0111] In implementation, users are allowed to customize the scaling rules of cells. The specific processing can be as follows:

[0112] Generate a grid in the document display interface to obtain multiple cells, such as Fig.13 As shown. The user can choose whether to scale the cells containing the content elements according to actual needs. For each cell containing the content elements, if a scaling operation of the cell is received from the user, the scaling rule of the cell is confirmed according to the scaling operation of the cell by the user. Exemplarily, the user scales down the cell so that the length and width of the scaled-down cell become half of the original size, then the scaling rule of the cell is determined to be that the length and width are both reduced to half of the original size.

[0113] In addition, the cell can be undisplayed after the user performs a zoom operation or after the display time reaches a threshold, where the threshold can be 2s, 3s, etc.

[0114] In the embodiment of the present disclosure, in addition to allowing the user to define the scaling rule of the cell, the scaling rule of the cell may also be determined according to the scaling rule of the element type corresponding to the content element contained in the cell.

[0115] When determining the scaling rule of a cell based on the scaling rule of the element type, if the cell contains only one content element, the scaling rule of the element type corresponding to the content element is determined as the scaling rule of the cell. If the cell contains multiple content elements, the scaling rule of the cell can be determined based on the scaling priorities of the multiple content elements and the scaling rules corresponding to the element types of the multiple content elements. Specifically, the scaling rule of the element type corresponding to the content element with the highest scaling priority in the cell can be determined, and the scaling rule of the element type can be determined as the scaling rule of the cell. Exemplarily, the scaling priority of tables, pictures, and texts can be arranged from high to low as: table, picture, text.

[0116] Here, the scaling priority of the content element may be issued by the cloud platform together with the scaling rule, or may be stored locally.

[0117] In conjunction with Table 1, the cell scaling rule is described below by taking the element types including text, picture, and table as an example.

[0118] Table 1

[0119]

[0120] In one possible implementation, for each cell containing content elements, if a user zoom operation is received on the cell, the zoom rule of the cell is determined based on the user's zoom operation on the cell; if no user zoom operation is received on the cell, the zoom rule of the element type corresponding to the content element with the highest zoom priority in the cell is determined as the zoom rule of the cell.

[0121] Step 406: Process the content elements in each cell according to the scaling rule of the cell.

[0122] In implementation, for each cell containing content elements, the cell is scaled according to the scaling rule of the cell, and correspondingly, each content element in the cell is also scaled in the same proportion as the cell.

[0123] For example, see Fig.14, the document includes content element 13, content element 14 and content element 15, wherein content element 13, content element 14 and content element 15 are in three different cells, wherein the scaling rule of the cell where content element 13 is located is geometric scaling, the scaling rule of the cell where content element 15 is located is geometric scaling, and the scaling rule of the cell where content element 14 is located is no scaling. Before scaling the content element to be scaled, first, the scaling ratio a corresponding to the length of the document and the scaling ratio b corresponding to the width of the document are calculated according to the original size of the document and the changed size. Then, the cell where content element 13 is located is scaled geometrically according to the scaling ratio a and the scaling ratio b, the cell where content element 15 is located is scaled geometrically according to the scaling ratio a and the scaling ratio b, and the cell where content element 14 is located is not scaled. In this way, the scaling effect displayed to the user is that content element 113 and content element 15 are scaled geometrically, and content element 14 is not scaled. Among them, geometric scaling refers to scaling the length of the content element to a times the original, and scaling the width to b times the original.

[0124] The calculation formulas for scaling ratio a and scaling ratio b are as follows:

[0125]

[0126] Among them, l1 is the length of the size of the document after scaling, l2 is the length of the size of the document before scaling, w1 is the width of the size of the document after scaling, and w2 is the width of the size of the document before scaling.

[0127] In the document processing method provided by the embodiment of the present disclosure, the terminal responds to the change in document size and scales each content element to be scaled in the document using a corresponding scaling rule. In this way, the content elements in the document can automatically adapt to the size of the document after the change, thereby making the content elements have a better display effect in the document.

[0128] The present disclosure also provides a document processing device, such as Fig.15 As shown, the device comprises:

[0129] Display module 1510, used to generate a display interface of a document, wherein the document includes a plurality of content elements;

[0130] A receiving module 1520, configured to receive a size change operation on the document;

[0131] An adjustment module 1530, configured to adjust the size of the document according to the size change operation;

[0132] An acquisition module 1540 is used to acquire a scaling rule of an element type corresponding to each content element;

[0133] The processing module 1550 is used to process the multiple content elements to adapt to the adjusted document according to the adjusted size of the document and the scaling rule of the element type corresponding to each content element.

[0134] In a possible implementation, the processing module 1550 is configured to:

[0135] According to the positions of the multiple content elements in the document, the document is grid-divided to obtain multiple cells, and each content element is included in one cell after the division;

[0136] The content elements in each cell are processed according to the scaling rules of the cell.

[0137] In a possible implementation, the display module 1510 is further configured to: generate the multiple cells in the display interface of the document.

[0138] In a possible implementation manner, the device further includes a determining module, configured to:

[0139] The scaling rule of the first cell is determined according to the scaling rule corresponding to the element type of the content element in the first cell.

[0140] In a possible implementation, the acquisition module 1540 is further configured to:

[0141] Get the user's zoom operation on the second cell;

[0142] The device also includes a determination module, which is used to determine a scaling rule of the second cell according to the user's scaling operation on the second cell.

[0143] In a possible implementation, the processing module 1550 is configured to:

[0144] Determine that a first content element and a second content element in the document have overlapping projections on a bottom edge of the document, and / or have overlapping projections on any side edge of the document;

[0145] The first content element and the second content element are divided into the same cell.

[0146] In a possible implementation manner, the element type of each content element is a table, a picture, or text.

[0147] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0148] The document processing device provided in the above embodiment only uses the division of the above functional modules as an example when performing document processing. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the document processing device provided in the above embodiment and the document processing method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0149] The present disclosure also provides a computing device 100. Fig.16 As shown, the computing device 100 includes: a bus 102, a processor 104, a memory 106, and a communication interface 108. The processor 104, the memory 106, and the communication interface 108 communicate with each other through the bus 102. The computing device 100 may be a terminal device. It should be understood that the present disclosure does not limit the number of processors and memories in the computing device 100.

[0150] The bus 102 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.16 The bus 102 is represented by only one line, but it does not mean that there is only one bus or one type of bus. The bus 102 may include a path for transmitting information between various components of the computing device 100 (eg, the memory 106, the processor 104, and the communication interface 108).

[0151] The processor 104 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0152] The memory 106 may include a volatile memory, such as a random access memory (RAM). The memory 106 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

[0153] The memory 106 stores executable codes, and the processor 104 executes the executable codes to respectively implement the functions of the display module 1510, the receiving module 1520, the adjustment module 1530, the acquisition module 1540, and the processing module 1550, thereby implementing the document processing method. That is, the memory 106 stores instructions for the document processing method.

[0154] The communication interface 108 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 100 and other devices or a communication network.

[0155] The present disclosure also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device may be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device may also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.

[0156] like Fig.17 As shown, the computing device cluster includes at least one computing device 100. The memory 106 in one or more computing devices 100 in the computing device cluster may store the same instructions for executing the document processing method.

[0157] In some possible implementations, the memory 106 of one or more computing devices 100 in the computing device cluster may also store partial instructions for executing the document processing method. In other words, the combination of one or more computing devices 100 may jointly execute the instructions for executing the document processing method.

[0158] It should be noted that the memory 106 in different computing devices 100 in the computing device cluster may store different instructions, which are respectively used to execute part of the functions of the document processing method.

[0159] In some possible implementations, the memory 106 of one or more computing devices 100 in the computing device cluster may also store partial instructions for executing the document processing method. In other words, the combination of one or more computing devices 100 may jointly execute the instructions for executing the document processing method.

[0160] It should be noted that the memory 106 in different computing devices 100 in the computing device cluster may store different instructions for executing part of the document processing functions. That is, the instructions stored in the memory 106 in different computing devices 100 may implement the functions of one or more of the display module 1510, the receiving module 1520, the adjustment module 1530, the acquisition module 1540 and the processing module 1550.

[0161] In some possible implementations, one or more computing devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network. Fig.18 A possible implementation is shown. Fig.18 As shown, two computing devices 100A and 100B are connected via a network. Specifically, the network is connected via a communication interface in each computing device. In this type of possible implementation, the memory 106 in the computing device 100A stores instructions for executing the functions of the display module 1510, the receiving module 1520, and the adjustment module 1530. At the same time, the memory 106 in the computing device 100B stores instructions for executing the functions of the acquisition module 1540 and the processing module 1550. It should be understood that Fig.18 The functions of the computing device 100A shown in FIG. 1 may also be completed by multiple computing devices 100. Similarly, the functions of the computing device 100B may also be completed by multiple computing devices 100.

[0162] The present disclosure also provides another computing device cluster. The connection relationship between the computing devices in the computing device cluster can be similar to that of Fig.17 and Fig.18 The connection mode of the computing device cluster is different in that the memory 106 in one or more computing devices 100 in the computing device cluster may store the same instructions for executing the document processing method.

[0163] In some possible implementations, the memory 106 of one or more computing devices 100 in the computing device cluster may also store partial instructions for executing document processing. In other words, the combination of one or more computing devices 100 may jointly execute instructions for executing the method for document processing.

[0164] It should be noted that the memory 106 in different computing devices 100 in the computing device cluster may store different instructions for executing part of the document processing functions. That is, the instructions stored in the memory 106 in different computing devices 100 may implement the functions of one or more of the display module 1510, the receiving module 1520, the adjustment module 1530, the acquisition module 1540 and the processing module 1550.

[0165] The present disclosure also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device is caused to perform a document processing method.

[0166] The present disclosure also provides a computer-readable storage medium. The computer-readable storage medium may be any available medium that can be stored by a computing device or a data storage device such as a data center that includes one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct a computing device to perform a method for document processing, or instructs a computing device to perform a method for document processing.

[0167] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present application.

Claims

1. A document processing method, characterized in that: The device for document processing comprises: Generating a display interface of a document, wherein the document includes a plurality of content elements; receiving a size change operation on the document; adjusting the size of the document according to the size change operation; Get the scaling rule of the element type corresponding to each content element; According to the adjusted size of the document and a scaling rule of an element type corresponding to each content element, the multiple content elements are processed to fit the adjusted document.

2. The method according to claim 1, characterized in that The processing of the plurality of content elements to adapt to the adjusted document according to the adjusted size of the document and a scaling rule of an element type corresponding to each content element comprises: According to the positions of the multiple content elements in the document, the document is grid-divided to obtain multiple cells, and each content element is included in one cell after the division; The content elements in each cell are processed according to the scaling rules of the cell.

3. The method according to claim 2, characterized in that Also includes: The plurality of cells are generated in a display interface of the document.

4. The method according to claim 2 or 3, characterized in that: Before processing the content elements in each cell according to the scaling rule of the cell, the process includes: The scaling rule of the first cell is determined according to the scaling rule corresponding to the element type of the content element in the first cell.

5. The method according to any one of claims 2 to 4, characterized in that: Before the content elements in each cell are processed according to the scaling rules of the cell, they include: Get the user's zoom operation on the second cell; According to the user's zooming operation on the second cell, a zooming rule of the second cell is confirmed.

6. The method according to any one of claims 2 to 4, characterized in that The step of dividing the document into grids according to the positions of the plurality of content elements in the document comprises: Determine that a first content element and a second content element in the document have overlapping projections on a bottom edge of the document, and / or have overlapping projections on any side edge of the document; The first content element and the second content element are divided into the same cell.

7. The method according to any one of claims 1 to 6, characterized in that The element type of each content element is table, image, or text.

8. A document processing device, characterized in that: The device comprises: A display module, used to generate a display interface of a document, wherein the document includes a plurality of content elements; A receiving module, used for receiving a size change operation on the document; An adjustment module, used for adjusting the size of the document according to the size change operation; An acquisition module, used for acquiring a scaling rule of an element type corresponding to each content element; The processing module is used to process the multiple content elements to adapt to the adjusted document according to the adjusted size of the document and the scaling rule of the element type corresponding to each content element.

9. The device according to claim 8, characterized in that The processing module is used to: According to the positions of the multiple content elements in the document, the document is grid-divided to obtain multiple cells, and each content element is included in one cell after the division; The content elements in each cell are processed according to the scaling rules of the cell.

10. The device according to claim 9, characterized in that The display module is further used to generate the multiple cells in the display interface of the document.

11. The device according to claim 9 or 10, characterized in that The device also includes a determining module, configured to: The scaling rule of the first cell is determined according to the scaling rule corresponding to the element type of the content element in the first cell.

12. The device according to any one of claims 9 to 11, characterized in that The acquisition module is further used for: Get the user's zoom operation on the second cell; The device also includes a determination module, which is used to determine a scaling rule of the second cell according to the user's scaling operation on the second cell.

13. The device according to any one of claims 9 to 11, characterized in that The processing module is used to: Determine that a first content element and a second content element in the document have overlapping projections on a bottom edge of the document, and / or have overlapping projections on any side edge of the document; The first content element and the second content element are divided into the same cell.

14. The device according to any one of claims 8 to 13, characterized in that The element type of each content element is table, image, or text.

15. A device, characterized in that The device comprises a processor and a memory, wherein the processor of the device is configured to execute instructions stored in the memory of the device, so that the computing device cluster executes the document processing method according to any one of claims 1 to 7.

16. A computer program product comprising instructions, characterized in that When the instruction is executed by a device, the device is caused to perform the document processing method according to any one of claims 1 to 7.

17. A computer-readable storage medium, characterized in that: The device comprises computer program instructions. When the computer program instructions are executed by a device, the device performs the document processing method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Document object size adjustment method and device, electronic equipment and storage medium

    CN113988008A

  • Object based adaptive document resizing

    US20110047505A1

  • Systems and methods to resize document content

    US20110113323A1

  • Dynamic Adjustment of Select Elements of a Document

    US20160179757A1