Document processing method and device, electronic equipment, computer program product and computer readable storage medium

By displaying format controls in the document display area and obtaining and applying format parameters in response to selection operations, the problem of low format adjustment efficiency in the prior art is solved, efficient reuse and consistent application of format parameters is achieved, and user experience is improved.

CN120406792APending Publication Date: 2025-08-01TENCENT TECH WUHAN
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410139460.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-31
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

In the process of adjusting electronic document formats, the interactive path is long and the format brush control is fixed to the toolbar, resulting in inconvenient operation, lack of flexibility, and the format parameters cannot be previewed and modified, resulting in incomplete format reuse and inefficient efficiency.

Method used

It provides a document processing method. By displaying format controls in the document display area, obtaining and applying format parameters in response to selection operations, adopting adsorbed format controls and middleware design, supporting preview and direct modification of format parameters, and using middleware to decouple from cache, to achieve efficient multiplexing and storage of format parameters.

Benefits of technology

Improves the efficiency and ease of use of format adjustment, ensures consistency in format reuse, reduces operation steps, simplifies the process of changing format parameters, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120406792A_ABST
    Figure CN120406792A_ABST
Patent Text Reader

Abstract

The invention provides a document processing method and device, electronic equipment, a computer program product and a computer readable storage medium. The method comprises the following steps: displaying contents of a document in a document display area; in response to a selection operation for a first area in the document display area, displaying a format control; in response to a trigger operation on the format control, obtaining a format parameter of the first area; and in response to a selection operation for a second region in the document display region, applying the format parameter of the first region to the second region. Through the method and the device, a user can be supported to efficiently adjust the format of the document.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to data processing technologies, and in particular, to a method, apparatus, electronic device, computer program product, and computer-readable storage medium for processing documents. Background Art

[0002] Electronic documents are the mainstream way of file processing. In the process of document processing, a common use scenario is to adjust the format of the content in an electronic document, such as changing the font, adjusting the line spacing, etc.

[0003] The formats of the content in electronic documents are complex and diverse. To apply the format of one area to another area, the related technology provides a format painter solution. Since the format painter is set in the toolbar of the editing software, during the operation, it is necessary to select an area, then enable the format painter function in the toolbar, and then select another area for format reuse. The applicant has found that such an interaction path is relatively long, resulting in relatively low efficiency of format adjustment. Summary of the Invention

[0004] Embodiments of this application provide a method, apparatus, electronic device, computer program product, and computer-readable storage medium for processing documents, which can support users to efficiently adjust the format of documents.

[0005] The technical solution of the embodiments of this application is implemented as follows:

[0006] Embodiments of this application provide a method for processing documents, the method including:

[0007] Display the content of the document in the document display area;

[0008] In response to a selection operation on a first area in the document display area, display a format control;

[0009] In response to a trigger operation on the format control, obtain the format parameters of the first area;

[0010] In response to a selection operation on a second area in the document display area, apply the format parameters of the first area to the second area.

[0011] Embodiments of this application provide a document processing apparatus, the apparatus including:

[0012] A first display module, configured to display the content of the document in the document display area,

[0013] A second display module, configured to display a format control in response to a selection operation on a first area in the document display area;

[0014] A parameter acquisition module, configured to acquire format parameters of the first area in response to a trigger operation on the format control;

[0015] A parameter application module, configured to apply the format parameters of the first area to the second area in response to a selection operation on the second area in the document display area.

[0016] An embodiment of the present application provides an electronic device, including:

[0017] A memory, configured to store computer-executable instructions;

[0018] A processor, configured to implement the document processing method provided by the embodiment of the present application when executing the computer-executable instructions stored in the memory.

[0019] An embodiment of the present application provides a computer-readable storage medium, storing a computer program or computer-executable instructions, configured to implement the document processing method provided by the embodiment of the present application when being executed by a processor.

[0020] An embodiment of the present application provides a computer program product, including a computer program or computer-executable instructions, where when the computer program or computer-executable instructions are executed by a processor, the document processing method provided by the embodiment of the present application is implemented.

[0021] The embodiment of the present application has the following beneficial effects:

[0022] Associating the selection operation on the first area with the display of the format control, since the operation format copying of area selection is a high-frequency scenario, the format parameters of the first area can be conveniently and quickly extracted by triggering the format control, and then through the selection operation on the second area, the format parameters of the first area can be efficiently applied to the second area; compared with the related technology solution of setting the format brush control at a fixed position in the toolbar, since the format control is associated with the display of the first area, it can prominently remind the user to trigger when needed, saving the operation process of finding the format brush in the toolbar and then returning to the second area again, avoiding the situation of too long interaction logic in the related technology, and enhancing the efficiency and usability of document format processing. Description of the Drawings

[0023] Figure 1 is a schematic diagram of format reuse in the related technology;

[0024] Figure 2 is a schematic diagram of format extraction in the related technology;

[0025] Figure 3 is a schematic structural diagram of a document processing system 100 provided by the embodiment of the present application;

[0026] Figure 4 It is a schematic structural diagram of the terminal 400 provided by an embodiment of the present application;

[0027] Figure 5A It is a first flowchart of the document processing method provided by an embodiment of the present application;

[0028] Figure 5B It is a second flowchart of the document processing method provided by an embodiment of the present application;

[0029] Figure 5C It is a third flowchart of the document processing method provided by an embodiment of the present application;

[0030] Figure 5D It is a fourth flowchart of the document processing method provided by an embodiment of the present application;

[0031] Figure 5E It is a fifth flowchart of the document processing method provided by an embodiment of the present application;

[0032] Figure 5F It is a sixth flowchart of the document processing method provided by an embodiment of the present application;

[0033] Figure 5G It is a seventh flowchart of the document processing method provided by an embodiment of the present application;

[0034] Figure 5H It is an eighth flowchart of the document processing method provided by an embodiment of the present application;

[0035] Figure 5I It is a ninth flowchart of the document processing method provided by an embodiment of the present application;

[0036] Figure 5J It is a tenth flowchart of the document processing method provided by an embodiment of the present application;

[0037] Figure 5K It is an eleventh flowchart of the document processing method provided by an embodiment of the present application;

[0038] Figure 5L It is a twelfth flowchart of the document processing method provided by an embodiment of the present application;

[0039] Figure 6 It is a principle comparison diagram between the document processing method provided by an embodiment of the present application and related technologies;

[0040] Figure 7A It is a first schematic diagram of the document display area provided by an embodiment of the present application;

[0041] Figure 7BIt is the second schematic diagram of the document display area provided by the embodiments of the present application;

[0042] Figure 7C It is the third schematic diagram of the document display area provided by the embodiments of the present application;

[0043] Figure 8A It is the first schematic diagram of the format application provided by the embodiments of the present application;

[0044] Figure 8B It is the second schematic diagram of the format application provided by the embodiments of the present application;

[0045] Figure 8C It is the third schematic diagram of the format application provided by the embodiments of the present application;

[0046] Figure 9 It is the schematic diagram of the middleware provided by the embodiments of the present application;

[0047] Figure 10A It is the first structural schematic diagram of the format control provided by the embodiments of the present application;

[0048] Figure 10B It is the schematic diagram of the first style to be collected provided by the embodiments of the present application;

[0049] Figure 10C It is the schematic diagram of the style list in the style library provided by the embodiments of the present application;

[0050] Figure 10D It is the first application schematic diagram of the format collection provided by the embodiments of the present application;

[0051] Figure 10E It is the second structural schematic diagram of the format control provided by the embodiments of the present application;

[0052] Figure 10F It is the second application schematic diagram of the format collection provided by the embodiments of the present application;

[0053] Figure 11A It is the first schematic diagram of the thumbnail control provided by the embodiments of the present application;

[0054] Figure 11B It is the second schematic diagram of the thumbnail control provided by the embodiments of the present application;

[0055] Figure 11C It is the third schematic diagram of the thumbnail control provided by the embodiments of the present application;

[0056] Figure 12A It is the first schematic diagram of the first format parameter list provided by the embodiments of the present application;

[0057] Figure 12BIt is the first schematic diagram of applying the target format parameters provided by the embodiments of the present application;

[0058] Figure 12C It is the schematic diagram of selecting and applying the target format parameters provided by the embodiments of the present application;

[0059] Figure 12D It is the second schematic diagram of the first format parameter list provided by the embodiments of the present application;

[0060] Figure 12E It is the second schematic diagram of applying the target format parameters provided by the embodiments of the present application;

[0061] Figure 13A It is the first schematic diagram of the editing toolbar displayed in the first area provided by the embodiments of the present application;

[0062] Figure 13B It is the second schematic diagram of displaying the editing toolbar in the first area provided by the embodiments of the present application;

[0063] Figure 13C It is the third schematic diagram of displaying the editing toolbar in the first area provided by the embodiments of the present application;

[0064] Figure 14A It is the first schematic diagram of changing the format parameters through the editing control provided by the embodiments of the present application;

[0065] Figure 14B It is the application schematic diagram of changing the format parameters of the target area provided by the embodiments of the present application;

[0066] Figure 14C It is the second schematic diagram of changing the format parameters through the editing control provided by the embodiments of the present application;

[0067] Figure 14D It is the third schematic diagram of changing the format parameters through the editing control provided by the embodiments of the present application;

[0068] Figure 15A It is the first application schematic diagram of the second format parameter list provided by the embodiments of the present application;

[0069] Figure 15B It is the second application schematic diagram of the second format parameter list provided by the embodiments of the present application;

[0070] Figure 15C It is the third application schematic diagram of the second format parameter list provided by the embodiments of the present application;

[0071] Figure 16A It is the first application schematic diagram of the preview control provided by the embodiments of the present application;

[0072] Figure 16BIt is the second application schematic diagram of the preview control provided by the embodiment of the present application;

[0073] Figure 16C It is the third application schematic diagram of the preview control provided by the embodiment of the present application;

[0074] Figure 17A It is the first schematic diagram of the style library entry provided by the embodiment of the present application;

[0075] Figure 17B It is the first application schematic diagram of the style in the style list provided by the embodiment of the present application;

[0076] Figure 17C It is the schematic diagram of the style application provided by the embodiment of the present application;

[0077] Figure 17D It is the second schematic diagram of the style library entry provided by the embodiment of the present application;

[0078] Figure 17E It is the second application schematic diagram of the style in the style list provided by the embodiment of the present application;

[0079] Figure 18A It is the first schematic diagram of the second area changing format parameters through the editing toolbar provided by the embodiment of the present application;

[0080] Figure 18B is the second schematic diagram of the second area changing format parameters through the editing toolbar provided by the embodiment of the present application;

[0081] Figure 18C It is the third schematic diagram of the second area changing format parameters through the editing toolbar provided by the embodiment of the present application;

[0082] Figure 19 It is the flowchart schematic diagram of the document processing method provided by the embodiment of the present application;

[0083] Figure 20 It is the logical schematic diagram of the format application provided by the embodiment of the present application;

[0084] Figure 21 It is the principle schematic diagram of the conflict handling logic algorithm provided by the embodiment of the present application. Detailed implementation manners

[0085] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations of the present application. All other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present application.

[0086] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments. However, it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0087] If a similar description such as "first / second" appears in the application documents, the following explanation shall be added. In the following description, the terms "first / second / third" are only used to distinguish similar objects and do not represent a specific order for the objects. It is understood that "first / second / third" may be interchanged in a specific order or sequence when permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0088] In the embodiments of the present application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of an overall module or unit that includes the function of that module or unit.

[0089] In the embodiments of the present application, when collecting and processing relevant data in actual applications, the informed consent or separate consent of the personal information subject should be obtained strictly in accordance with the requirements of relevant national laws and regulations, and subsequent data use and processing behaviors should be carried out within the scope authorized by laws, regulations and the personal information subject.

[0090] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meaning as commonly understood by those skilled in the art to which the present application pertains. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

[0091] Before further elaborating on the embodiments of the present application, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following explanations.

[0092] 1) Electronic Document, that is, a document that depends on a computer system for access and editing and has a certain editable format. For example, text documents represented by Word documents, table documents represented by Excel documents, and presentation documents represented by presentation (PPT, Power PoinT) documents.

[0093] 2) Format parameters, which are parameters related to the attributes of the document. For example, common format parameters may include font type, font size, font color, background color, etc.; when the document type is a table, format parameters may also include cell width and height (width and height), background color, background image, style of the cell's bounding box, thickness and color of the cell's bounding box, etc.

[0094] 3) Style, the document style refers to the set of format parameters applied to the document (including text, graphics, and other elements in the document). The final display form of the document is determined by the document's style.

[0095] 4) Content unit, the smallest unit that is operated on in the document, and the operations performed include format reuse, format update, etc. For example, when the document is a table document, a cell can be used as a content unit; when the document is a text document, a line or a natural sentence can be used as a content unit; when the document is a presentation document, a text box can be used as a content unit. The size of the content unit can be a fixed value or can be adaptively adjusted according to the size of the selected area in the document.

[0096] 5) Flyweight pattern, which is a software design pattern. It uses shared objects to minimize memory usage as much as possible and share information among as many similar objects as possible; it is suitable for a large number of objects that cause unacceptable memory usage only due to repetition. Usually, some states in the objects can be shared. A common approach is to place them in an external data structure and pass them to the flyweight when needed. Among them, the flyweight is also the shared object, which is used to store duplicate objects.

[0097] 6) Longest common subsequence, for multiple sequences (such as at least two sequences), the same subsequence included in all the sequences is used as the longest common subsequence of these sequences.

[0098] 7) Atomic operation, which refers to the smallest granularity operation performed on the document. Each format parameter corresponds to an atomic operation, and each atomic operation is used to update a format parameter in the second region to the corresponding type of format parameter in the first region.

[0099] The applicant found that the following problems exist in the format processing of files in the related art:

[0100] 1. In the related art, after selecting the area where the format parameters need to be extracted, it is necessary to return to the toolbar for operation, and the interaction logic path is long and lacks flexibility;

[0101] 2. The format brush in the related art is fixed in the toolbar. When the distance between the selected area where the format parameters need to be extracted and the toolbar is far, the triggering operation of the format brush is inconvenient and consumes too much time;

[0102] 3. After selecting the area for which format parameters need to be extracted, no preview can be performed until the format is actually reused, and the effect can only be confirmed after reuse. If there are any problems, the operation has to be repeated. The reuse effect is uncertain. Refer to Figure 1 , Figure 1 which is a schematic diagram of format reuse in related technologies. Figure 1 It shows that during the process of format reuse in related technologies, only the icon of the format brush is displayed, without any preview or prompt.

[0103] 4. When the extracted format parameters need to be modified multiple times, it is necessary to repeatedly return to the toolbar to find the corresponding editing tool to change the format parameters, resulting in low processing efficiency.

[0104] 5. In the process of format reuse in related technologies, the situation of incomplete format reuse may occur. Refer to Figure 2 , Figure 2 which is a schematic diagram of format extraction in related technologies. As Figure 2 shown, area 210 is the area for which format parameters need to be extracted, and area 220 is the area where format parameters need to be reused. When area 220 reuses the format parameters of area 210, only some of the format parameters in area 210 can be reused, and the column height is not reused, resulting in a poor final presentation effect of the document. Moreover, the effects produced by different types of documents, different object types, and even different selection methods are all different, lacking consistency.

[0105] Based on the above analysis, the applicant found that the method for processing documents in related technologies cannot perform complete format reuse, nor can it preview and modify the format of the selected area. To address the above problems, the embodiments of the present application provide a method for processing documents, which can support users to efficiently adjust the format of documents.

[0106] The embodiments of the present application provide a method, device, electronic device, computer program product, and computer-readable storage medium for processing documents, which can support users to efficiently adjust the format of documents. The following describes an exemplary application of the electronic device provided by the embodiments of the present application. The electronic device provided by the embodiments of the present application can be implemented as various types of user terminals such as laptop computers, tablet computers, desktop computers, set-top boxes, mobile devices (e.g., mobile phones, portable music players, personal digital assistants, dedicated messaging devices, portable gaming devices), smart phones, smart speakers, smart watches, smart TVs, in-vehicle terminals, etc., or can also be implemented as a server. The following will describe the exemplary application when the electronic device is implemented as a terminal.

[0107] Refer to Figure 3 , Figure 3FIG. 0 is a schematic structural diagram of a document processing system 100 provided by an embodiment of the present application. To support a document processing application, terminals (exemplarily shown as terminal 400-1 and terminal 400-2) are connected to a server 200 through a network 300. The network 300 can be a wide area network, a local area network, or a combination of both.

[0108] The document can be an online document for multi-user collaborative editing. The terminal 400-1 can apply the format parameters of the first area of the document to the second area, and can share it with the terminal 400-2 based on the server 200 and the network 300, so that after any one of the terminal 400-1 and the terminal 400-2 adjusts the format parameters of the document, the other terminal can synchronously display the changed document style. Among them, the server 200 can be the background server of the online document.

[0109] The document can be a local document processed offline on the terminal. The terminal 400-1 or the terminal 400-2 is used to display the content of the document. In response to a selection operation on the first area in the document display area, a format control is displayed; in response to a trigger operation on the format control, the format parameters of the first area are obtained; in response to a selection operation on the second area in the document display area, the format parameters of the first area are applied to the second area. Among them, the document content, the first area, the second area, and the format control are all displayed on a graphical interface (exemplarily shown as graphical interface 410-1 and graphical interface 410-2).

[0110] In some embodiments, the server 200 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms. The terminal 400 can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a vehicle-mounted terminal, etc., but is not limited thereto. The terminal and the server can be directly or indirectly connected through wired or wireless communication methods, which are not limited in the embodiments of the present application.

[0111] See Figure 4 , Figure 4 FIG. 16 is a schematic structural diagram of the terminal 400 provided by an embodiment of the present application. Figure 4The illustrated terminal 400 includes: at least one processor 410, a memory 450, at least one network interface 420, and a user interface 430. Each component in the terminal 400 is coupled together through a bus system 440. It can be understood that the bus system 440 is used to implement the connection and communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, in Figure 4 all kinds of buses are labeled as the bus system 440.

[0112] The processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0113] The user interface 430 includes one or more output devices 431 capable of presenting media content, including one or more speakers and / or one or more visual display screens. The user interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, a mouse, a microphone, a touch screen display, a camera, other input buttons, and controls.

[0114] The memory 450 can be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disc drives, etc. The memory 450 optionally includes one or more storage devices that are physically located away from the processor 410.

[0115] The memory 450 includes volatile memory or non-volatile memory, and can also include both volatile and non-volatile memory. The non-volatile memory can be a read-only memory (ROM), and the volatile memory can be a random access memory (RAM). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.

[0116] In some embodiments, the memory 450 is capable of storing data to support various operations. Examples of such data include programs, modules, and data structures, or subsets or supersets thereof, which are illustrated below.

[0117] An operating system 451, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0118] A network communication module 452 for reaching other electronic devices via one or more (wired or wireless) network interfaces 420. Exemplary network interfaces 420 include: Bluetooth, Wireless Fidelity (WiFi), Universal Serial Bus (USB), etc.

[0119] A presentation module 453 for enabling the presentation of information (e.g., a user interface for operating peripheral devices and displaying content and information) via one or more output devices 431 associated with the user interface 430 (e.g., a display screen, a speaker, etc.).

[0120] An input processing module 454 for detecting and translating one or more user inputs or interactions from one of one or more input devices 432.

[0121] In some embodiments, the device provided by the embodiments of the present application can be implemented in software. Figure 4 A processing device 455 for documents stored in the memory 450 is shown, which can be software in the form of a program and a plug-in, etc., including the following software modules: a first display module 4551, a second display module 4552, a parameter acquisition module 4553, and a parameter application module 4554. These modules are logical, so they can be combined arbitrarily or further split according to the functions implemented. The functions of each module will be described below.

[0122] In some embodiments, a terminal or a server can implement the document processing method provided by the embodiments of the present application by running various computer-executable instructions or computer programs. For example, the computer-executable instructions can be commands at the microprogram level, machine instructions, or software instructions. The computer program can be a native program or a software module in an operating system; it can be a local (Native) application (APP), that is, a program that needs to be installed in the operating system to run, such as a document processing APP; it can also be a small program that can be embedded in any APP, that is, a program that only needs to be downloaded to a browser environment to run. In short, the above computer-executable instructions can be instructions in any form, and the above computer programs can be application programs, modules, or plug-ins in any form.

[0123] The embodiments of the present application can be implemented through artificial intelligence technology. Artificial Intelligence (AI) uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, and is a theory, method, technology, and application system that can perceive the environment, acquire knowledge, and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a way similar to human intelligence. Artificial intelligence also studies the design principles and implementation methods of various intelligent machines, enabling the machines to have the functions of perception, reasoning, and decision-making.

[0124] Artificial intelligence technology is an interdisciplinary subject that involves a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, pre-trained model technology, operation / interaction systems, mechatronics, etc. Among them, the pre-trained model, also known as the large model or the foundation model, can be widely applied to downstream tasks in various directions of artificial intelligence after fine-tuning. The software technologies of artificial intelligence mainly include several major directions such as computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0125] The processing method of the document provided by the embodiments of the present application will be described in combination with the exemplary applications and implementations of the terminal provided by the embodiments of the present application.

[0126] See Figure 5A , Figure 5A FIG. is the first flowchart of the processing method of the document provided by the embodiments of the present application. Taking the terminal as the main body, the steps shown in Figure 5A will be described.

[0127] In step 101, the content of the document is displayed in the document display area.

[0128] In some embodiments, there are various types of documents, such as: tables, Word, presentation (PPT, PowerPoint), Portable Document Format (PDF), etc.

[0129] Exemplarily, when the document type is a table, see Figure 7A , Figure 7A FIG. is the first schematic diagram of the document display area provided by the embodiments of the present application. In Figure 7A , the content in the document display area 701 is the content from the 1st row to the 25th row in the table.

[0130] Exemplarily, when the document type is Word, see Figure 7B ,Figure 7B This is the second schematic diagram of the document display area provided by the embodiments of the present application. In Figure 7B this, the content in the document display area 801 is the content of the first to third sentences in Word.

[0131] For example, when the document type is PPT, refer to Figure 7C , Figure 7C This is the third schematic diagram of the document display area provided by the embodiments of the present application. In Figure 7C this, the content in the document display area 901 is the content in the three text boxes in the PPT.

[0132] In step 102, in response to a selection operation on the first area in the document display area, a format control is displayed.

[0133] In some embodiments, the first area is the source area for format copying, and the format control is adsorbed to the first area. The adsorption positions include: the inner edge of the border of the first area, the outer edge of the border of the first area, and a position outside the first area and at a distance less than a distance threshold from the border of the first area. Among them, the adsorption position can be changed. For example, in response to a drag operation on the format control, the format control is moved to the release position of the contact point of the drag operation, thereby shortening the length of the interaction path between the first area, the format control, and the second area, shortening the operation time, and improving the efficiency of format processing.

[0134] For example, when the document type is a table, refer to Figure 8A , Figure 8A This is the first schematic diagram of format application provided by the embodiments of the present application. Figure 8A In the left figure, the area 702 is used as the first area, that is, from the first row to the seventh row. In response to a selection operation on the first area 702 in the document display area 701, the format control 705 is displayed. That is to say, the format control 705 is displayed when receiving the selection operation on the first area 702, and is displayed at the lower right corner of the outer edge of the border of the first area. Of course, it can also be displayed at other positions of the first area, such as the inner edge of the border of the first area, or a position outside the first area and at a distance less than the distance threshold (such as a distance of 10 pixels) from the border of the first area, to indicate that the first area is the source area for extracting format parameters. At the same time, the adsorption position can be changed. For example, in response to a drag operation on the format control, the format control is moved to the release position of the contact point of the drag operation, thereby ensuring the fluency of the operation. When processing documents on a mobile device, large-scale operations are avoided, which is convenient for single-handed operation. Figure 8AIn the left figure, region 702 is used as the first region. Similarly, region 703 (lines 8 to 15) or region 704 (lines 16 to 24) can also be used as the first region.

[0135] Exemplarily, when the document type is Word, refer to Figure 8B , Figure 8B is the second schematic diagram of the format application provided by the embodiment of the present application. Figure 8B In the upper figure, region 802 is used as the first region, which includes the first sentence of the document. In response to a selection operation on the first region 802 in the document display region 801, the format control 805 is displayed. Figure 8B In the upper figure, region 802 is used as the first region. Similarly, region 803 (including the second sentence of the document) or region 804 (including the third sentence of the document) can also be used as the first region.

[0136] Exemplarily, when the document type is PPT, refer to Figure 8C , Figure 8C is the third schematic diagram of the format application provided by the embodiment of the present application. Figure 8C In the left figure, region 902 is used as the first region, that is, the first text box. In response to a selection operation on the first region 902 in the document display region 901, the format control 905 is displayed. Figure 8C In the left figure, region 902 is used as the first region. Similarly, region 903 (the second text box) or region 904 (the third text box) can also be used as the first region.

[0137] In some embodiments, the selection operation can have different forms. In a mobile terminal, the selection operation can be a box selection operation that simulates a mouse by clicking on the screen. For example, the position of the first click is used as one vertex of the diagonal of the selection box, press and hold without releasing, and continue to drag on the screen. The release position is used as the other vertex of the diagonal, and the position of the selection box is determined by the diagonal formed by the two vertices. In a personal computer (PC), the selection operation can be a box selection based on the mouse. For example, one vertex of the selection box is determined by clicking the mouse, and the range of the selection box is determined by continuing to hold and drag.

[0138] In some embodiments, the format control can have different styles. For example, at least one of the elements of an icon and text can be used. When the style of the format control is an icon, as Figure 8A shown, it can be in the shape of a straw, or it can also be icons such as a brush, a pen, a triangle, etc., which are not limited here; when the style of the format control is text, in response to a selection operation on the first region in the document display region, the words of the format control are displayed at the edge of the first region.

[0139] In step 103, in response to a triggering operation on the format control, format parameters of the first region are obtained.

[0140] In some embodiments, in response to a triggering operation on the format control, all format parameters of the first region can be automatically obtained, such as: font, font size, font color, background color, etc. In response to a triggering operation on the format control, all format parameters of the first region can be obtained. When the document type is a table, the format parameters further include cell width and height, style of the cell's bounding box, thickness of the cell's bounding box, font background color, and so on.

[0141] Exemplarily, when the document type is a table, in Figure 8A the left figure, in response to a triggering operation on format control 705, format parameters of the first region 702 are obtained. For example, the format parameters of the first region 702 include at least one of the following: font, font size, font color, background color, cell width and height, style of the cell's bounding box, thickness of the cell's bounding box, font background color.

[0142] Exemplarily, when the document type is Word, in Figure 8B the upper figure, in response to a triggering operation on format control 805, format parameters of the first region 802 are obtained. For example, the format parameters of the first region 802 include at least one of the following: font, font size, font color, font background color, font thickness, and font inclination degree.

[0143] Exemplarily, when the document type is PPT, in Figure 8C the left figure, in response to a triggering operation on format control 905, format parameters of the first region 902 are obtained. For example, the format parameters of the first region 902 include at least one of the following: font, font size, font color, picture size, picture color, and picture position.

[0144] In some embodiments, in step 103 of "obtaining format parameters of the first region", in addition to automatically obtaining all format parameters of the first region as described above, some or all of the format parameters can also be selected according to the user's setting. Refer to Figure 5B , Figure 5B which is the second process schematic diagram of the document processing method provided by the embodiments of the present application. Figure 5A In step 103 of "obtaining format parameters of the first region" in Figure 5B it can be implemented by executing steps 201 to 203 in

[0145] In step 201, a first list of format parameters is displayed, where the first list of format parameters includes multiple format parameters to be selected.

[0146] In some embodiments, the first format parameter list includes multiple format parameters to be selected, such as: font, background color of the selected area, font color, cell style, and so on. The displayed format parameters to be selected can be uniformly set format parameters, or can be part of the format parameters sorted in a specific order (such as name, most recent usage time, editing frequency). The displayed format parameters to be selected can be summarized according to the user's historical usage habits, for example: counting the format parameters set by the user during the operation of the reference document (such as the currently processed document, or the documents processed within a time window), such as the format parameters with a usage frequency higher than the frequency threshold.

[0147] For example, when the document type is a table, refer to Figure 12A , Figure 12A is the first schematic diagram of the first format parameter list provided by the embodiments of the present application. Figure 12A In the left diagram of Figure 12A In the right diagram of Figure 12A the format control 705 and the first format parameter list 715 are displayed. Among them, the first format parameter list 715 includes multiple format parameters to be selected, and the multiple format parameters to be selected include at least one of the following: font, background color, font color, and cell style.

[0148] For example, when the document type is Word, refer to Figure 12C , Figure 12C is the schematic diagram of selecting and applying the target format parameter provided by the embodiments of the present application. Figure \12C In the upper diagram of Figure 12C In the middle diagram of Figure 12C the format control 805 and the first format parameter list 811 are displayed. Among them, the first format parameter list 811 includes multiple format parameters to be selected, and the multiple format parameters to be selected include at least one of the following: font size, font weight, and font inclination degree.

[0149] For example, when the document type is PPT, refer to Figure 12D , Figure 12D is the second schematic diagram of the first format parameter list provided by the embodiments of the present application. Figure 12D In the left diagram of Figure 12DIn the right figure, the format control 905 and the first format parameter list 911 are shown. Among them, the first format parameter list 911 includes multiple format parameters to be selected, and the multiple format parameters to be selected include at least one of the following: font size, picture size, and picture position. Figure 12D Only some format parameters are shown in the right figure. The first format parameter list 911 may further include at least one of the following: font color, font thickness, and picture color.

[0150] In step 202, in response to the selection operation on the multiple format parameters to be selected in the first format parameter list, the selected format parameter is used as the target format parameter.

[0151] For example, when the document type is a table, in Figure 12A the right figure, in response to the selection operation on the multiple format parameters to be selected in the first format parameter list 715, the selected format parameter, such as the background color, is used as the target format parameter, and the corresponding checkbox is in the selected state. When there are multiple target format parameters, some of the format parameters to be selected can be selected, or all can be selected.

[0152] For example, when the document type is Word, in Figure 12C the middle bitmap, in response to the selection operation on the multiple format parameters to be selected in the first format parameter list 911, the selected format parameter, such as the font size, is used as the target format parameter, and the corresponding checkbox is in the selected state. When there are multiple target format parameters, some of the format parameters to be selected can be selected, or all can be selected.

[0153] For example, when the document type is PPT, in Figure 12D the right figure, in response to the selection operation on the multiple format parameters to be selected in the first format parameter list 911, the selected format parameter, such as the picture size, is used as the target format parameter, and the corresponding checkbox is in the selected state. When there are multiple target format parameters, some of the format parameters to be selected can be selected, or all can be selected.

[0154] In step 203, the target format parameter of the first area is obtained.

[0155] In some embodiments, after obtaining the target format parameter of the first area, the target format parameter is applied to the second area.

[0156] For example, when the document type is a table, refer to Figure 12B , Figure 12B is the first schematic diagram of applying the target format parameter provided by the embodiment of the present application. In Figure 12AIn the right figure, after determining the target format parameter through the first format parameter list 715, for example, taking the background color of the first region 702 as the target format parameter, obtaining this target format parameter, in Figure 12B the obtained target format parameter is applied to the second region 703, only changing the background color in the second region 703, and other format parameters in the second region 703 remain unchanged.

[0157] Exemplarily, when the document type is Word, refer to Figure 12C in Figure 12C in the middle bitmap, after determining the target format parameter through the first format parameter list 811, for example, the font size of the first region 802 can be taken as the target format parameter, obtaining this target format parameter, in Figure 12C in the lower bitmap, the obtained target format parameter is applied to the second region 803, only changing the font size in the second region 803, and other format parameters in the second region 803 remain unchanged.

[0158] Exemplarily, when the document type is PPT, refer to Figure 12E , Figure 12E is the second schematic diagram of applying the target format parameter provided by the embodiment of the present application. In Figure 12D in the right figure, after determining the target format parameter through the first format parameter list 911, for example, the picture size of the first region 902 can be taken as the target format parameter, obtaining this target format parameter, in Figure 12E the obtained target format parameter is applied to the second region 903, only changing the picture size in the second region 903, and other format parameters in the second region 903 remain unchanged.

[0159] In the embodiment of the present application, the format parameters of the obtained first region are selected through the first format parameter list, and the format parameters of the selected part or all can be determined by itself, improving the user experience and enhancing the flexibility of style application.

[0160] Continue to refer to Figure 5A , in step 104, in response to the selection operation for the second region in the document display area, the format parameters of the first region are applied to the second region.

[0161] In some embodiments, the first region is the source region for applying format parameters, that is, the source of format parameters, and the second region is the target region for applying format parameters, that is, the region for reusing the format parameters of the first region.

[0162] Exemplarily, when the document type is a table, refer to Figure 8AIn the right figure, in response to a selection operation on the second region 703 in the document display area 701, the format parameters of the first region 702 are applied to the second region 703. At this time, the format parameters of the second region 703 are the same as those of the first region 702.

[0163] Exemplarily, when the document type is Word, refer to Figure 8B In the lower figure, in response to a selection operation on the second region 803 in the document display area 801, the format parameters of the first region 802 are applied to the second region 803. At this time, the format parameters of the second region 803 are the same as those of the first region 802.

[0164] Exemplarily, when the document type is PPT, refer to Figure 8C In the right figure, in response to a selection operation on the second region 903 in the document display area 901, the format parameters of the first region 902 are applied to the second region 903. At this time, the format parameters of the second region 903 are the same as those of the first region 902.

[0165] In the embodiments of the present application, the format control can be displayed near the first region in an adsorbed manner or dragged arbitrarily, which solves the above-mentioned problems 1 and 2 existing in the related art. Compared with the related art that requires clicking the format brush in the toolbar, there is no need to repeatedly adjust the format parameters through the toolbar at the top of the document, shortening the distance between the format control and the reuse area. In response to the trigger operation on the format control, the update and reuse of the format parameters can be realized, which is more convenient and fast in operation, improves the efficiency of applying the format parameters, and realizes the continuity of the operation in the first region.

[0166] In the above example, when the document type is a table, as Figure 8A shown, the area 703 can be selected as the first region, and the area 704 as the second region; there can be multiple second regions. When the area 702 is the first region, one of the areas 703 or 704 can be selected as the second region. At this time, the selected area 703 or 704 is the target area for applying the format parameters; the areas 703 and 704 can also be selected in sequence. That is to say, both the areas 703 and 704 can be used as the second region, that is, both are used as the target areas for format application.

[0167] In the above example, when the document type is Word, as Figure 8BAs shown, area 803 can be selected as the first area, and area 804 as the second area; there can be multiple second areas. When area 802 is the first area, one of area 803 or area 804 can be selected as the second area. At this time, the selected area 803 or 804 is the target area for applying the format parameters; alternatively, area 803 and area 804 can be selected in sequence, that is to say, both area 803 and area 804 can be used as the second area, that is, both are the target areas for format application.

[0168] In the above example, when the document type is PPT, as Figure 8C shown, area 903 can be selected as the first area, and area 904 as the second area; there can be multiple second areas. When area 902 is the first area, one of area 903 or area 904 can be selected as the second area. At this time, the selected area 903 or 904 is the target area for applying the format parameters; alternatively, area 903 and area 904 can be selected in sequence, that is to say, both area 903 and area 904 can be used as the second area, that is, both are the target areas for format application.

[0169] In some embodiments, referring to Figure 5C , Figure 5C is the third process schematic diagram of the document processing method provided by the embodiments of the present application. Figure 5A Step 104 of " Figure 5A applying the format parameters of the first area to the second area" can be implemented through Figure 5C steps 1041 to 1044 of Figure 5C , which will be specifically described below.

[0170] In step 1041, multiple format parameters included in the first area are set as corresponding multiple middleware, where each middleware includes one format parameter.

[0171] For example, referring to Figure 9 , Figure 9 is the middleware schematic diagram provided by the embodiments of the present application. In Figure 9 , each format parameter is set as the corresponding middleware, where the format parameters include background, font, color, and line height, corresponding to four middleware respectively. Figure 9 These four middleware are shown in Figure 9 , and the middleware are all stored in the cache.

[0172] In step 1042, a mapping relationship between the multiple middleware and the format parameters included in the second area is generated.

[0173] In some embodiments, the format parameters of each in the first region are set to corresponding middleware, and each middleware has a binding relationship with the format parameters of the same type in the second region. That is to say, the format parameters of the first region form a binding relationship with the parameters of the same type in the second region through the middleware. The mapping relationship can be expressed as: <format parameter x in the first region; middleware x; format parameter x in the second region>, where x is the serial number of the format parameter, and the format parameters with the same serial number have the same type and are associated through the middleware with the same serial number.

[0174] As an example of the mapping relationship, all types of format parameters included in the first region are respectively set to corresponding multiple middleware. For example, the background is used as middleware 1, the font is used as middleware 2, the color is used as middleware 3, and the line height is used as middleware 4. Then, when the format parameter of the second region is the font, the binding relationship between the font corresponding to middleware 2 in the first region and the font in the second region is used as the mapping relationship, so that middleware 2 in the first region can map the font in the first region to the second region through the binding relationship.

[0175] In step 1043, multiple atomic operations are generated based on the mapping relationship, where each atomic operation is used to update a format parameter in the second region to the corresponding type of format parameter in the first region.

[0176] In some embodiments, according to the binding relationship between the middleware corresponding to each format parameter in the first region and the format parameters of the corresponding type in the second region, the format parameters included in each middleware in the first region are applied to the second region to update the format parameters in the second region. The process of updating the corresponding format parameters in the second region with the format parameters corresponding to the middleware in the first region according to the binding relationship is used as an atomic operation.

[0177] As an example, if the font included in the first region is used as a middleware, named middleware 2, through the binding relationship of <font in the first region: middleware 2: font in the second region>, the font in the first region is applied to the second region, where the atomic operation is the process of applying the font in the first region included in middleware 2 to the second region. Each format parameter corresponds to an atomic operation. As Figure 9 shown, middleware 1 (background), middleware 2 (font), middleware 3 (color), and middleware 4 (line height) each correspond to an atomic operation.

[0178] In step 1044, multiple atomic operations are executed.

[0179] In some embodiments, the atomic operations corresponding to each type of format parameter are executed, that is, each format parameter in the second region is updated to the corresponding type of format parameter in the first region.

[0180] In the embodiments of the present application, the format parameters of the second region are updated through atomic operations. Atomic operations are operations with the smallest granularity. When any one atomic operation has an error, the complete reuse of the format cannot be achieved. Only when all atomic operations are correct can the middleware in the first region be fully applied to the second region completely, ensuring the consistency of operations and avoiding the situation of partial modification success or partial modification failure.

[0181] In some embodiments, the format control also includes a style collection entry. When performing step 102, the following operations may also be performed: in response to a trigger operation for the style collection entry, display a first style to be collected, where the first style to be collected is formed by combining multiple format parameters obtained from the first region; display a setting control for the first style to be collected, used to set the name and style type, where different style types correspond to different style lists; in response to a setting operation based on the setting control, store the attributes of the first style to be collected; store the first style to be collected into the style list in the style library.

[0182] Exemplarily, when the document type is a table, refer to Figure 10A , Figure 10A is the first structural schematic diagram of the format control provided by the embodiments of the present application. In Figure 10A , the format control 705 includes a style collection entry 714. Refer to Figure 10B , Figure 10B is the schematic diagram of the first style to be collected provided by the embodiments of the present application. In response to a trigger operation for the style collection entry 714 in Figure 10A , display Figure 10B the first style to be collected 718 in, display the setting control 717 for the first style to be collected, where the setting control 717 can be used to set the name and style type of the first style to be collected 718, and different style types correspond to different style lists. In response to a setting operation based on the setting control 717, store the format parameters of the first style to be collected 718. Refer to Figure 10C , Figure 10C is the schematic diagram of the style list in the style library provided by the embodiments of the present application. In Figure 10C , in response to a setting operation for the setting control 717 in Figure 10B , store Figure 10B the first style to be collected 718 in Figure 10C into the style list of the style library 716 in

[0183] Exemplarily, when the document type is Word, refer to Figure 10D , Figure 10D is the first application schematic diagram of format collection provided by the embodiments of the present application. In Figure 10DIn the upper diagram, the format control 805 includes a style collection entry 806. In response to a trigger operation on the style collection entry 806, in Figure 10D the middle diagram, the first style to be collected 807 and the setting control 808 for the first style to be collected are displayed. Among them, the setting control 808 can be used to set the name and style type of the first style to be collected 807. Different style types correspond to different style lists. In response to a setting operation based on the setting control 808, in Figure 10D the lower diagram, the first style to be collected 807 is stored in the style list of the style library 809.

[0184] For example, when the document type is PPT, refer to Figure 10E , Figure 10E which is the second structural schematic diagram of the format control provided by the embodiment of the present application. In Figure 10E , the format control 905 includes a style collection entry 906. Refer to Figure 10F , Figure 10F which is the second application schematic diagram of format collection provided by the embodiment of the present application. In response to a trigger operation on the style collection entry 906 in Figure 10E , in the left diagram of Figure 10F , the first style to be collected 907 and the setting control 908 for the first style to be collected are displayed. Among them, the setting control 908 can be used to set the name and style type of the first style to be collected 907. Different style types correspond to different style lists. In response to a setting operation based on the setting control 908, in Figure 10F the right diagram, the first style to be collected 907 is stored in the style list of the style library 909.

[0185] In some embodiments, after applying the format parameters of the first region to the second region in response to a selection operation on the second region in the document display area, the following operations can also be performed: In response to a trigger operation on the style collection entry, display the second style to be collected, where the second style to be collected is formed by combining multiple format parameters obtained from the second region, and store the second style to be collected in the style list of the style library. Among them, when the document type is a table, the process of storing the second style to be collected in the style list of the style library is the same as that shown in the above Figures 10A to 10C ; when the document type is Word, the process of storing the second style to be collected in the style list of the style library is the same as that shown in the above Figure 10D ; when the document type is PPT, the process of storing the second style to be collected in the style list of the style library is similar to that shown in the above Figures 10E to 10F .

[0186] In the embodiments of the present application, by setting a favorite entry, the rapid reuse of document styles can be realized. For the favorite styles, through the triggering operation in the style library, the selected style can be quickly applied to the document, improving the efficiency of format application and enhancing the user experience.

[0187] In some embodiments, when performing step 102, the following operations may also be performed: display a thumbnail control for the first area, where the thumbnail control is used to be displayed following the format control before receiving a selection operation, to prompt that the format parameters of the first area will be applied to the second area selected by the selection operation. After displaying the thumbnail control, proceed to perform step 103 and step 104.

[0188] Exemplarily, when the document type is a table, refer to Figure 11A , Figure 11A which is the first schematic diagram of the thumbnail control provided by the embodiments of the present application. In Figure 11A the left diagram, in response to a selection operation for the first area 702 in the document display area 701, display the format control 705. In Figure 11A the right diagram, when displaying the format control 705 in the left diagram of Figure 11A , the thumbnail control 706 of the first area 702 may also be displayed. The thumbnail control 706 is used to display the thumbnail of the selected area (i.e., the first area 702), to prompt that the format parameters of the first area 702 will be applied to the second area 703 selected by the selection operation. After displaying the thumbnail control 706, proceed to perform step 103 and step 104.

[0189] Exemplarily, when the document type is Word, refer to Figure 11B , Figure 11B which is the second schematic diagram of the thumbnail control provided by the embodiments of the present application. In Figure 11B the upper diagram, in response to a selection operation for the first area 802 in the document display area 801, display the format control 805. In Figure 11B the lower diagram, when displaying the format control 805 in the left diagram of Figure 11B , the thumbnail control 810 of the first area 802 may also be displayed. The thumbnail control 810 is used to display the thumbnail of the selected area (i.e., the first area 802), to prompt that the format parameters of the first area 802 will be applied to the second area 803 selected by the selection operation. After displaying the thumbnail control 810, proceed to perform step 103 and step 104.

[0190] Exemplarily, when the document type is PPT, refer to Figure 11C , Figure 11C which is the third schematic diagram of the thumbnail control provided by the embodiments of the present application. In Figure 11CIn the left figure of FIG, in response to the selection operation of the first area 902 in the document display area 901, the format control 905 is displayed. Figure 11C In the figure on the right, Figure 11C When the format control 905 in the left figure is displayed, a thumbnail control 910 for the first area 902 can also be displayed. Thumbnail control 910 is used to display a thumbnail of the selected area (i.e., first area 902) to indicate that the format parameters of first area 902 will be applied to the second area 903 selected by the selection operation. After the thumbnail control 910 is displayed, the process proceeds to steps 103 and 104.

[0191] The embodiment of the present application uses a thumbnail control to preview the format of the selected area in the thumbnail before format reuse, which solves problem 3 of the above-mentioned related technology. After confirming that the preview effect is correct, format reuse is performed, reducing error correction costs.

[0192] In some embodiments, after obtaining the format parameters of the first region, the format parameters of the first region may be adjusted, and the adjusted format parameters may be applied to the second region. Figure 5D , Figure 5D This is a fourth flow chart of the document processing method provided by the embodiment of the present application. Figure 5A After step 103 "Get the format parameters of the first region", you can execute Figure 5D Steps 301 to 302 are described in detail below.

[0193] In step 301 , an editing toolbar is displayed, wherein the editing toolbar includes a plurality of editing controls, and the plurality of editing controls respectively correspond to a plurality of format parameters of the first area.

[0194] For example, when the document type is table, see Figure 13A , Figure 13A This is a first schematic diagram of displaying an editing toolbar in the first area provided by an embodiment of the present application. Figure 13A In the left figure of FIG, after obtaining the format parameters of the first area 702, the format control 705 is displayed. Figure 13A In the right figure, the format control 705 also includes an editing toolbar 712, and the editing toolbar 712 includes multiple editing controls: a background color editing control 707, a font size editing control 708, a font editing control 709, a font color editing control 710, and a cell size editing control 711, each of which corresponds to a format parameter in the first area 702.

[0195] For example, when the document type is Word, see Figure 13B , Figure 13BThis is the second schematic diagram provided by an embodiment of the present application for displaying an editing toolbar in a first area. In Figure 13B In the upper diagram, after obtaining the format parameters of the first area 802, a format control 805 is displayed. In Figure 13B In the lower diagram, the format control 805 further includes an editing toolbar 812. The editing toolbar 812 includes multiple editing controls: a background color editing control 813, a font editing control 814, a font size editing control 815, a font color editing control 816, and a font spacing editing control 817. Each editing control corresponds to a format parameter in the first area 802.

[0196] Exemplarily, when the document type is PPT, refer to Figure 13C , Figure 13C This is the third schematic diagram provided by an embodiment of the present application for displaying an editing toolbar in a first area. In Figure 13C In the left diagram, after obtaining the format parameters of the first area 902, a format control 905 is displayed. In Figure 13C In the right diagram, the format control 905 further includes an editing toolbar 912. The editing toolbar 912 includes multiple editing controls: a background color editing control 913, a font editing control 914, a font size editing control 915, a font color editing control 916, and a font spacing editing control 917. Each editing control corresponds to a format parameter in the first area 902.

[0197] In step 302, in response to an editing operation based on a target editing control, update the format parameter in the obtained format parameters of the first area that corresponds to the target editing control, where the target editing control is any one of the editing controls.

[0198] In some embodiments, when updating the format parameter in the obtained format parameters of the first area that corresponds to the target editing control in response to an editing operation based on the target editing control, step 104 "applying the format parameters of the first area to the second area" may further perform the following operation: applying the updated format parameters of the first area to the second area.

[0199] Exemplarily, when the document type is a table, refer to Figure 14A , Figure 14A This is the first schematic diagram provided by an embodiment of the present application for changing format parameters through an editing control. In Figure 14A In the left diagram, when the editing toolbar 712 is displayed, use the background color editing control 707 in the editing toolbar 712 as the target editing control. After selecting one of the background colors, refer to Figure 14A In the right diagram, apply the updated format parameters of the first area 702 to the second area 703. The background in the second area 703 has been changed to Figure 14AFor the selected background in the left figure, except for the background, other format parameters reuse the format parameters of the first region 702.

[0200] For example, when the document type is Word, refer to Figure 14C , Figure 14C This is the second schematic diagram provided by the embodiment of the present application for changing format parameters through an editing control. In Figure \14C In the upper figure of Figure 14C , when the editing toolbar 812 is displayed, the font editing control 814 in the editing toolbar 812 is used as the target editing control. After selecting the font as "STXingkai", refer to Figure 14C In the lower figure of

[0201] the format parameters of the updated first region 802 are applied to the second region 803. The font in the second region 803 has been changed to Figure 14D , Figure 14D the font selected in the upper figure of Figure 14D In the left figure of Figure 14D , when the editing toolbar 912 is displayed, the font editing control 914 in the editing toolbar 912 is used as the target editing control. After selecting the font as "STXingkai", refer to Figure 14D In the right figure of

[0202] In some embodiments, before obtaining the format parameters of the first region, the target format parameters can be selected in combination with the user's historical operation data. For example, through artificial intelligence technology, based on the user's operations on historical documents or the frequency of used styles, the format parameters to be selected in the current document can be predicted through a prediction model, and then the predicted format parameters are applied to the second region as the target format parameters.

[0203] After the embodiment of the present application obtains the format parameters of the first region, it displays an editing toolbar and updates the obtained format parameters of the first region through the editing toolbar, solving problem 4 existing in the above related technologies. Compared with the related technologies that need to repeatedly return to the toolbar to find the corresponding editing tool to change the format parameters, the editing toolbar appears after obtaining the format parameters of the first region, shortening the editing distance, saving editing time, and improving usability.

[0204] In some embodiments, in response to a region selection operation in a first region, a selected target region, i.e., a sub-region of the first region, can be highlighted. In response to an editing operation based on a target editing control, format parameters corresponding to the target editing control in the first region or the target region in the first region are updated. At this time, step 104, "applying the format parameters of the first region to the second region", can further perform the following operation: applying the format parameters after only updating the target region to the second region.

[0205] For example, refer to Figure 14B , Figure 14B which is a schematic diagram of the application for changing the format parameters of a target region provided by an embodiment of the present application. In Figure 14B the left diagram of, taking the selection of the first region 702 as an example, in response to a region selection operation in the first region 702, the selected target region 716, i.e., a sub-region of the first region (the 5th row of the table), is highlighted. In response to an editing operation based on the target editing control 707 (changing the background color), the format parameters corresponding to the target editing control 707 in the target region 716 are updated. In the right diagram of FIG. 14, the updated format parameters of the first region 702 are applied to the second region 703. Only the format parameters of the target region 716 are changed. Therefore, for the second region 703, only the background color of the 11th row is different from the format parameters of the first region, and the rest of the format parameters are the same as those of the first region.

[0206] In some embodiments, applying the format parameters of the first region to the second region is achieved by performing multiple atomic operations. Refer to Figure 5E , Figure 5E which is the fifth flowchart of the document processing method provided by an embodiment of the present application. Figure 5D Step 302, "updating the format parameters corresponding to the target editing control" in, can be implemented by Figure 5E steps 3021 to 3022 in, which are specifically described below.

[0207] In step 3021, the updated format parameters set through the target editing control and the position of the application area of the updated format parameters are obtained.

[0208] In some embodiments, the application area can be the first region or the above-mentioned target region.

[0209] In step 3022, the updated format parameters and the position of the application area are stored as an object, and multiple atomic operations are updated based on the object, where each atomic operation is used to update a format parameter of the second region to the corresponding type of format parameter of the first region.

[0210] In some embodiments, the updated format parameters and the location of the application area of the updated format parameters are obtained, the obtained updated format parameters and location are used as an object, and the object is placed into the atomic operation before the unupdated format parameters to update the atomic operation, where the multiple updated atomic operations may be the multiple atomic operations generated based on the mapping relationship in step 1043.

[0211] In the embodiments of the present application, different format parameters are set as different middleware, and through the design pattern of the middleware, decoupling from the cache is achieved, and the format parameters are independent of each other. When any format parameter needs to be added, reduced, or modified, when one format parameter is modified, the use of other format parameters is not affected, and it can support the quick modification of some of the multiple extracted format parameters.

[0212] In some embodiments, refer to Figure 5F , Figure 5F is the sixth process schematic diagram of the document processing method provided by the embodiments of the present application. After Figure 5A step 103 "obtain the format parameters of the first area" in Figure 5F , steps 401 to 403 in

[0213] can also be executed, which will be specifically described below.

[0214] In step 401, the first area is split into multiple content units, and the multiple format parameters applied in each content unit are concatenated into a string.

[0215] In some embodiments, step 401 can be implemented in the following several ways:

[0216] Way 1: When the document is a table document, the first area is divided with at least one cell as a content unit, and the first area is split into multiple content units.

[0217] Way 2: When the document is a text document, the first area is divided with at least one line or at least one natural sentence as a content unit, and the first area is split into multiple content units.

[0218] For example, the sizes of different content units can be fixed values or can be adaptively adjusted according to the size of the first area. Taking the document as a table as an example, one cell can be used as a content unit, or two cells can be used as a content unit. Taking the document as a Word as an example, one natural sentence can be used as a content unit. Taking the document as a PPT as an example, one text box can be used as a content unit. Figure 5G , Figure 5G is the seventh process schematic diagram of the document processing method provided by the embodiments of the present application. Figure 5FStep 401 of "concatenating multiple format parameters applied in each content unit into a string" can be implemented by executing Figure 5G from step 4011 to step 4012, which will be specifically described below.

[0219] In step 4011, multiple format parameters applied to the content in the content unit are sorted according to a specific priority to form a string.

[0220] In some embodiments, taking a document as a table as an example, the specific priority can be: font, background, line height, line width, and color; taking a document as Word as an example, the specific priority can be: font, font color, font size, and line spacing; taking a document as PPT as an example, the order of the specific priority from high to low can be: font, font size, picture size, picture position.

[0221] In step 4012, multiple format parameters included in each content unit are concatenated to obtain the string corresponding to the content unit.

[0222] In some embodiments, taking a document as a table as an example, the format parameters included in the data structure of the above content unit can be concatenated, that is, the font, background color, font size, and font color of the content unit are concatenated to obtain the string corresponding to the content unit; taking a document as Word as an example, the format parameters included in the data structure of the above content unit can be concatenated, that is, the font, font color, font size, and line spacing of the content unit are concatenated to obtain the string corresponding to the content unit; taking a document as PPT as an example, the format parameters included in the data structure of the above content unit can be concatenated, that is, the font, font size, picture size, and picture position of the content unit are concatenated to obtain the string corresponding to the content unit.

[0223] Exemplarily, taking a document as a table as an example, the string corresponding to the content unit can be: font - background color - cell width and height - font color; taking a document as Word as an example, the string corresponding to the content unit can be: font - font color - font size - line spacing; taking a document as PPT as an example, the string corresponding to the content unit can be: font - font size - picture size - picture position.

[0224] Continue to refer to Figure 5F , in step 402, determine the repeating sequences of the strings respectively corresponding to multiple content units.

[0225] In some embodiments, calculate the longest common subsequence (i.e., the smallest common repeatable region) of the strings respectively corresponding to different content units, and use the longest common subsequence as the repeating sequence.

[0226] In some embodiments, referring to Figure 5H , Figure 5H is the eighth process schematic diagram of the document processing method provided by the embodiments of the present application. Figure 5F Step 402 of Figure 5H can be implemented by steps 4021 to 4023 of

[0227] In step 4021, the strings respectively corresponding to multiple content units in the first region are stored in a two-dimensional array.

[0228] In some embodiments, taking the document as a table as an example, taking a cell as a content unit, traversing all the content units in the first region row by row and column by column, and sequentially storing the strings respectively corresponding to each content unit in the first region in the two-dimensional array in order, wherein the storage order is determined by the position of the content unit.

[0229] In step 4022, determine the target step length in the two-dimensional array, wherein the format parameters of the content units included in the target step length are the same as those of the content units included in the previous step length.

[0230] Exemplarily, first traverse the first region, store the style results of the cells in each row into a two-dimensional array, and save the result of the two-dimensional array; then traverse the two-dimensional array to find the smallest common repeatable region in each row: traverse the format parameters of each row, start a loop with a step length of 0 until a smallest step length is found, that is, the target step length, wherein the smallest step length can satisfy that the format parameters of each content unit in the step length are the same as those of the corresponding content unit in the previous step length at the corresponding position.

[0231] In step 4023, use the sequence in the string included in the target step length as the repeated sequence in the strings respectively corresponding to multiple content units.

[0232] In some embodiments, the target step length is also the smallest step length obtained in the above embodiments, that is, the smallest common subsequence between different strings, and the obtained smallest common subsequence is used as the repeated sequence.

[0233] Continue to refer to Figure 5F , in step 403, store the format parameters of the first region into the cache space based on the repeated sequence.

[0234] In some embodiments, when there are a large number of repetitions in the format parameters of the content units in the first region, only the repeated sequence can be stored in the cache space.

[0235] In some embodiments, after storing the format parameters of the first region into the cache space based on the repeated sequence, the format parameters of the first region stored in the cache control are applied to the second region.

[0236] In some embodiments, first traverse the first region, store the style results of the cells in each row into a two-dimensional array, and save the results of the two-dimensional array; then traverse the two-dimensional array to find the smallest common repeatable region in each row: traverse the format parameters of each row, start a loop with a step size of 0 until a smallest step size is found, where the smallest step size can satisfy that each style key in the step size is the same as the corresponding position style key in the previous step size.

[0237] Embodiments of the present application solve the above-mentioned problem 5 by concatenating the format parameters included in the content unit into a string to ensure that all format parameters in the document can be stored. Compared with the related art that can only extract partial format parameters, it avoids the incomplete reuse of format parameters, making the effects the same for different types of documents, different object types, and even different selection methods, improving the consistency of document processing; by obtaining the repeated sequence, when there are a large number of repeated formats in the first region of the document, only the repeated sequence needs to be stored, without storing all format parameters into the cache space, improving the application efficiency of the format control and reducing the application memory.

[0238] In some embodiments, refer to Figure 5I , Figure 5I is the ninth process schematic diagram of the document processing method provided by the embodiments of the present application. Before Figure 5A step 104 “Apply the format parameters of the first region to the second region” in Figure 5I , steps 501 to 502 in

[0239] are executed, which are specifically described below.

[0240] In step 501, display a second format parameter list, where the second format parameter list includes multiple format parameters obtained from the first region.

[0241] Exemplarily, when the document type is a table, refer to Figure 15A , Figure 15A is the first application schematic diagram of the second format parameter list provided by the embodiments of the present application. In Figure 15AIn the left figure, before applying the format parameters of the first region 702 to the second region 703, a second format parameter list 714 is displayed. The second format parameter list 714 includes multiple format parameters obtained from the first region 702: font, background color, font color, and cell style. Figure 15A Only some format parameters are shown. The second format parameter list 714 may also include other format parameters, such as: font size, border style, line thickness, and so on.

[0242] Exemplarily, when the document type is Word, refer to Figure 15B , Figure 15B is the second application schematic diagram of the second format parameter list provided by the embodiment of the present application. In Figure 15B In the upper figure, before applying the format parameters of the first region 802 to the second region 803, a second format parameter list 818 is displayed. The second format parameter list 818 includes multiple format parameters obtained from the first region 802. The multiple obtained format parameters include at least one of the following: font size, font weight, and font inclination degree. Figure 15B Only some format parameters are shown in the upper figure. The second format parameter list 818 may also include other format parameters. The other format parameters include at least one of the following: font, font color, and line spacing.

[0243] Exemplarily, when the document type is PPT, refer to Figure 15C , Figure 15C is the third application schematic diagram of the second format parameter list provided by the embodiment of the present application. In Figure 15C In the left figure, before applying the format parameters of the first region 902 to the second region 903, a second format parameter list 918 is displayed. The second format parameter list 918 includes multiple format parameters obtained from the first region 902. The multiple obtained format parameters include at least one of the following: font size, picture size, and picture position. Figure 15C Only some format parameters are shown in the left figure. The second format parameter list 918 may also include other format parameters. The other format parameters include at least one of the following: font, font color, and picture color.

[0244] In step 502, in response to the selection operation of the format parameters in the second format parameter list, the selected format parameters are placed in the selected state.

[0245] In some embodiments, after placing the selected format parameters in the selected state in response to the selection operation of the format parameters in the second format parameter list, "applying the format parameters of the first region to the second region" in step 104 can also be achieved in the following manner: in response to the application operation of the format parameters of the first region, the format parameters in the selected state are applied to the second region.

[0246] For example, when the document type is a table, in response to Figure 15A In the second format parameter list 714 in the left figure, the selection operation of the format parameter can be displayed by checking the box after the format parameter to put the selected format parameter into the selected state. When all format parameters need to be selected, it can be achieved by checking the box to select all. Figure 15A In the right figure, in response to the application operation of the format parameters of the first area 702, the selected format parameters are applied to the second area 703. When all the format parameters in the second format parameter list are selected, the second area 703 reuses all the format parameters of the first area 702.

[0247] For example, when the document type is Word, in response to Figure 15B The selection operation of the format parameters in the second format parameter list 818 in the upper image can be displayed by checking the box after the format parameter to put the selected format parameter in the selected state. When all format parameters need to be selected, it can be achieved by checking the box to select all. Figure 15B In the lower bitmap, in response to the application operation of the format parameters of the first area 802, the selected format parameters are applied to the second area 803. When all the format parameters in the second format parameter list are selected, the second area 803 reuses all the format parameters of the first area 802.

[0248] For example, when the document type is PPT, in response to Figure 15C In the second format parameter list 918 in the left figure, the selection operation of the format parameter can be displayed by checking the box after the format parameter to put the selected format parameter in the selected state. When all format parameters need to be selected, it can be achieved by checking the box to select all. Figure 15C In the right figure, in response to the application operation of the format parameters of the first area 902, the selected format parameters are applied to the second area 903. When all the format parameters in the second format parameter list are selected, the second area 903 reuses all the format parameters of the first area 902.

[0249] In some embodiments, see Figure 5J , Figure 5J[[END This is the tenth flow chart of the document processing method provided by the embodiment of the present application. ​ Before step 104 "applying the format parameters of the first area to the second area", you can also perform ​ Steps 601 to 602 are described in detail below.

[0250] In step 601, a preview control is displayed. The preview control includes a second area to which the format parameters of the first area are applied, and the preview control further includes a format application entry.

[0251] In some embodiments, the preview control further includes a cancellation entry.

[0252] Exemplarily, when the document type is a table, refer to ​ , ​ which is the first application schematic diagram of the preview control provided by the embodiments of the present application. In ​ the left diagram of, before applying the format parameters of the first area 702 to the second area 703, a preview control 720 is displayed. The preview control 720 displays the extracted format parameters of the first area 702. The preview control 720 includes a format application entry 721 and a cancellation entry 722.

[0253] Exemplarily, when the document type is Word, refer to ​ , ​ which is the second application schematic diagram of the preview control provided by the embodiments of the present application. In ​ the upper diagram of, before applying the format parameters of the first area 802 to the second area 803, a preview control 819 is displayed. The preview control 819 displays the extracted format parameters of the first area 802. The preview control 819 includes a format application entry 820 and a cancellation entry 821.

[0254] Exemplarily, when the document type is PPT, refer to ​ , ​ which is the third application schematic diagram of the preview control provided by the embodiments of the present application. In ​ the left diagram of, before applying the format parameters of the first area 902 to the second area 903, a preview control 919 is displayed. The preview control 919 displays the extracted format parameters of the first area 902. The preview control 919 includes a format application entry 920 and a cancellation entry 921.

[0255] In step 602, in response to a trigger operation on the format application entry, the step of applying the format parameters of the first area to the second area is executed.

[0256] In some embodiments, in response to a trigger operation on the cancellation entry, the step of applying the format parameters of the first area to the second area is no longer executed.

[0257] Exemplarily, when the document type is a table, in ​ the left diagram of, in response to a trigger operation on the format application entry 721, in Figure 16A the right diagram of, the format parameters of the first area 702 are applied to the second area 703. InFigure 16A In the left diagram of, in response to a trigger operation for the cancellation entry 722, in Figure 16A In the right diagram of, release the format parameters of the extracted first region 702, and no longer apply the format parameters of the first region 702 to the second region 703, and the format parameters of the second region 703 are not updated.

[0258] For example, when the document type is Word, in Figure 16B In the upper diagram of, in response to a trigger operation for the format application entry 820, in Figure 16B In the lower diagram of, apply the format parameters of the first region 802 to the second region 803. In Figure 16B In the upper diagram of, in response to a trigger operation for the cancellation entry 821, release the format parameters of the extracted first region 802, and no longer apply the format parameters of the first region 802 to the second region 803, and the format parameters of the second region 803 are not updated.

[0259] For example, when the document type is PPT, in Figure 16C In the left diagram of, in response to Figure 16C A trigger operation for the format application entry 920 in the left diagram of, in Figure 16C In the right diagram of, apply the format parameters of the first region 902 to the second region 903. In Figure 16C In the left diagram of, in response to a trigger operation for the cancellation entry 722, in Figure 16C In the right diagram of, release the format parameters of the extracted first region 902, and no longer apply the format parameters of the first region 902 to the second region 903, and the format parameters of the second region 903 are not updated.

[0260] In some embodiments, the format control includes a style library entry, see Figure 5K , Figure 5K Is the eleventh process schematic diagram of the document processing method provided by the embodiments of the present application. After Figure 5A Step 104 "Apply the format parameters of the first region to the second region" of, execute Figure 5K Steps 831 to 832 of, which are specifically described below.

[0261] In step 831, in response to a trigger operation for the style library entry, display the style list of the style library, where the style list includes multiple styles, and each style includes multiple format parameters.

[0262] For example, when the document type is a table, see Figure 17A , Figure 17A Is the first schematic diagram of the style library entry provided by the embodiments of the present application. In Figure 17AIn [reference], after applying the format parameters of the first region 702 to the second region 703, the displayed format control 705 further includes a style library entry 713. Refer to Figure 17B , Figure 17B which is the first application schematic diagram of the styles in the style list provided by the embodiments of the present application. In response to the triggering operation on the style library entry 713 in Figure 17A , in the left diagram of Figure 17B , a style list in the style library 716 is displayed, where the style list includes multiple styles, such as style 719, and each style includes multiple format parameters.

[0263] For example, when the document type is Word, refer to Figure 17C , Figure 17C which is the schematic diagram of style application provided by the embodiments of the present application. In the upper diagram of Figure 17C , after applying the format parameters of the first region 802 to the second region 803, the displayed format control 805 further includes a style library entry 822. In response to the triggering operation on the style library entry 822, in the left diagram of Figure 17B , a style list in the style library 809 is displayed, where the style list includes multiple styles, such as style 823, and each style includes multiple format parameters.

[0264] For example, when the document type is PPT, refer to Figure 17D , Figure 17D which is the second schematic diagram of the style library entry provided by the embodiments of the present application. In Figure 17D , after applying the format parameters of the first region 902 to the second region 903, the displayed format control 905 further includes a style library entry 922. Refer to Figure 17E , Figure 17E which is the second application schematic diagram of the styles in the style list provided by the embodiments of the present application. In Figure 17D , in response to the triggering operation on the style library entry 922, in the left diagram of Figure , a style list in the style library 909 is displayed, where the style list includes multiple styles, such as style 923, and each style includes multiple format parameters.

[0265] In step 832, in response to the selection operation on the styles in the style list, the multiple format parameters included in the selected style are applied to the second region.

[0266] For example, when the document type is a table, in the left diagram of ​ , in response to the selection operation on style 719 in the style list, in the right diagram of ​ , the multiple format parameters included in style 719 are applied to the second region 703.

[0267] Exemplarily, when the document type is Word, in ​ the median graph of, in response to a selection operation on style 823 in the style list, in ​ the lower graph of, a plurality of format parameters included in style 823 are applied to the second region 803.

[0268] Exemplarily, when the document type is PPT, in ​ the left graph of, in response to a selection operation on style 923 in the style list, in ​ the right graph of, a plurality of format parameters included in style 923 are applied to the second region 903.

[0269] In some embodiments, referring to ​ , ​ is the twelfth process schematic diagram of the document processing method provided by the embodiments of the present application. After ​ step 104 “Apply the format parameters of the first region to the second region” of, steps 931 to 932 of ​ can also be executed, which will be specifically described below.

[0270] In step 931, an editing toolbar is displayed, where the editing toolbar includes a plurality of editing controls, and the plurality of editing controls respectively correspond to a plurality of format parameters of the second region.

[0271] Exemplarily, when the document type is a table, referring to ​ , ​ is the first schematic diagram of changing format parameters of the second region through the editing toolbar provided by the embodiments of the present application. In ​ the left graph of, after applying the format parameters of the first region 702 to the second region 703, an editing toolbar 712 is displayed. The editing toolbar 712 includes a plurality of editing controls: a background color editing control 707, a font size editing control 708, a font editing control 709, a font color editing control 710, and a cell width and height editing control 711, where each editing control respectively corresponds to a format parameter in the second region 703.

[0272] Exemplarily, when the document type is Word, referring to FIG. 18B, FIG. 18B is the second schematic diagram of changing format parameters of the second region through the editing toolbar provided by the embodiments of the present application. In the upper graph of FIG. 18B, after applying the format parameters of the first region 802 to the second region 803, an editing toolbar 812 is displayed. The editing toolbar 812 includes a plurality of editing controls: a background color editing control 813, a font editing control 814, a font size editing control 815, a font color editing control 816, and a font spacing editing control 817, where each editing control respectively corresponds to a format parameter in the second region 803.

[0273] Exemplarily, when the document type is PPT, refer to ​ , ​ It is the third schematic diagram of changing format parameters of the second region provided by the embodiments of the present application through the editing toolbar. In ​ In the left diagram of, after applying the format parameters of the first region 902 to the second region 903, an editing toolbar 912 is displayed. The editing toolbar 912 includes multiple editing controls: a background color editing control 913, a font editing control 914, a font size editing control 915, a font color editing control 916, and a font spacing editing control 917. Among them, each editing control corresponds to a format parameter in the second region 903 respectively.

[0274] In step 932, in response to an editing operation on the second region based on the editing control, update the format parameter corresponding to the target editing control for the second region.

[0275] Exemplarily, when the document type is a table, in ​ In the left diagram of, in response to an editing operation on the second region 703 based on the editing control, for example, taking the background color editing control 707 as the target editing control, based on a background color in the background color editing control 707, in ​ In the right diagram of, change the format parameter corresponding to the background color in the second region 703 and apply it in the second region 703.

[0276] Exemplarily, when the document type is Word, in the upper diagram of Fig. 18B, in response to an editing operation on the second region 803 based on the editing control, for example, taking the font editing control 814 as the target editing control, based on a font in the font editing control 814, such as "STXingkai", in the lower diagram of Fig. 18B, change the format parameter corresponding to the font in the second region 803 and apply the font of "STXingkai" in the second region 803.

[0277] Exemplarily, when the document type is PPT, in ​ In the left diagram of, in response to an editing operation on the second region 903 based on the editing control, for example, taking the font editing control 914 as the target editing control, based on a font in the font editing control 914, such as "STXingkai", in ​ In the right diagram of, change the format parameter corresponding to the font in the second region 903 and apply the font of "STXingkai" in the second region 903.

[0278] In some embodiments, in response to a region selection operation in the second region, the selected target region, i.e., a sub-region of the second region, is highlighted; in response to an editing operation on the second region based on an editing control, the format parameters corresponding to the target editing control are updated for the second region or the target region in the second region. That is, after applying the format parameters of the first region to the second region, the format parameters of the second region can be further adjusted.

[0279] Exemplarily, the schematic diagram of the update operation of the format parameters for the target region is the same as that shown above. ​ as shown.

[0280] In some embodiments, referring to ​ , ​ is a schematic flowchart of a document processing method provided by an embodiment of the present application.

[0281] First, a document display area is displayed. The document display area includes a first region and a second region. The first region serves as a reference region, and the second region serves as an application region.

[0282] Second, a format control is displayed. In response to a selection operation on the first region in the document display area, the format control is displayed. When the format control is displayed, a thumbnail interface of the first region is displayed beside the format control.

[0283] Next, the format parameters of the first region are extracted and cached in memory. The difficulty in caching in the format control is that if the selected region is too large, it will occupy a large amount of application memory. For example, when the selected region is the entire table and the corresponding format parameters need to be extracted, if each node is cached, the memory will directly double at this time. Therefore, it is necessary to find the smallest common repeatable region of the content units of the first region.

[0284] Then, it is determined whether the format parameters in the cache have been modified. If the style has been modified, the format parameters in the cache are updated; if the style has not been modified, they are directly applied to the second region.

[0285] Finally, the format parameters are applied to the second region. If the cached style has been modified, the style of the first region is mapped to the second region through the atomic operation obtained after modification.

[0286] Exemplarily, referring to ​ , ​It is a logical schematic diagram of format application provided by an embodiment of the present application. When the cell style selected by the format control is not modified, a reuse operation (CopyPasteMutation) is generated to update the format parameters of the cell. CopyPasteMutation describes the mapping relationship between the first region and the second region; when the user updates the format parameters of the cell selected by the format control, that is, updates the memory cache, then an update operation (setRangeMutation) is generated to update the format parameters of the cell. setRangeMutation updates the format parameters of the final format control by describing the one-to-one mapping of the format parameters of the cell, where the function for generating the update operation (generatesetRangeMutation) represents the production operation.

[0287] In some embodiments, in response to different operations being performed on the document simultaneously, after coordination through the network layer, conflict handling logic needs to be executed. Refer to ​ , ​ It is a schematic diagram of the principle of the conflict handling logic algorithm provided by an embodiment of the present application. In ​ , a series of atomic operations generated by user A's operation are named op1, and a series of atomic operations generated by user B's operation are named op2. When op1 and op2 conflict, the respective conflicted op2' and op1' are applied, so that the final effects seen by user A and user B are the same.

[0288] Exemplarily, as shown in Tables 1 to 4, Table 1 is the original table, Table 2 is that user A inserts the numbers 1 to 4 in sequence from the 2nd to the 5th rows of the second column, Table 3 is that user B moves the contents of the third and fourth rows of the first column down one row respectively, and Table is the final result shown when user A and user B perform the operations in Tables 2 and 3 simultaneously, that is, when user A and user B perform different operations on the table simultaneously, after conflict handling, user A and user B finally see the same result after retaining the two different operations.

[0289] ​ ​ ​ 1 ​ 2 ​ 3 ​ 4 ​

[0290] Table 1

[0291] ​ ​ ​ ​ 1 ​ 2 1 ​ 3 2 ​ 4 3 ​ 4

[0292] Table 2

[0293] ​ ​ ​ 1 ​ 2 ​ ​ 3 ​ 4 ​

[0294] Table 3

[0295] ​ ​ ​ ​ 1 ​ 2 1 ​ ​ 3 2 ​ 4 3 ​ 4 ​

[0296] Table 4

[0297] See ​ , ​ which is a comparison diagram of the principles of the document processing method provided by the embodiments of the present application and related technologies. As shown in ​ , related technologies can only extract partial formats, and the format controls in related technologies cannot adjust format details during the process of extracting formats. However, the document processing method provided by the embodiments of the present application can extract all formats and can directly change format parameters in the format control. The embodiments of the present application display the format control in an adsorbed manner and change the stored or reused format parameters through the format control. Compared with the prior art which can only reuse the original format and only allows users to manually adjust format parameters through the toolbar of the document, there is no need to repeatedly adjust format parameters through the toolbar at the top of the document, shortening the distance between the format control and the reuse area. All change operations can be completed within the adsorbed format control, simplifying the process of document style processing and shortening the time for style changes. By previewing the format of the selected area in the preview interface, the user experience is improved to facilitate better viewing and changing of the extracted document formats. Through the design pattern of the middleware, it is decoupled from the cache main process and has pluggable characteristics, enabling better support for future new functions. By concatenating the format parameters included in the content unit into a string, it is ensured that all format parameters in the document can be stored, avoiding the incomplete reuse of format parameters, making the effects of different types of documents, different object types, and even different selection methods the same, and improving the consistency of document processing. By determining the repeated sequence, in scenarios where format controls are widely applied, the application efficiency of the format control can be improved, the application memory can be reduced, the steps are simplified in terms of user experience, and the efficiency of reusing text and modifying style settings in document editing by users is improved, saving the time for document work. In addition, the collection function can improve the quick reuse of document templates, and through this function, the format can be quickly applied to one's own documents.

[0298] Next, the exemplary structure of the implementation of the document processing apparatus 455 provided by the embodiments of the present application as software modules will be further described. In some embodiments, as shown in ​ , the software modules stored in the document processing apparatus 455 in the memory 450 may include:

[0299] The first display module 4551 is used to display the content of the document in the document display area.

[0300] The second display module 4552 is used to display a format control in response to a selection operation on a first area in the document display area.

[0301] A parameter acquisition module 4553, configured to acquire format parameters of a first area in response to a triggering operation on a format control.

[0302] A parameter application module 4554, configured to apply the format parameters of the first area to a second area in response to a selection operation on the second area in a document display area.

[0303] In some embodiments, the format control is adsorbed to the first area, and the positions where the format control is adsorbed to the first area include: an inner edge of a border of the first area, an outer edge of the border of the first area, and a position outside the first area and at a distance less than a distance threshold from the border of the first area.

[0304] In some embodiments, a second display module 4552 is further configured to display a first style to be collected in response to a triggering operation on a style collection entry, where the first style to be collected is formed by combining a plurality of format parameters obtained from the first area; and store the first style to be collected into a style list in a style library.

[0305] In some embodiments, the second display module 4552 is further configured to display a thumbnail control of the first area, where the thumbnail control is configured to be displayed following the format control before a selection operation is received, so as to prompt that the format parameters of the first area will be applied to the second area selected by the selection operation.

[0306] In some embodiments, the second display module 4552 is further configured to display a first format parameter list, where the first format parameter list includes a plurality of format parameters to be selected; in response to a selection operation on the plurality of format parameters to be selected in the first format parameter list, use the selected format parameter as a target format parameter; and acquire the target format parameters of the first area.

[0307] In some embodiments, the parameter acquisition module 4553 is further configured to display an editing toolbar, where the editing toolbar includes a plurality of editing controls, and the plurality of editing controls respectively correspond to a plurality of format parameters of the first area; in response to an editing operation based on a target editing control, update the format parameter corresponding to the target editing control in the acquired format parameters of the first area, where the target editing control is any one of the editing controls.

[0308] In some embodiments, the parameter acquisition module 4553 is further configured to acquire updated format parameters set by a target editing control and the position of an application area of the updated format parameters; store the updated format parameters and the position of the application area as an object, and update a plurality of atomic operations based on the object, where each atomic operation is configured to update a format parameter of the second area to a corresponding type of format parameter of the first area.

[0309] In some embodiments, the parameter acquisition module 4553 is further configured to split the first region into multiple content units, concatenate the multiple format parameters applied in each content unit into a string; determine the repeated sequences of the strings respectively corresponding to the multiple content units; and store the format parameters of the first region in the cache space based on the repeated sequences.

[0310] In some embodiments, when the document is a table document, the parameter acquisition module 4553 is further configured to divide the first region with at least one cell as a content unit to split the first region into multiple content units; when the document is a text document, divide the first region with at least one line or at least one natural sentence as a content unit to split the first region into multiple content units.

[0311] In some embodiments, for each content unit, the parameter acquisition module 4553 is further configured to sort the multiple format parameters applied to the content of the content unit according to a specific priority to form a string; concatenate the multiple format parameters included in each content unit to obtain the string corresponding to the content unit.

[0312] In some embodiments, the parameter acquisition module 4553 is further configured to store the strings respectively corresponding to the multiple content units in the first region in a two-dimensional array; determine the target step length in the two-dimensional array, where the format parameters of the content units included in the target step length are the same as those of the content units included in the previous step length; and use the sequences in the strings included in the target step length as the repeated sequences of the strings respectively corresponding to the multiple content units.

[0313] In some embodiments, the parameter acquisition module 4553 is further configured to display a second format parameter list, where the second format parameter list includes multiple format parameters obtained from the first region; and in response to a selection operation on the format parameters in the second format parameter list, set the selected format parameters to the selected state.

[0314] In some embodiments, the parameter acquisition module 4553 is further configured to display a preview control, where the preview control includes a second region to which the format parameters of the first region are applied, and the preview control further includes a format application entry; and in response to a trigger operation on the format application entry, proceed to execute the step of applying the format parameters of the first region to the second region.

[0315] In some embodiments, the parameter application module 4554 is further configured to set a plurality of format parameters included in the first region to corresponding middleware, where each middleware includes one format parameter; generate a mapping relationship between the plurality of middleware and the format parameters included in the second region; generate a plurality of atomic operations based on the mapping relationship, where each atomic operation is used to update a format parameter in the second region to the corresponding type of format parameter in the first region; and execute the plurality of atomic operations.

[0316] In some embodiments, the parameter application module 4554 is further configured to display a style list of a style library in response to a trigger operation on an entry of the style library, where the style list includes a plurality of styles, and each style includes a plurality of format parameters; and apply the plurality of format parameters included in the selected style to the second region in response to a selection operation on the style in the style list.

[0317] In some embodiments, the parameter application module 4554 is further configured to display an editing toolbar, where the editing toolbar includes a plurality of editing controls, and the plurality of editing controls respectively correspond to a plurality of format parameters in the second region; and update the format parameter corresponding to the target editing control for the second region in response to an editing operation on the second region based on the editing control.

[0318] An embodiment of the present application provides a computer program product, which includes a computer program or computer-executable instructions, and the computer program or computer-executable instructions are stored in a computer-readable storage medium. A processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium, and the processor executes the computer-executable instructions, so that the electronic device executes the document processing method described above in the embodiments of the present application.

[0319] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, where computer-executable instructions or a computer program are stored therein, and when the computer-executable instructions or the computer program are executed by a processor, it will cause the processor to execute the document processing method provided in the embodiments of the present application, for example, ​ the document processing method shown.

[0320] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disc, or CD-ROM; or may be various devices including one or any combination of the above memories.

[0321] In some embodiments, the computer-executable instructions may be in the form of a program, software, a software module, a script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including being deployed as a stand-alone program or being deployed as a module, a component, a subroutine, or other unit suitable for use in a computing environment.

[0322] As an example, the computer-executable instructions may or may not correspond to a file in a file system, may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, stored in a single file dedicated to the program under discussion, or, stored in multiple cooperating files (e.g., files that store one or more modules, subroutines, or portions of code).

[0323] As an example, the computer-executable instructions may be deployed to execute on one electronic device, or on multiple electronic devices located at one site, or, on multiple electronic devices distributed at multiple sites and interconnected by a communication network.

[0324] In summary, the document processing method provided by the embodiments of the present application can extract all formats and directly change format parameters in the format control. The format control is displayed in an adsorbed manner, and the stored or reused format parameters are changed through the format control. Compared with the prior art, which can only reuse the original format and only allows users to manually adjust format parameters through the document toolbar, there is no need to repeatedly adjust format parameters through the toolbar at the top of the document, shortening the distance between the format control and the reuse area. All change operations can be completed within the adsorbed format control, simplifying the process of document style processing and shortening the time for style changes. By previewing the format of the selected area in the preview interface, the user experience is improved, facilitating better viewing and changing of the extracted document format. Through the design pattern of the middleware, it is decoupled from the cache main process, has pluggable characteristics, and can better support future new functions. By concatenating the format parameters included in the content unit into a string, it is ensured that all format parameters in the document can be stored, avoiding the incomplete reuse of format parameters, making the effects generated by different types of documents, different object types, and even different selection methods the same, improving the consistency of document processing. By determining the repeated sequence, in the scenario of large-scale application of the format control, the application efficiency of the format control can be improved, the application memory can be reduced, the steps are simplified in terms of user experience, and the efficiency of reusing text and modifying style settings by users in document editing is improved, saving the time for document work. In addition, the collection function can improve the rapid reuse of document templates, and through this function, the format can be quickly applied to one's own documents.

[0325] The above is only the embodiments of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims

1. A method for processing a document, characterized in that, The method includes: Displaying the content of the document in the document display area; In response to a selection operation on a first area in the document display area, displaying a format control; In response to a triggering operation on the format control, obtaining the format parameters of the first area; In response to a selection operation on a second area in the document display area, applying the format parameters of the first area to the second area.

2. The method according to claim 1, wherein: The format control is adsorbed to the first area, and the positions where the format control is adsorbed to the first area include: the inner edge of the border of the first area, the outer edge of the border of the first area, and a position outside the first area and at a distance less than a distance threshold from the border of the first area.

3. The method according to claim 1, wherein After obtaining the format parameters of the first area, the method further includes: Displaying an editing toolbar, wherein the editing toolbar includes a plurality of editing controls, and the plurality of editing controls respectively correspond to the plurality of format parameters of the first area; In response to an editing operation based on a target editing control, updating the format parameter corresponding to the target editing control in the obtained format parameters of the first area, wherein the target editing control is any one of the editing controls; The applying the format parameters of the first area to the second area includes: Applying the updated format parameters of the first area to the second area.

4. The method according to claim 3, wherein: Applying the format parameters of the first area to the second area is implemented by executing a plurality of atomic operations; The updating the format parameter corresponding to the target editing control includes: Obtaining the updated format parameters set by the target editing control and the position of the application area of the updated format parameters; Storing the updated format parameters and the position of the application area as an object; Updating the plurality of atomic operations based on the object, wherein each atomic operation is used to update a format parameter of the second area to the corresponding type of format parameter of the first area.

5. The method according to claim 1, wherein: The obtaining the format parameters of the first area includes: Displaying a first format parameter list, wherein the first format parameter list includes a plurality of format parameters to be selected; In response to a selection operation on the plurality of format parameters to be selected in the first format parameter list, taking the selected format parameter as the target format parameter; Obtaining the target format parameter of the first area.

6. The method according to claim 1, wherein: After applying the format of the first area to the second area, the method further includes: Displaying an editing toolbar, wherein the editing toolbar includes a plurality of editing controls, and the plurality of editing controls respectively correspond to the plurality of format parameters of the second area; In response to an editing operation on the second area based on an editing control, updating the format parameter corresponding to the target editing control for the second area.

7. The method according to claim 1, wherein the format control includes an entry for the style library; after displaying the format control, the method further includes: in response to a trigger operation on the entry for the style library, displaying a style list of the style library, wherein the style list includes a plurality of styles, and each of the styles includes a plurality of the format parameters; in response to a selection operation on the style in the style list, applying the plurality of format parameters included in the selected style to the second area.

8. The method according to claim 7, wherein the format control further includes an entry for style collection; when displaying the format control in response to a selection operation on the first area in the document display area, the method further includes: in response to a trigger operation on the entry for style collection, displaying a first style to be collected, wherein the first style to be collected is formed by combining a plurality of the format parameters obtained from the first area, and storing the first style to be collected into the style list of the style library.

9. The method according to claim 8, characterized in that, after applying the format parameters of the first area to the second area in response to a selection operation on the second area in the document display area, the method further includes: in response to a trigger operation on the entry for style collection, displaying a second style to be collected, wherein the second style to be collected is formed by combining a plurality of the format parameters obtained from the second area, and storing the second style to be collected into the style list of the style library.

10. The method according to claim 1, wherein before applying the format parameters of the first area to the second area, the method further includes: displaying a second format parameter list, wherein the second format parameter list includes a plurality of the format parameters obtained from the first area; in response to a selection operation on the format parameters in the second format parameter list, setting the selected format parameters to a selected state; applying the format parameters of the first area to the second area includes: in response to an application operation on the format parameters of the first area, applying the format parameters in the selected state to the second area.

11. The method according to claim 1, characterized in that, when displaying the format control, the method further includes: displaying a thumbnail control for the first area, wherein the thumbnail control is used to be displayed following the format control before receiving the selection operation, so as to prompt that the format parameters of the first area will be applied to the second area selected by the selection operation.

12. The method according to claim 1, characterized in that, before applying the format parameters of the first area to the second area, the method further includes: displaying a preview control, wherein the preview control includes the second area to which the format parameters of the first area are applied, and the preview control further includes an entry for format application; in response to a trigger operation on the entry for format application, proceeding to execute the step of applying the format parameters of the first area to the second area.

13. The method according to claim 1, wherein after obtaining the format parameters of the first area, the method further includes: Split the first region into multiple content units, and concatenate the multiple format parameters applied in each content unit into a string; Determine the repeating sequences of the strings corresponding to the multiple content units respectively; Store the format parameters of the first region in the cache space based on the repeating sequences.

14. The method according to claim 13, wherein The splitting of the first region into multiple content units includes: When the document is a table document, divide the first region with at least one cell as one content unit, and split the first region into multiple content units; When the document is a text document, divide the first region with at least one line or at least one natural sentence as one content unit, and split the first region into multiple content units.

15. The method according to claim 13, wherein The concatenating of the multiple format parameters applied in each content unit into a string includes: Perform the following processing for each content unit: Sort the multiple format parameters applied to the content of the content unit according to a specific priority to form a string; Concatenate the multiple format parameters included in each content unit to obtain the string corresponding to the content unit.

16. The method according to claim 13, wherein The determination of the repeating sequences in the strings corresponding to the multiple content units respectively includes: Store the strings corresponding to the multiple content units in the first region in a two-dimensional array; Determine the target step size in the two-dimensional array, where the format parameters of the content units included in the target step size are the same as those of the content units included in the previous step size; Take the sequence in the string included in the target step size as the repeating sequence in the strings corresponding to the multiple content units respectively.

17. The method according to claim 1, characterized in that, The application of the format parameters of the first region to the second region includes: Set the multiple format parameters included in the first region as corresponding multiple middleware, where each middleware includes one format parameter; Generate a mapping relationship between the multiple middleware and the format parameters included in the second region; Generate multiple atomic operations based on the mapping relationship, where each atomic operation is used to update one format parameter of the second region to the corresponding type of format parameter of the first region; Execute the multiple atomic operations.

18. A processing device for a document, characterized in that, The device includes: A first display module for displaying the content of the document in a document display area; A second display module for displaying format controls in response to a selection operation on a first region in the document display area; A parameter acquisition module for acquiring the format parameters of the first region in response to a trigger operation on the format controls; A parameter application module for applying the format parameters of the first region to the second region in response to a selection operation on a second region in the document display area.

19. An electronic device, characterized in that, The electronic device includes: A memory for storing computer-executable instructions; A processor for implementing the document processing method according to any one of claims 1 to 17 when executing the computer-executable instructions stored in the memory.

20. A computer-readable storage medium stores computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, the method for processing a document according to any one of claims 1 to 17 is implemented.

21. A computer program product, comprising computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, the method for processing a document according to any one of claims 1 to 17 is implemented.