Document processing method, electronic device, storage medium and chip system

By providing multi-interface operation and document assistant services in electronic devices, the layout of text content is automatically updated to the original document, and the cumbersome update of the update operation in the existing technology is solved and the user experience is improved.

CN119250018BActive Publication Date: 2025-04-11HONOR DEVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411777049.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-04-11
Estimated Expiration
2044-12-05

AI Technical Summary

Technical Problem

In the prior art, after the user types the text content in the document in an electronic device, updating the typed text content to the original document requires multiple cumbersome operations, resulting in poor user experience.

Method used

By providing a document processing method in an electronic device, multiple interfaces are displayed in response to user operations, including selecting text content, triggering typography and replacing original text options, the typed text content is automatically updated to the original document using the clipboard and document assistant services.

Benefits of technology

The operation process of updating the selected text content in the document APP to the typed text content, and improves the user experience of typing the text content in the document APP.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119250018B_ABST
    Figure CN119250018B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a document processing method, an electronic device, a storage medium and a chip system, which relate to the field of information display technology. The method includes: displaying a first interface, the first interface includes the first display content of the first APP; in response to a first operation on the first document in the first display content, displaying a second interface; in response to the second operation, displaying a third interface, the second operation is used to trigger the typesetting of the first text content, the third interface includes the second display content of the first APP, and the second document, the second document includes the option to replace the original text; in response to the third operation on the option to replace the original text, displaying a fourth interface, the fourth interface includes the third display content of the first APP, the third display content includes the updated first document, and the updated first document includes the first text content after typesetting. By adopting this scheme, the operation process of typesetting the text content in the document APP can be simplified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information display technology, and in particular to a document processing method, electronic equipment, storage medium and chip system. Background Art

[0002] At present, users can use some common document applications (Application, APP) in electronic devices to edit documents, including typesetting the text content in the document. Specifically, after a user opens a first document through the document APP in the electronic device, he can select part or all of the text content in the first document; then, the electronic device is triggered to typeset the selected text content to obtain the typeset text content. Among them, the typeset text content obtained by the electronic device is displayed in an area outside the first document. In order to update the selected text content in the first document to the typeset text content, the user needs to input multiple operations such as copying and pasting the typeset text content. In response to these multiple operations, the electronic device updates the selected text content in the first document to the typeset text content. This process is cumbersome. As a result, the user's experience is poor. Summary of the invention

[0003] The embodiments of the present application provide a document processing method, an electronic device, a storage medium, and a chip system, which can simplify the operational process of updating the selected text content in the document APP to the formatted text content, thereby improving the user experience of formatting the text content in the document APP.

[0004] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:

[0005] In a first aspect, a document processing method is provided, which is applied to an electronic device, wherein the electronic device includes a first APP. The method includes: first displaying a first interface, wherein the first interface includes a first display content of the first APP, and the first display content includes a first document; then, in response to a first operation on the first document, displaying a second interface, wherein the first operation is used to select a first text content in the first document, the second interface includes a second display content of the first APP, and the second display content includes the marked first text content; then, in response to a second operation, displaying a third interface, wherein the second operation is used to trigger typesetting of the first text content, the third interface includes the second display content and a second document, the second document includes the first text content after typesetting, and an option to replace the original text; finally, in response to a third operation on the option to replace the original text, displaying a fourth interface, wherein the fourth interface includes a third display content of the first APP, the third display content includes the updated first document, and the updated first document includes the first text content after typesetting.

[0006] It is understandable that when the electronic device displays the first interface, it can display the second interface in response to the first operation of selecting the first text content in the first interface. Then, the electronic device displays the third interface including the second document in response to the second operation of triggering typeset the first text content. In addition to displaying the typeset first text content in the second document, the electronic device also displays an option to replace the original text in the second document. Furthermore, after receiving the operation (i.e., the third operation) of the option to replace the original text, the electronic device can complete the update of the selected first text content in the first APP (e.g., the document APP) to the first text content after typeset, without the user having to input too many operations. By adopting this solution, the operation process of updating the selected first text content in the first APP to the first text content after typeset can be simplified. Thereby, the user's experience of typeseting the text content in the first APP can be improved.

[0007] In combination with the first aspect, in a possible implementation, the second document includes a hypertext markup language (HTML) document, and the electronic device also includes a clipboard. The fourth interface is displayed in response to the third operation of the option to replace the original text, including: in response to the third operation, obtaining the source code corresponding to the HTML document, and parsing the source code corresponding to the HTML document to obtain the first text content after typeset; converting the first text content after typeset into rich text, and saving the rich text to the clipboard; replacing the marked first text content in the second display content with the rich text in the clipboard, generating and displaying the fourth interface.

[0008] It is understandable that the electronic device first parses the source code corresponding to the HTML document to obtain the first text content after typeset. Then, the electronic device uses the feature that the clipboard can paste rich text to convert the first text content after typeset into formatted rich text, and then saves the rich text to the clipboard. Furthermore, the electronic device can paste the rich text in the clipboard into the first document in the first APP, so as to update the first text content in the first APP to the first text content after typeset in response to a third operation.

[0009] In combination with the first aspect, in another possible implementation, the electronic device further includes a document assistant service. Among them, the above-mentioned response to the third operation, obtaining the source code corresponding to the HTML document, and parsing the source code corresponding to the HTML document to obtain the first text content after typeset, includes: the document assistant service responds to the third operation, obtains the source code corresponding to the HTML document, and parses the source code corresponding to the HTML document to obtain the first text content after typeset. The above-mentioned conversion of the first text content after typeset into rich text and saving the rich text to the clipboard includes: the document assistant service converts the first text content after typeset into rich text and saves the rich text to the clipboard. The above-mentioned replacement of the marked first text content in the second display content with the rich text in the clipboard, generating and displaying the fourth interface, includes: the document assistant service sends a first instruction to the first APP; the first APP responds to the first instruction, replaces the marked first text content in the second display content with the rich text in the clipboard, generates and displays the fourth interface.

[0010] It is understandable that, in the case where the first APP does not have the function of parsing the HTML document to obtain the first text content after typeset in the HTML document, the document assistant service provided by the electronic device can parse the source code corresponding to the HTML document to obtain the first text content after typeset. The document assistant service also uses the feature that the clipboard can paste rich text to convert the first text content after typeset into formatted rich text, and then save the rich text to the clipboard. Then, the first APP can use the clipboard to paste the rich text in the clipboard into the first document in the first APP, solving the problem that the first APP cannot replace the first text content in the first APP with the first text content after typeset in the HTML document. Thereby, the first text content in the first APP is updated to the first text content after typeset in response to a third operation.

[0011] In combination with the first aspect, in another possible implementation, the electronic device further includes a document assistant service. The above-mentioned response to the third operation, obtaining the source code corresponding to the HTML document, and parsing the source code corresponding to the HTML document to obtain the first text content after typeset, includes: the document assistant service responds to the third operation, sending a second instruction to the first APP; the first APP responds to the second instruction, enters an interactive state, and sends a first response to the document assistant service; the document assistant service responds to the first response, obtains the source code corresponding to the HTML document, and parses the source code corresponding to the HTML document to obtain the first text content after typeset.

[0012] The above-mentioned converting the first text content after typeset into rich text and saving the rich text into the clipboard includes: the document assistant service converting the first text content after typeset into rich text and saving the rich text into the clipboard. The above-mentioned replacing the marked first text content in the second display content with the rich text in the clipboard, generating and displaying the fourth interface includes: the document assistant service replacing the marked first text content in the second display content with the rich text in the clipboard, generating and displaying the fourth interface.

[0013] It is understandable that when the electronic device receives the third operation of the option to replace the original text in the second document, the focus of the electronic device is located in the second document, and the second document is in an interactive state. Therefore, the document assistant service in the electronic device can first send a second instruction to the first APP in response to the third operation, so that the first APP enters an interactive state. The first APP entering the interactive state indicates that the focus is on the first document in the first APP, and the first document in the first APP can be directly operated. Furthermore, after the document assistant service parses the source code corresponding to the HTML document to obtain the first text content after typeset, and converts the first text content after typeset into formatted rich text and saves it to the clipboard, the rich text in the clipboard can be directly pasted into the first document in the first APP. After the document assistant service saves the rich text to the clipboard, it is no longer necessary to send the first instruction to the first APP to control the first APP to paste the rich text in the clipboard into the first document in the first APP. Thereby, the duration of the first text content after typeset replacing the first text content in the first APP can be shortened, and the duration of the first text content after typeset occupying the clipboard can also be shortened.

[0014] In combination with the first aspect, in another possible implementation, the third interface includes the second display content in the first preset area, and the second document in the second preset area. The fourth interface includes the third display content in the first preset area, and the second document in the second preset area. The first preset area includes the first preset area and the second preset area. The first APP entering the interactive state indicates that the focus of the electronic device is located in the first preset area.

[0015] Among them, after the document assistant service replaces the marked first text content in the second display content with the rich text in the clipboard, generates and displays the fourth interface, the method also includes: the document assistant service enters an interactive state. The document assistant service entering an interactive state indicates that the focus of the electronic device is located in the second preset area.

[0016] It is understandable that the electronic device can display the second display content of the first APP and the second document in different areas of the third interface, for example, display the second display content of the first APP in the first preset area, and display the second document in the second preset area. When the electronic device receives the third operation of the option to replace the original text in the second document, the focus of the electronic device is located in the second preset area for displaying the second document. In response to the third operation, the document assistant service in the electronic device sends a second instruction to the first APP to control the focus of the electronic device to be switched to the first preset area for displaying the second display content of the first APP, so that the content of the clipboard can be directly pasted into the first APP. However, the third operation input by the user is to switch the focus of the electronic device to the second preset area for displaying the second document. Therefore, after the document assistant service is pasted, the document assistant service enters the interactive state again, that is, the focus of the electronic device is switched back to the second preset area for displaying the second document, so as to ensure that the area where the focus is located matches the third operation input by the user.

[0017] In combination with the first aspect, in another possible implementation, the method further includes: in response to the third operation, obtaining the initial content in the clipboard, and saving the initial content to a preset storage address. After replacing the marked first text content in the second display content with the rich text in the clipboard, generating and displaying the fourth interface, the method further includes: reading the initial content from the preset storage address, and saving the initial content to the clipboard.

[0018] It is understandable that, since pasting rich text into the clipboard will overwrite the original content in the clipboard, the electronic device saves the original content in the clipboard to a preset storage address before the rich text occupies the clipboard to avoid the loss of the original content. Then, after the clipboard is occupied, the original content is saved to the clipboard, that is, the content in the clipboard is restored.

[0019] In combination with the first aspect, in another possible implementation, after saving the rich text to the clipboard as mentioned above, the method also includes: creating a monitoring service, wherein the monitoring service is used to monitor the target operation, the target operation includes a copy operation or a paste operation; receiving a fourth operation, the monitoring service saves the fourth operation to a preset queue, and the fourth operation belongs to the target operation; when it is determined that the rich text in the clipboard is pasted into the first APP, the monitoring service stops monitoring the target operation and executes the fourth operation in the preset queue.

[0020] It is understandable that after the electronic device saves the rich text to the clipboard and before the initial content of the clipboard is saved to the clipboard, the clipboard is occupied and the initial content in the clipboard is not restored. In order to avoid the problem of clipboard usage conflict caused by the user calling the clipboard during the period when the clipboard is occupied, the electronic device may temporarily not respond to the target operation received during the period when the clipboard is occupied.

[0021] In combination with the first aspect, in another possible implementation, after saving the rich text to the clipboard as mentioned above, the method also includes: displaying preset prompt information, wherein the preset prompt information is used to prompt to temporarily block the target event, and the target event includes a mouse event; when it is determined that the rich text in the clipboard is pasted into the first APP, canceling the display of the preset prompt information.

[0022] It is understandable that the electronic device temporarily shields the target event to prevent the target event occurring during the period when the clipboard is occupied from affecting the electronic device's replacement of the first text content in the first APP with rich text.

[0023] In combination with the first aspect, in another possible implementation, the first APP includes a WPS® APP, a word® APP or a Yongzhong® APP, and the first document includes a word® document. The electronic device also includes a second APP, the second document includes an HTML document, and the first interface, the second interface, the third interface and the fourth interface are all interfaces in the second APP.

[0024] This implementation describes some examples of the first APP and the second APP.

[0025] In combination with the first aspect, in another possible implementation, before displaying the third interface in response to the second operation, the method also includes: the second APP displays a first window on the second interface, and the first window includes a layout option; the second APP responds to a fifth operation on the layout option and displays a second window on the second interface, wherein the second window includes at least one layout style, and the second operation includes a click operation on one of the at least one layout styles.

[0026] Among them, the above-mentioned display of the third interface in response to the second operation includes: the second APP generates an HTML document in response to the second operation based on the typesetting style selected by the second operation and the first text content; the second APP displays the third interface based on the HTML document.

[0027] It is understandable that the second APP in the electronic device can not only open the first document in the first APP, but also provide at least one typesetting style for typeset the selected first text content in the first document. When the user selects a typesetting style, the electronic device can quickly generate an HTML document, which includes the typeset first text content corresponding to the typesetting style.

[0028] In a second aspect, an electronic device is provided, the electronic device comprising: a processor, a memory, and a communication interface. The memory and the communication interface are coupled to the processor, the memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device executes the method as described in any one of the above-mentioned first aspects.

[0029] In a third aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes any one of the methods described in the first aspect.

[0030] According to a fourth aspect, a computer program product comprising computer instructions is provided. When the computer instructions are executed on an electronic device, the electronic device executes the method as described in any one of the above-mentioned first aspects.

[0031] In a fifth aspect, a device (for example, the device may be a chip system) is provided, the device including a processor for supporting an electronic device to implement the document processing method described in the first aspect. In a possible design, the device also includes a memory for storing necessary program instructions and data for the electronic device. When the device is a chip system, it may be composed of a chip, or may include a chip and other discrete devices.

[0032] Among them, the technical effects brought about by any design method in the second to fifth aspects can refer to the technical effects brought about by different design methods in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1A A schematic diagram of an interface for typeset text content in a document APP provided in an embodiment of the present application;

[0034] Figure 1B A schematic diagram of an interface for typeset text content in a document APP provided in an embodiment of the present application;

[0035] Figure 1C A schematic diagram of an interface for typeset text content in a document APP provided in an embodiment of the present application;

[0036] Figure 1D A schematic diagram of an interface for typeset text content in a document APP provided in an embodiment of the present application;

[0037] Figure 2 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0038] Figure 3 A schematic diagram of a system architecture of an electronic device provided in an embodiment of the present application;

[0039] Figure 4 A flowchart of a document processing method provided in an embodiment of the present application is shown in FIG1 ;

[0040] Figure 5A A schematic diagram of an interface for processing documents by an electronic device provided in an embodiment of the present application;

[0041] Figure 5B A schematic diagram of an interface for processing documents by an electronic device provided in an embodiment of the present application;

[0042] Figure 5C A schematic diagram of an interface for processing documents by an electronic device provided in an embodiment of the present application;

[0043] Figure 5D A schematic diagram of an interface for processing documents by an electronic device provided in an embodiment of the present application;

[0044] Figure 5E A schematic diagram of an interface for processing documents by an electronic device provided in an embodiment of the present application;

[0045] Fig. 5F A schematic diagram of an interface for processing documents by an electronic device provided in an embodiment of the present application;

[0046] Figure 6 A schematic diagram of a document processing method provided in an embodiment of the present application Figure 2 ;

[0047] Figure 7 A schematic diagram of a document processing method provided in an embodiment of the present application Figure 3 ;

[0048] Figure 8 A schematic diagram of an interface for displaying first prompt information of an electronic device provided in an embodiment of the present application;

[0049] Fig.9A A schematic diagram of an interface for displaying second prompt information in an electronic device provided in an embodiment of the present application;

[0050] Fig. 9B A schematic diagram of an interface for canceling display of a second prompt message in an electronic device provided in an embodiment of the present application;

[0051] Fig.10 A schematic diagram of a document processing method provided in an embodiment of the present application Figure 4 ;

[0052] Fig.11 Schematic diagram 5 of a document processing method provided in an embodiment of the present application;

[0053] Fig.12 A schematic diagram of the structure of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0054] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0055] The terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, unless otherwise specified, "plurality" means two or more.

[0056] At present, electronic devices provide a smart typesetting function, which specifically means that when a user selects a piece of text content in the electronic device, the electronic device can typeset the selected text content according to a typesetting style to obtain the typeset text content, and display the typeset text content in a preset display area on the display screen.

[0057] Exemplarily, when an electronic device opens and displays a document in any document APP, the user can select part or all of the text content in the document; then, the electronic device typesets the selected text content according to a typesetting style to obtain another document, and the other document includes the typeset text content. Although the electronic device can complete the typesetting of the selected text content in the document APP based on a typesetting style, the typeset text content generated by the electronic device is in another document. The user also needs to select and copy the typeset text content in another document, and then paste the copied content into the document in the document APP to replace the selected text content in the document APP. It can be seen that the electronic device requires the user to input multiple operations (including selection operations, copy operations, and paste operations, etc.) to update the selected text content in the document APP to the typeset text content, and the entire operation process is cumbersome. As a result, the user's experience is poor.

[0058] For example, taking the electronic device as a laptop computer as an example, refer to Figure 1A , Figure 1B , Figure 1C and Figure 1D , are schematic diagrams of an interface for typesetting text content in a document APP provided in an embodiment of the present application. A laptop computer may include a workbench APP, and the workbench APP may provide a document assistant function for a user. The document assistant function may include calling any document APP in the laptop computer (for example, WPS ® APP、word ® APP or Yongzhong ® APP) functions, as well as smart typesetting functions.

[0059] like Figure 1A As shown, the laptop displays the icon 111 of the workbench APP in the desktop interface 110, and can receive a user's click operation on the icon 111 of the workbench APP. Figure 1B As shown, in response to a click operation on the workbench APP icon 111, the laptop displays the main interface 120 of the workbench APP. The main interface 120 of the workbench APP may include a document assistant icon 121 corresponding to the document assistant function. After the laptop displays the main interface 120, it may receive a WPS trigger. ® The APP opens any document. Figure 1C As shown, the laptop responds to the document opening operation and displays the WPS ® A document in APP130.

[0060] Then, if Figure 1DAs shown, the workbench APP in the laptop computer can respond to the typesetting operation of triggering the typesetting of the selected text content 131 in the document 130, typeset the selected text content 31 to obtain an HTML document 141, and display the HTML document 141 in a preset display area. The HTML document 141 includes the typeset text content 142. Optionally, the HTML document can be called a web page.

[0061] It is understandable that since the typeset text content 142 is included in the HTML document 141, the WPS ® APP does not have the function of parsing HTML documents to obtain the content in HTML documents. Therefore, WPS ® The APP cannot directly use the typeset text content 142 in the HTML document 141 to update the WPS ® That is, the user also needs to select and copy the typeset text content 142 in the HTML document 141, and then paste the copied content into the WPS ® In the document 130 opened by the APP, it is used to replace WPS ® The selected text content 131 in the APP. It can be seen that the electronic device requires the user to input multiple operations (including selection operation, copy operation and paste operation, etc.) to transfer the WPS ® The selected text content 131 in the APP is updated to the typeset text content 142, and the whole operation process is cumbersome.

[0062] In response to the above problems, an embodiment of the present application provides a document processing method. After a workbench APP in an electronic device triggers any document APP to open a document, a typesetting operation that triggers typesetting of part or all of the text content in the document can be received. In response to the typesetting operation, the electronic device can typeset the selected text content to obtain an HTML document, and display the HTML document in a preset display area (e.g., the third area). The HTML document includes not only the typeset text content, but also an option to replace the original text. Furthermore, the electronic device can convert the typeset text content in the HTML document into rich text in response to a user's click operation on the option to replace the original text, and then paste the rich text into the clipboard.

[0063] It is understandable that, since rich text can contain formatted text, rich text can save the text content after typeset. Since the content in the clipboard can be pasted into the document APP, the electronic device can paste the rich text in the clipboard into the document APP and replace the selected text content with the rich text. Rich text includes the text content after typeset, and pasting the rich text in the clipboard into the document APP is to paste the text content after typeset into the document in the document APP, so as to replace the selected text content with the text content after typeset. With this scheme, when the document APP does not have the function of parsing the HTML document to obtain the typeset content in the HTML document, the user inputs a click operation on the option to replace the original text, and the electronic device can update the selected text content in the document APP to the text content after typeset, so as to simplify the operation process of updating the selected text content in the document APP to the text content after typeset. Thereby, the user's experience of typeseting the selected text content in the document APP can be improved.

[0064] The embodiments of the present application provide a document processing method, which can be applied to electronic devices including display screens, such as personal computers (PCs) (e.g., desktop computers, laptop computers), tablet computers, mobile phones, netbooks, personal digital assistants (PDAs), and the like. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.

[0065] Take for example the electronic device is a laptop computer. Figure 2 A schematic structural diagram of an electronic device provided by the present application is shown.

[0066] like Figure 2 As shown, the laptop computer may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, a sensor module 280, a button 290, a motor 291, an indicator 292, a camera [1-N] 293, and a display [1-N] 294, and a subscriber identification module (SIM) card interface 295, etc. Among them, the sensor module 280 may include a pressure sensor, a fingerprint sensor, a temperature sensor, a touch sensor, etc.

[0067] The processor 210 can be used to execute various functions or steps performed by the laptop computer in the embodiment of the present application.

[0068] The display screen 240 is used to display an interface, etc. The display screen 240 includes a display panel. The display panel can be a liquid crystal display (LCD), a light-emitting diode (LED), an organic light-emitting diode (OLED), etc.

[0069] Among them, if the display screen 240 in the embodiment of the present application is integrated with a touch sensor, the display screen 240 can be called a touch screen. The touch sensor can also be called a "touch panel". That is to say, the display screen 240 may include a display panel and a touch panel. The touch sensor is used to detect touch operations acting on or near it. After the touch sensor detects a touch operation (such as the above-mentioned click operation), it can trigger the event driver of the laptop computer to periodically scan the touch parameters generated by the touch operation. Then, the event driver passes the touch parameters to the relevant modules of the upper layer so that the relevant modules can determine the touch events corresponding to the touch parameters. In the embodiment of the present application, the method provided in the embodiment of the present application is explained by taking the display screen 240 as a display screen (i.e., a touch screen) integrated with a touch sensor as an example.

[0070] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the laptop computer. In other embodiments, the laptop computer may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0071] The software system of the laptop computer can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. ® Taking the system as an example, the software structure of the electronic device is illustrated. Figure 3 The software structure diagram of the electronic device of the embodiment of the present application is shown in FIG. The layered architecture divides the software into several layers, each of which has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, Windows ® The system may include an application layer, a subsystem dynamic link library, a driver layer, and a firmware layer.

[0072] like Figure 3 As shown, the application layer may include music, video, game, office, social and other APPs.

[0073] It should be noted that Figure 3 Only some APPs are shown in the figure, and the application layer may also include other APPs, such as shopping APPs, browsers, etc., which are not limited in the embodiments of the present application.

[0074] The subsystem dynamic link library includes the application programming interface (API) module, which includes the Windows ® API, Windows ® Native API, etc. Among them, Windows ® API and Windows ® Native APIs can provide system call entry and internal function support for APP. The difference is that Windows ® Native API for Windows ® System native API.

[0075] For example, Windows ® APIs may include user.dll, kernel.dll, Windows ® The native API may include ntdll.dll. Among them, user.dll is Windows ® User interface, which can be used to perform operations such as creating windows and sending messages. kernel.dll is used to provide APP with an interface to access the kernel. ntdll.dll is an important Windows ® NT kernel-level files. ® When the system starts, ntdll.dll resides in a specific write-protected area in the memory, preventing other programs from occupying this memory area.

[0076] The driver layer can include a process manager, a virtual memory manager, a security reference monitor, an input / output (I / O) manager, a power manager, a Windows ® Windows Management Instrumentation (WMI) plug-in, event driver (Event driver), operating system to system on chip (OS2SOC) driver.

[0077] Among them, the process manager is used to create and terminate processes and threads. The virtual memory manager implements "virtual memory". The virtual memory manager also provides basic support for the cache manager. The security reference monitor can enforce security policies on the local computer, which protects operating system resources and performs protection and monitoring of runtime objects. The I / O manager performs device-independent input / output and further processes and calls appropriate device drivers. The power manager manages the power state changes of all devices that support power state changes. The WMI plug-in can be used for the execution scheduling engine to send scheduling policies to the firmware layer; the event driver can interact with the graphics driver, audio and video driver, camera driver and keyboard driver, so that the system detection module can detect various events (also called data or information), such as interacting with the graphics driver so that the system detection module can monitor the graphics processing unit (GPU) video decoding events. The OS2SOC driver can be used for the execution scheduling engine to send scheduling policies to the firmware layer.

[0078] The firmware layer includes various hardware and hardware drivers configured for the laptop computer. For example, the firmware layer may include a CPU, a display screen, a mouse, etc. The firmware layer also includes a display screen driver and a mouse driver.

[0079] In the present application embodiment, Figure 3 As shown, the application layer may also include a workbench APP, at least one document APP (e.g., WPS ® APP and word ® APP), document assistant service, and application services corresponding to each document APP (for example, WPS ® WPS corresponding to APP ® service, or the word service corresponding to the word® APP).

[0080] Among them, the workbench APP can be used to provide users with smart interconnection and aggregated office services. Among them, smart interconnection can be called device interconnection, which means that the laptop computer establishes a connection with other electronic devices to exchange information and work together. The aggregated office service may include a note-taking function and a document assistant function. The document assistant function may include calling any document APP in the laptop computer (for example, WPS ® APP), and the smart typesetting function. Optionally, the smart typesetting function can be called the smart typesetting function.

[0081] The document assistant service can be used to execute the document assistant functions provided by the workbench APP, including the function of calling the document APP and the intelligent typesetting function. For example, the document assistant service can call any document APP to open a document, and can also typeset the selected text content in the document to generate an HTML document including the typeset text content.

[0082] The application service corresponding to each document APP can be used to interact with other APPs other than the document APP, and interact with the document APP based on the interaction results to realize the control of the document APP by other APPs. For example, the document assistant service controls the document APP to open a document through the application service. For another example, the document assistant service pastes rich text into the clipboard and can send a replace original text instruction to the application service. In response to the replace original text instruction, the application service can send a paste instruction to the document APP. In response to the paste instruction, the document APP can paste the rich text in the clipboard into the document in the document APP.

[0083] It should be noted that the present application embodiment is based on Windows ® For example, in other operating systems (such as macOS ® System or Linux ® System, etc.), as long as the functions implemented by each functional module are similar to those of the embodiments of the present application, the method provided by the embodiments of the present application can also be implemented.

[0084] Based on the above hardware architecture and software architecture, the document processing method provided in the embodiment of the present application is introduced below by taking the electronic device as a laptop computer as an example.

[0085] Reference Figure 4 , is a flowchart of a document processing method provided in an embodiment of the present application. Figure 4 As shown, the specific process may include S401-S414.

[0086] S401. The laptop computer displays a first workbench interface in the workbench APP, wherein the first workbench interface includes a first display content of a target document APP, and the first display content includes a target document.

[0087] The target document APP can be any document APP in the laptop, for example, WPS ® APP、word ® APP or Yongzhong ® APP. The target document may be an electronic document in a preset format. The preset format refers to a document format that the target document APP can open. For example, the preset format may include a word format, and a document in the word format may be called a word document.

[0088] In some embodiments, before S401, the laptop computer may display the main interface of the workbench APP; then, on the main interface of the workbench APP, a document opening operation is received to trigger the target document APP to open the target document. In response to the document opening operation, the workbench APP may trigger the target document APP to open the target document, and then display the first workbench interface, which includes the target document opened by the target document APP.

[0089] In some embodiments, the first workbench interface may include multiple areas, for example, the multiple areas include a first area and a second area, the first area may include at least one function option, and the second area may be a specific operation area corresponding to one of the at least one function option. For example, at least one function option may include a document processing icon, a smart interconnection icon, a note icon, and a collection icon. Among them, the smart interconnection icon can be used to trigger the smart interconnection function; the note icon can be used to trigger the launch of the note APP; the collection icon can be used to trigger the launch of the collection APP.

[0090] For example, Figure 5A As shown, the laptop displays the main interface 120 of the workbench APP, and the main interface 120 may include a document processing icon 121, a smart interconnection icon 122, a note icon 123, and a favorites icon 124 in the first area 511. Among them, the smart interconnection icon 122 may be the default selected icon. The expression form of the selected icon in the main interface 120 is different from that of other icons to be selected (for example, the line thickness is different, the line color is different). The main interface 120 may also include a second area 512, and the second area 512 is the specific operation area of ​​the function corresponding to the selected icon. Since the smart interconnection icon 122 is the default selected icon at this time, the second area 512 is the specific operation area of ​​the smart interconnection function.

[0091] Then, if Figure 5B As shown, the laptop computer can receive and respond to the document opening operation that triggers the target document APP to open the target document, and display the first workbench interface 520. At this time, since the selected icon changes from the smart interconnection icon 122 to the document processing icon 121, the expression form of the icon located in the first area 511 in the first workbench interface 520 changes, and the content of the second area 512 in the first workbench interface 520 also changes. The second area 512 in the first workbench interface 520 includes the target document 151 opened by the target document APP.

[0092] It should be noted that the laptop computer may display other interfaces between displaying the main interface 120 of the workbench APP and displaying the first workbench interface 520. Figure 5A and Figure 5B None shown.

[0093] S402. The workbench APP in the laptop computer responds to the text selection operation, marks the selected text content in the target document to obtain the marked text content, and displays a second workbench interface, the second workbench interface includes the second display content of the target document APP, and the second display content includes the marked text content.

[0094] When the laptop displays the first workbench interface, it can receive a text selection operation, and then forward the text selection operation to the workbench APP. In response to the text selection operation, the workbench APP can mark the selected text content in the target document according to a preset expression form to obtain the marked text content, and replace the selected text content in the first workbench interface with the marked text content, generate a second workbench interface and display it.

[0095] In some embodiments, the text selection operation may be a sliding operation. The notebook computer may mark the selected text content in real time and display the marked text content as the sliding operation moves.

[0096] In some embodiments, the preset representation may include at least one of a preset background color (eg, gray or black), a preset line thickness, or a preset font color.

[0097] In some embodiments, the second workbench interface may also include the first area and the second area. Compared with the first workbench interface, the display content in the second area of ​​the second workbench interface changes. Specifically, the second workbench interface may include: the at least one function option in the first area, and the second display content of the target document APP in the second area.

[0098] For example, taking the preset background color as black as an example, Figure 5C As shown, in response to the text selection operation, the laptop computer marks the selected text content in the target document 151 with a preset background color, and displays the second workbench interface 530. The second workbench interface 530 includes the second display content of the target document APP in the second area 512, the second display content includes the marked text content 531, and the background color of the marked text content 531 is black.

[0099] S403. The workbench APP displays a first window, which includes layout options.

[0100] When the text selection operation is completed, the workbench APP can control the display screen to display the first window on the upper layer of the second workbench interface.

[0101] In some embodiments, the first window may include not only the typesetting option, but also the translation option, the polishing option, and the AI ​​search option, etc. Among them, the typesetting option is used to trigger the smart typesetting function. The translation option is used to trigger the translation function. The polishing option is used to trigger the text polishing function. The AI ​​search option is used to trigger the automatic search function.

[0102] Optionally, the first window may be a pop-up window, which is a small window displayed on the top layer of a display screen, and the content and size of the pop-up window may be fixed.

[0103] For example, Figure 5C As shown, the notebook computer displays a first window 540 on an upper layer of the second workbench interface 530. The first window 540 includes a layout option 541.

[0104] S404: In response to a click operation on a typesetting option, the workbench APP displays a second window, where the second window includes at least one typesetting style option.

[0105] When the display screen in the laptop displays the first window, it can receive a user's click operation on the layout option and send the click operation on the layout option to the workbench APP. In response to the click operation on the layout option, the workbench APP can control the display screen to display the second window on the upper layer of the second workbench interface and cancel the display of the first window.

[0106] In some embodiments, at least one layout style may include a section summary, a work summary, and a paper outline.

[0107] Optionally, the second window may be a pop-up window.

[0108] For example, Figure 5D As shown, in response to the user clicking on the typesetting option 541, the workbench APP displays a second window 550 on the upper layer of the second workbench interface 530. The second window 550 includes at least one typesetting style option, for example, the at least one typesetting style option may include: a section summary option 551, a work summary option 552, and a paper outline option 553.

[0109] S405. In response to a click operation on a typesetting style option, the workbench APP generates an HTML document based on the typesetting style and the selected text content, and displays a third workbench interface, wherein the third workbench interface includes the second display content of the target document APP and the HTML document, and the HTML document includes the typeset text content and an option to replace the original text.

[0110] When the display screen in the laptop displays the second window, it can receive a user's click operation on any typesetting style option, and send the click operation on the typesetting style option to the workbench APP. In response to the click operation on the typesetting style option, the workbench APP can generate an HTML document based on the typesetting style and the selected text content, and the HTML document includes the typesetting text content; then obtain and display the third workbench interface based on the HTML document.

[0111] The option of replacing the original text is used to trigger the replacement of the original text. The text content after typeset is generated based on the typesetting style.

[0112] In some embodiments, the third workbench interface may also include the first area and the second area. The second area in the third workbench interface may also include the third area, that is, the third area is a part of the second area. The third workbench interface may include: at least one of the above-mentioned function options in the first area, the second display content of the target document APP in other areas of the second area except the third area, and the HTML document in the third area.

[0113] For example, take the option 551 of the segment summary as an example, Figure 5E As shown, in response to the user's click operation on the segment summary option 551, the workbench APP controls the display screen to display the third workbench interface 560. The third workbench interface 560 includes an HTML document 561 in the third area 513, and an option 562 to replace the original text. Secondly, the third workbench interface 560 also includes the second display content of the target document APP, and the second display content is located in other areas of the second area 512 except the third area 513.

[0114] It should be noted that the above S403-S405 describes an implementation method in which a laptop computer typesets the selected text content to obtain an HTML document. The laptop computer may also use other typesetting methods to typeset the selected text content to obtain a typeset document, and the typeset document includes the typeset text content. For example, other typesetting methods may include: responding to multiple adjustment operations input by the user (for example, font adjustment operations and paragraph adjustment operations, etc.), typeset the selected text content to obtain a typeset document; wherein the typeset document may be another word document different from the target document. For another example, other APPs respond to an operation that triggers typesetting, typeset the selected text content to obtain a typeset document; wherein the other APPs may be different from both the workbench APP and the document APP, and the typeset document may be an HTML document. The embodiment of the present application does not limit the implementation method in which a laptop computer typesets the selected text content.

[0115] S406. In response to the user clicking the option to replace the original text, the workbench APP sends a first message and a first replacement instruction to the document assistant service, where the first message includes the source code corresponding to the HTML document, and the first replacement instruction is used to instruct to replace the original text.

[0116] When the display screen in the laptop displays the HTML document, a user's click operation on an option to replace the original text can be received, and the click operation on the option to replace the original text can be sent to the workbench APP. In response to the click operation on the option to replace the original text, the workbench APP can send the first information and the first replacement instruction to the document assistant service. The source code corresponding to the HTML document can be used to generate the HTML document.

[0117] S407: The document assistant service obtains the initial content in the clipboard in response to the first replacement instruction, and saves the initial content to a preset storage address.

[0118] In response to the first replacement instruction, the document assistant service may read the content in the clipboard. Optionally, the content in the clipboard may be referred to as the initial content. Then, the document assistant service may save the initial content to a preset storage address, such as a memory.

[0119] S408: The document assistant service obtains rich text based on the source code corresponding to the HTML document, and saves the rich text to the clipboard, wherein the rich text includes the formatted text content.

[0120] The document assistant service can parse the source code corresponding to the HTML document to obtain the formatted text content, and then convert the formatted text content into rich text. Since rich text is a formatted text, it can be used to save the formatted text content.

[0121] Optionally, the document assistant service may not use rich text, but other formatted text, that is, the document assistant service may convert the formatted text content into other formatted text, and the other formatted text includes the formatted text content. The following embodiments are illustrated by taking rich text as an example.

[0122] Exemplarily, the document assistant service may utilize a Clipboard tool written in JavaScript (JS) to parse the source code corresponding to the HTML document to obtain the typeset text content; and then convert the typeset text content into rich text.

[0123] S409. The document assistant service sends a second replacement instruction to the application service corresponding to the target document APP, where the second replacement instruction is used to instruct to replace the original text.

[0124] After the document assistant service saves the rich text to the clipboard, it can send a second replacement instruction to the application service corresponding to the target document APP (for example, the WPS® document service corresponding to the WPS® APP, the word document service corresponding to the word® APP, or the word document service corresponding to the Yongzhong® APP).

[0125] S410: The application service sends a paste instruction to the target document APP in response to the second replacement instruction.

[0126] In response to the second replacement instruction, the application service corresponding to the target document APP may send a paste instruction to the target document APP through an interface provided by the target document APP (eg, an API provided by the target document APP).

[0127] S411. The target document APP responds to the paste instruction, obtains the rich text in the clipboard, and replaces the marked text content in the target document APP with the rich text, obtains and displays the fourth workbench interface, wherein the fourth workbench interface includes the third display content of the target document APP, and the third display content includes the typeset text content.

[0128] When the target document APP receives the paste instruction, the display screen in the laptop computer displays the third workbench interface, and the third workbench interface includes the second display content of the target document APP, and the second display content includes the marked text content. Therefore, in response to the paste instruction, the target document APP can read the rich text from the clipboard, and then replace the marked text content in the second display content with the typeset text content in the rich text to obtain the fourth workbench interface. The display screen in the laptop computer displays the fourth workbench interface. The fourth workbench interface includes: a third display content different from the second display content.

[0129] Among them, the process in which the target document APP reads rich text from the clipboard and then replaces the marked text content with the rich text is the process of pasting the content in the clipboard into the target document.

[0130] In some embodiments, the fourth workbench interface may also include the first area, the second area, and the third area. The fourth workbench interface may include: the at least one function option in the first area, the third display content of the target document APP in other areas of the second area except the third area, and the HTML document in the third area.

[0131] For example, Fig. 5FAs shown, in response to the user clicking the option 562 to replace the original text, the laptop displays a fourth workbench interface 570. The fourth workbench interface 570 includes the third display content of the target document APP, and the third display content is located in other areas of the second area 512 except the third area 513. The third display content includes the typeset text content 571.

[0132] S412: The target document APP sends a first paste response to the application service.

[0133] After the target document APP pastes the contents in the clipboard into the target document, it can send a first paste response to the application service. The first paste response can be used to indicate that the paste is completed or to indicate that the contents in the clipboard are pasted into the target document APP.

[0134] S413: The application service sends a second paste response to the document assistant service in response to the first paste response.

[0135] The application service sends a second paste response to the document assistant service, where the second paste response can be used to indicate that the paste is complete or to indicate that the content in the clipboard is pasted into the target document APP.

[0136] S414: In response to the second paste response, the document assistant service reads the initial content from a preset storage address and saves the initial content to the clipboard.

[0137] In response to the second paste response, the document assistant service may restore the content in the clipboard, specifically including: first reading the initial content of the clipboard from a preset storage address, and then saving the initial content to the clipboard.

[0138] It is understandable that, in the case where the target document APP does not have the function of parsing the HTML document to obtain the typeset text content in the HTML document, the document assistant service provided by the laptop computer utilizes the feature of the clipboard that can paste rich text to solve the problem of replacing the selected text content in the target document APP with the typeset text content. Thus, in response to a click operation on the option to replace the original text, the text content in the target document APP is updated with the typeset text content.

[0139] In some embodiments, after the workbench APP sends a first replacement instruction to the document assistant service in response to the user's click operation on the option to replace the original text in the HTML document, the document assistant service responds to the first replacement instruction and, in addition to sending a second replacement instruction to the application service corresponding to the target document APP to control the target document APP to replace the marked text content with rich text, can also first switch the focus from the HTML document to the target document APP and then replace the marked text content with rich text. The document assistant service in the laptop computer replaces the marked text content with rich text, so there is no need to execute the process of the document assistant service sending the second replacement instruction to the application service corresponding to the target document APP, and the application service sending a paste instruction to the target document APP. This can shorten the time it takes for the typeset text content to replace the marked text content, and also shorten the time the typeset text content occupies the clipboard.

[0140] Reference Figure 6 , describes the process of replacing the marked text content with rich text by the Document Assistant service. Figure 6 As shown, another document processing method provided by an embodiment of the present application may include the above-mentioned S401-S406, and further include S601-S609 after S406.

[0141] S601. The document assistant service sends a first focus switching instruction to the application service corresponding to the target document APP in response to the first replacement instruction.

[0142] After receiving the first information and the first replacement instruction from the workbench APP, the document assistant service can send a first focus switching instruction to the application service in response to the first replacement instruction. The first focus switching instruction is used to instruct to switch the focus of the laptop computer to the target document opened by the target document APP.

[0143] It should be noted that the focus usually refers to the object or area in the laptop that currently receives user input or operation. Specifically, the focus can be a cursor in a text input box, a button, a menu item, or an interactive element in a window. When an element has the focus, the user can operate it through the keyboard or mouse, such as entering text, clicking buttons, etc.

[0144] In some embodiments, when the laptop displays the third workbench interface, the third workbench interface includes an HTML document, and the HTML document includes an option to replace the original text. At this time, the laptop can receive a user's click operation on the option to replace the original text. In response to the click operation, the laptop not only saves the rich text to the clipboard through the document assistant service, but also switches the focus to the HTML document. Therefore, before the document assistant service pastes the content in the clipboard into the target document APP, it needs to switch the focus to the target document APP. Only in this way can the paste operation be performed on the target document APP.

[0145] S602: The application service sends a second focus switching instruction to the target document APP in response to the first focus switching instruction.

[0146] In response to the first focus switching instruction, the application service may send a second focus switching instruction to the target document APP through an interface provided by the target document APP (eg, an API provided by the target document APP).

[0147] S603: The target document APP responds to the second focus switching instruction, enters an interactive state, and sends a first switching response to the application service.

[0148] The target document APP responds to the second focus switching instruction, enters an interactive state, and sends a first switching response to the application service to inform the application service that the focus switching is successful.

[0149] In some embodiments, the target document APP enters an interactive state in response to the second focus switching instruction, which may include: activating other areas in the second area except the third area to prepare to receive user input or operation in the other areas. The other areas are used to display the second display content of the target document APP.

[0150] S604: In response to the first switching response, the application service sends a second switching response to the document assistant service.

[0151] The application service then sends a second switching response to the document assistant service to inform the document assistant service that the focus switching is successful.

[0152] S605: The document assistant service obtains the initial content of the clipboard in response to the second switching response, and saves the initial content of the clipboard to a preset storage address.

[0153] The document assistant service receives the second switching response and can determine that the focus is switched to the target document APP. Therefore, the process of pasting the formatted text content to the target document APP based on the source code corresponding to the HTML document can be executed. The process of pasting the formatted text content to the target document APP based on the source code corresponding to the HTML document can include S606-608.

[0154] It should be noted that the details of "obtaining the initial content of the clipboard and saving the initial content of the clipboard to a preset storage address" in S605 can be referred to the introduction of "obtaining the initial content of the clipboard and saving the initial content of the clipboard to a preset storage address" in the above S407, which will not be repeated here.

[0155] S606: The document assistant service obtains rich text based on the source code corresponding to the HTML document, and saves the rich text to the clipboard, wherein the rich text includes the formatted text content.

[0156] It should be noted that the details of S605 can be found in the above introduction to S408, which will not be repeated here.

[0157] S607. The document assistant service reads the rich text in the clipboard and replaces the marked text content with the rich text, obtains and displays the fourth workbench interface, and the fourth workbench interface includes the third display content of the target document, and the third display content includes the typeset text content.

[0158] Since the focus is on the target document APP, the document assistant service can paste the rich text in the clipboard to the marked text content in the second display content of the target document APP, thereby replacing the marked text content with rich text.

[0159] It should be noted that the difference between S607 and S411 is that the execution entities are different. Apart from that, the details of S607 can refer to the above introduction to S411, which will not be repeated here.

[0160] S608: The document assistant service reads the initial content of the clipboard from a preset storage address, and saves the initial content of the clipboard to the clipboard.

[0161] It should be noted that the details of "reading the initial content of the clipboard from a preset storage address and saving the initial content of the clipboard to the clipboard" in S608 can be referred to the introduction of "reading the initial content of the clipboard from a preset storage address and saving the initial content of the clipboard to the clipboard" in the above S414, which will not be repeated here.

[0162] S609: The document assistant service enters an interactive state.

[0163] The document assistant service entering the interactive state may include: activating the third area to prepare to receive user input or operation in the third area. The third area is used to display the HTML document.

[0164] In some embodiments, after the document assistant service saves the rich text to the clipboard and before the initial content of the clipboard is saved to the clipboard, the clipboard is occupied and the initial content in the clipboard is not restored. In order to avoid the problem of clipboard usage conflict caused by calling the clipboard during the period when the clipboard is occupied, the laptop computer may temporarily not respond to the target operation received during the period when the clipboard is occupied. The target operation may refer to an operation on the clipboard, for example, a copy operation or a paste operation.

[0165] by Figure 4 As an example, refer to the document processing method shown in Figure 7 , describes the process by which a laptop computer temporarily becomes unresponsive to target operations received while the clipboard is occupied. Figure 7 As shown, Figure 4 The document processing method shown may include S701 - S702 after S409 , and may include S703 - S704 after S412 .

[0166] S701. The application service corresponding to the target document APP creates a monitoring service, and the monitoring service is used to monitor the target operation.

[0167] After the document assistant service saves the rich text to the clipboard, the clipboard is occupied. The application service corresponding to the target document APP can create a listening service to listen to the target operation on the clipboard.

[0168] In some embodiments, the application service corresponding to the target document APP executes S701 after S409, and S701 may include: the application service creates a listening service in response to the second replacement instruction.

[0169] It should be noted that the embodiment of the present application does not limit the sequence of S701 and S410.

[0170] S702: When the notebook computer receives the target operation, the monitoring service saves the target operation into a preset queue.

[0171] When the laptop displays the third workbench interface, it can receive the target operation input by the user, and the monitoring service can save the target operation to a preset queue. The preset queue can be a temporary queue created by the monitoring service.

[0172] In some embodiments, after receiving the target operation, the laptop computer can not only monitor the service to save the target operation into a preset queue, but also display a first prompt message on the display screen. The first prompt message is used to prompt that the target operation has been received and is being processed.

[0173] Optionally, the laptop computer may display the first prompt information within a first duration, for example, the first duration may be 2 seconds (s), 3s or 5s.

[0174] For example, Figure 8 As shown, when the laptop displays the third workbench interface 560, a paste operation is received, and in response to the paste operation, the laptop displays a first prompt message 810 on the third workbench interface 560. The content of the first prompt message 810 may include: the paste operation has been received and is being processed.

[0175] S703: When the application service determines that the rich text in the clipboard is pasted into the target document APP, it sends a pause monitoring instruction to the monitoring service.

[0176] The application service sends a pause monitoring instruction to the monitoring service to instruct the monitoring service to pause monitoring the target operation.

[0177] In some embodiments, the application service corresponding to the target document APP executes S703 after S412, and S703 may include: the application service sends a pause monitoring instruction to the monitoring service in response to the first paste response. The first paste response is used to indicate that the paste is completed.

[0178] It should be noted that the embodiment of the present application does not limit the sequence of S703 and S413.

[0179] S704: The monitoring service stops monitoring the target operation in response to the pause monitoring instruction, and executes the target operation in the preset queue.

[0180] The monitoring service stops monitoring the target operation in response to the pause monitoring instruction and executes the target operation in the preset queue.

[0181] In some embodiments, in order to prevent the occurrence of target events such as operating the mouse or operating the keyboard during the period when the clipboard is occupied, which may affect the laptop computer's replacement of the marked text content with rich text, the laptop computer may temporarily block the target event. Specifically, Figure 4 The document processing method shown may further include S705 after S409 and may include S706 after S412.

[0182] S705: The application service displays a second prompt message on the display screen, wherein the second prompt message is used to prompt to temporarily shield a target event, where the target event includes a mouse event, and a mouse event refers to an event of operating a mouse.

[0183] After the document assistant service saves the rich text to the clipboard, the clipboard is occupied. In addition to creating a listening service, the application service corresponding to the target document APP can also trigger the display screen to display the second prompt information.

[0184] In some embodiments, the application service corresponding to the target document APP executes S705 after S409, and S705 may include: the application service displays a second prompt information on the display screen in response to the second replacement instruction.

[0185] It should be noted that the embodiment of the present application does not limit the sequence of S701 and S705.

[0186] Optionally, the second prompt information may be a spinning animation. The main function of the spinning animation is to provide a visual feedback to the user, indicating that a certain process or operation is in progress and that processing of new operations is paused.

[0187] For example, Fig.9A As shown, when the laptop displays the third workbench interface 560, it receives and responds to the user's click operation on the option 562 of replacing the original text, and displays the second prompt information 910 on the third workbench interface 560. The second prompt information 910 is a rotating animation.

[0188] S706: When the application service determines that the rich text in the clipboard is pasted into the target document APP, cancel the display of the second prompt information on the display screen.

[0189] In some embodiments, the application service corresponding to the target document APP executes S706 after S412, and S706 may include: the application service responds to the first paste response and cancels displaying the second prompt information on the display screen.

[0190] It should be noted that the embodiment of the present application does not limit the sequence of S703 and S706.

[0191] For example, Fig. 9B As shown, when the laptop computer determines that the rich text in the clipboard is pasted into the target document APP, the fourth workbench interface 570 is displayed, and the second prompt information 910 is canceled.

[0192] For example, Figure 6 As an example, refer to the document processing method shown in Fig.10 , describes the process by which a laptop computer temporarily becomes unresponsive to target operations received while the clipboard is occupied. Fig.10 As shown, Figure 6The document processing method shown may include S701 - S702 and S705 after S601 , and may include S703 - S704 and S706 after S609 .

[0193] Among them, the application service corresponding to the target document APP executes S701 and S705 after S601. S701 may include: the application service creates a monitoring service in response to the first focus switching instruction; S705 may include: the application service displays a second prompt information on the display screen in response to the first focus switching instruction.

[0194] Among them, after S608, the document assistant service can send a third paste response to the application service corresponding to the target document APP, and the third paste response is used to indicate that the paste is completed. Further, the application service corresponding to the target document APP executes S703 and S706 after S609, and S703 may include: the application service responds to the third paste response and sends a pause monitoring instruction to the monitoring service; S706 may include: the application service responds to the third paste response and cancels the display of the second prompt information on the display screen.

[0195] Reference Fig.11 As shown, it is a flowchart of a document processing method provided by an embodiment of the present application. Fig.11 As shown, the display method may also include the following S1101-S1104.

[0196] S1101. The laptop computer displays a first interface, wherein the first interface includes first display content of a first APP, and the first display content includes a first document.

[0197] Exemplarily, S1101 may include S401, the first interface may be the first workbench interface, the first APP may be the target document APP, and the target document may be the first document.

[0198] S1102. The laptop computer displays a second interface in response to a first operation on the first document, wherein the first operation is used to select first text content in the first document, and the second interface includes second display content of the first APP, and the second display content includes the marked first text content.

[0199] Exemplarily, S1102 may include S402, the first operation may be the above-mentioned text option operation, the second interface may be the above-mentioned second workbench interface, the second display content of the first APP may be the second display content of the above-mentioned target document APP, the first text content may be the above-mentioned selected text content, and the marked first text content may be the above-mentioned marked first text content.

[0200] S1103. The laptop computer displays a third interface in response to the second operation, wherein the second operation is used to trigger typesetting of the first text content, and the third interface includes the second display content and a second document, and the second document includes the typeset first text content and an option to replace the original text.

[0201] Exemplarily, S1103 may include S405, the second operation may be the above-mentioned click operation on a typesetting style option, the third interface may be the above-mentioned third workbench interface, and the first text content after typeset may be the above-mentioned text content after typeset.

[0202] S1104. In response to the third operation on the option to replace the original text, the laptop computer displays a fourth interface, wherein the fourth interface includes third display content of the first APP, the third display content includes the updated first document, and the updated first document includes the typeset first text content.

[0203] Exemplarily, S1104 may include S406-S411; or, S1104 may include S406 and S601-S607. The third operation may be the above-mentioned click operation on the option to replace the original text, the fourth interface may be the above-mentioned fourth workbench interface, and the third display content of the first APP may be the third display content of the above-mentioned target document APP.

[0204] In some embodiments, the third interface includes the second display content in the first preset area and the second document in the second preset area; the fourth interface includes the third display content in the first preset area and the second document in the second preset area; the first preset area includes the first preset area and the second preset area. Exemplarily, the first preset area may be an area other than the third area in the second area, and the second preset area may be the third area.

[0205] In some embodiments, after the laptop computer saves the rich text to the clipboard, it displays a preset prompt message; when it is determined that the rich text in the clipboard is pasted into the first APP, the preset prompt message is canceled. The preset prompt message is used to prompt to temporarily block the target event. Exemplarily, the preset prompt message can be the second prompt message mentioned above.

[0206] It is understandable that, in order to realize the above functions, the above electronic device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present application.

[0207] The embodiment of the present application can divide the functional modules of the above-mentioned electronic device according to the above-mentioned method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present invention is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0208] An embodiment of the present application also provides an electronic device, which includes: a memory and one or more processors; the memory is coupled to the processor; wherein computer program code is stored in the memory, and the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the document processing method provided in the aforementioned embodiment.

[0209] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the document processing method provided in the above embodiment.

[0210] An embodiment of the present application also provides a computer program product, which includes executable instructions. When the computer program product is run on an electronic device, the electronic device executes the document processing method provided in the above embodiment.

[0211] The present application also provides a chip system, such as Fig.12 As shown, the chip system 1200 includes at least one processor 1201 and at least one interface circuit 1202. The processor 1201 and the interface circuit 1202 can be interconnected through a line. For example, the interface circuit 1202 can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit 1202 can be used to send signals to other devices (such as the processor 1201).

[0212] Exemplarily, the interface circuit 1202 can read the instruction stored in the memory and send the instruction to the processor 1201. When the instruction is executed by the processor 1201, the chip system can execute each step in the above embodiment. Of course, the chip system can also include other discrete devices, which is not specifically limited in the embodiment of the present application.

[0213] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0214] In the several embodiments provided in the present application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0215] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0216] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0217] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0218] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application.

Claims

1. A document processing method, characterized in that: Applied in an electronic device, the electronic device includes a first APP, a document assistant service and a clipboard, and the method includes: Displaying a first interface, wherein the first interface includes first display content of the first APP, and the first display content includes a first document; In response to a first operation on the first document, displaying a second interface, wherein the first operation is used to select a first text content in the first document, and the second interface includes a second display content of the first APP, and the second display content includes the marked first text content; In response to a second operation, a third interface is displayed, wherein the second operation is used to trigger typeset of the first text content, the third interface includes the second display content and a second document, the second document includes the typeset first text content and an option to replace the original text; the second document includes a hypertext markup language HTML document; The document assistant service obtains the source code corresponding to the HTML document in response to the third operation on the option of replacing the original text, and parses the source code corresponding to the HTML document to obtain the typeset first text content; The document assistant service converts the typeset first text content into rich text, and saves the rich text to the clipboard; The document assistant service sends a first instruction to the first APP; In response to the first instruction, the first APP replaces the marked first text content in the second display content with the rich text in the clipboard, generates and displays a fourth interface, wherein the fourth interface includes the third display content of the first APP, the third display content includes the updated first document, and the updated first document includes the formatted first text content.

2. The method according to claim 1, characterized in that The method further comprises: The document assistant service sends a second instruction to the first APP in response to a third operation on the option of replacing the original text; The first APP enters an interactive state in response to the second instruction, and sends a first response to the document assistant service; The document assistant service obtains the source code corresponding to the HTML document in response to the first response, and parses the source code corresponding to the HTML document to obtain the typeset first text content; The document assistant service converts the typeset first text content into rich text, and saves the rich text to the clipboard; The document assistant service replaces the marked first text content in the second display content with the rich text in the clipboard, generates the fourth interface, and displays it.

3. The method according to claim 2, characterized in that The third interface includes the second display content in the first preset area and the second document in the second preset area; the fourth interface includes the third display content in the first preset area and the second document in the second preset area; the first preset area includes the first preset area and the second preset area; The first APP entering the interactive state indicates that the focus of the electronic device is located in the first preset area; Wherein, after the document assistant service replaces the marked first text content in the second display content with the rich text in the clipboard, generates and displays the fourth interface, the method further includes: The document assistant service enters an interactive state, and the document assistant service entering an interactive state indicates that the focus of the electronic device is located within the second preset area.

4. The method according to any one of claims 1 to 3, characterized in that The method further includes: in response to the third operation, acquiring the initial content in the clipboard, and saving the initial content to a preset storage address; After replacing the marked first text content in the second display content with the rich text in the clipboard and generating and displaying the fourth interface, the method further includes: The initial content is read from the preset storage address, and the initial content is saved in the clipboard.

5. The method according to any one of claims 1 to 3, characterized in that: After saving the rich text to the clipboard, the method further includes: Creating a monitoring service, wherein the monitoring service is used to monitor a target operation, wherein the target operation includes a copy operation or a paste operation; receiving a fourth operation, the monitoring service saving the fourth operation into a preset queue, the fourth operation belonging to the target operation; When it is determined that the rich text in the clipboard is pasted into the first APP, the monitoring service stops monitoring the target operation and executes the fourth operation in the preset queue.

6. The method according to any one of claims 1 to 3, characterized in that After saving the rich text to the clipboard, the method further includes: Displaying preset prompt information, wherein the preset prompt information is used to prompt to temporarily block a target event, and the target event includes a mouse event; When it is determined that the rich text in the clipboard is pasted into the first APP, the preset prompt information is canceled.

7. The method according to any one of claims 1 to 3, characterized in that The first APP includes WPS® APP, Word® APP or Yongzhong® APP, and the first document includes a Word® document; The electronic device also includes a second APP, the second document includes an HTML document, and the first interface, the second interface, the third interface and the fourth interface are all interfaces in the second APP.

8. The method according to claim 7, characterized in that Before displaying the third interface in response to the second operation, the method further includes: The second APP displays a first window on the second interface, where the first window includes layout options; The second APP displays a second window on the second interface in response to a fifth operation on the typesetting option, wherein the second window includes at least one typesetting style, and the second operation includes a click operation on one typesetting style of the at least one typesetting style; The displaying of the third interface in response to the second operation includes: The second APP generates the HTML document in response to the second operation based on the typesetting style selected by the second operation and the first text content; The second APP displays the third interface based on the HTML document.

9. An electronic device, characterized in that: The electronic device comprises: a processor, a memory and a communication interface; the memory and the communication interface are coupled to the processor, the memory is used to store computer program code, and the computer program code comprises computer instructions; wherein, when the processor executes the computer instructions, the electronic device executes the method as described in any one of claims 1-8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions; when the computer instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 8.

11. A chip system, characterized in that: The chip system includes a processor and an interface circuit, and the processor and the interface circuit can be interconnected via lines; wherein the interface circuit is used to receive a signal from an electronic device and send the signal to the processor, and the signal includes a computer instruction; when the processor executes the computer instruction, the chip system executes the method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Interaction method and device, electronic equipment and storage medium

    CN116795261A