Compilation method of description document, related device, equipment and storage medium
By using accessibility services to obtain feature text and page screenshots of the application page, and automatically analyze and generate description documents, solving the problems of inefficient and insufficient accuracy of manual writing software functions, and achieving efficient and accurate description documents.
Patent Information
- Application Number
- CN202410953372.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2024-12-17
AI Technical Summary
In the prior art, software function descriptions of applications are usually written manually by developers, resulting in inefficient preparation and possible inaccurate description problems.
By responding to the trigger instructions for preparing description documents for target applications, use accessibility services to obtain the feature text of the current page, and combine the page screenshots to import them into the document compilation program, performing automated analysis to generate page documents, and improving the accuracy of information extraction and compilation. .
It realizes automatic compilation of explanatory documents, improves compilation efficiency and accuracy, and reduces human errors.
Smart Images

Figure CN119149096A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer software technology, and in particular to a method for compiling a description document and related devices, equipment and storage media. Background Art
[0002] As the functions of computer applications become more and more diverse, software functional descriptions for applications are an indispensable part of understanding the applications.
[0003] However, currently, software function descriptions for applications are usually written manually by developers, which is not only time-consuming and labor-intensive, resulting in low compilation efficiency, but may also lead to inaccurate descriptions of software functions due to personal subjective factors.
[0004] Therefore, how to improve the efficiency and accuracy of document preparation has become an urgent problem to be solved. Summary of the invention
[0005] The main technical problem solved by the present application is to provide a method for compiling an explanatory document and related devices, equipment and storage media, which can improve the efficiency and accuracy of compiling the explanatory document.
[0006] In order to solve the above-mentioned technical problems, the first aspect of the present application provides a method for preparing an explanatory document, which comprises: responding to a trigger instruction indicating that an explanatory document is to be prepared for a target application, keeping the accessibility service of the target application's operating environment turned on, and obtaining feature text extracted by the accessibility service from the current page of the target application; obtaining a page screenshot of the current page, and importing the page screenshot into a document preparation program, and importing the feature text into the document preparation program; obtaining a page document obtained by analyzing the page screenshot and the feature text by the document preparation program; wherein the page document is used to describe the function of the current page, and the explanatory document includes a page document of at least one program page in the target application.
[0007] In order to solve the above-mentioned technical problems, the second aspect of the present application provides a device for compiling an explanatory document, and the device for compiling an explanatory document includes a response module, an import module and an acquisition module; the response module is used to respond to a trigger instruction representing the compilation of an explanatory document for a target application, keep the accessibility service of the target application running environment in an turned-on state, and obtain the feature text extracted by the accessibility service on the current page of the target application; the import module is used to obtain a page screenshot of the current page, import the page screenshot into a document compilation program, and import the feature text into the document compilation program; the acquisition module is used to obtain a page document obtained by the document compilation program by analyzing the page screenshot and the feature text; wherein, the page document is used to describe the function of the current page, and the explanatory document includes a page document of at least one program page in the target application.
[0008] In order to solve the above technical problem, the third aspect of the present application provides an electronic device, including a memory and a processor coupled to each other, and the processor is used to execute program instructions stored in the memory to implement the method for compiling the instruction document in the above first aspect.
[0009] In order to solve the above technical problems, the fourth aspect of the present application provides a computer-readable storage medium on which program instructions are stored. When the program instructions are executed by a processor, the method for compiling the instruction document in the first aspect is implemented.
[0010] The above scheme, in response to a trigger instruction for preparing a description document for the target application, keeps the accessibility service of the target application running environment turned on, obtains the feature text extracted by the accessibility service on the current page of the target application, obtains a page screenshot of the current page, imports the page screenshot into the document preparation program, and imports the feature text into the document preparation program, and then obtains a page document obtained by the document preparation program analyzing the page screenshot and the feature text; wherein the page document is used to describe the function of the current page, and the description document includes a page document of at least one program page in the target application. Therefore, compared with text recognition of the page screenshot, directly obtaining the feature text of the current page through the accessibility service can improve the accuracy of information extraction from the current page, thereby helping to improve the accuracy of the document preparation program analyzing the page screenshot and the feature text, and obtaining the page document through the document preparation program can realize the automatic preparation of the description document in a machine-assisted manner, which helps to improve the preparation efficiency of the description document, and therefore, can improve the preparation efficiency and accuracy of the description document. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 A flowchart of an embodiment of a method for preparing a description document of this application;
[0012] Figure 2 A schematic diagram of an interface of an embodiment of a target application program;
[0013] Figure 3 A schematic diagram of an interface of an embodiment of a document preparation program;
[0014] Figure 4 A schematic diagram of a framework of an embodiment of a device for compiling a description document of this application;
[0015] Figure 5 A schematic diagram of a framework of an embodiment of an electronic device of the present application;
[0016] Figure 6 A schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0017] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.
[0018] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.
[0019] The term "multiple" herein means two or more than two. In addition, the term "at least one" herein means any combination of at least two of any one or more of a plurality of, for example, including at least one of A, B, and C, and may mean including any one or more elements selected from the set consisting of A, B, and C.
[0020] See also Figure 1 , Figure 1 The following is a flow chart of an embodiment of a method for preparing a description document of the present application, specifically, comprising the following steps:
[0021] Step S11: In response to a trigger instruction indicating the preparation of a description document for a target application, the accessibility service of the target application running environment is kept enabled, and feature text extracted by the accessibility service from the current page of the target application is obtained.
[0022] In the disclosed embodiment, the barrier-free service is a set of system-level APIs (Application Programming Interface) that can simulate operations. After the operating system authorizes the barrier-free service to be enabled, the barrier-free service can control the application running in the operating system, such as obtaining the text of the application page, automatic reply, auditory assistance, visual assistance, etc. Among them, the operating system can be an Android system; or, the operating system can also be other systems that have the ability to obtain text in the program page. It should be noted that the title of "barrier-free service" is only used as an example. In the Android system or other operating systems other than the Android system, the system service that has the ability to obtain text in the program page can also be other titles, which are not limited here. For example, in the Windows operating system, the "narrator" function can obtain information such as controls and text on the application page, so in the Windows operating system, the "narrator" can be regarded as an "accessibility service". Other situations can be deduced by analogy, and examples are not given one by one here.
[0023] In the disclosed embodiment, the target application's operating environment may be the aforementioned Android system or other operating systems, and the operating system responds to a trigger instruction representing the preparation of a description document for the target application, so as to keep the accessibility service of the target application's operating environment turned on, and the operating system obtains the feature text extracted by the accessibility service on the current page of the target application.
[0024] In one implementation scenario, in order to compile a description document for a target application, it is first necessary to trigger a trigger instruction representing the compilation of a description document for the target application. For example, the trigger instruction may be to open the current page of the target application, or to long press a blank position on the current page.
[0025] In one implementation scenario, the target application may include, but is not limited to: a weather application, a car master application, a smart examination application, a news application, etc.
[0026] In one implementation scenario, the current page of the target application may be suspended with a floating window, and after acquiring the feature text extracted by the accessibility service on the current page of the target application, the feature text is displayed in the floating window. Therefore, the floating window displaying the feature text is suspended on the current page, and the specific content of the feature text can be displayed to verify the feature text, thereby improving the robustness of feature text acquisition.
[0027] In a specific implementation scenario, the current page of the target application can also display a document compilation program in a suspended state. After the trigger instruction for compiling a description document for the target application is triggered, the document compilation program obtains the suspended display permission of the operating environment, and after the suspended display permission is enabled, the document compilation program is suspended on the current page of the target application in the form of background running. Therefore, by importing the feature text displayed in suspension on the current page into the document compilation program that is also displayed in suspension on the current page, the step of opening the document compilation program to import the feature text can be omitted, thereby improving the accuracy of feature text acquisition and the efficiency of feature text importing.
[0028] For example, see Figure 2 , Figure 2 This is an interface diagram of an embodiment of the target application of the present application, wherein the target application is a weather application, and a floating window is displayed on the current page of the target application, wherein feature text and a document compilation program are displayed in the floating window. In this case, operations can be performed directly on the current page to import the feature text into the document compilation program.
[0029] Step S12: Obtain a page screenshot of the current page, import the page screenshot into a document compilation program, and import the feature text into the document compilation program.
[0030] In an implementation scenario, a screenshot of the current page can be obtained through a system screenshot function in the target application running environment, and then the page screenshot can be imported into a document preparation program by copying and pasting.
[0031] In another implementation scenario, the document preparation program may obtain the screenshot permission of the operating environment, and then the document preparation program may take a screenshot of the current page of the target application, and then the document preparation program may directly obtain the page screenshot.
[0032] In one implementation scenario, the characteristic text is displayed in a floating window, and the floating window is displayed in a floating manner on the current page. When a copy instruction for the characteristic text in the floating window is detected, the characteristic text is imported into the document compilation program. Therefore, by displaying the floating window displaying the characteristic text in a floating manner on the current page, and then performing a copy operation based on the characteristic text in the floating window, the characteristic text can be visually verified before being imported into the document compilation program, which can improve the accuracy of obtaining the characteristic text compared to directly copying the characteristic text from the current page.
[0033] In a specific implementation scenario, please continue to refer to Figure 2 , the floating window is provided with a first control "one-click copy" for triggering a copy instruction. The form of the first control may include but is not limited to: button form, icon form, etc., and the triggering instruction for the first control may include but is not limited to: click trigger, remote sensing trigger, etc. When the triggering instruction for the first control is detected, it can be determined that the copy instruction for the characteristic text in the floating window is detected, and then the characteristic text can be imported into the document preparation program. Therefore, by responding to the trigger of the first control on the floating window, the copy instruction for the characteristic text in the floating window is detected, which can improve the convenience of detecting the copy instruction, and then improve the convenience of importing the characteristic text.
[0034] It should be noted that the second control, the third control, the fourth control, the fifth control and the sixth control involved in the subsequent embodiments are similar in form to the first control, and the trigger instructions for the second control, the third control, the fourth control, the fifth control and the sixth control are also similar in form to the trigger instructions for the first control, and will not be described in detail in the subsequent embodiments.
[0035] In a specific implementation scenario, in order to improve the efficiency of importing feature text into a document writing program, the document writing program is enabled to listen to the clipboard by obtaining the listening permission of the document writing program in the running environment, and then the feature text on the floating window is copied to the clipboard. When the document writing program listens to the new text on the clipboard, the new text is automatically imported into the document writing program. The new text on the clipboard is the feature text. Therefore, by the document writing program listening to the clipboard, and when the new text is listened to on the clipboard, the new text is automatically imported into the document writing program, which can simplify the triggering operation of the control and improve the efficiency of importing the feature text.
[0036] Step S13: Obtain a page document obtained by analyzing the page screenshot and feature text by a document compilation program; wherein the page document is used to describe the function of the current page, and the description document includes a page document of at least one program page in the target application.
[0037] In one implementation scenario, the page document includes at least an explanatory text of the function description, and the document preparation program is also provided with a fourth control for triggering text polishing. When a trigger instruction for the fourth control is detected, the description style of the function description can be determined, and the explanatory text can be generated based on the description style. In addition, the description style of the function description may include, but is not limited to: concise, detailed, professional, etc. As a possible example, the target application is a puzzle game application, and the description style of the function description of the puzzle game application can be light, interesting, detailed, etc. As another possible example, the target application is a news application, and the description style of the function description of the news application can be professional, in-depth, etc., which will not be listed one by one here. Therefore, by adding the description style of the function description, it is possible to generate explanatory texts with different description styles according to different scenarios, which helps to improve the flexibility of the description document preparation.
[0038] In one implementation scenario, the page document at least includes an explanatory text describing the function. In order to further improve the efficiency of compiling the explanatory document, the document compilation application can be connected to the large language model. For example, the large language model can be integrated into the document compilation application through the use of an API to achieve the connection, or the large language model can also be run locally and connected through the underlying signaling transmission of the system. After being connected to the document compilation application, the large language model obtains the page screenshots and feature texts in the document compilation program, and generates explanatory texts based on the page screenshots and feature texts, and then imports the generated explanatory texts into the document compilation program. Therefore, the document compilation program analyzes the page screenshots and feature texts with the help of the large language model, and can use the semantic analysis capabilities of the large language model to perform multimodal analysis, which helps to improve the efficiency and accuracy of the compilation of the explanatory document.
[0039] In a specific implementation scenario, a prompt instruction is constructed as input information of the large language model to instruct the large language model to generate an explanatory text of the function description with reference to the page screenshot and the feature text. Specifically, based on the page screenshot and the feature text, a prompt instruction is constructed and input into the large language model, so that the explanatory text received by the document preparation program from the large language model can be obtained.
[0040] In a specific implementation scenario, the document preparation program is further provided with a fourth control for triggering text polishing in the aforementioned embodiment. When a trigger instruction for the fourth control is detected, the description style of the function description is determined, and the description style, page screenshots, and feature text are analyzed using a large language model to generate an explanation text. In addition, in order to simplify the manipulation of the control, a prompt instruction can also be directly constructed based on the description style, page screenshots, and feature text to instruct the large language model to generate an explanation text with reference to the description style, page screenshots, and feature text.
[0041] In a specific implementation scenario, the document preparation program is also provided with a fifth control for triggering language selection. When a trigger instruction for the fifth control is detected, the target language of the function description is determined, and the page screenshots and feature texts are analyzed using a large language model to generate an explanatory text in the target language. In addition, in order to simplify the manipulation of the controls, prompt instructions can also be constructed directly based on the target language, page screenshots, and feature texts to instruct the large language model to generate an explanatory text in the target language with reference to the target language, page screenshots, and feature texts. Among them, the target language may include, but is not limited to: Chinese, English, Japanese, Korean, etc. Therefore, by compiling the explanatory text in multiple languages, the use environment of the explanatory document can be enriched.
[0042] In a specific implementation scenario, the large language model may include but is not limited to: LLAMA, Bloom and other open source large models, and the specific structure of the large language model is not limited here.
[0043] In one implementation scenario, a page document includes a functional description of explanatory text and a page screenshot. The document compilation program is provided with a second control for setting the document layout. When a trigger instruction for the second control is detected, the layout style of the page document is determined, and the explanatory text and the page screenshot are typeset according to the layout style to obtain the page document. Among them, the layout style can be that the page screenshot and the explanatory text are typeset up and down, or the layout style can be that the page screenshot and the explanatory text are typeset left and right, or the layout style can also be that the explanatory text and the page screenshot are overlapped, and the explanatory text is displayed on the layer of the page screenshot. Therefore, by typeset the explanatory text and the page screenshot according to the layout style, the diversification of the layout style of the compiled explanatory document can be achieved.
[0044] In one implementation scenario, the page document includes a functional description text and a page screenshot, and the document preparation program is also provided with a third control for setting the document theme. When a trigger instruction for the third control is detected, the theme style of the page document is determined, and the page document displayed according to the theme style is obtained. The theme style may include but is not limited to: theme style, background color, etc. Therefore, displaying the page document according to the preset theme style can achieve the diversification of the theme style of the prepared instruction document.
[0045] In one implementation scenario, the document preparation program includes a preview interface, which displays a page document. When a preview instruction is detected, the program jumps from the current interface (at least the interface used to analyze page screenshots and feature text) to the preview interface to display the page document.
[0046] In a specific implementation scenario, the preview interface is provided with a second control for setting the document layout in the aforementioned embodiment. When a trigger instruction for the second control is detected, the layout style of the page document is determined, and the description text and page screenshots that are typeset according to the layout style are displayed on the preview interface. Therefore, by setting the preview interface to intuitively pre-display the layout style of the description text and page screenshots, the layout style can be switched as needed when necessary, which helps to achieve the diversification of the description document layout style while improving the flexibility of the description document preparation.
[0047] In a specific implementation scenario, the preview interface is provided with the third control for setting the document theme in the aforementioned embodiment. When a trigger instruction for the third control is detected, the theme style of the page document is determined, and the page document displayed according to the theme style is displayed on the preview interface. Therefore, by setting the preview interface to intuitively pre-display the page document under the preset theme style, the theme style can be switched as needed when necessary, which helps to achieve the diversification of the theme style of the description document while improving the flexibility of the description document preparation.
[0048] In a specific implementation scenario, the preview interface also includes a return control and a save control. When a trigger instruction for the return control is detected, the interface returns to the original interface (at least the interface used to analyze page screenshots and feature texts); when a trigger instruction for the save control is detected, the page document of the current page is saved to a local file.
[0049] In one implementation scenario, the document preparation program includes at least a generation interface and a preview interface, the generation interface includes at least a first input control, a second input control and an output control, the first input control is used to import a page screenshot, the second input control is used to import a feature text, the output control is used to display the description text generated based on the page screenshot and the feature text, and the preview interface is used to display the page document. Among them, the generation interface and the preview interface can include human-computer interaction and a graphical user interface, the first input control can be a dialog box for inputting an image, the second input control can be a dialog box for inputting text, and the output control includes at least a dialog box for displaying the description text in the page document. Therefore, through the specific architecture of the document preparation program, the automatic arrangement of the description document can be realized, thereby improving the efficiency of the preparation of the description document.
[0050] For example, see Figure 3 , Figure 3 This is a schematic diagram of the interface of an embodiment of the application document preparation program. Figure 3 The left picture is a schematic diagram of the generation interface. Figure 3 The right picture is a schematic diagram of the preview interface. In the generation interface, the first input control is the dialog box for importing page screenshots in Step 1, the second input control is the dialog box for importing feature text in Step 2, the output control includes the dialog box in Step 3, and the generation interface is connected to the large language model, which is used to receive the explanatory text output by the large language model analyzing the page screenshots and feature text, and display the explanatory text in the dialog box in Step 3. In addition, the output control also includes a fourth control "text polishing" for triggering text polishing. When a trigger instruction for the fourth control is detected, the description style of the function description is determined, and the large language model is triggered to generate the explanatory text based on the description style, page screenshots and feature text. In addition, the output control also includes a sixth control "regenerate" for triggering the regeneration of the explanatory text. When a trigger instruction for the sixth control is detected, the large language model can be triggered to regenerate the explanatory text based on the description style, page screenshots and feature text. The generation interface also includes a preview control "effect preview". When a preview instruction for the preview control is detected, it can jump from the generation interface to the preview interface. The preview interface displays a page document, and the page document includes a page screenshot and an explanatory text generated in the generation interface. The upper left corner of the preview interface includes a return control, and the upper right corner of the preview interface includes a save control. When a trigger instruction for the return control is detected, you can return to the generation interface from the preview interface. When a trigger instruction for the save control is detected, you can save the page document of the current page to a local file.
[0051] In one implementation scenario, the current page of the target application has folds, and the folds are represented by target text, such as "show more", "expand", etc. In this case, it is necessary to detect whether the target text is included in the feature text, and if the target text is included in the feature text, expand the fold on the current page to obtain a new current page, and for the new current page, return to step S11 of obtaining the feature text extracted by the accessibility service on the current page of the target application to obtain the page document of the new current page, and then return to the step of detecting whether the target text is included in the feature text for the latest feature text, until the target text is not included in the latest feature text. Therefore, by detecting whether the current page of the target application has folds, and expanding the folds if there are folds, and re-obtaining the page screenshot and feature text based on the expanded new current page, the information of the current page can be obtained as comprehensive as possible as feature text, thereby improving the accuracy of document preparation.
[0052] In an implementation scenario, the description document of the target application may include a page document of a program page, or may include a plurality of page documents obtained by respectively using a plurality of program pages as the current page.
[0053] The above scheme, in response to a trigger instruction for preparing a description document for the target application, keeps the accessibility service of the target application running environment turned on, obtains the feature text extracted by the accessibility service on the current page of the target application, obtains a page screenshot of the current page, imports the page screenshot into the document preparation program, and imports the feature text into the document preparation program, and then obtains a page document obtained by the document preparation program analyzing the page screenshot and the feature text; wherein the page document is used to describe the function of the current page, and the description document includes a page document of at least one program page in the target application. Therefore, compared with text recognition of the page screenshot, directly obtaining the feature text of the current page through the accessibility service can improve the accuracy of information extraction from the current page, thereby helping to improve the accuracy of the document preparation program analyzing the page screenshot and the feature text, and obtaining the page document through the document preparation program can realize the automatic preparation of the description document in a machine-assisted manner, which helps to improve the preparation efficiency of the description document, and therefore, can improve the preparation efficiency and accuracy of the description document.
[0054] See also Figure 4 , Figure 4This is a framework diagram of an embodiment of a device for compiling a description document of the present application, wherein the device 40 for compiling a description document includes a response module 41, an import module 42 and an acquisition module 43; the response module 41 is used to respond to a trigger instruction representing the compilation of a description document for a target application, keep the accessibility service of the target application running environment in an on state, and obtain feature text extracted by the accessibility service on the current page of the target application; the import module 42 is used to obtain a page screenshot of the current page, import the page screenshot into a document compilation program, and import the feature text into the document compilation program; the acquisition module 43 is used to obtain a page document obtained by analyzing the page screenshot and the feature text by the document compilation program; wherein the page document is used to describe the function of the current page, and the description document includes a page document of at least one program page in the target application.
[0055] In the above scheme, the description document preparation device 40 responds to the trigger instruction for preparing the description document for the target application, keeps the accessibility service of the target application running environment in the open state, obtains the feature text extracted by the accessibility service on the current page of the target application, and obtains the page screenshot of the current page, then imports the page screenshot into the document preparation program, and imports the feature text into the document preparation program, and then obtains the page document obtained by the document preparation program analyzing the page screenshot and the feature text; wherein the page document is used to describe the function of the current page, and the description document includes the page document of at least one program page in the target application. Therefore, compared with text recognition of the page screenshot, directly obtaining the feature text of the current page through the accessibility service can improve the accuracy of information extraction from the current page, and then help improve the accuracy of the document preparation program analyzing the page screenshot and the feature text, and the page document obtained through the document preparation program can realize the automatic preparation of the description document in a machine-assisted manner, which helps to improve the preparation efficiency of the description document, and therefore, can improve the preparation efficiency and accuracy of the description document.
[0056] In some disclosed embodiments, the document preparation device 40 also includes a display module, which is used to display a floating window with characteristic text on the current page after the response module obtains the characteristic text extracted by the accessibility service on the current page of the target application and before the import module imports the characteristic text into the document preparation program. The import module is specifically used to import the characteristic text into the document preparation program in response to detecting a copy instruction for the characteristic text in the floating window.
[0057] Therefore, by displaying a floating window with feature text on the current page and then performing a copy operation based on the floating window, the feature text can be verified before importing it into the document compilation program. Compared with directly copying the feature text from the current page, the accuracy of feature text acquisition can be improved.
[0058] In some disclosed embodiments, the floating window is provided with a first control for triggering a copy instruction, and the import module is further specifically configured to determine that a copy instruction for a feature text in the floating window has been detected in response to detecting a trigger instruction for the first control.
[0059] Therefore, by triggering the first control on the floating window and determining that a copy instruction for the feature text in the floating window is detected, the convenience of importing the feature text can be improved.
[0060] In some disclosed embodiments, the document compilation program monitors the clipboard, and the import module is specifically used to copy the feature text on the floating window to the clipboard; wherein the new text on the clipboard is the feature text; in response to monitoring the new text on the clipboard, the new text is automatically imported into the document compilation program.
[0061] Therefore, by monitoring the clipboard through the document compilation program, and when new text is detected on the clipboard, the new text is automatically imported into the document compilation program, which can simplify the triggering operation of the control and improve the efficiency of importing feature text.
[0062] In some disclosed embodiments, before the display module displays the floating window with the characteristic text on the current page, the display module is further used to obtain the floating display permission of the operating environment for the document compilation program in response to the trigger instruction.
[0063] Therefore, the document writing program obtains the floating display permission of the operating environment, and can import the feature text floatingly displayed on the current page into the document writing program that is also floatingly displayed on the current page, thereby improving the accuracy of feature text acquisition while improving the efficiency of feature text importing.
[0064] In some disclosed embodiments, a page document includes explanatory text and page screenshots of a functional description, a document compilation program is provided with a second control for setting the document layout, and the document compilation program is also provided with a third control for setting the document theme, the explanatory document compilation device 40 also includes a first determination module and a second determination module, the first determination module is used to determine the layout style of the page document in response to detecting a trigger instruction for the second control, and to layout the explanatory text and the page screenshot based on the layout style to obtain the page document, and the second determination module is used to determine the theme style of the page document in response to detecting a trigger instruction for the third control, and to obtain the page document displayed according to the theme style.
[0065] Therefore, by typeset the description text and the page screenshot according to the typesetting style and / or displaying the page document according to the preset theme style, the style of the compiled description document can be diversified.
[0066] In some disclosed embodiments, the document preparation device 40 also includes a jump module, which is used to jump to a preview interface in response to detecting a preview instruction; wherein the preview interface displays a page document, and the preview interface is provided with at least one of a second control for setting the document layout and a third control for setting the document theme.
[0067] Therefore, by setting the preview interface to intuitively pre-display the typesetting style of the explanatory text and page screenshots, and / or intuitively pre-display the page document under a preset theme style, the typesetting style and / or theme style can be switched as needed when necessary, which helps to improve the flexibility of explanatory document preparation while achieving diversification of explanatory document styles.
[0068] In some disclosed embodiments, the page document includes at least explanatory text of the function description, and the document compilation program is also provided with a fourth control for triggering text polishing. The compilation device 40 of the explanatory document also includes a third determination module, and the third determination module is used to determine the description style of the function description in response to detecting a trigger instruction for the fourth control, and generate the explanatory text based on the description style.
[0069] Therefore, by adding description styles of functional descriptions, such as concise, detailed, professional, etc., it is possible to generate description texts with different description styles according to different scenarios, which helps to improve the flexibility of document preparation.
[0070] In some disclosed embodiments, the document preparation device 40 also includes a detection module, which is used to detect whether the feature text includes the target text; wherein the target text indicates that there is a fold on the current page; and in response to the feature text including the target text, the module unfolds the fold on the current page to obtain a new current page, and for the new current page, returns to the step of obtaining the feature text extracted by the accessibility service on the current page of the target application to obtain the page document of the new current page; and for the latest feature text, returns to the step of detecting whether the target text is included in the feature text, until the target text is not included in the latest feature text.
[0071] Therefore, by detecting whether there is a fold in the current page of the target application, and expanding the fold if it exists, and re-obtaining the page screenshot and feature text based on the new current page after the expansion, the information of the current page can be obtained as comprehensive as possible as feature text, thereby improving the accuracy of document preparation.
[0072] In some disclosed embodiments, the page document includes at least an explanatory text of the function description, and the acquisition module 43 also includes an acquisition submodule, which is used to construct a prompt instruction based on the page screenshot and the feature text; wherein the prompt instruction is used to instruct the large language model to generate the explanatory text with reference to the page screenshot and the feature text, and the document compilation program is connected to the large language model, and the prompt instruction is input into the large language model to obtain the explanatory text received by the document compilation program from the large language model.
[0073] Therefore, the document preparation program uses the large language model to analyze page screenshots and feature texts, and can use the semantic analysis capabilities of the large language model to perform multimodal analysis, which helps to improve the efficiency and accuracy of document preparation.
[0074] In some disclosed embodiments, a document compilation program includes at least a generation interface and a preview interface, the generation interface includes at least a first input control, a second input control, and an output control, the first input control is used to import a page screenshot, the second input control is used to import a feature text, the output control is used to display an explanatory text generated based on the page screenshot and the feature text, the preview interface is used to display a page document, and the page document includes a page screenshot and an explanatory text.
[0075] Therefore, through the specific architecture of the document preparation program, the automatic arrangement of the description document can be realized, thereby improving the efficiency of preparing the description document.
[0076] See also Figure 5 , Figure 5 1 is a schematic diagram of a framework of an embodiment of an electronic device 50 of the present application. The electronic device 50 includes a memory 51 and a processor 52 coupled to each other, and the processor 52 is used to execute program instructions stored in the memory 51 to implement the steps in any of the above-mentioned document preparation method embodiments. Specifically, the electronic device 50 may include, but is not limited to: a microcomputer, a server, a laptop computer, a tablet computer, a smart phone, etc., which are not limited here.
[0077] Specifically, the processor 52 is used to control itself and the memory 51 to implement the steps of any of the above-mentioned document preparation method embodiments. The processor 52 can also be called a CPU (Central Processing Unit). The processor 52 may be an integrated circuit chip with signal processing capabilities. The processor 52 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 52 can be implemented by an integrated circuit chip.
[0078] In the above scheme, the electronic device 50 responds to the trigger instruction for compiling a description document for the target application, keeps the accessibility service of the target application running environment turned on, obtains the feature text extracted by the accessibility service on the current page of the target application, obtains a page screenshot of the current page, imports the page screenshot into the document compilation program, and imports the feature text into the document compilation program, and then obtains the page document obtained by the document compilation program analyzing the page screenshot and the feature text; wherein the page document is used to describe the function of the current page, and the description document includes the page document of at least one program page in the target application. Therefore, compared with text recognition of the page screenshot, directly obtaining the feature text of the current page through the accessibility service can improve the accuracy of information extraction from the current page, and thus help improve the accuracy of the document compilation program analyzing the page screenshot and the feature text, and obtaining the page document through the document compilation program can realize the automatic compilation of the description document in a machine-assisted manner, which helps improve the compilation efficiency of the description document, and therefore, can improve the compilation efficiency and accuracy of the description document.
[0079] See also Figure 6 , Figure 6 The schematic diagram of the framework of an embodiment of a computer-readable storage medium 60 of the present application. The computer-readable storage medium 60 stores program instructions 61 that can be executed by a processor, and the program instructions 61 are used to implement the steps of the embodiment of the method for compiling the above-mentioned description document.
[0080] In the above scheme, the computer-readable storage medium 60 responds to the trigger instruction characterized by compiling a description document for the target application, keeps the accessibility service of the target application running environment in an open state, obtains the feature text extracted by the accessibility service on the current page of the target application, obtains a page screenshot of the current page, imports the page screenshot into the document compilation program, and imports the feature text into the document compilation program, and then obtains the page document obtained by the document compilation program analyzing the page screenshot and the feature text; wherein the page document is used to describe the function of the current page, and the description document includes the page document of at least one program page in the target application. Therefore, compared with text recognition of the page screenshot, directly obtaining the feature text of the current page through the accessibility service can improve the accuracy of information extraction from the current page, thereby helping to improve the accuracy of the document compilation program analyzing the page screenshot and the feature text, and obtaining the page document through the document compilation program can realize the automatic compilation of the description document in a machine-assisted manner, which helps to improve the compilation efficiency of the description document, and therefore, can improve the compilation efficiency and accuracy of the description document.
[0081] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0082] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.
[0083] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as units or components can be combined or integrated into another system, 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, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0084] 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.
[0085] 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 computer-readable storage medium. Based on this understanding, the technical solution 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, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0086] If the technical solution of this application involves personal information, the product using the technical solution of this application has clearly informed the personal information processing rules and obtained the individual's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using the technical solution of this application has obtained the individual's separate consent before processing the sensitive personal information, and at the same time meets the "explicit consent" requirement. For example, on personal information collection devices such as cameras, clear and prominent signs are set to inform that the personal information collection scope has been entered and personal information will be collected. If the individual voluntarily enters the collection scope, it is deemed that he or she agrees to the collection of his or her personal information; or on the device that processes personal information, the personal information processing rules are notified by obvious signs / information, and the individual's authorization is obtained through pop-up information or by asking the individual to upload his or her personal information; among them, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the type of personal information processed.
Claims
1. A method for compiling a description document, characterized in that: include: In response to a trigger instruction indicating that a description document is to be prepared for a target application, an accessibility service of a running environment of the target application is kept enabled, and feature text extracted by the accessibility service from a current page of the target application is obtained; Obtaining a page screenshot of the current page, and importing the page screenshot into a document compilation program, and importing the feature text into the document compilation program; A page document is obtained by analyzing the page screenshot and the feature text by the document compilation program; wherein the page document is used to describe the function of the current page, and the description document includes a page document of at least one program page in the target application.
2. The method according to claim 1, characterized in that After acquiring the characteristic text extracted by the accessibility service from the current page of the target application and before importing the characteristic text into the document compilation program, the method further includes: Floating and displaying a floating window displaying the characteristic text on the current page; The step of importing the feature text into a document preparation program comprises: In response to detecting a copy instruction for the feature text in the floating window, the feature text is imported into the document preparation program.
3. The method according to claim 2, characterized in that The floating window is provided with a first control for triggering the copy instruction, and the method further includes: In response to detecting a trigger instruction for the first control, it is determined that a copy instruction for the feature text in the floating window is detected.
4. The method according to claim 2, characterized in that: The document preparation program monitors the clipboard, and the importing of the characteristic text into the document preparation program includes: Copying the feature text on the floating window to the clipboard; wherein the new text on the clipboard is the feature text; In response to monitoring the new text on the clipboard, the new text is automatically imported into the document compilation program.
5. The method according to claim 2, characterized in that: Before the floating window displaying the characteristic text is displayed on the current page, the method further includes: In response to the trigger instruction, a floating display permission of the operating environment is obtained for the document preparation program.
6. The method according to claim 1, characterized in that The page document includes the explanatory text of the function description and the page screenshot, the document preparation program is provided with a second control for setting the document layout, and the method further includes: In response to detecting a trigger instruction for the second control, determining a typesetting style of the page document, and typeset the description text and the page screenshot based on the typesetting style to obtain the page document; And / or, the document preparation program is further provided with a third control for setting a document theme, and the method further comprises: In response to detecting a trigger instruction for the third control, a theme style of the page document is determined, and a page document displayed according to the theme style is acquired.
7. The method according to claim 1, characterized in that The method further comprises: In response to detecting a preview instruction, jump to a preview interface; wherein the preview interface displays a page document, and the preview interface is provided with at least one of a second control for setting the document layout and a third control for setting the document theme.
8. The method according to claim 1, characterized in that The page document at least includes the explanatory text of the function description, the document preparation program is further provided with a fourth control for triggering text polishing, and the method further includes: In response to detecting a trigger instruction for the fourth control, a description style of the function description is determined, and based on the description style, the description text is generated.
9. The method according to claim 1, characterized in that: The method further comprises: Detecting whether the characteristic text includes a target text; wherein the target text indicates that the current page has a fold; In response to the target text being included in the characteristic text, unfolding and folding the current page to obtain a new current page, and returning to the step of obtaining the characteristic text extracted by the accessibility service on the current page of the target application program for the new current page to obtain a page document of the new current page; For the latest feature text, return to the step of detecting whether the feature text includes the target text until the latest feature text does not include the target text.
10. The method according to claim 1, characterized in that The page document at least includes a description text of a function description, and the obtaining of the page document obtained by the document preparation program analyzing the page screenshot and the feature text includes: Based on the page screenshot and the feature text, a prompt instruction is constructed; wherein the prompt instruction is used to instruct the large language model to generate the description text with reference to the page screenshot and the feature text, and the document preparation program is connected to the large language model; The prompt instruction is input into the large language model, and the description text received by the document preparation program from the large language model is obtained.
11. The method according to any one of claims 1 to 10, characterized in that: The document preparation program includes at least a generation interface and a preview interface, the generation interface includes at least a first input control, a second input control and an output control, the first input control is used to import the page screenshot, the second input control is used to import the feature text, the output control is used to display the description text generated based on the page screenshot and the feature text, the preview interface is used to display the page document, and the page document includes the page screenshot and the description text.
12. A device for compiling a description document, characterized in that: include: a response module, configured to respond to a trigger instruction indicating that a description document is to be prepared for a target application, keep an accessibility service of a running environment of the target application in an enabled state, and obtain a feature text extracted by the accessibility service from a current page of the target application; An import module, used for obtaining a page screenshot of the current page, importing the page screenshot into a document compilation program, and importing the feature text into the document compilation program; The acquisition module is used to acquire the page document obtained by the document compilation program analyzing the page screenshot and the feature text; wherein the page document is used to describe the function of the current page, and the description document includes the page document of at least one program page in the target application.
13. An electronic device, characterized in that: It comprises a memory and a processor coupled to each other, wherein the processor is used to execute program instructions stored in the memory to implement the method for compiling a description document as claimed in any one of claims 1 to 11.
14. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the method for compiling a description document as described in any one of claims 1 to 11 is implemented.
