Interface recovery method and electronic equipment
By implementing the interface recovery method in electronic devices, the problem of abnormal shutdown of the note assistant function is solved, data continuity and user experience are ensured, and the continuous and stable operation of the note assistant function is achieved.
Patent Information
- Application Number
- CN202411303292.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-09-18
AI Technical Summary
When using the Notes Assistant function, there is an abnormal shutdown problem, which affects the user's user experience.
By implementing the interface recovery method in the electronic device, including saving the data output by the application assistant when destroying the first activity, and using the saved data to display the second interface when creating the second activity, data continuity and user experience are ensured.
It realizes the continuous and stable operation of the note assistant function, ensures the consistency and efficiency of user operations, and improves the user experience.
Smart Images

Figure CN119336427A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of terminal technology, and in particular to an interface recovery method and an electronic device. Background Art
[0002] With the continuous development of electronic devices, note-taking applications can include note-taking assistant functions. Users can use the note-taking assistant function to generate note summaries and meeting minutes, which greatly improves the utilization rate of note-taking applications and brings unprecedented convenient experience to users.
[0003] When using the note assistant function, the note assistant may be abnormally closed, which greatly affects the user experience. Therefore, how to ensure the normal operation of the note assistant function has become an urgent problem to be solved. Summary of the invention
[0004] The embodiments of the present disclosure provide an interface recovery method and an electronic device, which can enable the note assistant function to run continuously and stably.
[0005] To achieve the above objectives, the embodiments of the present disclosure adopt the following technical solutions:
[0006] In a first aspect, an embodiment of the present disclosure provides an interface recovery method, comprising: first, displaying a first interface of a first application, the first interface including a first display area of an application assistant, the first display area including at least one option of the application assistant; at a first moment, in response to an operation on a target option in the first display area, starting to display data output by the application assistant in the first display area; at a second moment, in response to an operation on a first control, destroying a first activity corresponding to the first interface, and at the second moment, the application assistant has not finished outputting data; after destroying the first activity, creating a second activity; after creating the second activity, displaying a second interface corresponding to the second activity; wherein the second interface includes a second display area, the second display area includes data that has been output by the application assistant between the first moment and the second moment, and the display effect of the second interface is different from that of the first interface.
[0007] Generally, when a user operation on the first control is received, the first display area of the first interface will be lost. In order for the first display area to continue to display, when the first activity corresponding to the first interface is destroyed, the first flag can be used to trigger the saving of data output by the application assistant. Later, when creating the second activity, the saved data output by the application assistant can be used to display the second display area of the second interface. The display content of the first display area and the second display area is the same, and the display effects of the first display area and the second display area are different. The content of the first activity and the second activity is the same, and the IDs of the first activity and the second activity are different. In this way, when the electronic device receives a user operation on the first control, it can still continue to display data to the user, so that the display of the corresponding display areas before and after the operation of triggering the first control can be consistent, without affecting the user's experience.
[0008] In combination with the first aspect, in another possible implementation, in response to an operation on the first control, destroying the first activity corresponding to the first interface includes: in the interface of the control center, in response to a click operation on the first control, destroying the first activity corresponding to the first interface. Based on this solution, it can be seen that the first control (i.e., the dark and light color mode switching control) is a system-level control. In other words, the interface recovery method disclosed in the present invention will only be applied when the system-level control is triggered, that is, a specific implementation scenario is provided.
[0009] In combination with the first aspect, in another possible implementation, in response to an operation on the first control, the first activity corresponding to the first interface is destroyed, including: in response to a click operation on the second control, at least two page layout controls are displayed; in response to a click operation on a sliding panel control in at least two page layout controls, the first activity corresponding to the first interface is destroyed. Based on this scheme, it can be seen that by clicking the second control (for example, the top Bar), the first control (for example, the sliding panel control) can be displayed. The first control is a system-level control. That is, only when the system-level control is triggered, the interface recovery method disclosed in the present invention will be applied, that is, another specific implementation scenario is provided.
[0010] In combination with the first aspect, in another possible implementation, the method further includes: at a third moment, displaying a third interface, the third interface including complete data output by the application assistant. Based on this solution, the user can obtain complete information in one interface, which helps to fully understand the data output by the application assistant.
[0011] In combination with the first aspect, in another possible implementation, the first activity includes a Webview, and the Webview corresponds to both the first display area and the second display area. Based on this solution, using the same Webview to maintain the first display area and the second display area can reduce code duplication and improve code maintainability.
[0012] In conjunction with the first aspect, in another possible implementation, destroying the first activity corresponding to the first interface includes: in the process of destroying the first activity corresponding to the first interface, saving the data that the application assistant has output between the first moment and the second moment. Based on this solution, in the process of destroying the first activity, the data output by the application assistant is saved. In this way, data loss caused by interface destruction can be avoided, and data continuity is ensured.
[0013] In combination with the first aspect, in another possible implementation, in the process of destroying the first activity corresponding to the first interface, saving the data that the application assistant has output between the first moment and the second moment includes: in the process of destroying the first activity corresponding to the first interface, setting the second flag bit to a third value, and saving the data that the application assistant has output between the first moment and the second moment; the third value is used to indicate the suspension of data transmission. Based on this solution, before saving the data that the application assistant has output, the data transmission can be suspended through the second flag bit to avoid data loss in the process of saving the data that the application assistant has output, thereby ensuring the integrity of the data.
[0014] In combination with the first aspect, in another possible implementation, after displaying the second interface corresponding to the second activity, the method further includes: setting the second flag to a fourth value, the fourth value being used to indicate to continue data transmission. Based on this solution, when the data output by the application assistant has been displayed, the data can continue to be sent through the second flag, so that the latest output data can be displayed to the user in a timely manner, thereby reducing the user's waiting time.
[0015] In combination with the first aspect, in another possible implementation, after responding to the operation of the first control, the method also includes: determining whether the application assistant function of the first application is activated; when the application assistant function of the first application is activated, setting the first flag bit to a first value; the first value is used to indicate the data output by the application assistant to be saved; in the process of destroying the first activity corresponding to the first interface, saving the data that the application assistant has output between the first moment and the second moment, including: in the process of destroying the first activity corresponding to the first interface, when it is determined that the first flag bit is the first value, saving the data that the application assistant has output between the first moment and the second moment. Based on this scheme, it is possible to first determine whether the application assistant function (i.e., the note assistant function) is activated, and then the first flag bit is used to characterize whether the application assistant function is activated, and then it can be decided whether to save the data based on the first flag bit. In this way, unnecessary save and restore operations can be avoided, thereby reducing the waste of system resources. If all functions are saved and restored indiscriminately during the reconstruction process, a large amount of computing resources and memory will be consumed, affecting the performance of the application.
[0016] In combination with the first aspect, in another possible implementation, after the second activity is created, the second interface corresponding to the second activity is displayed, including: in the process of creating the second activity, reading the first flag bit; when the first flag bit is a first value, displaying the second interface corresponding to the second activity. Based on this scheme, the first flag bit can be used to determine whether the application assistant function is in operation before the first activity is destroyed. During creation, it can be determined whether to display the second interface based on whether the application assistant function is in operation. This enables the electronic device to accurately restore to an interface display that matches the previous state at different stages (such as the destruction and creation of activities), thereby improving the stability and reliability of the system.
[0017] In a second aspect, an embodiment of the present disclosure provides an interface recovery device, which can be applied to an electronic device to implement the method in the first aspect. The functions of the interface recovery device can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions, such as a display module, a processing module, and a creation module.
[0018] Among them, the display module is configured to display a first interface of a first application, the first interface includes a first display area of an application assistant, and the first display area includes at least one option of the application assistant; at a first moment, in response to an operation on a target option in the first display area, the data output by the application assistant begins to be displayed in the first display area; and after creating a second activity, the second interface corresponding to the second activity is displayed; wherein the second interface includes a second display area, the second display area includes data that has been output by the application assistant between the first moment and the second moment, and the display effect of the second interface is different from that of the first interface.
[0019] The processing module is configured to, at a second moment, in response to an operation on the first control, destroy the first activity corresponding to the first interface, and at the second moment, the application assistant does not finish outputting data.
[0020] The creation module is configured to create a second activity after destroying the first activity.
[0021] In combination with the second aspect, in another possible implementation, the processing module is further configured to destroy the first activity corresponding to the first interface in response to a click operation on the first control in the interface of the control center.
[0022] In combination with the second aspect, in another possible implementation, the processing module is also configured to display at least two page layout controls in response to a click operation on the second control; and to destroy the first activity corresponding to the first interface in response to a click operation on the first control in at least two page layout controls.
[0023] In combination with the second aspect, in another possible implementation, the display module is further configured to display a third interface at a third moment, where the third interface includes complete data output by the application assistant.
[0024] In combination with the second aspect, in another possible implementation manner, the first activity includes a Webview, and the Webview corresponds to both the first display area and the second display area.
[0025] In combination with the second aspect, in another possible implementation, the processing module is further configured to save the data that the application assistant has output between the first moment and the second moment during the process of destroying the first activity corresponding to the first interface.
[0026] In combination with the second aspect, in another possible implementation method, the processing module is also configured to set the second flag to a third value during the process of destroying the first activity corresponding to the first interface, and save the data that the application assistant has output between the first moment and the second moment; the third value is used to indicate the suspension of data transmission.
[0027] In combination with the second aspect, in another possible implementation manner, the processing module is further configured to set the second flag bit to a fourth value, where the fourth value is used to indicate to continue data transmission.
[0028] In combination with the second aspect, in another possible implementation method, the processing module is also configured to determine whether the application assistant function of the first application is started; when the first application is started, the first flag is set to a first value; the first value is used to indicate that the data output by the application assistant is saved; and in the process of destroying the first activity corresponding to the first interface, when it is determined that the first flag is the first value, the data that the application assistant has output between the first moment and the second moment is saved.
[0029] In combination with the second aspect, in another possible implementation, the display module is further configured to read the first flag bit during the process of creating the second activity; and display the second interface corresponding to the first activity when the first flag bit is a first value.
[0030] In a third aspect, the present disclosure provides an electronic device, comprising: a memory, a display screen, and one or more processors; the memory, the display screen, and the processor are coupled. The memory is used to store computer program codes, and the computer program codes include computer instructions; when the electronic device is running, the processor is used to execute one or more computer instructions stored in the memory, so that the electronic device executes the interface recovery method as described in any one of the first aspects above.
[0031] In a fourth aspect, the present disclosure provides a computer storage medium, comprising computer instructions, which, when executed on an electronic device, enables the electronic device to execute the interface recovery method as described in any one of the first aspects.
[0032] In a fifth aspect, the present disclosure provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the interface recovery method as described in any one of the first aspects.
[0033] In a sixth aspect, a device (for example, the device may be a chip system) is provided, the device including a processor for supporting a first terminal device to implement the functions involved in the first aspect. In one possible design, the device also includes a memory for storing necessary program instructions and data for the first terminal device. When the device is a chip system, it may be composed of a chip, or may include a chip and other discrete devices.
[0034] It should be understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure;
[0036] Figure 2 One of the flowcharts of an interface recovery method provided in an embodiment of the present disclosure;
[0037] Figure 3 This is one of the display effect diagrams of a note provided in an embodiment of the present disclosure;
[0038] Figure 4 A second diagram of a note display effect provided by an embodiment of the present disclosure;
[0039] Figure 5 A schematic diagram illustrating key stages of EditWebFragment provided in an embodiment of the present disclosure;
[0040] Figure 6 A schematic diagram for explaining the reconstruction of a first activity and EditWebFragment provided in an embodiment of the present disclosure;
[0041] Figure 7 A schematic diagram for explaining a scenario provided in an embodiment of the present disclosure;
[0042] Figure 8 A method calling schematic diagram provided for an embodiment of the present disclosure;
[0043] Fig. 9A third diagram of a display effect of a note provided in an embodiment of the present disclosure;
[0044] Fig.10 A fourth diagram of a display effect of a note provided in an embodiment of the present disclosure;
[0045] Fig.11 A second flow chart of an interface recovery method provided in an embodiment of the present disclosure;
[0046] Fig.12 A third flowchart of an interface recovery method provided in an embodiment of the present disclosure;
[0047] Fig.13 A schematic diagram of the structure of a chip system provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0048] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to 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 embodiment, unless otherwise specified, "plurality" means two or more.
[0049] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments and are not intended to be limiting of the present application. As used in the specification and appended claims of the present application, the singular expressions "a", "an", "", "above", "the" and "this" are intended to include plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that " / " means or, for example, A / B can mean A or B; "and / or" in the text is merely a description of the association relationship of related characters, indicating that three relationships can exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0050] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.
[0051] The directional terms mentioned in the embodiments of the present application, such as "upper", "lower", "front", "back", "inside", "outside", "left", "right", etc., are only references to the directions of the drawings, or are for the purpose of better and clearer explanation and understanding of the embodiments of the present application, rather than indicating or implying that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the embodiments of the present application.
[0052] In the description of the embodiments of the present application, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0053] In order to make the description of the following embodiments clear and concise, a brief introduction to the relevant concepts or technologies is first given:
[0054] 1. Activity: It is a component that can realize user interface functions and is mainly used to respond to user interaction operations. An application is usually composed of multiple activities. Simply put, for an application, the application interface corresponds to the activity. Opening a certain interface will start one or more activities of the interface.
[0055] 2. Fragment: A user interface (UI) fragment that can be embedded in an activity. The same activity can introduce multiple page fragments, which allows the application to more reasonably and fully utilize the space of the large screen. Fragments can also be understood as a type of activity.
[0056] With the rapid advancement of electronic technology, note-taking applications are also constantly introducing new features, such as the note-taking assistant function. Users can use the note-taking assistant function to quickly generate note summaries and meeting minutes, allowing users to experience unprecedented efficiency and convenience.
[0057] When using the note assistant function, if the user resets the display effect of the main interface of the note application (for example, by operating the personalized control (also called the first control) to switch the dark / light mode), and the electronic device does not perform any processing, the summary / minutes generated by the note assistant function may be lost, or even the note assistant function may be turned off. This will affect the user's operation fluency and reduce the user's experience quality.
[0058] Therefore, when the user adjusts the display effect of the main interface of the note application, how to ensure that the note assistant function continues to run stably is a problem that needs to be solved urgently.
[0059] In response to the above problems, an embodiment of the present application provides an interface recovery method, which can be applied to an electronic device, which may include a note application, and the note application has a note assistant function. When receiving a user operation on a personalized control, the main process of the electronic device can set a first flag bit according to whether the note assistant function is turned on. If the note assistant function is turned on, then when the first activity is destroyed, the first flag bit can be used to trigger the saving of data output by the application assistant. When creating a second activity, the saved data output by the application assistant can be used to display the second display area. In this way, when the electronic device receives a user operation on a personalized control, it can still continue to display data to the user, so that the corresponding interface display before and after the operation of triggering the personalized control can be connected.
[0060] The following describes the interface recovery method provided in the embodiment of the present application.
[0061] The interface recovery method provided in the embodiment of the present application can be applied to electronic devices. In some embodiments, the electronic device can be a mobile phone, a tablet computer, a handheld computer, a personal computer (PC), a cellular phone, a personal digital assistant (PDA), a wearable device, or other electronic device with a note-taking application. The embodiment of the present application does not limit the specific form of the electronic device.
[0062] For example, taking the electronic device as a tablet computer, Figure 1 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown.
[0063] like Figure 1 As shown, the tablet computer may include: a processor 110, a fan 111, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, a display screen 150, an antenna, a wireless communication module 160, an audio module 170, a speaker (i.e., a horn) 170A, a microphone 170C, an earphone interface 170B, a touch pad 180, and a camera 190, etc.
[0064] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the tablet computer. In other embodiments, the tablet 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.
[0065] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0066] The controller can be the nerve center and command center of the tablet computer. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
[0067] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0068] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0069] It is understandable that the interface connection relationship between the modules shown in this embodiment is only a schematic illustration and does not constitute a structural limitation on the tablet computer. In other embodiments, the tablet computer may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0070] The charging management module 140 is used to receive charging input from a charger (such as a wireless charger or a wired charger) to charge the battery 142. The wireless communication function of the tablet computer can be implemented through the antenna and the wireless communication module 160, the modem processor and the baseband processor.
[0071] Antennas are used to transmit and receive electromagnetic wave signals. Each antenna in a tablet can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas.
[0072] In some embodiments, the antenna of the tablet computer is coupled to the wireless communication module 160, so that the tablet computer can communicate with the network and other devices through wireless communication technology. The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as Wi-Fi networks, Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc.) applied to the tablet computer.
[0073] The tablet computer can realize the display function through a GPU, a display screen 150, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 150 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information. The display screen 150 is used to display images, videos, etc.
[0074] A touch sensor is integrated in the touch panel 180. The tablet computer can receive control commands of the user on the tablet computer through the touch panel 180.
[0075] The tablet computer can realize the shooting function through the ISP, the camera 191, the video codec, the GPU, the display screen 150 and the application processor. The ISP is used to process the data fed back by the camera 191. In some embodiments, the ISP can be set in the camera 191. The camera 191 is used to capture a still image or a video. In some embodiments, the tablet computer can include 1 or N cameras 191, where N is a positive integer greater than 1.
[0076] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the tablet computer. The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the tablet computer by running the instructions stored in the internal memory 121. For example, in an embodiment of the present application, the processor 110 can execute instructions stored in the internal memory 121, and the internal memory 121 may include a program storage area and a data storage area.
[0077] The tablet computer can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the microphone 170C, the headphone jack 170B, and the application processor.
[0078] The audio module 170 is used to convert digital audio signals into analog audio signals for output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals.
[0079] The tablet computer according to the embodiment of the present application may include one or more speakers 170A and one or more microphones 370C.
[0080] The fan 112 is used to dissipate heat from the laptop computer. The processor 110 can control the fan 112 to run at different speeds to dissipate heat from the tablet computer.
[0081] Of course, it is understandable that the above Figure 1 The electronic device is shown only as an example when it is in the form of a tablet computer. If the electronic device is in other device forms such as a notebook computer, a handheld computer, a PDA, a personal computer, etc., the structure of the electronic device may include more Figure 1 The structure shown in the figure is less than Figure 1 More structures are shown in the figure, which are not limited here.
[0082] The methods in the following embodiments can all be implemented in an electronic device having the above hardware structure. In the embodiments of the present application, the electronic device is a tablet computer as an example for illustration.
[0083] The following combination Figure 2 An interface recovery method provided in an embodiment of the present application is described in detail. Figure 2 The following is a flow chart of an interface recovery method provided in an embodiment of the present application. Figure 2 As shown, the interface recovery method may include the following S201-S215.
[0084] S201. In response to an operation of opening a note application, the electronic device displays a main interface of the note application.
[0085] In the embodiment of the present application, the electronic device can be a mobile phone, a tablet computer, a handheld computer, a personal computer, or other electronic device with a note-taking application. The embodiment of the present application does not limit the specific form of the electronic device. The embodiment of the present application takes the electronic device as an example for illustration.
[0086] The electronic device may include a note application (also referred to as a first application). A user may create notes through the note application on the electronic device, thereby recording information that the user needs to record, which is convenient for the user to use.
[0087] When a user needs to create a note through a note application on an electronic device, the user can open the note application on the electronic device, that is, the main process of the electronic device can receive the user's opening operation on the note application, for example, the main process of the electronic device can receive the user's click operation on the icon corresponding to the note application.
[0088] The electronic device receives an opening operation of the note application by the user. After the electronic device receives the opening operation of the note application by the user, the electronic device may display the main interface of the note application. The main interface of the note application may include an identification of at least one note that has been created. For example, the identification of the created note may include at least one of the icon of the created note, the name of the created note, and the creation time of the created note. The main interface of the note application may also include classification management options for the created notes and classification management options for folders created by the user. For example, the classification management options for the created notes may include at least one of the number of all notes, the number of notes collected by the user, the number of notes locked by the user, and the number of recently deleted notes. The classification management options for folders created by the user may include at least one of the number of unclassified notes, the number of my folders, and the number of lists. The number of my folders may include at least one of the number of personal notes and the number of reading notes.
[0089] The main interface of the note application may include at least one note. The notes in the main interface of the note application may be of various types, such as text notes, audio notes, image notes, etc. Note summaries or detailed meeting minutes may be generated based on existing notes (e.g., audio notes), which facilitates user operations and improves the user experience.
[0090] For example, after the electronic device receives the user's opening operation on the note application, Figure 3 (a) in the figure shows an exemplary schematic diagram of a horizontal screen display of an electronic device, and the electronic device can display the main interface 01 of the note application. The main interface 01 of the note application can include an identifier corresponding to at least one created note, for example, a created audio note can include an icon 02 of the audio note, a name corresponding to the created note (such as an audio note), and a creation time of the created note (such as the creation time of the audio note, August 17).
[0091] The main interface 01 of the note application may also include a classification management option 03 for created notes and a classification management option 04 for user-created folders, etc. For example, the classification management option 03 for created notes may include at least one of the number of all notes (such as the number of all notes 218), the number of user favorited notes (such as the number of user favorited notes 18), the number of user locked notes (such as the number of user locked notes 77), and the number of recently deleted notes (such as the number of recently deleted notes 49). The classification management option 04 for user-created folders may include at least one of the number of unclassified (such as the number of unclassified 49), the number of my folders (such as the number of my folders 68), and the number of lists (such as the number of lists 40). The number of my folders may include at least one of the number of individuals (such as the number of individuals 18) and the number of reading notes (such as the number of reading notes 40).
[0092] In some examples, the main interface of the note application is constructed by the first activity. After receiving the user's opening operation on the note application, the electronic device starts the main process of the note application. After the main process is started, the main process will start the first activity to use the first activity to build the main interface of the note application for the user.
[0093] S202. In response to an operation on a note, the electronic device displays a content interface of the note.
[0094] Among them, the content interface of the note includes a note assistant control, and the note assistant control can be used to generate data output by the application assistant related to the note.
[0095] When the user needs to process the note, the electronic device may receive the user's operation on the note. After receiving the operation on the note, the electronic device may display the content interface of the note. The content interface of the note may include an identifier of at least one functional control, for example, the identifier of the functional control includes a note assistant control.
[0096] The content interface of the note may also include a note editing area. The note editing area includes at least one of a note playback progress bar, a note voice recognition text, a note playback control, and a note edit text control. For example, the note playback control may include at least one of a Mandarin control, a display speaker control, an AI meeting minutes control, a tag control, and more controls. The note edit text control may include at least one of a text bold control, an italic control, an underline control, and the like.
[0097] Optionally, when the user needs to further process the recorded notes, the main process of the electronic device can receive the user's operation on the recorded notes in the note application. Figure 3As shown in (a) of FIG. 1 , in response to clicking the recording note icon 02, as shown in FIG. Figure 3 As shown in (b) of FIG. 1 , the electronic device displays the content interface 05 of the note. The content interface 05 of the note may include at least one identifier of a function control, for example, the content interface 05 of the note includes at least one of an identifier of an undo control, an identifier of a restore control, an identifier of a search control, and an identifier 06 of a note assistant control.
[0098] Among them, the undo control is used to trigger the electronic device to undo the content deleted by the user in the content interface of the note. The restore control is used to trigger the electronic device to restore the deletion operation of the user in the content interface of the note. The search control is used to trigger the electronic device to highlight the note content searched by the user. The note assistant control is used to trigger the electronic device to display data output by the application assistant related to the note, such as note summaries, meeting minutes, etc.
[0099] In some examples, the content interface of the note is constructed by editing a webpage fragment (EditWebFragment). After receiving the user's operation on the note, the main process adds EditWebFragment to the first activity to use EditWebFragment to construct the content interface of the note for the user.
[0100] Exemplarily, EditWebFragment can be added to the first activity through a callback method. For example, after the main process of the electronic device starts the first activity, the first activity can be associated with EditWebFragment by calling getsupportFragmentManager() or getsupportFragmentManager().findFragmentById() method.
[0101] S203. In response to the operation of the note assistant control, the electronic device displays a first display area of the application assistant in the content interface of the note.
[0102] The content interface showing the notes in the first display area can also be called the first interface. The first display area can also be called the note assistant display area.
[0103] When a user needs to generate a note summary or meeting minutes, the electronic device can receive the user's operation on the note assistant control, such as a click operation. After the electronic device receives the operation on the note assistant control, the main process of the electronic device can display the first display area of the application assistant in the content interface of the note, that is, display the first display area corresponding to the note assistant control. The first display area includes at least one option for the application assistant. Exemplarily, the options in the first display area may be AI (Artificial Intelligence) options. For example, the first display area may include at least one of a smart summary option, a smart layout option, and an AI meeting minutes option.
[0104] Among them, the smart summary option is used to trigger the electronic device to display the summary content of the note. The smart layout option is used to trigger the electronic device to display the layout content of the note. The AI meeting minutes option is used to trigger the electronic device to display the meeting minutes content of the note.
[0105] For example, when the note is an audio note, Figure 3 As shown in (b) of FIG. 1 , the electronic device displays the content interface 05 of the note, and the content interface 05 of the note includes the note assistant control 06. After the electronic device receives an operation on the note assistant control 06, such as a click operation, Figure 3 As shown in (c), the electronic device can display the first display area 07 in the content page of the note, and the first display area 07 includes a smart summary option, a smart typesetting option and an AI meeting minutes option 08.
[0106] In some examples, EditWebFragment includes a web view (Webview) component. EditWebFragment is responsible for managing and controlling the display of Webview. Webview is used to display web content.
[0107] The first display area can be a window, and the first display area can be constructed by a Webview component. That is, Webview corresponds to the first display area, and the first display area can also be called a Webview page. The first display area is a window created by the note application, not a window created by the system of the electronic device.
[0108] S204. In response to the operation on the AI option, the electronic device starts to display data output by the application assistant in the first display area.
[0109] When the user needs to use the AI option to intelligently output the data output by the application assistant related to the note, the user can trigger an operation on at least one AI option in the first display area. That is, the main process of the electronic device can receive the user's operation on the AI option, such as a click operation.
[0110] After the electronic device receives the user's operation on the AI option, the main process of the electronic device can start to display the data output by the application assistant in the first display area.
[0111] In some examples, at a first moment, when the electronic device receives a user's operation on a target option, the data output by the application assistant starts to be displayed in the first display area, where the target option can be any one of a plurality of AI options.
[0112] For example, Figure 3 As shown in (c) of FIG. 1 , the electronic device displays a plurality of AI options in the first display area 07, for example, a smart summary option, a smart layout option, and an AI meeting minutes option 08. After the electronic device receives an operation of the user on the AI meeting minutes option 08, such as a click operation, Figure 3 As shown in (d) in FIG. , the electronic device may begin to display data 09 output by the application assistant in the first display area.
[0113] In some scenarios, the data output by the application assistant displayed in the first display area may be derived from a preset model, wherein the preset model may be stored in the cloud or locally, and the present disclosure does not limit this.
[0114] Exemplarily, the note assistant function can interact with the preset model through the network to obtain data output by the application assistant.
[0115] like Figure 3 As shown in (c), when the user performs a trigger operation on the AI option in the first display area of the note application, such as a click operation, the main process of the electronic device can send the user's operation on the AI option as input data to the preset model. After the preset model receives the input data, it can respond to the input data and analyze and process the input data to obtain output data. For example, the preset model is an artificial intelligence generated content agent (AIGCAgent).
[0116] After the preset model obtains the output data, the preset model and the note assistant function can communicate asynchronously through the message queue mechanism. Among them, the message queue, as a communication mechanism, enables different applications or systems to transmit data in an asynchronous manner.
[0117] In some examples, the process of asynchronous communication between the preset model and the note-taking assistant function through the message queue mechanism can be: the main process can store input data in the message queue, which is processed by the preset model. The output data of the preset model (i.e., the output result of the AI assistant) can also be transmitted back to the main process through the message queue. After that, the main process displays the output data in the first display area in the form of a web page.
[0118] In addition, the main process also includes Messagestation (message queue management class). Messagestation can be considered as a storage module of the main process. Messagestation can send data (for example, AI options) to the preset model through the message queue, obtain output data from the preset model (for example, data output by the application assistant, etc.), and send output data to the JS thread, etc.
[0119] S205. In response to the operation of the dark and light color mode switching control in the control center interface, the main process of the note application determines whether the note assistant function is started; when the note assistant function is started, the storage value of the first flag is set to the first value; when the note assistant function is not started, the storage value of the first flag is set to the second value.
[0120] The first flag bit may also be referred to as a save flag bit. The first flag bit is used to indicate whether to save the data output by the application assistant.
[0121] When the user needs to adjust the display effect of the electronic device, the user can adjust the display effect of the electronic device by triggering the personalized control. The personalized control can be triggered in a variety of scenarios. For example, the user can trigger the personalized control through the control center interface, or the user can directly trigger the personalized control in the content interface of the note. The present disclosure does not limit this. The personalized control can also be called the first control, and the personalized control is used to adjust the display effect of each interface in the electronic device.
[0122] Exemplarily, the personalized controls include a dark / light mode switching control, a split screen control, and a font size setting control. The dark / light mode switching control is used to switch the dark and light modes of the electronic device. The split screen control is used to divide the main interface of the note application into at least two independent display areas for display. The font size setting control is used to adjust the font size. The sliding panel control is used to switch the display form of the first display area, for example, from the sidebar form to the sliding panel form.
[0123] In some examples, when the electronic device displays the first display area in the content interface of the note, the user can trigger the electronic device to display the control center interface by sliding down from the top right side of the screen of the electronic device. After the electronic device receives the user's operation on the dark / light mode switching control in the control center interface, such as a click operation, the electronic device displays the content interface after the note is switched, and the content interface after the note is switched should include the first display area. However, due to the user's operation on the dark / light mode switching control, the first display area will be reconstructed. If the electronic device does not perform any processing, the first display area in the content interface after the note is switched will be closed, and the data output by the application assistant displayed in the first display area will also be lost. Among them, the display effects of the content interface of the note and the content interface after the note is switched are different. The display effect of the content interface after the note is switched is consistent with the display effect triggered by the dark / light mode switching control.
[0124] For example, Figure 4 As shown in (a) of FIG. 1 , the electronic device displays the content interface of the note, and the user performs a downward swipe operation from the top of the screen of the electronic device. After receiving the downward swipe operation of the user, as shown in FIG. Figure 4 As shown in (b), the electronic device displays a control center interface 10, and the control center interface 10 may include a video playback card, a brightness card, a volume card, and multiple shortcut controls. For example, the video playback card includes one or more controls for controlling video playback (such as play / pause control, previous second control, next second control). The brightness card includes a switch for adjusting the brightness of the electronic device. The volume card includes a switch for adjusting the volume of the electronic device. Multiple shortcut controls may include personal hotspot controls, screenshot controls, mute controls, automatic rotation controls, Honor sharing controls, flight mode controls, multi-screen collaboration controls, flashlight controls, location information controls, eye protection mode controls, screen recording controls, do not disturb controls, dark / light mode switching controls, wireless projection controls, parent-child mode controls, AI subtitle controls, e-book mode controls, selected reading controls, etc.
[0125] After the electronic device receives the user's operation on the dark / light mode control 11, Figure 4 As shown in (c) in the figure, the electronic device can display the content interface 12 after the note is switched. Among them, the content interface 12 after the note is switched does not display the first display area. Of course, the dark / light mode switching control can also be set from other interfaces, and the present disclosure does not limit this.
[0126] For example, the electronic device displays the content interface of the note, and the content interface of the note includes a dark / light mode switching control. After the electronic device receives the user's operation on the dark / light mode control, the electronic device can display the content interface after the note is switched. Among them, the content interface after the note is switched does not include the first display area.
[0127] In other examples, when the personalized control is a split-screen control, after the electronic device receives an operation on the split-screen control by the user, the electronic device displays a content interface after the note is switched, and the content interface after the note is switched does not include the first display area.
[0128] Combination Figure 4 It can be seen that when using the note assistant function of the note application, if the user performs an operation on the personalized control, the note assistant function of the note application will be closed, and accordingly, all the data output by the application assistant displayed in the first display area will be lost, giving the user an extremely poor user experience.
[0129] Therefore, after the user performs an operation on the personalized control, the electronic device needs to reconstruct the content interface of the note to redisplay the content interface of the note and the first display area in the content interface of the note.
[0130] Combined with S201, it can be known that the main interface of the note application is constructed through the first activity. Combined with S202, it can be known that the content interface of the note is constructed by editing the web page fragment (EditWebFragment). Combined with S203, it can be known that EditWebFragment includes a Webview component. The first display area in the content interface of the note is constructed through the Webview component. Therefore, after the user performs an operation on the personalized control, the electronic device needs to reconstruct the first activity. Since EditWebFragment is associated with the first activity, and EditWebFragment includes a Webview component, by reconstructing the first activity, it is possible to reconstruct EditWebFragment and the Webview component, thereby re-displaying the content interface of the note and the first display area in the content interface of the note.
[0131] In combination with S202, it can be known that EditWebFragment can be added to the first activity through the callback method. When EditWebFragment is added to the first activity, the life cycle of EditWebFragment will be interdependent with the first activity, and the call to a certain life cycle method of the first activity will also cause the call to the same method of EditWebFragment (for example: when the onResume() method of the first activity is called, the onResume() methods of all Fragments (including EditWebFragment) contained in the first activity will be called).
[0132] When the electronic device reconstructs the first activity, the EditWebFragment will also be reconstructed to adapt to the changes of the first activity and maintain consistency with the first activity. After the EditWebFragment is reconstructed, the electronic device can display the content interface of the note and the first display area in the content interface of the note again.
[0133] In some examples, the reconstruction of EditWebFragment can be achieved by executing the life cycle methods of EditWebFragment. The Android operating system provides many life cycle methods of EditWebFragment, as follows:
[0134] onAttach() method: called when EditWebFragment is attached to an activity. The onAttach() method is used to obtain a reference to the activity associated with it and set the properties of EditWebFragment. When this method is executed, EditWebFragment has been bound to the first activity.
[0135] onCreate() method: Called when EditWebFragment is created. This method can be used to initialize data and set up the UI.
[0136] onCreateView(): Called when the view of EditWebFragment is created. This method can return the view root element of EditWebFragment.
[0137] onActivityCreated() method: Called after the view is created and before the view appears on the screen. This method can be used to access the UI elements of the Activity. When this method is executed, the onCreate() method of the first activity bound to EditWebFragment has been executed and returned.
[0138] onResume() method: Called when EditWebFragment is in the foreground and ready to handle input events. When using this method, EditWebFragment is in the display state and the user can interact with it.
[0139] onsaveInstancestate() method: saves the current state of EditWebFragment. This method can automatically save the state of EditWebFragment, such as the expansion state of the sidebar page.
[0140] onDestroy() method: called before EditWebFragment is destroyed. This method can be used to release resources and other operations.
[0141] According to the above EditWebFragment life cycle methods, such as Figure 5 As shown, EditWebFragment goes through several key stages. That is, when EditWebFragment is ready to interact with the user, the onResume() callback method is called to put EditWebFragment in the display state. When the electronic device destroys EditWebFragment, the onDestroy() callback method is called to put EditWebFragment in the destroyed state and release resources. When EditWebFragment is recreated, the onCreate() callback method is called to put EditWebFragment in the recreated state to complete the initialization of EditWebFragment. When EditWebFragment is ready to interact with the user, the onResume() callback method is called again.
[0142] The above content shows the complete process of EditWebFragment from the onResume() display state to the onDestroy() destruction state, to the onCreate() re-creation state, to the final onResume display state.
[0143] Combined with the life cycle methods of EditWebFragment, Figure 6 and Figure 8 , the reconstruction of the first activity and the EditWebFragment content of the electronic device may be further explained below.
[0144] When the main process of the electronic device starts the first activity, the main process triggers the onCreate() method of the first activity. During this process, the first activity sets its layout, initializes data, and the like.
[0145] After the onCreate() method of the first activity is executed, when EditWebFragment is attached to the first activity, the main process can trigger the onAttach() method of EditWebFragment to execute. In this process, EditWebFragment can obtain a reference to the first activity and perform initialization operations.
[0146] After the EditWebFragment initialization operation is completed, the main process triggers the execution of the onActivityCreated() method of EditWebFragment, so that EditWebFragment further processes and initializes the data of the first activity.
[0147] Then the data loading process is triggered. After the data loading is completed, EditWebFragment can call the dataLoadFinish() method to notify the main process that the data loading is complete, and then trigger the HTML rendering process. When the HTML rendering is completed, EditWebFragment calls the renderHtmlFinished() method to notify the main process that the rendering is complete.
[0148] When EditWebFragment is about to be destroyed, the main process triggers the execution of EditWebFragment's onSaveInstanceState() method to save the state of EditWebFragment.
[0149] When EditWebFragment is destroyed, the main process triggers the onDestroy() method of EditWebFragment to destroy EditWebFragment. During this process, EditWebFragment can release resources and perform cleanup operations.
[0150] When the first activity needs to be resumed, the system can call the onActivityCreated() method again and repeat the above process.
[0151] refer to Figure 6 ,like Figure 7 As shown, in the process of reconstructing the first activity and EditWebFragment, two key callback methods, onsaveInstancestate() and onDestroy(), are involved. These two callback methods can be triggered in three different scenarios.
[0152] Scenario 1: When the note application switches to other applications, or the note application switches to the background, or the main interface of the electronic device switches, the EditWebFragment will not be reconstructed. Therefore, the electronic device only needs to call the onsaveInstancestate() method to save the state data of the EditWebFragment, and does not need to call the onDestroy() method to destroy the EditWebFragment.
[0153] Scenario 2: When the note application is closed or EditWebFragment exits, both the onsaveInstancestate() method and the onDestroy() method are involved to save the state data of EditWebFragment and destroy EditWebFragment. However, since EditWebFragment exits, the reconstruction of EditWebFragment is not involved.
[0154] Scenario 3: When the electronic device receives the user's operation on the personalized control, it will cause the EditWebFragment to be reconstructed. Since the main interface of the note application also includes the first display area, the electronic device needs to call the onsaveInstancestate() method to save the data output by the application assistant. Based on the life cycle method of EditWebFragment, when EditWebFragment is reconstructed, the onDestroy() method must also be called to destroy EditWebFragment.
[0155] It is understandable that in scenario one, since EditWebFragment exited, EditWebFragment does not need to be reconstructed, so the first display area does not need to be restored. In scenario two, since the onDestroy() method was not called, the first display area was not actually destroyed, so the first display area did not need to be restored again. In scenario three, since the electronic device called the onDestroy() method, the first display area was destroyed, so the first display area needs to be restored and redisplayed. In other words, only in scenario three (i.e., when the user triggers the personalized control) is the recovery of the first display area involved. Therefore, this application only proposes an interface recovery method for scenario three.
[0156] According to the above content, after receiving the user's operation on the personalized control, the electronic device needs to reconstruct the EditWebFragment to redisplay the first display area. Therefore, after receiving the user's operation on the personalized control, the electronic device can reconstruct the content interface of the note and the first display area in response to the operation.
[0157] In combination with S203, it can be known that the first display area may include data output by the application assistant of the preset model. Since the first display area is displayed based on the Webview component, when the EditWebFragment is reconstructed, the data output by the application assistant displayed in the first display area will be completely destroyed.
[0158] In addition, S204 also discloses that the data output by the application assistant of the first display area is transmitted through a message queue mechanism, and the data corresponding to the message queue mechanism is stored in a separate class (i.e., Messagestation), and Messagestation is only related to the number of each note in the note application and the task identifier (task id) of the first activity, and has nothing to do with the life cycle of EditWebFragment. Therefore, during the reconstruction of EditWebFragment, the data stored in Messagestation will not be destroyed. Therefore, when executing the reconstruction of EditWebFragment, the data output by the application assistant stored in Messagestation can be saved so that the data output by the application assistant of the first display area can continue to be displayed later.
[0159] In some examples, reference Figure 7 As can be seen from the above content, after receiving the user's operation on the personalized control (ie, scenario three), the electronic device needs to reconstruct the first activity and will also reconstruct the EditWebFragment accordingly.
[0160] When the electronic device is reconstructed, the main process can first determine whether the content interface of the note includes the first display area. That is, first determine whether the note assistant function is started. Then set the first flag bit according to whether the note assistant function is started. Finally, determine whether to save and restore the first display area according to the storage value of the first flag bit. By first determining whether the note assistant function is started, unnecessary save and restore operations can be avoided, thus reducing the waste of system resources. If all functions are saved and restored indiscriminately during the reconstruction process, a large amount of computing resources and memory will be consumed, affecting the performance of the application.
[0161] In some examples, in response to the operation of the dark-light mode switching control in the control center interface, the main process of the note-taking application determines whether the note-taking assistant function is started; when the note-taking assistant function is started, the storage value of the first flag is set to a first value; when the note-taking assistant function is started, the storage value of the first flag is set to a second value. The process may be: first, in response to the operation of the dark-light mode switching control in the control center interface, the main process queries the startup flag; based on the startup flag, determines whether the note-taking assistant function is started; when the note-taking assistant function is started, the storage value of the first flag is set to a first value; when the note-taking assistant function is started, the storage value of the first flag is set to the second value.
[0162] Among them, the startup flag is used to represent the display state of the sidebar page. When the display state of the sidebar page is expanded, it means that the note assistant function is started. When the display state of the sidebar page is hidden, it means that the note assistant function is not started. Of course, other methods can also be used to determine whether the note assistant function is started, and the present disclosure does not limit this.
[0163] In some examples, such as Fig.12 As shown, in response to the operation of the dark and light mode switching control in the control center interface, the process of the main process querying the startup flag bit can be: in response to the operation of the dark and light mode switching control in the control center interface, the main process triggers the execution of the onSaveInstanceState() method of EditWebFragment, thereby determining the startup status bit.
[0164] According to the start flag, the process of determining whether the note assistant function is started may be: when the start flag is the first target value, the storage value of the first flag is set to the first value. When the start flag is the second target value, the storage value of the first flag is set to the second value.
[0165] The first target value is used to indicate that the display state of the sidebar page is an expanded state. The second target value is used to indicate that the display state of the sidebar page is a hidden state. The first value is used to indicate that the data output by the application assistant is saved. The second value is used to indicate that the data output by the application assistant is not saved.
[0166] That is, when the note assistant function is activated, the storage value of the first flag is set to the first value to trigger saving of the data output by the application assistant. When the note assistant function is not activated, the storage value of the first flag is set to the second value to achieve not saving the data output by the application assistant.
[0167] Exemplarily, the identification field corresponding to the start flag bit is issideHidden. The identification field corresponding to the first flag bit is isYOYOsideshown.
[0168] When the value of issideHidden is the first target value (e.g., false), it indicates that the display state of the sidebar page is expanded, that is, the note assistant function is in the activated state. In other words, the sidebar interface (i.e., the first display area) of the note application is visible, and the note assistant function is in use, then the storage value of isYOYOsideshown is set to the first value (e.g., true) to instruct the electronic device to save the data output by the application assistant.
[0169] When the value of issideHidden is the second target value (e.g., true), it indicates that the display state of the sidebar page is hidden, that is, the note assistant function is not activated. In other words, the sidebar interface (i.e., the first display area) of the note application is invisible, and the note assistant function is not used. Then, the storage value of isYOYOsideshown is set to the second value (e.g., false) to instruct the electronic device not to save the data output by the application assistant.
[0170] In some examples, after the first flag is set according to the startup flag, the main process can pass the storage value of the first flag through the bundle mechanism to save and restore the data output by the application assistant according to the first flag when calling the appropriate lifecycle method.
[0171] Exemplarily, after the main process completes setting the storage value of isYOYOsideshown, a preset key (e.g., RESTORE_KEY_YOYO_SIDE_SHOWN) can be used as the identifier of the Bundle. The storage value of isYOYOsideshown is then associated with the preset key and stored in the Bundle object, so that when necessary, related operations can be performed according to the storage value of isYOYOsideshown stored in the Bundle object.
[0172] In some examples, the user's operation on the dark and light color mode switching control can occur after the user operates the AI option and before the data output by the application assistant is displayed. It can also occur while the data output by the application assistant is being output, or it can occur after the data output by the application assistant is completely output. This application does not limit the triggering timing of the personalized control.
[0173] Optionally, for the main process of the note application in S205, it is determined whether the note assistant function is started; when the note assistant function is started, the storage value of the first flag is set to a first numerical value; when the note assistant function is started, the storage value of the first flag is set to a second numerical value. In another implementation method, it can be triggered by the user's operation on the split-screen control. For example, S206 is also included after S204.
[0174] S206. In response to the operation of the split-screen control, the main process of the note application determines whether the note assistant function is started; when the note assistant function is started, the storage value of the first flag is set to the first value; when the note assistant function is started, the storage value of the first flag is set to the second value.
[0175] When the electronic device displays the content interface of the note, the electronic device can receive the user's operation on the top bar control (i.e., the top Bar) in the content interface of the note. After receiving the user's operation on the top bar control, such as a click operation, the electronic device displays a page layout window. The page layout window may include multiple page layout controls, such as at least one of a split screen control and a sliding panel control. Among them, the top status bar control can also be called a second control.
[0176] After the electronic device receives the user's operation on the split-screen control in the page layout window, such as a click operation, the electronic device displays the split-screen interface of the note, and the split-screen interface of the note should include the first display area. However, due to the user's operation on the split-screen control, the first display area will be reconstructed. If the electronic device does not perform any processing, the first display area in the split-screen interface of the note will be closed, and the data output by the application assistant in the first display area will also be lost. Among them, the display effects of the content interface of the note and the split-screen interface of the note are different. The display effect of the split-screen interface of the note is consistent with the display effect triggered by the split-screen control.
[0177] For example, Fig. 9 As shown in (a) of FIG. 1 , the electronic device displays a content interface 13 of the note, and the content interface 13 of the note includes a top Bar 14 and a first display area 15. After the electronic device receives an operation of the user on the top Bar 14, such as a click operation, Fig. 9 As shown in (b) of FIG. 1 , the electronic device may display a page layout window 16. The page layout window 16 includes multiple page layout controls, for example, the multiple page layout controls include a full screen control, a split screen control 17, and a sliding window control. After the electronic device receives an operation of the user on the split screen control 17, such as a click operation, Fig. 9As shown in (c), the electronic device can display the split screen interface 18 of the note. Among them, the split screen interface 18 of the note does not display the first display area. Of course, the split screen control can also be set from other interfaces, and the present disclosure does not limit this.
[0178] In this case, the specific content of S205 can be referred to, first determine whether the note assistant function is activated; if the note assistant function is activated, set the storage value of the first flag bit to the first value; if the note assistant function is not activated, set the storage value of the first flag bit to the second value. No further details will be given here.
[0179] Optionally, for the main process of the note application in S205, it is determined whether the note assistant function is started; when the note assistant function is started, the storage value of the first flag is set to a first numerical value; when the note assistant function is started, the storage value of the first flag is set to a second numerical value. In another implementation method, it can be triggered by the user's operation on the sliding control. Exemplarily, S207 is also included after S204.
[0180] S207. In response to the operation of the sliding panel control, the main process of the note application determines whether the note assistant function is started; when the note assistant function is started, the storage value of the first flag is set to the first value; when the note assistant function is started, the storage value of the first flag is set to the second value.
[0181] When the electronic device displays the content interface of the note, the electronic device can receive the user's operation on the top bar control in the content interface of the note. After receiving the user's operation on the top bar control, such as a click operation, the electronic device displays a page layout window. The page layout window may include a sliding panel control.
[0182] After the electronic device receives the user's operation on the sliding panel control in the page layout window, such as a click operation, the electronic device displays the content interface after the note is slid and displayed. The content interface after the note is slid and displayed should include the first display area. However, due to the user's operation on the sliding panel control, the first display area will be reconstructed. If the electronic device does not perform any processing, the first display area will be closed, and the data output by the application assistant in the first display area will also be lost. Among them, the display effects of the content interface of the note and the content interface after the note is slid and displayed are different. The display effect of the content interface after the note is slid and displayed is consistent with the display effect triggered by the sliding panel control.
[0183] In this case, the specific content of S205 can be referred to, first determine whether the note assistant function is activated; if the note assistant function is activated, set the storage value of the first flag bit to the first value; if the note assistant function is not activated, set the storage value of the first flag bit to the second value. No further details will be given here.
[0184] S208. When EditWebFragment is destroyed, if it is determined that the storage value of the first flag is the first value, the main process executes to save the data output by the application assistant; if it is determined that the storage value of the first flag is the second value, the main process does not save the data output by the application assistant.
[0185] Based on the aforementioned life cycle methods, such as Fig.12 As shown, when the main process triggers the onDestroy() method to execute and destroys the first activity (in the process of destroying the first activity, the EditWebFragment associated with the first activity will also be destroyed), it can also query the storage value of the first flag (i.e., isYOYOsideshown) and determine whether to execute Webview page saving based on the storage value of the first flag.
[0186] In some examples, when the first activity is destroyed, at the second time, the application assistant does not finish outputting the data.
[0187] In some examples, the main process may query the storage value of the first flag, and determine whether to execute the Webview page saving process according to the storage value of the first flag: the main process queries the storage value of the first flag, and saves the data output by the application assistant when the first flag is a first value. When the first flag is a second value, the data output by the application assistant is not saved.
[0188] Exemplarily, the main process may query the storage value of the first flag, and determine whether to save the data output by the application assistant according to the storage value of the first flag. The process may be: the main process queries the storage value of isYOYOsideshown, and when the isYOYOsideshown flag is true, the data output by the application assistant is saved. When the isYOYOsideshown flag is false, the data output by the application assistant is not saved.
[0189] In some examples, saving the data output by the application assistant is saving the actual content of the webview page, wherein the actual content of the webview page includes the output data that has been displayed and the data that has been output but not displayed.
[0190] In some examples, when the storage value of the first flag is determined to be a first value, the main process obtains and saves the data output by the application assistant through the JS thread. When the storage value of the first flag is determined to be a second value, the main process does not save the data output by the application assistant.
[0191] For example, Fig.12 As shown, the process of the main process obtaining and saving the data output by the application assistant through the JS thread can be: the main process can trigger the execution of the saveWebviewstate() method of Messagestation to save the data output by the application assistant.
[0192] like Figure 8 As shown, the main process can also trigger the execution of the saveWebviewstate() method of Messagestation to save the data output by the application assistant when triggering the execution of the onDestroy() method to destroy the EditWebFragment. The process can be: when executing the saveWebviewState() method, the main thread can call the getallmessage() method of the JS thread to collect and organize the data output by the application assistant from the Js thread. The Js thread collects and organizes the data output by the application assistant in response to the getallmessage() method, and sends the data output by the application assistant to the main process, so that the main process obtains the data output by the application assistant.
[0193] Generally, according to the life cycle method of EditWebFragment, when EditWebFragment calls the renderHtmlFinished() method to notify the main process that rendering is complete, the main process can send the saved data output by the application assistant to the JS process to redisplay the data output by the application assistant in the second display area.
[0194] The data displayed in the first display area involves two types of data. The first type of data is: the saved application assistant output data sent by the main process to the Js thread. The second type of data is: the newly generated application assistant output data sent by the preset model to the Js thread through the main process.
[0195] Usually, the above two types of data are sent from the main process to the JS thread through the Messagestation. Among them, the data output by the application assistant is stored in the memory of the main process, not in the message queue. The data output by the application assistant corresponding to the AI option is stored in the message queue of the Messagestation.
[0196] During the process of sending to the JS thread, if the data sending method does not comply with the preset rules, the second display area will continue to display the JS animation (ie, loading animation).
[0197] For example, Fig.10 As shown in (a) of FIG. 1 , the electronic device displays a content interface 19 of the note, and the content interface 19 of the note includes a top Bar 20 and a first display area 21. After the electronic device receives an operation of the user on the top Bar 2, such as a click operation, Fig.10 As shown in (b) of FIG. 1 , the electronic device may display a page layout window 22. The page layout window 22 includes multiple page layout controls, for example, the multiple page layout controls include a full screen control, a split screen control, and a sliding window control 23. After the electronic device receives the user's operation on the sliding window control 23, as shown in FIG. Fig.10 As shown in (c) in FIG. 1 , the electronic device can display the second display area 24 on the desktop of the electronic device.
[0198] The second display area 24 includes a dialog box content 25 and an edit control 26 for the dialog box content. The edit control 26 for the dialog box content may include a source control, an add control, a more control, etc. The source control is used to display the source of the data output by the application assistant (for example, provided by cloud data).
[0199] At this time, the dialog content 25 of the second display area 24 displays a loading animation instead of the data output by the application assistant, and the source control has normally displayed the source of the data output by the application assistant, and the add control and the more controls are also displayed normally. Usually, the source of the dialog content and the editing control of the dialog content are displayed only when the dialog content is fully output. That is to say, when the electronic device receives the user's operation on the sliding panel control and displays the second display area, the dialog content in the second display area may be displayed abnormally.
[0200] In some examples, based on preset rules, the second display area will not display the loading animation only in two cases.
[0201] The first case is: the main process triggers the execution of the setallMessage() method, and the JS thread obtains data through the setallMessage() method. In this case, JS can refresh the obtained data to the second display area, and the second display area does not display the loading animation.
[0202] The second situation is: the main process sends the data output by the application assistant, and the status bit of the data output by the application assistant is start (specifically, when sending the data output by the application assistant to the JS thread, only the status bit of the first data output by the application assistant will be set to start, and the status bits of the subsequent data output by the application assistant will be middle or end). In this case, after the JS thread receives the data output by the application assistant, the JS thread can refresh the data output by the application assistant to the second display area, and the second display area does not display the loading animation.
[0203] Combined with the above, it can be seen that when the renderHtmlFinished() method is called, the main process will send the data output by the application assistant to the JS thread. In addition, after the electronic device receives the user's operation on the AI option, it will continue to receive the data output by the application assistant sent from the preset model. Correspondingly, the main process will continue to send the received data output by the application assistant to the JS thread. Therefore, when restoring the data output by the application assistant, the main process will continue to send the data output by the application assistant to the JS thread, and there is no fixed sending order for the first and second types of data mentioned above.
[0204] When the JS thread receives the first type of data first and then the second type of data, since the first type of data is sent to the JS thread through the setallMessage() method, this scenario meets the first case mentioned above, and the second display area does not display the loading animation.
[0205] When the JS thread receives the second data first and then the first data, since the status bit of the second data is not start (only when the AI option is triggered for the first time, the status bit of the first data output by the application assistant sent to the JS thread is start), the scenario does not meet the first or second situation mentioned above, so the second display area will continue to display the loading animation. This will bring a poor user experience.
[0206] Therefore, in order to avoid the problem of continuous loading animation during the display data recovery process in the second display area, the present invention suspends data transmission (i.e., suspends data transmission output by the application assistant) when the storage value of the first flag is true and the main process saves the data output by the application assistant. When EditWebFragment calls the renderHtmlFinished() method to notify the main process that the rendering is complete, the main process sends the saved data output by the application assistant to the JS process, and continues data transmission (i.e., continues data transmission output by the application assistant) after sending the data output by the application assistant. In this way, it is equivalent to the main process triggering the setallMessage() method, first sending the first type of data to the JS thread, and then sending the second type of data. This processing method meets the first case mentioned above, and the second display area does not display the loading animation.
[0207] In some examples, when it is determined that the storage value of the first flag bit is the first numerical value and the main process saves the data output by the application assistant, the data transmission may be suspended.
[0208] Exemplarily, the process of the main process suspending data transmission may be: the main process clears the flag position in the message queue to suspend data transmission. For example, the process of the main process clearing the flag position in the message queue may be: the main process triggers the execution of the MessageQueue.clearFlag() method to clear the flag position in the message queue.
[0209] In addition, in combination with the above content, it can be known that the user's operation on the personalized control will cause the first display area to be reconstructed. The data in the first display area is displayed through the JS thread, and the data displayed by the JS thread is sent by the main process through the message queue.
[0210] When the second display area is reconstructed (ie, the Webview page is reconstructed), the data output by the application assistant will be lost, and accordingly, the data displayed by the JS thread will also be lost.
[0211] Usually, after receiving the user's operation on the AI option, the main process will continue to transmit the data output by the application assistant to the JS thread through the message queue. Even in the process of reconstructing the Webview page, the main process will still transmit the data output by the application assistant.
[0212] Since the reconstruction of the Webview page will cause the data displayed by the JS thread to be lost, it is necessary to suspend the execution of data transmission during the reconstruction process. Otherwise, the data transmitted from the main process to the JS thread will be lost forever. Therefore, in the process of reconstructing the Webview page (specifically, after saving the data output by the application assistant), the present disclosure can also avoid data loss by suspending the execution of data transmission, so that the displayed data can be displayed continuously, thereby improving the user experience.
[0213] More specifically, the detailed process of the main process saving the data output by the application assistant and suspending the data transmission of the message queue is as follows: First, through MessageStation's Webview = current Webview, the current Webview is assigned to MessageStation to ensure that MessageStation operates the correct Webview instance. Then, the main process retrieves all messages from the JavaScript thread through Webview.getAllMessages() to obtain the data output by the application assistant. Next, through savedMessage = the message of the current Webview obtained, the data output by the application assistant is saved to the savedMessage variable. Finally, through MessageQueue.clearFlag(), the flag in the message queue is cleared and the transmission of messages is suspended to ensure that no new messages are transmitted or processed during the saving process, thereby avoiding inconsistent states.
[0214] Optionally, in S207, when it is determined that the storage value of the first flag is the first value, and after the main process saves the data output by the application assistant, the data transmission can be suspended. In another implementation, when it is determined that the storage value of the first flag is the first value, the main process sets the second flag (also called the data push flag) to a third value and saves the data output by the application assistant. Exemplarily, after S204, S209 is also included.
[0215] S209: When it is determined that the storage value of the first flag is the first numerical value, the main process sets the second flag to the third numerical value and saves the data output by the application assistant.
[0216] Combined with S208, it can be known that in the process of restoring the data output by the application assistant, the JS thread may receive the second data first and then the first data. Therefore, when the JS thread refreshes the output data of the preset model in the second display area, the second display area will continue to display the loading animation.
[0217] based on Figure 2In the content of S208 in the embodiment shown, in order to avoid this situation, when it is determined that the storage value of the first flag bit is the first value, the main process stops the data output by the application assistant from being transmitted to the JS thread by suspending the execution of data transmission. When the data output by the application assistant is restored, the main process controls the output data of the preset model to be transmitted to the JS thread by continuing the execution of data transmission.
[0218] That is to say, when restoring the data output by the application assistant, the first data is sent to the JS process first and then the second data. Since the sending of the first data is implemented by the setallmessage() method, this method meets the first situation where the loading animation disappears. Therefore, when the JS thread refreshes the data output by the application assistant newly generated by the preset model in the second display area, the data can be displayed normally.
[0219] In some examples, before saving the data output by the application assistant, the main process may set a second flag to control the suspension of data transmission (e.g., suspension of data transmission to the JS thread) through the second flag. The second flag may be set to a third value or a fourth value.
[0220] For example, Fig.12 As shown, the flag field corresponding to the second flag bit is mIsCanPopMessage. The third value may be false. The fourth value may be true.
[0221] In some examples, when it is determined that the storage value of the first flag is a first numerical value, the main process sets the second flag to a third numerical value to use the third numerical value to instruct the message queue to pause sending data output by the application assistant to the JS thread.
[0222] The main process sets the second flag bit to the third value as follows: the main process sets mIsCanPopMessage to false. When mIsCanPopMessage=false, the message queue stops transmitting data to the JS thread. That is, when mIsCanPopMessage=false, MessageStation interrupts the transmission process of the data output by the application assistant and returns.
[0223] After the second flag is set, the Messagestation can control whether the message queue suspends transmitting data to the JS thread through the second flag.
[0224] In some examples, the process of MessageStation determining whether to suspend data transmission to the JS thread according to the second flag bit may be: first, MessageStation copies the variable to be transmitted from the head of the message queue. Then, it is determined whether the variable to be transmitted includes transmission data (for example, data output by the application assistant). Finally, the second flag bit (i.e., mIsCanPopMessage) is checked. If the value of the second flag bit is false, MessageStation suspends sending the variable to be transmitted to the JS thread and continues to loop the process.
[0225] Combination Fig.10 It can be seen that when the user performs an operation on the sliding panel control, the dialog box content in the second display area will continue to display the loading effect. The reason for this problem is that in the process of restoring the data output by the application assistant, the preset model is also continuously generating data. The JS thread may receive the second data first and then the first data. Since the flag bit of the second data is not start, when the JS thread refreshes the second data in the second display area, the second display area will continue to display the loading effect.
[0226] In order to avoid this abnormal display, the present application can set the second flag to the third value after receiving the user's operation on the sliding control. That is, the second flag is set to false. In this way, the main process will suspend the transmission of data to the JS thread. Since the data in the JS thread will be lost during the reconstruction of EditWebFragment, this can not only avoid the second type of data loss, but also avoid the problem of continuous display of loading animation.
[0227] In addition, S207 includes the following steps: when it is determined that the storage value of the first flag is the first value, and after the main process saves the data output by the application assistant, the data transmission of the message queue can also be suspended. According to the content, the suspension of the data transmission of the message queue is performed after the data output by the application assistant is saved. That is to say, when the data output by the application assistant is saved, the main process continues to send the second type of data to the JS thread.
[0228] For example, the data output by the application assistant is saved at 11:00, and the data transmission of the message queue is suspended at 11:01. That is to say, during the period from 11:00 to 11:01, the main process continues to send the second type of data to the JS thread. Since all data of the JS thread will be lost during the reconstruction of EditWebFragment, the second type of data sent by the main process to the JS thread during the period from 11:00 to 11:01 will also be lost.
[0229] Therefore, in order to avoid this situation, the present disclosure sets the second flag bit to the third value before saving the data output by the application assistant. That is, before saving the data output by the application assistant, the second data is first suspended from being sent to the JS thread. Then the main process can obtain all the data from the JS thread through the getallmessage() method, thereby avoiding data loss and improving the consistency of data display and user experience.
[0230] S210. When EditWebFragment is recreated, the main process reads the storage value of the first flag bit, and determines to execute Webview page recovery when the storage value of the first flag bit is a first numerical value; and determines not to execute Webview page recovery when the storage value of the first flag bit is a second numerical value.
[0231] After the first activity is destroyed, the main process can create a second activity, wherein the first activity and the second activity have the same content, but different IDs.
[0232] like Fig.12 As shown, since EditWebFragment is attached to the first activity, when the main process creates the second activity, the onActivityCreated() method of EditWebFragment will also be triggered to execute. During the execution of the onActivityCreated() method, the main process can read the stored value of the first flag.
[0233] like Figure 8 As shown, the main process can trigger the execution of the onActivityCreated() method, and the process of reading the storage value of the first flag bit can be: in the process of triggering the execution of the onActivityCreated() method, the main process can query the Bundle to obtain the storage value of the first flag bit, and determine whether to trigger the Webview page recovery according to the storage value of the first flag bit.
[0234] In some examples, the process of determining whether to execute Webview page recovery based on the storage value of the first flag bit can be: when the storage value of the first flag bit is a first numerical value, determine to execute Webview page recovery; when the storage value of the first flag bit is a second numerical value, determine not to execute Webview page recovery.
[0235] Exemplarily, the main process queries the Bundle to obtain the storage value of the first flag bit by: querying the RESTORE_KEY_YOYO_SIDE_SHOWN key in the Bundle, and determining whether to restore the Webview page based on the RESTORE_KEY_YOYO_SIDE_SHOWN key-value pair information.
[0236] For example, when the RESTORE_KEY_YOYO_SIDE_SHOWN key-value pair information is true, it is confirmed that the Webview page is restored. When the RESTORE_KEY_YOYO_SIDE_SHOWN key-value pair information is false, it is confirmed that the Webview page is not restored.
[0237] S211. When the rendering of EditWebFragment is completed and it is determined to execute Webview page recovery, the main process sends the data output by the application assistant to the JS thread.
[0238] like Fig.12 As shown, based on the aforementioned life cycle method, when the renderHtmlFinished() method is called to notify the main process that the rendering is complete, the main process can query the storage value of the first flag. When it is determined to restore the Webview page according to the storage value of the first flag, the main process sends the data output by the application assistant to the JS thread.
[0239] In some examples, such as Fig.12 As shown, the process of the main process sending the data output by the application assistant to the JS thread may be: the main process may trigger the execution of the startAndRestoreWebview() method of Messagestation to send the data output by the application assistant to the JS thread.
[0240] like Figure 8 As shown, the main process triggers the execution of the startAndRestoreWebview() method of Messagestation to send the data output by the application assistant to the JS thread. The process can be: when executing the startAndRestoreWebview() method, Messagestation can call the setallmessage() method of the JS thread to send the data output by the application assistant to the Js thread.
[0241] In some examples, after the main process sends the data output by the application assistant to the JS thread, the data transmission may continue.
[0242] Exemplarily, the process of the main process continuing to perform data transmission may be: the main process assigns a value to a flag in the message queue to continue to perform data transmission. For example, the process of the main process assigning a value to a flag in the message queue may be: the main process triggers the execution of the MessageQueue.resetFlag() method to assign a value to the flag in the message queue.
[0243] Combined with the content of S212, it can be known that after the main process saves the data output by the application assistant, the data transmission is suspended. Therefore, after the main process sends the data output by the application assistant to the JS thread, the JS thread can save the data received from the application assistant as the second data. In this case, the data transmission can continue to be executed, so that the data output by the application assistant obtained through the preset model can continue to be displayed in the second display area. In this way, the display data in the second display area can also be displayed continuously.
[0244] More specifically, the process in which the main process sends the data output by the application assistant to the JS thread and continues to execute the data transmission can be: first, through MessageStation's Webview = current Webview, the current Webview is assigned to MessageStation to ensure that MessageStation operates the correct Webview instance. Then, through Webview.setAllMessages(savedMessage), the data output by the application assistant previously saved in savedMessage is reapplied to Webview. Next, through savedMessage = null, the savedMessage variable is cleared to free up memory and avoid reusing previous data. Secondly, through MessageQueue.clearFlag(), the flag in the message queue is restored so that message transmission can continue. Finally, through MessageQueue.popUp(), the message queue is restored so that the main process can continue to send the data output by the application assistant to the JS thread.
[0245] S212: The second display area displays the first data.
[0246] Based on the aforementioned life cycle method, after EditWebFragment is rendered, EditWebFragment can display the content interface after the note is restored (also referred to as the second interface), and the second interface includes a second display area. The second interface corresponds to the second activity. After the main process sends the data output by the application assistant to the JS thread, the JS thread can save the data received from the application assistant as the second data, and display the first data in the second display area based on the second data. Exemplarily, the content of the first data and the second data is the same. The second display area is also built based on Webview, and the second display area corresponds to Webview.
[0247] Optionally, the first data may include the second data, that is, the first data displayed in the second display area may include not only the second data but also other data.
[0248] In some examples, the process of the JS thread displaying the first data in the second display area according to the second data may be: after displaying the second display area, the JS thread may refresh the acquired second data to the second display area, thereby displaying the first data in the second display area.
[0249] In some examples, the second display area includes data that has been output by the application assistant between the first moment and the second moment, and the display effect of the second interface is different from that of the first interface.
[0250] based on Figure 2 In the method provided by the illustrated embodiment, when a user operation on a personalized control (for example, a control for switching between dark and light color modes) is received, the first display area will be lost. In order to restore the first display area, in this scenario, the main process of the electronic device can set a first flag bit according to whether the note assistant function is turned on. If the note assistant function is turned on, then when the first activity is destroyed, the first flag bit is used to trigger the saving of the data output by the application assistant in the first display area. When creating the second activity, the saved data output by the application assistant can be used to display the second display area again. Among them, the display data of the first display area and the second display area are the same. In this way, when the electronic device receives a user operation on the personalized control, it can still continue to display data to the user, so that the corresponding interface display before and after the operation of triggering the personalized control can be connected.
[0251] In addition, after saving the data output by the application assistant, the data transmission can be suspended. After the data output by the application assistant is restored, the data transmission can be resumed. In this way, it can be ensured that the output data of the preset model can be refreshed to the second display area by the JS thread normally, and the problem of continuous display of the loading animation effect will no longer occur.
[0252] In another embodiment, Fig.11 As shown, in Figure 2 Based on the embodiment shown, after S212, the following steps are further included:
[0253] S1101. The main process sets the second flag bit to a fourth value, and continues to send data output by the application assistant newly generated by the preset model to the JS thread.
[0254] After the data output by the application assistant is restored to display, the main process sets the second flag bit to the fourth value to instruct the message queue to continue sending the data output by the application assistant newly generated by the preset model to the JS thread using the fourth value.
[0255] The main process updates the second flag bit to the fourth value by: the main process updates mIsCanPopMessage to true. When mIsCanPopMessage=true, the message queue continues to transmit data to the JS thread. That is, when mIsCanPopMessage=true, MessageStation continues to execute the data transmission process.
[0256] S208 discloses the specific process of MessageStation determining whether to suspend data transmission to the JS thread according to the second flag. According to the content, when the value of the second flag is false, MessageStation suspends sending the variable to be transmitted to the JS thread and continues to copy the variable to be transmitted from the head of the message queue. Then, it is determined whether the variable to be transmitted includes the transmission data. Finally, the second flag is checked. When the main process updates the second flag to true, MessageStation performs the data transmission operation and continues to send the variable to be transmitted to the JS thread (the variable to be transmitted may include the output data of the preset model).
[0257] In some examples, such as Fig.12 As shown, before the main process sends the output data of the preset model to the JS thread, the main process also includes: the main process obtains the output data of the preset model. The process of the main process obtaining the output data of the preset model can be: the preset model sends the newly generated application assistant output data to the Messagestation by calling the Popup() method of the Messagestation.
[0258] After Messagestation obtains the output data of the newly generated application assistant through the preset model, the process of sending the newly generated output data of the application assistant to the JS thread can be: Messagestation calls the showLLManswerSSE() method of the JS thread, and sends the output data of the preset model to the JS thread to display the output data of the newly generated application assistant of the preset model.
[0259] S1102. The JS thread receives and refreshes in the second display area the data output by the application assistant newly generated by the preset model.
[0260] After the JS thread receives the data output by the newly generated application assistant of the preset model sent by the main thread, the data output by the newly generated application assistant of the preset model can be spliced after the existing data, and refreshed and displayed in the second flag bit in sequence according to the order of the data.
[0261] In some examples, at a third moment, a third interface is displayed, and the third interface includes complete data output by the application assistant. The complete data output by the application assistant may include data output by the application assistant newly generated by a preset model.
[0262] More specifically, the detailed process of the electronic device making the display data in the second display area display normally is as follows: First, when notifying the JS thread to save the data output by the application assistant, the main process sets mIsCanPopMessage to false to suspend the data transmission of the message queue. This ensures that the data output by the application assistant is not disturbed by new messages. Then, call Webview.getAllMessages() to obtain the data output by the application assistant. When the JS thread obtains the data output by the application assistant, the main process stores the data output by the application assistant in the savedMessage variable, and performs the form switching and reconstruction of the second display area. When preparing to display the second display area, the current Webview is then assigned to MessageStation to ensure that MessageStation operates the correct Webview instance. Then, the previously saved message is reset to the Webview page through Webview.setAllMessages(savedMessage) to display the second display area. When the second display area is displayed normally, mIsCanPopMessage is set to true so that the data in the message queue can continue to be transmitted. Finally, the main process calls MessageQueue.popUp() to restore the message queue so that MessageStation can continue to pass messages to the JS thread.
[0263] based on Fig.11 In the method provided by the illustrated embodiment, when a user operation on a personalized control is received, the first display area will be lost. In order to restore the first display area, in this scenario, the main process of the electronic device can set a first flag bit according to whether the note assistant function is turned on. If the note assistant function is turned on, then when the first activity is destroyed, the first flag bit can be used to trigger the saving of data output by the application assistant. When creating the second activity, the saved data output by the application assistant can be used to display the second display area. Among them, the display data of the first display area and the second display area are the same. In this way, when the electronic device receives a user operation on the personalized control, it can still continue to display data to the user, so that the corresponding interface display before and after the operation of triggering the personalized control can be consistent.
[0264] In addition, before saving the data output by the application assistant, the data transmission can be suspended by using the second flag. After the data output by the application assistant is restored, the data transmission can be continued by setting the second flag. In this way, it can be ensured that the data output by the application assistant newly generated by the preset model can be refreshed to the second display area by the JS thread normally, and the problem of continuous display of the loading animation will no longer occur. Moreover, since the suspension of data transmission is executed before saving the data output by the application assistant, the data saved by the application assistant will be complete data, and there will be no data loss. Accordingly, when restoring the data output by the application assistant, the data in the second display area can also be completely restored.
[0265] It should be understood that each step in the above method embodiment provided by the present disclosure can be completed by an integrated logic circuit of hardware in a processor or by instructions in the form of software. The method steps disclosed in the embodiments of the present disclosure can be directly embodied as being executed by a hardware processor, or by a combination of hardware and software modules in a processor.
[0266] In one example, the unit in the above apparatus may be one or more integrated circuits configured to implement the above method, such as one or more ASICs, or one or more DSPs, or one or more FPGAs, or a combination of at least two of these integrated circuit forms.
[0267] For another example, when the units in the device can be implemented in the form of a processing element scheduling program, the processing element can be a general-purpose processor, such as a CPU or other processor that can call a program. For another example, these units can be integrated together and implemented in the form of a system on a chip SOC.
[0268] In one implementation, the units of the above apparatus implementing the corresponding steps in the above method can be implemented in the form of a processing element scheduling program. For example, the apparatus may include a processing element and a storage element, and the processing element calls the program stored in the storage element to execute the method of the above method embodiment. The storage element may be a storage element on the same chip as the processing element, that is, an on-chip storage element.
[0269] In another implementation, the program for executing the above method may be in a storage element on a different chip from the processing element, i.e., an off-chip storage element. In this case, the processing element calls or loads the program from the off-chip storage element to the on-chip storage element to call and execute the method of the above method embodiment.
[0270] For example, the embodiments of the present disclosure may also provide a device, such as an electronic device, which may include a processor and a memory for storing instructions executable by the processor. When the processor is configured to execute the above instructions, the electronic device implements the data processing method of the above embodiment. The memory may be located inside the electronic device or outside the electronic device. And the processor includes one or more.
[0271] In another implementation, the unit of the device implementing each step in the above method may be configured as one or more processing elements, which may be arranged on the corresponding electronic device, and the processing element here may be an integrated circuit, for example: one or more ASICs, or one or more DSPs, or one or more FPGAs, or a combination of these integrated circuits. These integrated circuits may be integrated together to form a chip.
[0272] For example, the present disclosure also provides a chip, such as Fig.13 As shown, the chip system includes at least one processor 1301 and at least one interface circuit 1302. The processor 1301 and the interface circuit 1302 can be interconnected through a line. For example, the interface circuit 1302 can be used to receive signals from other devices. For another example, the interface circuit 1302 can be used to send signals to other devices (such as the processor 1301).
[0273] For example, the interface circuit 1302 can read the instructions stored in the memory in the device and send the instructions to the processor 1301. When the instructions are executed by the processor 1301, the electronic device (such as Figure 1 The electronic device 100 shown in the figure performs each step in the above embodiment. Of course, the chip system may also include other discrete devices, which is not specifically limited in the embodiment of the present disclosure.
[0274] The embodiment of the present disclosure further provides a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by an electronic device, the electronic device can implement the above-mentioned data processing method.
[0275] The disclosed embodiments also provide a computer program product, including computer instructions for the electronic device to run as described above, and when the computer instructions are run in the electronic device, the electronic device can implement the data processing method as described above. Through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above 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.
[0276] In the several embodiments provided in the present disclosure, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and 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.
[0277] 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.
[0278] In addition, each functional unit in each embodiment of the present disclosure 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.
[0279] 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 disclosure 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, such as a program. The software product is stored in a program product, such as a computer-readable storage medium, including a number of instructions to enable a terminal device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the methods of each embodiment of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, ROM, RAM, disk or optical disk and other media that can store program codes.
[0280] For example, the embodiments of the present disclosure may also provide a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by an electronic device, the electronic device implements the data processing method in the aforementioned method embodiment.
[0281] The above are only specific embodiments of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present disclosure should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. An interface recovery method, characterized in that: Applied to electronic equipment, the method comprises: Displaying a first interface of a first application, the first interface including a first display area of an application assistant, the first display area including at least one option of the application assistant; At a first moment, in response to an operation on a target option in the first display area, starting to display data output by the application assistant in the first display area; At a second moment, in response to an operation on the first control, the first activity corresponding to the first interface is destroyed, and at the second moment, the application assistant does not finish outputting data; After destroying the first activity, create a second activity; After creating the second activity, the second interface corresponding to the second activity is displayed; wherein, the second interface includes the second display area, the second display area includes the data that the application assistant has output between the first moment and the second moment, and the second interface has a different display effect from the first interface.
2. The method according to claim 1, characterized in that In response to an operation on a first control, destroying a first activity corresponding to the first interface includes: In the interface of the control center, in response to a click operation on the first control, a first activity corresponding to the first interface is destroyed.
3. The method according to claim 1, characterized in that: In response to an operation on a first control, destroying a first activity corresponding to the first interface includes: In response to a click operation on the second control, displaying at least two page layout controls; In the at least two page layout controls, in response to an operation on the first control, a first activity corresponding to the first interface is destroyed.
4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: At a third moment, a third interface is displayed, and the third interface includes complete data output by the application assistant.
5. The method according to any one of claims 1 to 4, characterized in that The first activity includes a Webview, and the Webview corresponds to both the first display area and the second display area.
6. The method according to claim 1 or 2, characterized in that: The destroying the first activity corresponding to the first interface includes: In the process of destroying the first activity corresponding to the first interface, data output by the application assistant between the first moment and the second moment is saved.
7. The method according to claim 6, characterized in that The step of saving the data output by the application assistant between the first moment and the second moment during the process of destroying the first activity corresponding to the first interface includes: In the process of destroying the first activity corresponding to the first interface, the second flag is set to a third value, and the data output by the application assistant between the first moment and the second moment is saved; the third value is used to indicate the suspension of data transmission.
8. The method according to any one of claims 1 to 7, characterized in that After displaying the second interface corresponding to the second activity, the method further includes: The second flag bit is set to a fourth value, where the fourth value is used to indicate to continue data transmission.
9. The method according to claim 2 or 3, characterized in that: After the response to the operation on the first control, the method further includes: Determining whether an application assistant function of the first application is enabled; When the first application is started, the first flag is set to a first value; the first value is used to indicate that the data output by the application assistant is saved; The step of saving the data output by the application assistant between the first moment and the second moment during the process of destroying the first activity corresponding to the first interface includes: In the process of destroying the first activity corresponding to the first interface, when it is determined that the first flag is the first value, the data output by the application assistant between the first moment and the second moment is saved.
10. The method according to claim 6, characterized in that After the second activity is created, a second interface corresponding to the second activity is displayed, including: In the process of creating the second activity, reading the first flag bit; When the first flag bit is a first value, a second interface corresponding to the second activity is displayed.
11. An electronic device, characterized in that: include: Processors, memories, buses, and communication interfaces; The memory is used to store computer-executable instructions, and the processor is connected to the memory via the bus. When the terminal is running, the processor executes the computer-executable instructions stored in the memory so that the terminal executes the interface recovery method as described in any one of claims 1-10.
12. A computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium, characterized in that: When the instruction is executed on the terminal, the terminal executes the interface recovery method according to any one of claims 1 to 10.
13. A computer program product, characterized in that The computer program product comprises a computer program code, and when the computer program code is run on a computer, the computer is enabled to implement the interface recovery method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Application recovery device and method and mobile terminal
CN108415734A
Page display method, device and equipment and storage medium
CN110618848A
Application page recovery method and device, equipment and storage medium
CN118277140A
Application Exception Recovery
US20220075696A1