Online document editing method and device, electronic equipment and storage medium
By separating the rotatable objects in the online document into rotatable components and non-rotating components, and only rotating the rotatable components, the problem in the prior art that the rotation operation affects the reading experience is solved, and the user experience is improved. reading experience.
Patent Information
- Application Number
- CN202410708973.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-10-01
AI Technical Summary
When the existing online document editing technology performs a rotation operation, all content will be rotated uniformly, which affects the user's reading experience. Especially for documents containing rotatable targets, users need to tilt their heads to view, causing reading inconvenience.
By separating the rotatable objects in the current page into rotatable components and non-rotating components, only the rotatable components are rotated and the non-rotating components remain unchanged to ensure the readability of the document content.
It is possible to rotate the target without affecting the readability of non-rotated components, which improves the user's reading experience and eliminates the need for users to tilt their heads to view the document content.
Smart Images

Figure CN118734799A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to an online document editing method, device, electronic equipment and storage medium. Background Art
[0002] With the development of Internet technology, some documents can be browsed and edited online, such as PDF documents, which can be read and edited online without installing a separate document reader on the user end. However, in the prior art, when performing a rotation operation relative to a certain target in an online document, the page where the target is located is often rotated uniformly, which causes all reading content to be rotated uniformly. Although the target is rotated, some content requires the user to tilt his head to read, which brings inconvenience to the user's reading and leads to a poor user reading experience. Summary of the invention
[0003] The embodiment of the present invention provides an online document editing method, which aims to solve the problem of inconvenience in reading after rotating an online document in the prior art. By separating the rotatable target in the current page, the rotatable target is separated into a rotatable component and a non-rotatable component, and only the rotatable component is rotated. In this way, in the obtained target editing page, the rotated target is composed of a rotated component and a non-rotatable component. When the rotatable target is rotated, the readability of the non-rotatable component is not affected, which facilitates users to simultaneously view the document content composed of the rotated component and the non-rotatable component in the target editing page, without the need for users to tilt their heads to read, thereby improving the user reading experience.
[0004] In a first aspect, an embodiment of the present invention provides an online document editing method, the online document editing method comprising the following steps:
[0005] When detecting a page rotation operation performed by a user in the editing interface, identifying whether there is a rotatable object in the current page;
[0006] If the rotatable target exists, performing component separation processing on the rotatable target to obtain a rotatable component and a non-rotatable component of the rotatable target;
[0007] In response to the page rotation operation, the rotatable component is rotated to obtain a rotated component;
[0008] Combining the rotated component with the non-rotating component to obtain a rotated target;
[0009] Based on the rotated object, a target editing page of the current page is obtained.
[0010] Optionally, the step of rotating the rotatable component in response to the page rotation operation to obtain a rotated component includes:
[0011] Determining a rotation direction and / or rotation angle of the page rotation operation;
[0012] The non-rotating component is kept unchanged, and the rotatable component is rotated according to the rotation direction and / or the rotation angle to obtain the rotated component.
[0013] Optionally, the step of combining the rotated component with the non-rotating component to obtain a rotated target includes:
[0014] Determining the positional relationship between the non-rotating component and the rotated component according to the positional relationship between the rotatable component and the non-rotating component;
[0015] The position of the rotated component is kept unchanged, and the position of the non-rotating component is adjusted according to the positional relationship between the non-rotating component and the rotated component to obtain the rotated target.
[0016] Optionally, the non-rotating component is a directional component and a connecting component, the connecting component is used to connect the directional component with the rotatable component, and the step of performing component separation processing on the rotatable target to obtain the rotatable component and the non-rotating component of the rotatable target includes:
[0017] Performing component separation processing on the rotatable target to obtain a rotatable component and a non-rotatable component of the rotatable target;
[0018] The non-rotational components are classified to obtain the directional components and the connection components.
[0019] Optionally, the step of combining the rotated component with the non-rotating component to obtain a rotated target includes:
[0020] Determining a connection relationship between the connecting component and the rotated component according to a connection relationship between the rotatable component and the connecting component;
[0021] Keeping the position of the rotated component unchanged, connecting the connecting component to the rotated component according to the connection relationship between the connecting component and the rotated component;
[0022] The direction of the directional component is kept unchanged, the connection component is connected to the directional component according to the connection relationship between the connection component and the directional component, and the position of the directional component is adjusted to obtain the rotated target.
[0023] Optionally, after the step of obtaining a target editing page of the current page based on the rotated target, the method further includes:
[0024] Obtain the source file of the current page;
[0025] Determine the file location of the current page in the source file;
[0026] According to the file position of the current page, the target editing page is overwritten on the current page to obtain an editing file of the source file;
[0027] In response to a download request initiated by the user terminal, the edited file is sent to the user terminal.
[0028] Optionally, the step of overwriting the target editing page on the current page according to the file position of the current page to obtain the editing file of the source file includes:
[0029] Determine the page size of the source document and / or the size of the rotatable object in the source document;
[0030] Determining the adjustment size of the target editing page and / or the rotated object according to the page size of the source file and / or the size of the rotatable object in the source file;
[0031] Based on the adjusted size of the target editing page and / or the rotated target, adjusting the target editing page and / or the rotated target to obtain an adjusted target editing page;
[0032] The adjusted target editing page is overwritten on the current page to obtain an editing file of the source file.
[0033] In a second aspect, an embodiment of the present invention further provides an online document editing device, the online document editing device comprising:
[0034] The recognition module is used to detect whether there is a rotatable object in the current page when the user performs a page rotation operation in the editing interface;
[0035] A first processing module is used for performing component separation processing on the rotatable target if the rotatable target exists, so as to obtain a rotatable component and a non-rotatable component of the rotatable target;
[0036] A second processing module, configured to rotate the rotatable component in response to the page rotation operation to obtain a rotated component;
[0037] A third processing module is used to combine the rotated component with the non-rotated component to obtain a target editing page of the current page and a rotated target;
[0038] The fourth processing module is used to obtain a target editing page of the current page based on the rotated target.
[0039] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the online document editing method provided in the embodiment of the present invention when executing the computer program.
[0040] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the online document editing method provided in the embodiment of the invention are implemented.
[0041] In an embodiment of the present invention, when a page rotation operation performed by a user in an editing interface is detected, it is identified whether there is a rotatable target in the current page; if there is a rotatable target, the rotatable target is subjected to component separation processing to obtain a rotatable component and a non-rotatable component of the rotatable target; in response to the page rotation operation, the rotatable component is rotated to obtain a rotated component; the rotated component and the non-rotatable component are combined to obtain a rotated target; based on the rotated target, a target editing page of the current page is obtained. The present invention separates the rotatable target in the current page into a rotatable component and a non-rotatable component, and only rotates the rotatable component. In this way, in the obtained target editing page, the rotated target is composed of a rotated component and a non-rotatable component. When the rotatable target is rotated, the readability of the non-rotatable component will not be affected, so that the user can view the document content composed of the rotated component and the non-rotatable component in the target editing page at the same time, without the user having to tilt his head to read, thereby improving the user's reading experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1 is a flow chart of an online document editing method provided by an embodiment of the present invention;
[0044] Figure 2is a structural schematic diagram of an online document editing device provided by an embodiment of the present invention;
[0045] Figure 3 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] like Figure 1 As shown, Figure 1 1 is a flow chart of an online document editing method provided by an embodiment of the present invention. The online document editing method comprises the following steps:
[0048] 101. When a page rotation operation performed by a user in an editing interface is detected, it is identified whether there is a rotatable object in the current page.
[0049] In an embodiment of the present invention, the online document editing method can be applied to an online document editing platform, which can be constructed by a server or a distributed server, and can provide an online document editing interface to users through a front-end interface. Users can obtain the document to be edited through the uniform resource locator URL of the online document, load the document to be edited in the editing interface, and display the document to be edited through the editing interface for users to read and edit. Of course, users can also load a local document as the document to be edited in the editing interface through a local file path, and display the document to be edited through the editing interface for users to read and edit.
[0050] The above-mentioned editing interface can be a browser interface, or it can be a document editing interface embedded in other types of applications (such as DingTalk, Feishu, Enterprise WeChat, etc.). The editing interface includes a rotation control component, and the above-mentioned rotation control component can include a rotation direction and / or a rotation angle. The user can select a rotation direction / or enter a rotation angle to rotate the current page.
[0051] The editing interface is loaded with a document to be edited, which may be in various formats and may be obtained from the Internet or locally. The current page refers to the page that the editing interface is loading, and may also be understood as the page that the user is reading and editing. The current page is at least one page in the document to be edited.
[0052] When receiving a page rotation operation performed by the user in the editing interface, the object recognition technology can be used to identify whether there is a rotatable object in the current page. The above-mentioned rotatable object can be a graphic and / or a table. The above-mentioned object recognition technology can be an object recognition technology based on template matching, or it can be an object recognition technology based on a convolutional neural network CNN. Further, the above-mentioned rotatable target can be a graphic containing at least one of graphic information (such as text), graphic guidance (such as marked lines, arrows, etc.), graphic labels (such as numbers, letters, symbols, etc.), and / or a table containing characters (such as text, numbers, letters, symbols, etc.).
[0053] In a possible embodiment, if there is no rotatable object in the current page, the current page can be rotated in response to the page rotation operation, and the rotated page is used as the target editing page. Alternatively, if there is no rotatable object in the current page, a prompt can be given to the user, prompting the user whether to continue the rotation. If the user chooses to continue the rotation, the current page is rotated in response to the page rotation operation, and the rotated page is used as the target editing page. If the user chooses to stop the rotation, the rotation operation is not performed.
[0054] 102. If a rotatable target exists, perform component separation processing on the rotatable target to obtain a rotatable component and a non-rotatable component of the rotatable target.
[0055] In an embodiment of the present invention, if there is a rotatable object on the current page, it means that there is an object that the user wants to rotate on the current page, and a separation prompt can be issued to the user, prompting the user whether to separate the rotatable object. If the user chooses to separate the rotatable object, the rotatable object is separated into a rotatable component and a non-rotatable component by separating the components. If the user chooses not to separate the rotatable object, the current page is rotated in response to the page rotation operation, and the rotated page is obtained as the target editing page.
[0056] The above-mentioned rotatable target may be one or more. When there are multiple rotatable targets, each rotatable target may be subjected to component separation processing separately, and the rotatable components and non-rotating components obtained by the separation processing may be added to a component set. Each rotatable target corresponds to a component set. In this way, confusion between rotatable components and non-rotating components may be avoided.
[0057] The above-mentioned separation component can be an image processing component and / or a table processing component. If the rotatable target is a graphic, the separation component is an image processing component. If the rotatable target is a table, the separation component is a table processing component. The image processing component is used to separate the graphic into rotatable components and non-rotating components, and the table processing component is used to separate the table into rotatable components and non-rotating components.
[0058] For graphic targets, the rotatable component may be a graphic outline, and the non-rotating component may be graphic information, graphic instructions, graphic labels, etc. For table targets, the rotatable component may be a table border, and the non-rotating component may be a character.
[0059] The above-mentioned image processing component can be composed of recognition modules such as graphic contour recognition (based on convolutional neural network CNN), character recognition (based on optical character recognition OCR), line recognition (based on convolutional neural network CNN), and arrow recognition (based on convolutional neural network CNN), which are used for graphic contour, graphic information, graphic guidance, graphic label and other graphic composition components. The above-mentioned table processing component can be composed of recognition modules such as border recognition and optical character recognition.
[0060] 103. In response to the page rotation operation, the rotatable component is rotated to obtain a rotated component.
[0061] In the embodiment of the present invention, after the rotatable component and the non-rotatable component of the rotatable object are obtained, the rotatable component of the rotatable object may be rotated, so that the entire current page does not need to be rotated.
[0062] The page rotation operation may include a rotation direction and / or a rotation angle, and the rotatable component is rotated according to the page rotation direction and / or the rotation angle to obtain a rotated component. If there are multiple rotatable objects, the multiple rotatable components may be rotated respectively according to the page rotation direction and / or the rotation angle to obtain multiple rotated components.
[0063] 104. Combine the rotated component and the non-rotated component to obtain a rotated target.
[0064] In the embodiment of the present invention, after the rotated component is obtained, the rotated component can be combined with the non-rotated component to form a new rotated target.
[0065] The above combination processing may be to adaptively move or scale the non-rotating component so that there is no occlusion between the rotated component and the non-rotating component. Specifically, the rotated component may be fixed, and the non-rotating component overlapping with the rotated component may be moved or scaled until there is no overlap between the rotated component and the non-rotating component.
[0066] For example, the rotatable target is a graphic, which includes a graphic structure and text content. The graphic is separated, the graphic structure and the text content are separated, the graphic structure is rotated, and the text content is not rotated. The text content is moved to a position that does not overlap with the graphic structure to form a rotated graphic.
[0067] For another example, the target table can be rotated, and the table includes a border and character content. The table is separated, and the table border and character content are separated. The table border is rotated, for example, a vertical table is rotated into a horizontal table, and the character content is not rotated (such as scaling or line wrapping). The character content is adaptively processed to obtain a rotated table.
[0068] 105. Based on the rotated target, obtain a target editing page of the current page.
[0069] In the embodiment of the present invention, after the rotated object is obtained, the rotated object is used to replace the original rotatable object, and then a target editing page can be obtained, which includes the rotated object, wherein the center point of the rotated object can coincide with the center point of the rotatable object.
[0070] If there are multiple rotated targets, align the center point of each rotated target with the center point of the corresponding rotatable target, and then replace the rotatable target with the rotated target to obtain multiple rotated targets, and then obtain a target editing page containing multiple rotated targets.
[0071] For example, the rotatable target is a graphic, which includes a graphic structure and text content. The graphic is separated, the graphic structure and the text content are separated, the graphic structure is rotated, and the text content is not rotated. The text content is moved to a position that does not overlap with the graphic structure to form a rotated graphic, and the rotated graphic replaces the graphic before rotation to obtain a new page. In the new page, the graphic is the rotated graphic, and the text content does not rotate with it, so that users do not have to tilt their heads to read the text content, giving users a better experience.
[0072] For another example, the target table can be rotated, and the table includes borders and character content. The table is separated, and the table border and character content are separated. The table border is rotated, such as rotating a vertical table into a horizontal table, and the character content is not rotated (such as scaling or line wrapping). The character content is adaptively processed to obtain a rotated table, and the rotated table replaces the table before rotation to obtain a new page. In the new page, the vertical table is rotated into a horizontal table, but the character content is not rotated. Therefore, the user does not need to tilt his head to read the text content in the table, which brings a better experience to the user.
[0073] In an embodiment of the present invention, when a page rotation operation performed by a user in an editing interface is detected, it is identified whether there is a rotatable target in the current page; if there is a rotatable target, the rotatable target is subjected to component separation processing to obtain a rotatable component and a non-rotatable component of the rotatable target; in response to the page rotation operation, the rotatable component is rotated to obtain a rotated component; the rotated component and the non-rotatable component are combined to obtain a rotated target; based on the rotated target, a target editing page of the current page is obtained. The present invention separates the rotatable target in the current page into a rotatable component and a non-rotatable component, and only rotates the rotatable component. In this way, in the obtained target editing page, the rotated target is composed of a rotated component and a non-rotatable component. When the rotatable target is rotated, the readability of the non-rotatable component will not be affected, so that the user can view the document content composed of the rotated component and the non-rotatable component in the target editing page at the same time, without the user having to tilt his head to read, thereby improving the user's reading experience.
[0074] It is understandable that in the specific implementation of this application, data related to user information, user operations, document information, etc. are involved. When the embodiments in this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0075] Optionally, in the step of rotating the rotatable component in response to the page rotation operation to obtain the rotated component, the rotation direction and / or rotation angle of the page rotation operation can be determined; the non-rotating component is kept unchanged, and the rotatable component is rotated according to the rotation direction and / or rotation angle to obtain the rotated component.
[0076] In the embodiment of the present invention, after obtaining the rotatable component of the rotatable target, the rotation direction and / or rotation angle of the rotatable component can be determined according to the rotation direction and / or rotation angle of the page rotation operation, and the rotatable component is rotated according to the rotation direction and / or rotation angle of the rotatable component to obtain the rotated component. Specifically, the rotation direction and / or rotation angle of the page rotation operation can be directly used as the rotation direction and / or rotation angle of the rotatable component.
[0077] The rotation direction and / or rotation angle of the page rotation operation is selected or input by the user in the editing interface. If there are multiple rotatable components, the rotation direction and / or rotation angle of the page rotation operation can be used as the rotation direction and / or rotation angle of the multiple rotatable components.
[0078] Optionally, in the step of combining the rotated component with the non-rotating component to obtain the rotated target, the positional relationship between the non-rotating component and the rotated component can be determined based on the positional relationship between the rotatable component and the non-rotating component; the position of the rotated component is kept unchanged, and the position of the non-rotating component is adjusted based on the positional relationship between the non-rotating component and the rotated component to obtain the rotated target.
[0079] In an embodiment of the present invention, after separating the rotatable component and the non-rotating component, the positions of the rotatable component and the non-rotating component in the current page can be recorded, and then the positional relationship between the rotated component and the non-rotating component can be determined according to the positions of the rotatable component and the non-rotating component in the current page.
[0080] The above positional relationship may be an up-down-left-right positional relationship, that is, the non-rotating component is located above, below, to the left or to the right of the rotatable component.
[0081] The above-mentioned position relationship can also be a relative position relationship with the key points of the rotatable component. The above-mentioned key points of the rotatable component can be obtained by performing key point detection on the rotatable component through a key point detection model. There are at least two key points of the above-mentioned rotatable component. The positions of the two key points of the rotatable components and a non-rotating component can form a stable triangular position relationship, that is, the relative position relationship between the rotatable component and the at least two key points. This relative position relationship will not change with the rotation of the rotatable component. At the same time, the above-mentioned key points will also exist in the rotated component. Therefore, the relative position relationship between the non-rotating component and the key points of the rotatable component can be used to determine the relative position relationship between the non-rotating component and the key points of the rotated component.
[0082] After obtaining the positional relationship between the non-rotating component and the rotated component, the position of the rotated component can be kept unchanged, and the position of the non-rotating component can be adjusted according to the positional relationship between the non-rotating component and the rotated component, and the rotated target can be obtained after the adjustment. The rotated target includes the rotated component and the non-rotating component.
[0083] After the rotated target is obtained, the rotated target can be used to replace the rotatable target in the current page, thereby obtaining the target editing page of the current page, which includes the rotated target.
[0084] Optionally, the non-rotating component is a directional component and a connecting component, and the connecting component is used to connect the directional component and the rotatable component. In the step of performing component separation processing on the rotatable target to obtain the rotatable component and the non-rotating component of the rotatable target, the rotatable target can be subjected to component separation processing to obtain the rotatable component and the non-rotating component of the rotatable target; the non-rotating component can be classified to obtain the directional component and the connecting component.
[0085] In the embodiment of the present invention, the rotatable target may be a graphic target, the rotatable component may be a graphic outline, and the non-rotating component may be graphic information, graphic instructions, graphic labels, etc. Specifically, the non-rotating component includes an orientation component and a connection component. The orientation component is a component with a fixed direction, generally graphic information (such as text), graphic labels (such as numbers, letters, symbols, etc.), etc. The connection component is a component that connects the rotatable component and the non-rotating component, generally a graphic instruction (such as a marked line, arrow, etc.).
[0086] The rotatable target is separated into rotatable components and non-rotating components by separating the components. Since the number and type of non-rotating components are not unique, it is necessary to classify the non-rotating components, classify the directional components and connection components in the non-rotating components, and obtain the directional component subset and the connection component subset. It can be understood that after a non-rotating target is separated, a component set will be obtained, and a component set can include a rotatable component, a directional component subset and a connection component subset. In this way, the classification management of components can be facilitated to avoid component confusion.
[0087] Optionally, in the step of combining the rotated component with the non-rotating component to obtain the rotated target, the connection relationship between the connecting component and the rotated component can be determined based on the connection relationship between the rotatable component and the connecting component; the position of the rotated component is kept unchanged, and the connecting component is connected to the rotated component based on the connection relationship between the connecting component and the rotated component; the direction of the directional component is kept unchanged, and the connecting component is connected to the directional component based on the connection relationship between the connecting component and the directional component, and the position of the directional component is adjusted to obtain the rotated target.
[0088] In an embodiment of the present invention, after separating the rotatable component, the directional component and the connection component, the connection relationship between the rotatable component and the connection component in the current page can be recorded, and then the connection relationship between the rotated component and the non-rotating component can be determined based on the connection relationship between the rotatable component and the connection component in the current page. At the same time, the connection point between the rotatable component and the connection component is used as an anchor point, and these anchor points can be found in the rotated component through the rotation mapping relationship between the rotatable component and the rotated component. All anchor points are found in the rotated component, and according to the connection relationship between the rotated component and the non-rotating component, the connection component corresponding to the anchor point is connected to the anchor point to complete the connection between the rotated component and the connection component.
[0089] In the current page, a rotatable component can correspond to one or more connecting components, and each connecting component corresponds to a directional component. Therefore, the connection relationship between the connecting component and the directional component can be determined. It should be noted that not every directional component needs to be connected to the connecting component. For the directional component that has a connection relationship with the connecting component, the direction of the directional component can be kept unchanged, and the connecting component can be connected to the directional component according to the connection relationship between the connecting component and the directional component. Specifically, since one end of the connecting component is connected to the anchor point, the directional component can be connected to the other end of the connecting component on the basis of keeping the direction unchanged.
[0090] Connected rotated components, connected components, and oriented components can be used as rotated targets.
[0091] In a possible embodiment, for an directional component that has no connection relationship with a connecting component, after separating the rotatable component and the directional component, the positions of the rotatable component and the directional component in the current page can be recorded, and then the positional relationship between the rotated component and the directional component can be determined based on the positions of the rotatable component and the directional component in the current page.
[0092] The above positional relationship may be an up-down-left-right positional relationship, that is, the directional component is located above, below, on the left or on the right of the rotatable component.
[0093] The above-mentioned position relationship can also be a relative position relationship with the key points of the rotatable component. The above-mentioned key points of the rotatable component can be obtained by performing key point detection on the rotatable component through a key point detection model. There are at least two key points of the above-mentioned rotatable component. The positions of the two key points of the rotatable components and an oriented component can form a stable triangular position relationship, that is, the relative position relationship between the rotatable component and at least two key points. This relative position relationship will not change with the rotation of the rotatable component. At the same time, the above-mentioned key points will also exist in the rotated component. Therefore, the relative position relationship between the oriented component and the key points of the rotated component can be determined through the relative position relationship between the oriented component and the key points of the rotatable component.
[0094] After obtaining the positional relationship between the directional component and the rotated component, the position of the directional component is adjusted according to the positional relationship between the directional component and the rotated component while keeping the position of the rotated component unchanged and the direction of the directional component unchanged. After the adjustment is completed, the rotated target can be obtained.
[0095] In a possible embodiment, it is possible to simultaneously separate an oriented component that has no connection relationship with the connecting component and an oriented component that has a connection relationship with the connecting component from the same rotatable target. Then, the rotated component, the connecting component and the oriented component (the oriented component that has a connection relationship with the connecting component) can be connected according to the connection relationship, and the rotated component and the oriented component (the oriented component that has no connection relationship with the connecting component) can be connected according to the position relationship to obtain the final rotated target.
[0096] After the rotated object is obtained, the rotated object can be used to replace the rotatable object in the current page, thereby obtaining the object editing page of the current page.
[0097] Optionally, after the step of obtaining the target editing page of the current page based on the rotated target, the source file of the current page can also be obtained; the file location of the current page is determined in the source file; according to the file location of the current page, the target editing page is overwritten on the current page to obtain the edited file of the source file; and in response to a download request initiated by the user terminal, the edited file is sent to the user terminal.
[0098] In the embodiment of the present invention, the source file of the current page is obtained through a uniform resource locator URL or a local file path. According to the page identifier of the current page (such as a page number or a page title), the file location of the current page is determined in the source file, and the file location of the current page is used as the overlay location of the target editing page. The current page is overwritten by the target editing page to obtain an edited file of the source file.
[0099] In a possible embodiment, the source file can be copied to obtain a copy file, and the target editing page overwrites the current page in the copy file to obtain an edited file of the source file. In this way, the source file can be prevented from being modified.
[0100] The edited files can be temporarily stored and downloaded via a uniform resource locator URL. Further, the edited files can be downloaded only to the user, and other users can only download the source files or the edited files edited by themselves.
[0101] Since the above edited file retains the user's rotation operation, when the user downloads the edited file, the rotation operation is also downloaded together; when the user views the edited file locally, it also conforms to his / her own user habits without having to rotate the page again.
[0102] Optionally, in the step of overwriting the target editing page on the current page according to the file position of the current page to obtain the editing file of the source file, the page size of the source file and / or the size of the rotatable target in the source file can be determined; the adjustment size of the target editing page and / or the rotated target can be determined according to the page size of the source file and / or the size of the rotatable target in the source file; based on the adjustment size of the target editing page and / or the rotated target, the target editing page and / or the rotated target is adjusted to obtain an adjusted target editing page; and the adjusted target editing page is overwritten on the current page to obtain the editing file of the source file.
[0103] In the embodiment of the present invention, considering that the width and height of the rotatable target change after rotation, the adjustment size of the target editing page and / or the rotated target can be determined according to the page size of the source file and / or the size of the rotatable target in the source file. Specifically, the adjustment size of the target editing page can be determined according to the page size of the source file, so that the size of the target editing page is the same as the page size of the source file. Alternatively, the adjustment size of the rotated target can be determined according to the page size of the source file, so that the size of the rotated target does not exceed the page size of the source file. Alternatively, the adjustment size of the rotated target can be determined according to the size of the rotatable target in the source file to avoid excessive size differences of the rotated target.
[0104] In a possible embodiment, the above-mentioned resizing can be adaptive resizing, and the size of the rotated object can be adjusted according to the blank ratio of the editing page, so that the blank ratio of the editing page reaches a preset blank ratio threshold. Alternatively, the size of the rotated object can be adjusted according to the height and width of the editing page, so that the height and width of the rotated object are in a fixed ratio with the height and width of the editing page, such as the height and width of the rotated object are in a golden ratio with the height and width of the editing page, so as to further improve the user's reading experience.
[0105] After obtaining the adjusted target editing page, the adjusted target editing page can be overwritten on the current page in the source file or the copied file to obtain the editing file of the source file.
[0106] like Figure 2 As shown, an embodiment of the present invention provides an online document editing device, the online document editing device comprising:
[0107] The identification module 201 is used to identify whether there is a rotatable object in the current page when detecting a page rotation operation performed by a user in the editing interface;
[0108] A first processing module 202 is used for performing component separation processing on the rotatable object if the rotatable object exists, so as to obtain a rotatable component and a non-rotatable component of the rotatable object;
[0109] A second processing module 203 is used to rotate the rotatable component in response to the page rotation operation to obtain a rotated component;
[0110] The third processing module 204 is used to combine the rotated component with the non-rotated component to obtain the target editing page of the current page and obtain the rotated target;
[0111] The fourth processing module 205 is used to obtain a target editing page of the current page based on the rotated target.
[0112] Optionally, the second processing module 203 is also used to determine the rotation direction and / or rotation angle of the page rotation operation; keep the non-rotating component unchanged, rotate the rotatable component according to the rotation direction and / or the rotation angle, and obtain the rotated component.
[0113] Optionally, the third processing module 203 is also used to determine the positional relationship between the non-rotating component and the rotated component based on the positional relationship between the rotatable component and the non-rotating component; keep the position of the rotated component unchanged, and adjust the position of the non-rotating component according to the positional relationship between the non-rotating component and the rotated component to obtain the rotated target.
[0114] Optionally, the non-rotating component is a directional component and a connecting component, and the connecting component is used to connect the directional component with the rotatable component. The first processing module 202 is also used to perform component separation processing on the rotatable target to obtain the rotatable component and the non-rotating component of the rotatable target; and to classify the non-rotating component to obtain the directional component and the connecting component.
[0115] Optionally, the third processing module 203 is also used to determine the connection relationship between the connecting component and the rotated component according to the connection relationship between the rotatable component and the connecting component; keep the position of the rotated component unchanged, and connect the connecting component to the rotated component according to the connection relationship between the connecting component and the rotated component; keep the direction of the directional component unchanged, and connect the connecting component to the directional component according to the connection relationship between the connecting component and the directional component, and adjust the position of the directional component to obtain a rotated target.
[0116] Optionally, the device further comprises:
[0117] An acquisition module, used to acquire the source file of the current page;
[0118] A fifth processing module, used for determining the file location of the current page in the source file;
[0119] A sixth processing module, configured to overwrite the target editing page with the current page according to the file position of the current page, to obtain an editing file of the source file;
[0120] The sending module is used to send the edited file to the user terminal in response to a download request initiated by the user terminal.
[0121] Optionally, the sixth processing module is also used to determine the page size of the source file and / or the size of the rotatable target in the source file; determine the adjustment size of the target editing page and / or the rotated target according to the page size of the source file and / or the size of the rotatable target in the source file; adjust the target editing page and / or the rotated target based on the adjustment size of the target editing page and / or the rotated target to obtain an adjusted target editing page; overwrite the adjusted target editing page on the current page to obtain an edited file of the source file.
[0122] It should be noted that the online document editing apparatus provided in the embodiment of the present invention can be applied to devices such as smart phones, tablets, servers, etc. that can perform the online document editing method.
[0123] The online document editing device provided in the embodiment of the present invention can implement each process implemented by the online document editing method in the above method embodiment and can achieve the same beneficial effects. To avoid repetition, it will not be described here.
[0124] See also Figure 3 , Figure 3 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, such as Figure 3 As shown, it includes: a memory 302, a processor 301, and a computer program of an online document editing method stored in the memory 302 and executable on the processor 301, wherein:
[0125] The processor 301 is used to call the computer program stored in the memory 302 and execute the following steps:
[0126] When detecting a page rotation operation performed by a user in the editing interface, identifying whether there is a rotatable object in the current page;
[0127] If the rotatable target exists, performing component separation processing on the rotatable target to obtain a rotatable component and a non-rotatable component of the rotatable target;
[0128] In response to the page rotation operation, the rotatable component is rotated to obtain a rotated component;
[0129] Combining the rotated component with the non-rotating component to obtain a rotated target;
[0130] Based on the rotated object, a target editing page of the current page is obtained.
[0131] Optionally, the step of rotating the rotatable component in response to the page rotation operation to obtain a rotated component executed by the processor 301 includes:
[0132] Determining a rotation direction and / or rotation angle of the page rotation operation;
[0133] The non-rotating component is kept unchanged, and the rotatable component is rotated according to the rotation direction and / or the rotation angle to obtain the rotated component.
[0134] Optionally, the step of combining the rotated component with the non-rotating component to obtain the rotated target, performed by the processor 301, includes:
[0135] Determining the positional relationship between the non-rotating component and the rotated component according to the positional relationship between the rotatable component and the non-rotating component;
[0136] The position of the rotated component is kept unchanged, and the position of the non-rotating component is adjusted according to the positional relationship between the non-rotating component and the rotated component to obtain the rotated target.
[0137] Optionally, the non-rotating component is an oriented component and a connecting component, the connecting component is used to connect the oriented component with the rotatable component, and the step of performing component separation processing on the rotatable target to obtain the rotatable component and the non-rotating component of the rotatable target performed by the processor 301 includes:
[0138] Performing component separation processing on the rotatable target to obtain a rotatable component and a non-rotatable component of the rotatable target;
[0139] The non-rotational components are classified to obtain the directional components and the connection components.
[0140] Optionally, the step of combining the rotated component with the non-rotating component to obtain the rotated target, performed by the processor 301, includes:
[0141] Determining a connection relationship between the connecting component and the rotated component according to a connection relationship between the rotatable component and the connecting component;
[0142] Keeping the position of the rotated component unchanged, connecting the connecting component to the rotated component according to the connection relationship between the connecting component and the rotated component;
[0143] The direction of the directional component is kept unchanged, the connection component is connected to the directional component according to the connection relationship between the connection component and the directional component, and the position of the directional component is adjusted to obtain the rotated target.
[0144] Optionally, after the step of obtaining a target editing page of the current page based on the rotated target, the method executed by the processor 301 further includes:
[0145] Obtain the source file of the current page;
[0146] Determine the file location of the current page in the source file;
[0147] According to the file position of the current page, the target editing page is overwritten on the current page to obtain an editing file of the source file;
[0148] In response to a download request initiated by the user terminal, the edited file is sent to the user terminal.
[0149] Optionally, the step of overwriting the target editing page on the current page according to the file position of the current page to obtain the editing file of the source file performed by the processor 301 includes:
[0150] Determine the page size of the source document and / or the size of the rotatable object in the source document;
[0151] Determining the adjustment size of the target editing page and / or the rotated object according to the page size of the source file and / or the size of the rotatable object in the source file;
[0152] Based on the adjusted size of the target editing page and / or the rotated target, adjusting the target editing page and / or the rotated target to obtain an adjusted target editing page;
[0153] The adjusted target editing page is overwritten on the current page to obtain an editing file of the source file.
[0154] It should be noted that the electronic device provided in the embodiment of the present invention can be applied to devices such as smart phones, tablets, servers, etc. that can perform the online document editing method.
[0155] The electronic device provided by the embodiment of the present invention can implement each process implemented by the online document editing method in the above method embodiment and can achieve the same beneficial effects. To avoid repetition, it will not be described here.
[0156] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the online document editing method provided by the embodiment of the present invention are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0157] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The computer-readable storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0158] The above disclosure is only the preferred embodiment of the present invention, which certainly cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.
Claims
1. An online document editing method, characterized in that: The online document editing method comprises the following steps: When detecting a page rotation operation performed by a user in the editing interface, identifying whether there is a rotatable object in the current page; If the rotatable target exists, performing component separation processing on the rotatable target to obtain a rotatable component and a non-rotatable component of the rotatable target; In response to the page rotation operation, the rotatable component is rotated to obtain a rotated component; Combining the rotated component with the non-rotating component to obtain a rotated target; Based on the rotated object, a target editing page of the current page is obtained.
2. The online document editing method according to claim 1, characterized in that: The step of rotating the rotatable component in response to the page rotation operation to obtain a rotated component comprises: Determining a rotation direction and / or rotation angle of the page rotation operation; The non-rotating component is kept unchanged, and the rotatable component is rotated according to the rotation direction and / or the rotation angle to obtain the rotated component.
3. The online document editing method according to claim 1, characterized in that: The step of combining the rotated component with the non-rotating component to obtain a rotated target comprises: Determining the positional relationship between the non-rotating component and the rotated component according to the positional relationship between the rotatable component and the non-rotating component; The position of the rotated component is kept unchanged, and the position of the non-rotating component is adjusted according to the positional relationship between the non-rotating component and the rotated component to obtain the rotated target.
4. The online document editing method according to claim 1, characterized in that: The non-rotating component is a directional component and a connecting component, and the connecting component is used to connect the directional component with the rotatable component. The step of performing component separation processing on the rotatable target to obtain the rotatable component and the non-rotating component of the rotatable target includes: Performing component separation processing on the rotatable target to obtain a rotatable component and a non-rotatable component of the rotatable target; The non-rotational components are classified to obtain the directional components and the connection components.
5. The online document editing method according to claim 4, characterized in that: The step of combining the rotated component with the non-rotating component to obtain a rotated target comprises: Determining a connection relationship between the connecting component and the rotated component according to a connection relationship between the rotatable component and the connecting component; Keeping the position of the rotated component unchanged, connecting the connecting component to the rotated component according to the connection relationship between the connecting component and the rotated component; The direction of the directional component is kept unchanged, the connection component is connected to the directional component according to the connection relationship between the connection component and the directional component, and the position of the directional component is adjusted to obtain the rotated target.
6. The online document editing method according to any one of claims 1 to 5, characterized in that: After the step of obtaining a target editing page of the current page based on the rotated target, the method further includes: Obtain the source file of the current page; Determine the file location of the current page in the source file; According to the file position of the current page, the target editing page is overwritten on the current page to obtain an editing file of the source file; In response to a download request initiated by the user terminal, the edited file is sent to the user terminal.
7. The online document editing method according to claim 6, characterized in that: The step of overwriting the target editing page on the current page according to the file position of the current page to obtain the editing file of the source file comprises: Determine the page size of the source document and / or the size of the rotatable object in the source document; Determining the adjustment size of the target editing page and / or the rotated object according to the page size of the source file and / or the size of the rotatable object in the source file; Based on the adjusted size of the target editing page and / or the rotated target, adjusting the target editing page and / or the rotated target to obtain an adjusted target editing page; The adjusted target editing page is overwritten on the current page to obtain an editing file of the source file.
8. An online document editing device, characterized in that: The online document editing device comprises: The identification module is used to detect whether there is a rotatable object in the current page when the user performs a page rotation operation in the editing interface; A first processing module is used for performing component separation processing on the rotatable target if the rotatable target exists, so as to obtain a rotatable component and a non-rotatable component of the rotatable target; A second processing module, configured to rotate the rotatable component in response to the page rotation operation to obtain a rotated component; A third processing module, configured to combine the rotated component with the non-rotating component to obtain a rotated target; The fourth processing module is used to obtain a target editing page of the current page based on the rotated target.
9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the online document editing method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the online document editing method according to any one of claims 1 to 7 are implemented.
