A background object processing method and device, electronic equipment and storage medium
By setting background objects in document section units, the problem of only being able to set one background object for a document is solved, allowing multiple sections to independently set different background objects, thus improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHUHAI KINGSOFT OFFICE SOFTWARE
- Filing Date
- 2022-08-15
- Publication Date
- 2026-07-10
AI Technical Summary
In existing technologies, a document can only have one background object set, and multiple background objects cannot be set, which causes inconvenience for users.
By adding background objects to sections of the target document, background objects can be set on a section-by-section basis, allowing each section to have a different background object.
This allows multiple sections within the target document to have different background objects set according to actual needs, improving user experience and making it easier for users to operate.
Smart Images

Figure CN115358188B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, electronic device and storage medium for processing background objects. Background Technology
[0002] During office work, you can set various page backgrounds for documents. Setting a page background means making relevant settings to the bottom of the document, such as setting it to gradient, pattern, picture, solid color or texture effects, etc. Gradients, patterns, pictures and textures will be tiled or repeated to fill the page.
[0003] However, currently, after setting a background object in a document, only one background object can be set for the entire document, making it very inconvenient for users. Summary of the Invention
[0004] In order to solve the above-mentioned technical problems, or at least partially solve the above-mentioned technical problems, this application provides a method, apparatus, electronic device and storage medium for processing background objects.
[0005] Firstly, this application provides a method for processing background objects, including:
[0006] Receive an object addition operation for the target document and determine the background object of the object addition operation;
[0007] In the target document, determine the target section to which the background object will be added;
[0008] The background object is added to the target section so that it can be displayed on the document page corresponding to the target section.
[0009] In one possible implementation of this application, adding the background object to the target section includes:
[0010] Obtain the section attributes of the target segment;
[0011] Assign the background object to the section attribute.
[0012] In one possible implementation of this application, the method further includes:
[0013] Determine whether the target document contains document sections;
[0014] If the target document contains the document section, perform the step of determining the background object for the object addition operation.
[0015] In one possible implementation of this application, determining the target section in the target document to which the background object is to be added includes:
[0016] Retrieve the document sections added to the target document through the section addition operation;
[0017] The document section added through the section addition operation is identified as the target section to which the background object is to be added.
[0018] In one possible implementation of this application, determining the target section in the target document to which the background object is to be added includes:
[0019] Retrieve the document sections selected in the target document through the section selection operation;
[0020] The document section selected through the section selection operation is determined as the target section to which the background object is to be added.
[0021] In one possible implementation of this application, the method further includes:
[0022] Upon receiving a section addition operation, generate section attributes corresponding to the document section added through the section addition operation;
[0023] or,
[0024] Upon receiving a section deletion operation, delete the section attribute corresponding to the document section deleted by the section deletion operation.
[0025] In one possible implementation of this application, determining the target section in the target document to which the background object is to be added includes:
[0026] Get the currently displayed document page;
[0027] The target section is determined based on the currently displayed document page.
[0028] In one possible implementation of this application, determining the target section based on the currently displayed document page includes:
[0029] Get the number of section breaks in the currently displayed document page, where the section breaks are used to separate two adjacent sections;
[0030] The target section is determined based on the number of section breaks.
[0031] In one possible implementation of this application, determining the target section based on the number of section breaks includes:
[0032] If the currently displayed document page does not contain section breaks, the section corresponding to the currently displayed document page is determined as the target section;
[0033] Alternatively, if there is only one section break in the currently displayed document page, the section corresponding to the largest area in the regions on both sides of the section break in the currently displayed document page is determined as the target section.
[0034] Alternatively, if there are at least two section breaks in the currently displayed document page, the section corresponding to the largest area between any two adjacent section breaks in the currently displayed document page is determined as the target section.
[0035] Secondly, this application provides a method for processing background objects, including:
[0036] Receive a document read operation for a target document and determine the background object in the target document;
[0037] In the target document, determine the target section corresponding to the background object;
[0038] The background object is read into the target section.
[0039] Thirdly, this application provides a background object processing apparatus, comprising:
[0040] The first determining module is used to receive an object addition operation for the target document and determine the background object of the object addition operation.
[0041] The second determining module is used to determine the target section in the target document to which the background object is to be added;
[0042] An add module is used to add the background object to the target section so that the background object can be displayed in the document page corresponding to the target section.
[0043] In one possible implementation of this application, the adding module includes:
[0044] The first acquisition unit is used to acquire the section attributes of the target segment;
[0045] The assignment unit is used to assign the background object to the section attribute.
[0046] In one possible embodiment of this application, the device further includes:
[0047] The judgment unit is used to determine whether the target document contains document sections;
[0048] An execution unit is configured to, if the target document contains the document section, perform the step of determining the background object for the object addition operation.
[0049] In one possible implementation of this application, the second determining module includes:
[0050] The second acquisition unit is used to acquire document sections added to the target document through the section addition operation;
[0051] The first determining unit is used to determine the document section added through the section addition operation as the target section to which the background object is to be added.
[0052] In one possible implementation of this application, the second determining module includes:
[0053] The third acquisition unit is used to acquire the document section selected in the target document through the section selection operation;
[0054] The second determining unit is used to determine the document section selected through the section selection operation as the target section to which the background object is to be added.
[0055] In one possible embodiment of this application, the device further includes:
[0056] The generation unit is used to generate section attributes corresponding to the document sections added by the section addition operation when a section addition operation is received.
[0057] or,
[0058] The deletion unit is used to delete the section attribute corresponding to the document section deleted by the section deletion operation when a section deletion operation is received.
[0059] In one possible implementation of this application, the second determining module includes:
[0060] The fourth acquisition unit is used to acquire the currently displayed document page;
[0061] The third determining unit is used to determine the target section based on the currently displayed document page.
[0062] In one possible implementation of this application, the fourth determining unit includes:
[0063] Get sub-unit, used to obtain the number of section breaks in the currently displayed document page, wherein the section breaks are used to separate two adjacent sections;
[0064] Determine subunits for determining the target segment based on the number of segmentation symbols.
[0065] In one possible implementation of this application, the determining subunit is further configured to:
[0066] If the currently displayed document page does not contain section breaks, the section corresponding to the currently displayed document page is determined as the target section;
[0067] Alternatively, if there is only one section break in the currently displayed document page, the section corresponding to the largest area in the regions on both sides of the section break in the currently displayed document page is determined as the target section.
[0068] Alternatively, if there are at least two section breaks in the currently displayed document page, the section corresponding to the largest area between any two adjacent section breaks in the currently displayed document page is determined as the target section.
[0069] Fourthly, this application provides a background object processing apparatus, comprising:
[0070] The third determining module is used to receive a document reading operation for the target document and determine the background object in the target document;
[0071] The fourth determining module is used to determine the target section in the target document that corresponds to the background object;
[0072] The reading module is used to read the background object into the target segment.
[0073] Fifthly, this application provides an electronic device, including: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0074] Memory, used to store computer programs;
[0075] When a processor executes a program stored in memory, it implements either the background object processing method described in the first aspect or the background object processing method described in the second aspect.
[0076] In a sixth aspect, this application provides a computer-readable storage medium storing a program for a background object processing method, wherein when the program for the background object processing method is executed by a processor, it implements the steps of the background object processing method described in any of the first aspects, or the steps of the background object processing method described in the second aspect.
[0077] The technical solutions provided in this application have the following advantages compared with the prior art:
[0078] This application embodiment achieves setting background objects on a section-by-section basis by adding background objects to the target section to which the background objects are to be added. That is, each section sets its own background object. Therefore, when the target document contains multiple sections, each section can be set with different background objects according to actual needs, which is convenient for users. Attached Figure Description
[0079] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0080] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0081] Figure 1 A flowchart illustrating a method for processing a background object provided in an embodiment of this application;
[0082] Figure 2 A schematic diagram illustrating the relationships between nodes in a target document defined in a schema file, provided as an embodiment of this application;
[0083] Figure 3 A schematic diagram of a background function entry provided in an embodiment of this application;
[0084] Figure 4 for Figure 1 A flowchart of step S102;
[0085] Figure 5 for Figure 1 Another flowchart for step S102;
[0086] Figure 6 for Figure 1 Another flowchart for step S102;
[0087] Figure 7 A flowchart illustrating another method for processing background objects provided in this application embodiment;
[0088] Figure 8 A structural diagram of a background object processing device provided in an embodiment of this application;
[0089] Figure 9 A structural diagram of another background object processing apparatus provided in the embodiments of this application;
[0090] Figure 10This is a structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0091] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0092] Currently, when setting a background object in a document, only one background object can be set for the entire document, making it inconvenient for users. Therefore, this application provides a method for displaying background objects. This method can be applied to terminal devices such as PCs or mobile phones, and this application allows for setting background objects individually for sections of the target document.
[0093] like Figure 1 As shown, the method for processing the background object may include the following steps:
[0094] Step S101: Receive an object addition operation for the target document and determine the background object of the object addition operation;
[0095] In this embodiment of the application, the target document may refer to the document for which the page background is to be set. If the target document contains document sections, each document section is respectively set with a name, identifier, and section attributes. Specifically, for example... Figure 2 As shown, in the schema file corresponding to the target document, the root node of the target document is connected to several nodes, including: the node corresponding to the document section. Each document section node is connected to several child nodes, including: the child node corresponding to the name, the child node corresponding to the identifier, and the child node corresponding to the section attribute. The section attribute refers to the page attributes of this section. For example, the section attributes include: page background, column settings, and manuscript paper settings, etc. Correspondingly, the child node corresponding to the section attribute is connected to several child nodes, including the child node corresponding to the page background.
[0096] Since the child nodes corresponding to the page background are attached to the child nodes corresponding to the section attributes, and the child nodes corresponding to the section attributes are attached to the nodes corresponding to the document sections, each document section can have its own background object set. Specifically, when the target document has two or more document sections, the background objects corresponding to each document section can be different or the same.
[0097] The background object of an object addition operation refers to the background object that the object addition operation will add to the target document. Specifically, the object addition operation can add background objects to a single document section or multiple document sections. The background object is used to fill the background of the document pages of the target document. Specifically, the background object can include patterns, colors, and images, etc. For example, if the target document contains three document sections, and each document section contains one or more pages, adding a background object of pattern A to the first document section will result in the page background of one or more pages corresponding to the first section being pattern A when the target document is displayed. Adding a red background object to the second document section will result in the page background of one or more pages corresponding to the second section being red when the target document is displayed. Adding a background object of image B to the third document section will result in the page background of one or more pages corresponding to the third section being image B when the target document is displayed.
[0098] The object addition operation can set a background object in the target document. In practical applications, the object addition operation can include at least one triggering operation. For example, the triggering operation can refer to a click operation, etc. Specifically, the object addition operation can include: clicking the background function entry point of the target document + clicking the desired color; clicking the background function entry point of the target document + clicking the corresponding position in the pattern settings window multiple times; clicking the background function entry point of the target document + clicking the image background selection entry point + clicking the corresponding position in the image background settings window multiple times, etc. For example, the background function entry point can be as follows: Figure 3 As shown.
[0099] Before step S101, the background object processing method provided in this application embodiment further includes:
[0100] Step S001: Determine whether the target document contains document sections;
[0101] In this step, it can be determined whether the target document contains section breaks. If the target document contains section breaks, it is determined that the target document contains sections; otherwise, the target document does not contain sections.
[0102] Step S002: If the target document contains the document section, execute step S101 to determine the background object of the object addition operation.
[0103] If the target document does not contain sections but a background object has already been set, when adding a document section to the target document, a selection prompt can be displayed to allow the user to choose whether to continue using the currently set background object in the target document. If the user chooses to continue using the set background object, the set background object of the target document is added to the newly added document section; if the user chooses not to continue using the set background object, the background object of the object addition operation is added to the newly added document section. For example, if the target document does not yet have document sections, but contains a background object A, and upon detecting that the user has set at least one document section for the target document, the current background object A of the target document is displayed as an option. If the user selects at least one document section to use the current background object A, then the background object A is displayed in at least one document section that has selected to use the background object A. To further illustrate this example, if the target document does not yet have document sections, but contains a background object A, the data of the background object A in the target document is associated with the current target document. When the user sets at least one document section in the target document, and the document section uses the background object A, the data of the background object A is associated with the document section (that document section uses the background object A).
[0104] Step S102: Determine the target section in the target document to which the background object is to be added;
[0105] In this embodiment of the application, the target section refers to one or more sections to which a background object needs to be added.
[0106] Furthermore, the target section can be selected from the existing sections of the target document through the section selection operation, or a new target section can be added to the target document through the section selection operation. Alternatively, the target section can be automatically selected based on the currently displayed document page. For details, please refer to the following examples.
[0107] Step S103: Add the background object to the target section so that the background object can be displayed in the document page corresponding to the target section.
[0108] In this embodiment of the application, the document page corresponding to the target section refers to the document page within the target section range. For example, if the target section is from the beginning of page 1 to the end of page 3, then the document page corresponding to the target section is pages 1 to 3 of the document; as another example, if the target section is from the middle of page 2 to the end of page 5, then the document page corresponding to the target section is pages 2 to 5 of the document.
[0109] The background object is added to the target section. Specifically, the section attribute of the target section can be obtained, and the background object can be assigned to the section attribute.
[0110] In this application, assignment refers to assigning the identifier of the background object to the section attribute, such as assigning the identifier "aaaa" of the background object to the section attribute.
[0111] Based on the above, this application can set a background object for a target section in the target document. The target section can be any document section in the target document. In other words, this application can set background objects for multiple document sections respectively. The background objects set for multiple document sections can be completely different or partially the same, avoiding the situation where only one background object can be set for the entire document.
[0112] It's important to note that, to conserve resources, when different document sections share the same background object, these sections are associated with the same background object's identifier. For example, if a target document has three sections: Section A, Section B, and Section C, and Section A and Section C use the same background object A (identified as "a"), and Section B uses background object B (identified as "b"), then Section A and Section C are associated with the same background object A identifier "a"; Section B is associated with the identifier "b".
[0113] This application embodiment achieves setting background objects on a section-by-section basis by adding background objects to the target section to which the background objects are to be added. That is, each section sets its own background object. Therefore, when the target document contains multiple sections, each section can be set with different background objects according to actual needs, which is convenient for users.
[0114] In yet another embodiment of this application, as Figure 4 As shown, step S102, which determines the target section in the target document to which the background object is to be added, includes:
[0115] Step S201: Obtain the document sections added to the target document through the section addition operation;
[0116] In this application embodiment, the section addition operation refers to the operation of adding a section in the target document. In one embodiment of this application, the section addition operation may refer to the operation of inserting a section break in the target document. After inserting a section break in the section addition operation, the added document section can be determined according to the position of the section break, such as: taking the document section before the section break and / or the document section after the section break as the added section.
[0117] In one embodiment of this application, if the section addition operation inserts a section break in the second document section when the target document contains two document sections, the target document will contain four document sections after the insertion, and the added section can be identified as the second document section and / or the third document section of the target document; if the section addition operation inserts a section break in the first document section, the target document will contain three document sections after the insertion, and the added section can be identified as the first document section and / or the second document section of the target document.
[0118] In another embodiment of this application, if the section addition operation inserts two adjacent section breaks in the target document, then one or more document sections before, between, and after the two adjacent section breaks can be determined as added sections; if the section addition operation inserts two non-adjacent section breaks in the target document, then the document sections before and / or after each section break can be determined as added sections.
[0119] In another embodiment of this application, if the section addition operation inserts multiple section breaks in the target document, and if there are at least two adjacent section breaks among the multiple section breaks, then one or more document sections before, between, and after the at least two adjacent section breaks can be determined as added sections, and document sections before and / or after individual section breaks can be determined as added sections, etc.
[0120] Step S202: The document section added through the section addition operation is determined as the target section to which the background object is to be added.
[0121] Furthermore, background objects can be added to target sections. When adding a background object in the object addition operation, the background object can be added to all target sections. When adding at least two background objects in the object addition operation, the user can be prompted to select one or more target sections to which each background object should be added.
[0122] In one embodiment of this application, when adding a new document section, if there are already document sections and background objects in the target document, the user can be provided with existing background objects (such as background object A, background object B, and background object C) to choose from. When the user selects any background object, the background object selected by the user is added to the target section. For example, if the user selects background object A, the identifier of background object A is associated with the target section.
[0123] In practical applications, when users need to set page backgrounds for several pages in a target document, the page range of the existing sections in the target document may not meet the user's needs. Therefore, users can add sections to the target document through the section addition operation. Then, the target section can be automatically determined based on the section added by the section addition operation, without the user having to specify which section is the target section separately, simplifying the user operation and making it easier for users to use.
[0124] In another embodiment of this application, the method further includes:
[0125] Upon receiving a section addition operation, a section attribute corresponding to the document section added through the section addition operation is generated so that it can be used for assignment when adding a background object to the section. In other words, the identifier of the background object can be assigned to the section attribute under the target section.
[0126] Alternatively, upon receiving a section deletion operation, the section attribute corresponding to the document section deleted by the section deletion operation can be deleted. Furthermore, the background object that has been added to the document section can be deleted, that is, the identifier of the background object assigned to the section attribute can be deleted.
[0127] Section deletion operation refers to the operation of deleting sections in a target document. In one embodiment of this application, section deletion operation may refer to the operation of deleting one or more section breaks in a target document. When a section deletion operation is received, one or more document sections to be deleted by the section deletion operation can be deleted.
[0128] After one or more document sections are deleted, in order to avoid continuing to occupy system resources, the section attributes of the deleted document sections should also be deleted, and the identifiers of the background objects that have been assigned to the section attributes of one or more document sections should also be deleted.
[0129] When deleting a document section, if the background object (the background object used by the deleted document section) is also used in other document sections, then only the association between the deleted document section and the background object is deleted. If only the deleted document section uses a single background object, then when deleting the document section, the content of the background object used by that document section, as well as the association between that document section and its background object, are also deleted.
[0130] In one embodiment of this application, upon receiving an operation to modify the background object, the modified background object can be determined, and all background objects of document sections using the modified background object can be changed to the modified background object.
[0131] In yet another embodiment of this application, as Figure 5 As shown, step S102, which determines the target section in the target document to which the background object is to be added, includes:
[0132] Step S301: Obtain the document sections selected in the target document through the section selection operation;
[0133] In this application embodiment, the section selection operation refers to the operation of selecting a section in the target document. In one embodiment of this application, the section selection operation may refer to the operation of specifying a target section among the existing sections in the target document, etc.
[0134] Step S302: The document section selected through the section selection operation is determined as the target section to which the background object is to be added.
[0135] In practical applications, when users need to set page backgrounds for several pages in a target document, the page range of any existing section in the target document may just meet the user's needs. Therefore, users can select an existing section in the target document through the section selection operation. Then, the section selected by the section selection operation can be automatically determined as the target section. The target section determined in this way is more accurate and convenient for users.
[0136] In yet another embodiment of this application, as Figure 6 As shown, step S102, which determines the target section in the target document to which the background object is to be added, includes:
[0137] Step S401: Obtain the currently displayed document page;
[0138] In practical applications, users may need to add a background object to a section while browsing a target document. Therefore, it is possible to obtain the document page that is being displayed at the moment the object addition operation is received.
[0139] Step S402: Determine the target section based on the currently displayed document page.
[0140] In this step, the section corresponding to the currently displayed document page can be determined as the target section. In one embodiment of this application, when the currently displayed document page belongs to a section, the section to which the currently displayed document page belongs can be determined as the target section.
[0141] In another embodiment of this application, when the currently displayed document page belongs to at least two sections, all or part of the at least two sections to which the currently displayed document page belongs can be determined as the target section. A quick settings panel can be displayed, which provides several options, such as: selecting one section as the target section from the at least two sections to which the currently displayed document page belongs, and selecting all sections as the target sections from the at least two sections to which the currently displayed document page belongs, etc., for the user to choose from.
[0142] In cases where it is necessary to determine any one of at least two sections as the target section, specifically, determining the target section based on the currently displayed document page includes: obtaining the number of section breaks in the currently displayed document page, where the section breaks are used to separate two adjacent sections, and determining the target section based on the number of section breaks.
[0143] Specifically, determining the target section based on the number of section breaks includes:
[0144] If the currently displayed document page does not contain section breaks, the section corresponding to the currently displayed document page is determined as the target section; that is, if the currently displayed document pages belong to the same section, the section to which the currently displayed document page belongs can be determined as the target section.
[0145] Alternatively, if there is only one section break in the currently displayed document page, the section corresponding to the largest area on both sides of the section break in the currently displayed document page is determined as the target section; that is, if the currently displayed document page consists of two sections, the section to which the largest area belongs can be determined as the target section.
[0146] Alternatively, if the currently displayed document page contains at least two section breaks, the section corresponding to the largest area between any two adjacent section breaks within the currently displayed document page is determined as the target section. In other words, if the currently displayed document page consists of at least two sections, the display area of each currently displayed section can be determined, and the section containing the largest display area is determined as the target section.
[0147] When it is necessary to identify a portion of at least two sections as the target section, the user needs to specify the range to be selected. For example, the user can select content on the currently displayed document page, obtain the section to which the selected content belongs, and identify the section to which the selected content belongs as the target section; or, a panel, button, or input box can be displayed for selecting sections, and the target section can be determined based on the user's operation.
[0148] The embodiments of this application can automatically determine the target section in the currently displayed document page, simplifying user operations and making it easier for users to use.
[0149] In yet another embodiment of this application, as Figure 7 As shown, a method for processing background objects is also provided, including:
[0150] Step S501: Upon receiving a document reading operation for the target document, determine the background object in the target document;
[0151] Document reading operations are used to read target documents, such as opening target documents. In the process of reading target documents, the background objects to be read in the software kernel can be determined first.
[0152] Step S502: Determine the target section in the target document that corresponds to the background object;
[0153] Since the background object was already stored in the corresponding target section when storing the target document in the aforementioned embodiments, the target section in the target document corresponding to the background object can be determined.
[0154] Step S503: Read the background object into the target segment.
[0155] Background objects can be read from the software kernel and assigned to the target section of the target document.
[0156] In one embodiment of this application, when reading a target document in UOF format, the background object can be directly read into the target section.
[0157] This application embodiment reads the background object into the target section, thereby setting the background object on a section-by-section basis. That is, each section sets its own background object. Therefore, when the target document contains multiple sections, each section can set different background objects according to actual needs, which is convenient for users.
[0158] In yet another embodiment of this application, as Figure 8 As shown, a background object processing apparatus is also provided, comprising:
[0159] The first determining module 11 is used to determine the background object corresponding to the object adding operation when an object adding operation for the target document is received.
[0160] The second determining module 12 is used to determine the target section in the target document to which the background object is to be added;
[0161] Add module 13 is used to add the background object to the target section so that the background object can be displayed in the document page corresponding to the target section.
[0162] In one possible implementation of this application, the adding module includes:
[0163] The first acquisition unit is used to acquire the section attributes of the target segment;
[0164] The assignment unit is used to assign the background object to the section attribute.
[0165] In one possible embodiment of this application, the device further includes:
[0166] The determination unit is used to determine whether the target document contains sections;
[0167] An execution unit is configured to, if the target document contains the section, perform the step of determining the background object for the object addition operation.
[0168] In one possible implementation of this application, the second determining module includes:
[0169] The second acquisition unit is used to acquire the sections added to the target document through the section addition operation;
[0170] The first determining unit is used to determine the segment added through the segment addition operation as the target segment of the background object to be added.
[0171] In one possible implementation of this application, the second determining module includes:
[0172] The third acquisition unit is used to acquire the section selected in the target document through the section selection operation;
[0173] The second determining unit is used to determine the section selected through the section selection operation as the target section to which the background object is to be added.
[0174] In one possible embodiment of this application, the device further includes:
[0175] The generation unit is used to generate section attributes corresponding to the document sections added by the section addition operation when a section addition operation is received.
[0176] or,
[0177] The deletion unit is used to delete the section attribute corresponding to the document section deleted by the section deletion operation when a section deletion operation is received.
[0178] In one possible implementation of this application, the second determining module includes:
[0179] The fourth acquisition unit is used to acquire the currently displayed document page;
[0180] The third determining unit is used to determine the target section based on the currently displayed document page.
[0181] In one possible implementation of this application, the fourth determining unit includes:
[0182] Get sub-unit, used to obtain the number of section breaks in the currently displayed document page, wherein the section breaks are used to separate two adjacent sections;
[0183] Determine subunits for determining the target segment based on the number of segmentation symbols.
[0184] In one possible implementation of this application, the determining subunit is further configured to:
[0185] If the currently displayed document page does not contain section breaks, the section corresponding to the currently displayed document page is determined as the target section;
[0186] Alternatively, if there is only one section break in the currently displayed document page, the section corresponding to the largest area in the regions on both sides of the section break in the currently displayed document page is determined as the target section.
[0187] Alternatively, if there are at least two section breaks in the currently displayed document page, the section corresponding to the largest area between any two adjacent section breaks in the currently displayed document page is determined as the target section.
[0188] In yet another embodiment of this application, as Figure 9 As shown, a background object processing apparatus is also provided, comprising:
[0189] The third determining module 21 is used to determine the background object in the target document when a document reading operation for the target document is received;
[0190] The fourth determining module 22 is used to determine the target section in the target document that corresponds to the background object;
[0191] The reading module 23 is used to read the background object into the target segment.
[0192] In another embodiment of this application, an electronic device is also provided, including: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0193] Memory, used to store computer programs;
[0194] A processor, when executing a program stored in memory, implements any of the aforementioned methods for processing background objects.
[0195] The electronic device provided in this embodiment of the invention allows the processor to add background objects to the target section of the document containing the background object by executing a program stored in the memory. This enables the setting of background objects on a section-by-section basis, meaning that each section can have its own background object set. Consequently, when the target document contains multiple sections, each section can have different background objects set according to actual needs, making it convenient for users.
[0196] The communication bus 1140 mentioned in the above-mentioned electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus 1140 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 10 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0197] The communication interface 1120 is used for communication between the above-mentioned electronic device and other devices.
[0198] The memory 1130 may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0199] The processor 1110 mentioned above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0200] In another embodiment of this application, a computer-readable storage medium is also provided, on which a program for a background object processing method is stored, wherein when the program for the background object processing method is executed by a processor, it implements the background object processing steps described above.
[0201] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0202] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for processing background objects, characterized in that, include: Receive an object addition operation for the target document and determine the background object of the object addition operation; In the target document, determine the target section to which the background object will be added; The background object is added to the target section to display the background object on the document page corresponding to the target section. If the target document does not contain a section but a background object has already been set, when a document section is added to the target document, a selection prompt is displayed. The selection prompt is used to allow the user to choose whether to continue using the currently set background object in the target document. If the user chooses to continue using the set background object, the set background object of the target document is added to the added document section. If the user chooses not to continue using the set background object, the background object of the object addition operation is added to the added document section.
2. The method according to claim 1, characterized in that, Adding the background object to the target section includes: Obtain the section attributes of the target segment; Assign the background object to the section attribute.
3. The method according to claim 1, characterized in that, The method further includes: Determine whether the target document contains document sections; If the target document contains the document section, perform the step of determining the background object for the object addition operation.
4. The method according to claim 1, characterized in that, Determining the target section in the target document to which the background object will be added includes: Retrieve the document sections added to the target document through the section addition operation; The document section added through the section addition operation is identified as the target section to which the background object is to be added.
5. The method according to claim 1, characterized in that, Determining the target section in the target document to which the background object will be added includes: Retrieve the document sections selected in the target document through the section selection operation; The document section selected through the section selection operation is determined as the target section to which the background object is to be added.
6. The method according to claim 1, characterized in that, The method further includes: Upon receiving a section addition operation, generate section attributes corresponding to the document section added through the section addition operation; or, Upon receiving a section deletion operation, delete the section attribute corresponding to the document section deleted by the section deletion operation.
7. The method according to claim 1, characterized in that, Determining the target section in the target document to which the background object will be added includes: Get the currently displayed document page; The target section is determined based on the currently displayed document page.
8. The method according to claim 7, characterized in that, Determining the target section based on the currently displayed document page includes: Get the number of section breaks in the currently displayed document page, where the section breaks are used to separate two adjacent sections; The target section is determined based on the number of section breaks.
9. The method according to claim 8, characterized in that, Determining the target section based on the number of section breaks includes: If the currently displayed document page does not contain section breaks, the section corresponding to the currently displayed document page is determined as the target section; Alternatively, if there is only one section break in the currently displayed document page, the section corresponding to the largest area in the regions on both sides of the section break in the currently displayed document page is determined as the target section. Alternatively, if there are at least two section breaks in the currently displayed document page, the section corresponding to the largest area between any two adjacent section breaks in the currently displayed document page is determined as the target section.
10. A method for processing background objects, characterized in that, include: Receive a document read operation for a target document and determine the background object in the target document; In the target document, determine the target section corresponding to the background object; The background object is read into the target section. If the target document does not contain a section but a background object has already been set, when a document section is added to the target document, a selection prompt is displayed. The selection prompt is used for the user to choose whether to continue using the currently set background object in the target document. If the user chooses to continue using the set background object, the set background object of the target document is added to the added document section. If the user chooses not to continue using the set background object, the background object of the object addition operation is added to the added document section.
11. A background object processing apparatus, characterized in that, include: The first determining module is used to receive an object addition operation for the target document and determine the background object of the object addition operation. The second determining module is used to determine the target section in the target document to which the background object is to be added; An add module is used to add the background object to the target section so that the background object can be displayed on the document page corresponding to the target section. If the target document does not contain a section but a background object has already been set, when a document section is added to the target document, a selection prompt is displayed. The selection prompt allows the user to choose whether to continue using the currently set background object in the target document. If the user chooses to continue using the set background object, the already set background object in the target document is added to the added document section; if the user chooses not to continue using the set background object, the background object of the object addition operation is added to the added document section.
12. A background object processing apparatus, characterized in that, include: The third determining module is used to receive a document reading operation for the target document and determine the background object in the target document; The fourth determining module is used to determine the target section in the target document that corresponds to the background object; The reading module is used to read the background object into the target section. When the target document does not contain a section but a background object has already been set, a selection prompt is displayed when a document section is added to the target document. The selection prompt is used for the user to choose whether to continue using the currently set background object in the target document. If the user chooses to continue using the set background object, the set background object of the target document is added to the added document section; if the user chooses not to continue using the set background object, the background object of the object addition operation is added to the added document section.
13. An electronic device, characterized in that, include: The processor, communication interface, memory, and communication bus are connected, with the processor, communication interface, and memory communicating with each other via the communication bus. Memory, used to store computer programs; When a processor executes a program stored in memory, it implements the background object processing method according to any one of claims 1 to 9, or the background object processing method according to claim 10.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program for a method of processing a background object, which, when executed by a processor, implements the steps of the background object processing method according to any one of claims 1-9, or the steps of the background object processing method according to claim 10.