File preview method and device, storage medium and electronic device
By creating and hiding the first preview window before the file preview, and sending a file identifier to display it when the user clicks on the target file, the problem of long preview window creation and loading time in the prior art is solved, thus improving the file preview speed.
Patent Information
- Application Number
- CN202210192570.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-28
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2042-02-28
AI Technical Summary
Existing technologies require creating a preview window and loading data during the file preview process, which takes a long time and affects the preview speed.
The first preview window is created and hidden before the file is previewed. When the user clicks on the target file, the data is sent to the first preview window for display via the file identifier, reducing window creation time.
Pre-creating a preview window saves time when creating the window to preview the file, thus improving the file preview speed.
Smart Images

Figure CN116701311B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the computer field, and in particular to a file preview method and device, a storage medium and an electronic device. BACKGROUND
[0002] Nowadays, the use of interactive tablets is becoming more and more popular, and the application of interactive tablets is gradually popularized. Data sharing between different interactive tablets and previewing of shared data have also become an indispensable practical function. SUMMARY
[0003] The embodiments of the present application provide a file preview method, device, storage medium and electronic device. The preview window is created in advance to save the time consumed for creating the window when previewing the file, thereby reducing the time required for previewing the file and improving the preview speed of the file. The technical method is as follows:
[0004] In a first aspect, the embodiments of the present application provide a file preview method, characterized in that the method comprises:
[0005] receiving a file identifier for a selected target file sent from a slave window, the slave window displaying at least one file;
[0006] sending the file identifier to a first preview window, so that the first preview window acquires file data corresponding to the target file based on the file identifier and displays the file data, the first preview window being a cache window created synchronously when the main window is started.
[0007] In a second aspect, the embodiments of the present application provide a file preview device, characterized in that the device is applied to a whiteboard application and comprises:
[0008] an identifier receiving module configured to receive a file identifier for a selected target file sent from a slave window, the slave window displaying at least one file;
[0009] a data display module configured to send the file identifier to a first preview window, so that the first preview window acquires file data corresponding to the target file based on the file identifier and displays the file data, the first preview window being a cache window created synchronously when the main window is started.
[0010] In a third aspect, the embodiments of the present application provide a computer storage medium, which stores a plurality of instructions, the instructions being suitable for being loaded and executed by a processor to perform the method steps described above.
[0011] In a fourth aspect, an electronic device is provided, which can include a processor and a memory; wherein the memory stores a computer program, and the computer program is adapted to be loaded by the processor and execute the method steps described above.
[0012] By creating the first preview window in advance and hiding it before previewing the file, when the user clicks the target file from the window, the file identifier corresponding to the target file is sent to the main window, the main window forwards the file identifier to the first preview window and displays the first preview window, and the first preview window obtains the corresponding file data based on the file identifier and displays the file data. By creating the preview window in advance, the time consumed for creating the window when previewing the file is saved, thereby reducing the time required for previewing the file and improving the preview speed of the file. BRIEF DESCRIPTION OF DRAWINGS
[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort on the basis of these drawings.
[0014] Figure 1 is a system architecture diagram of a file preview method provided by the embodiments of the present application;
[0015] Figure 2 is an example schematic diagram of a window display page provided by the embodiments of the present application;
[0016] Figure 3 is a flowchart of a file preview method provided by the embodiments of the present application;
[0017] Figure 4 is an example schematic diagram of a title bar provided by the embodiments of the present application;
[0018] Figure 5 is an example schematic diagram of a loading page provided by the embodiments of the present application;
[0019] Figure 6 is an example schematic diagram of a display interface provided by the embodiments of the present application;
[0020] Figure 7 is a flowchart of a file preview method provided by the embodiments of the present application;
[0021] Figure 8 is a schematic diagram of displaying the first preview window provided by the embodiments of the present application;
[0022] Figure 9is an example schematic diagram of outputting prompt information provided by an embodiment of the present application;
[0023] Figure 10 is an example schematic diagram of outputting prompt information provided by an embodiment of the present application;
[0024] Figure 11 is a structural schematic diagram of a file preview device provided by an embodiment of the present application;
[0025] Figure 12 is a structural schematic diagram of a file preview device provided by an embodiment of the present application;
[0026] Figure 13 is a structural schematic diagram of an identification receiving module provided by an embodiment of the present application;
[0027] Figure 14 is a structural schematic diagram of a data display module provided by an embodiment of the present application;
[0028] Figure 15 is a structural schematic diagram of a data display module provided by an embodiment of the present application;
[0029] Figure 16 is a structural schematic diagram of a data display module provided by an embodiment of the present application;
[0030] Figure 17 is a structural schematic diagram of a file preview device provided by an embodiment of the present application;
[0031] Figure 18 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0032] In order to make the objects, technical solutions and advantages of the present application clearer, the following will further describe the embodiments of the present application in combination with the accompanying drawings.
[0033] The following description refers to the accompanying drawings. Unless otherwise noted, like numbers in different drawings refer to the same or similar elements. The embodiments described in the following example embodiments do not represent all embodiments consistent with the present application. Instead, they are merely examples of apparatuses and methods consistent with some aspects of the present application as detailed in the appended claims.
[0034] In the description of the present application, it is understood that the terms "first", "second" and the like are only for the purpose of description and cannot be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances. In addition, in the description of the present application, "a plurality of" means two or more than two, unless otherwise specified. The association relationship of the associated objects is described, which means that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after it.
[0035] In the prior art, when previewing shared data, a preview window needs to be established first, and then the data is loaded and displayed. In this process, time is consumed to create the window, and after the window is created, time is also consumed to load the data.
[0036] Therefore, by creating a first preview window in advance before previewing a file and hiding it, when a user clicks a target file from the window, the file identifier corresponding to the target file is sent to the main window. After the main window identifies the file identifier, it forwards the file identifier to the first preview window and displays the first preview window. The first preview window obtains the corresponding file data based on the file identifier and displays it. By creating a preview window in advance, the time consumed to create a window when previewing a file is saved, thereby reducing the time required to preview a file and improving the preview speed of the file.
[0037] The present application will be described in detail below with reference to specific embodiments.
[0038] Please refer to Figure 1 The system structure diagram of a file preview method provided by the embodiment of the present application. Figure 1 The system includes an application and a server. The application can be an application program in a mobile terminal for sharing files, which can realize functions including previewing files, sharing files, etc. The application includes a window creation container (electron container), a main window created by the window creation container for managing various windows, and slave windows with various functions. The server can be a server device for storing file data. The file data shared by users are stored in the server, and the corresponding file data is downloaded when previewing is needed.
[0039] When a user needs to use the application to preview files, the application is started. The main window of the application creates a first preview window and hides it. The display page of the application is shown in FIG. 1A, which only displays the main window created when the application is started. Figure 2 When the user wants to preview a file in the slave window, the communication record button in the main window is clicked to obtain the display page shown in FIG. 1B. Figure 2The from window includes at least one file, and a target file to be previewed is selected from the from window according to a requirement and is clicked; after the user clicks the target file, the from window sends a file identifier of the target file to the main window, the main window displays a first preview window and sends the file identifier to the first preview window, the first preview window acquires file data of the target file from the server based on the file identifier (i.e. the first step in Figure 1 ), and during the acquisition of the file data of the target file, the first preview window does not have file data to be displayed, so the display interface of the first preview window is as shown by "C" in Figure 2 , and presents a display interface of waiting for loading; when the server returns the file data of the target file to the application (the second step in Figure 1 ), the first preview window receives and displays the file data, so as to obtain a display interface as shown by "D" in Figure 2 .
[0040] Through the above method, the first preview window is created in advance and is hidden before the file is previewed, when the user clicks the target file of the from window, the file identifier corresponding to the target file is sent to the main window, the main window sends the file identifier to the first preview window, and displays the first preview window, so that the first preview window acquires file data corresponding to the file identifier from the server based on the file identifier, and displays the file data in the first preview window. By using the method, the time consumed for creating the window when the file is previewed is saved by creating the first preview window in advance, so the time required for previewing the file is reduced, and the preview speed of the file is improved.
[0041] The above method can be run on a file preview device, and the file preview device can be the mobile terminal described above, including but not limited to: an intelligent interactive tablet, a personal computer, a tablet computer, a handheld device, a computing device or other processing devices connected to a wireless modem, etc. The mobile terminal can be called different names in different networks, for example: user equipment, access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication device, user agent or user device, cellular phone, cordless phone, personal digital assistant (PDA), terminal device in 5G network or future evolution network, etc.
[0042] Please refer to Figure 3 , a flowchart of a file preview method provided by an embodiment of the present application. The embodiment of the present application is described by taking the main window as an example, and the file preview method can include the following steps:
[0043] S101, receiving a file identifier of the selected target file sent from the slave window, the slave window displaying at least one file;
[0044] After the user selects the target file to be previewed in the slave window, the slave window sends the file identifier of the selected target file, and the master window receives the file identifier of the selected target file sent by the slave window.
[0045] The master window can be a process for managing windows, and is configured to manage the slave window. For example, the master window can be a window manager in the master window, which is configured to detect the slave window. In addition, the window manager is configured to control the creation and closing of the slave window.
[0046] The slave window can be a window configured to record and display files uploaded by the user to the application. The slave window displays at least one file uploaded by the user. The file includes a corresponding file identifier for distinguishing different files. The file can be classified into two types: an editable file and a non-editable file. The editable file can be edited online in real time, and the edited file content is saved and shared in the cloud in real time. For example, a notebook file. The non-editable file cannot be edited online, and can only be previewed online. If editing is required, the file needs to be downloaded to the local for editing. After editing, the edited file needs to be uploaded again for sharing. For example, office files, image files, and audio and video files belong to non-editable files.
[0047] Further, when the user clicks the target file in the slave window, the file identifier sent by the slave window can be the file name of the target file. Alternatively, the file identifier can be a download address of the file data corresponding to the target file. Alternatively, the file identifier can be file information of the target file, such as the file name, file size, file type, download address of the corresponding file data, or tag information of the corresponding file data in the server. The tag information is used to mark the data in the server, and the corresponding file data is obtained in the server by using the tag information. The specific content of the file identifier is not limited here, and can be set and adjusted according to actual conditions.
[0048] It should be noted that, in order to create the window and realize data transmission between different windows, a window creation container is required to provide a service of creating and managing the window. The window creation container is configured to create and manage the window in the application, and provides inter-process communication (IPC) to realize data transmission between different windows.
[0049] S102, send the file identification to the first preview window, so that the first preview window obtains file data corresponding to the target file based on the file identification and displays the file data, the first preview window being a cache window created synchronously when the main window is started;
[0050] After receiving the file identification, the file identification is identified. If there is no file corresponding to the file identification displayed in the currently opened preview window, the file identification is sent to the first preview window and the hidden first preview window is displayed. So that the first preview window receives the file identification and analyzes the file identification to obtain the file name, file size, file type, and download address or label information of the target file corresponding to the file identification. The file name, file size, and file type are displayed on the title bar of the first preview window. At the same time, the corresponding file data is downloaded from the server based on the download address or label information obtained after analysis, and the file data is displayed in the first preview window.
[0051] The first preview window can be a window for displaying file data. When the main window is started, one or more cache windows are created as the first preview window synchronously, and the created first preview window is hidden. It should be noted that when the first preview window is created, a display interface of one or more file types is loaded in the first preview window, so as to call the display interface of the file type corresponding to the file identification in the first preview window after the file identification is identified, thereby saving the display loading time of the file data.
[0052] The method of hiding the first preview window can be to set the length and width of the first preview window to 0, so as to achieve the effect that the first preview window exists but is not displayed.
[0053] After identifying the file identification, the currently opened preview window is detected. If there is a preview window with the same file data as the file identification in the currently opened preview window, the preview window is displayed. If there is no preview window with the same file data as the file identification, the file data corresponding to the file identification is obtained based on the file identification and displayed in the first preview window.
[0054] To obtain the file data of the target file, if the file identifier is the file name of the target file, the corresponding file data download address is obtained from the local based on the file name, and the file data is downloaded from the corresponding server based on the download address; if the file identifier is the download address of the file data corresponding to the target file, the file data of the target file is downloaded from the server based on the download address; if the file identifier is an information set including the file name, the file size, the file type and the download address or the tag information, the file identifier is parsed, if the download address is obtained after parsing, the file data is downloaded from the corresponding server based on the download address, if the tag information is obtained after parsing, the file data is obtained from the corresponding server based on the tag information, and then the file data is downloaded to the first preview window.
[0055] After obtaining at least the file name, the file size, the file type and the download address or the tag information based on the file identifier, each item of information is displayed, and the specific display method is as shown in Figure 4 The file name can be "Reconstruction of files and look" on the title bar as shown in Figure 4 The file size can be "3.75M" on the title bar as shown in Figure 4 The file type can be ".pptx" on the title bar as shown in Figure 4 After parsing the download address or the tag information, the corresponding file data is further downloaded, and the file data is displayed in the first preview window.
[0056] After obtaining the file data, the file data is adapted to the called display interface, so that the file data can be displayed in the first preview window and will not be displayed incorrectly due to format problems. The adaptation method of the file data and the display interface can be to unify the file data and the corresponding display interface, for example, if the target file is a video file, the total duration of the video file is displayed in the lower left corner of the display interface, and the channel option of the video file is added in the channel selection bar, so that the target file can be displayed in the first preview window to provide good user experience.
[0057] It should be noted that after the first preview window receives the file identifier sent by the main window, if the file data corresponding to the file identifier has not been downloaded, a loading interface as shown in Figure 5 is displayed, the display interface of the loading interface is the display interface corresponding to the file type of the file identifier; if the file data of the file identifier is obtained, the file data is displayed, and various display interfaces corresponding to the file types as shown in Figure 6 are obtained.
[0058] With the embodiment of the present application, by creating the first preview window in advance before previewing the file and hiding it, when the user clicks the target file from the window, the file identifier corresponding to the target file is sent to the main window, the main window identifies the file identifier and forwards the file identifier to the first preview window and displays the first preview window, the first preview window obtains the corresponding file data based on the file identifier and displays it. With the method, by creating the preview window in advance, the time consumed for creating the window when previewing the file is saved, thereby reducing the time required for previewing the file and improving the preview speed of the file.
[0059] Please refer to Figure 7 The flowchart of a file preview method provided by the embodiment of the present application. The embodiment of the present application takes the main window as an example for description, and the file preview method can include the following steps:
[0060] S201, synchronously creating the first preview window when the main window is started, and hiding the first preview window, the first preview window loading the interface of at least one file type, the interface not being displayed;
[0061] When the application is started, the window creation container of the application creates and displays the main window on the display interface of the application, and at the same time, after the main window is created, the window manager of the main window creates the first preview window based on the window creation container, and hides the first preview window. At the same time of creating the first preview window, the display interface of one or more file types is loaded, and the loaded display interface is not currently displayed in the first preview window.
[0062] The display interface can be the user interface corresponding to each file type, as shown in Figure 6 Different file types correspond to different display interfaces, for example Figure 6 The picture type display interface in has the keys for adjusting the picture size, and the keys for flipping, saving, etc.; the office type display interface takes the ppt file as an example, and correspondingly has the preview thumbnail on the left side, displays the specific information of the current page on the right side, and further includes the function keys such as the picture zooming key and the page turning key in the lower part of the display interface; the audio and video type display interface has the keys including the progress bar, the time, the volume control key and the screen zooming key at the bottom.
[0063] S202, receiving the file identifier of the selected target file sent from the window, synchronously creating the second preview window, and hiding the second preview window;
[0064] After receiving the file identifier of the selected target file sent by the user from the window, the second preview window is synchronously created, and the created second preview window is hidden. The creation method and content of the second preview window are the same as those of the first preview window.
[0065] Wherein, the relationship between the second preview window and the first preview window is that when the first preview window is used, the second preview window is created and hidden for use next time when previewing the file, and when the second preview window is used, the third preview window is created synchronously until the number of the preview windows reaches the preset number.
[0066] S203, judging whether the target file is opened in the first preview window based on the file identification;
[0067] After receiving the file identification, it is judged whether there is a first preview window with the same content as the target file in the currently opened first preview window based on the file identification.
[0068] Wherein, the method of judging the current window can be judged by the window manager of the main window, and the specific judging method can be detecting whether the file identification of the target file is the same as the file identification corresponding to the file displayed by the opened first preview window, if there is the same file identification, it is considered that the target file has been displayed, if there is no first preview window with the same file identification as the target file, it is considered that the target file has not been displayed.
[0069] Wherein, the window manager can be a manager in the main window for managing windows, for detecting the window conditions of each slave window including the number of opened windows, the length of time when the window is minimized, etc., in addition, it also has the function of controlling the creation, closing and other steps of each slave window.
[0070] S204, if the target file has been opened in the first preview window, the first preview window is displayed again;
[0071] If it is found that there is a first preview window displaying the target file in the currently opened first preview window through the detection of the currently opened first preview window, the first preview window is displayed again on the display page of the terminal and placed on the upper layer of all windows, such as Figure 8 Figure 8 The first preview window in the above figure covers other windows and is displayed on the top layer of the page.
[0072] S205, if the target file is not opened in the first preview window, detecting the number of currently opened preview windows;
[0073] If it is determined that there is no first preview window displaying the target file in the currently opened first preview window through the detection of the currently opened first preview window, the number of currently opened preview windows is further detected.
[0074] It should be noted that the purpose of detecting the number of currently opened preview windows can be to avoid that the user opens too many windows at the same time, that there are useless windows among the opened windows, and that memory resources are wasted, thereby affecting the user experience.
[0075] S206, if the number of the opened preview windows is equal to the preset number, destroying the first opened window among the opened preview windows, and sending the file identifier to the first preview window;
[0076] If the number of currently opened preview windows is equal to the preset number, in order to reduce the waste of memory, the first opened window among the currently opened preview windows is destroyed, and the file identifier is sent to the first preview window.
[0077] Further, if the number of currently opened preview windows is equal to the preset number, outputting prompt information for prompting the user that the number of currently opened preview windows is equal to the preset number, and inquiring whether to preview the target file, if the user determines to preview the target file, destroying the first opened window.
[0078] Further, if the number of currently opened preview windows is equal to the preset number, the preset number can be changed to open more preview windows.
[0079] The preset number can be a value defined by the user, and the specific value of the preset number is not limited here.
[0080] The prompt information can be output in the form of text, image, audio, video, etc. A feasible method is to output the text "the number of currently opened preview windows is equal to the preset number, whether to preview the file" as shown in Figure 9 At the same time, auxiliary methods such as audio prompts can also be used to prompt the user to determine whether to preview the target file.
[0081] S207, if the number of the opened preview windows is less than the preset number, sending the file identifier to the first preview window;
[0082] If the number of currently opened preview windows is less than the preset number, it can be considered that the current memory resources are sufficient, and opening one more preview window will not cause excessive use of memory and low user experience. Therefore, the file identifier of the target file is sent to the first preview window which does not display the file data, so that the first preview window displays the file data of the target file, and the first preview window is displayed. The displayed content of the first preview window is the file type determined by identifying the file identifier, and the corresponding display interface is called. Since the corresponding file data is not downloaded, the display interface is in a loading screen state as shown in Figure 5 .
[0083] S208, causing the first preview window to download the file data corresponding to the file identifier from the cloud;
[0084] If the user determines to preview the target file, after sending the file identifier to the first preview window, the first preview window parses the file identifier to obtain the file name, file size, file type, and download address or label information for downloading the file data, calls a display interface corresponding to the file type, displays the first preview window, displays the file name, file size, and file type of the target file on the title bar of the first preview window, and downloads the file data of the target file from the data server of the cloud based on the data identifier.
[0085] The specific definition and display method of the file name, file size, file type, and download address or label information can be referred to step S102, and will not be described here.
[0086] S209, if the first preview window does not receive the file data, controlling the first preview window to display a loading screen;
[0087] If the first preview window downloads the file data from the data server based on the file identifier, the speed of downloading the file data is slow due to network or other reasons, and the first preview window does not receive the file data, the first preview window displays a loading screen in the figure as shown in Figure 5 , and displays the loading progress according to the actual file data download condition.
[0088] The loading screen can be a circle and a progress percentage displayed in the middle of the screen as shown in Figure 5 , or other styles such as horizontal bar and progress percentage, and the specific style of the loading screen is not limited here.
[0089] S210, if the first preview window receives the file data, controlling the first preview window to adapt the file data, and controlling the first preview window to display the adapted file data;
[0090] If the first preview window receives the file data, the first preview window is controlled to adapt to the file data, so that the file data is displayed in the first preview window after the file data is adapted to the display interface. The adaptation method of the file data and the display interface can be to unify the file data and the corresponding display interface. For example, if the target file is a video file, the total duration of the video file is displayed in the lower left corner of the display interface, and the channel option of the video file is added in the channel selection bar, so that the target file displayed in the first preview window can provide a good user experience. The specific display effect can be referred to the display interface shown in Figure 6
[0091] S211, when it is detected that the first preview window is minimized, the duration of the minimization of the first preview window is recorded;
[0092] If the window manager of the main window detects that the first preview window is minimized by the user, the first preview window sends the minimization information to the window manager of the main window, the window manager records the minimization duration of the first preview window, and triggers a timer. If the minimization duration reaches the preset duration set by the timer, the first preview window is sent a notification to display prompt information.
[0093] The recording method of the minimization duration can be to start timing after the first preview window is minimized, and stop timing when the first preview window is un-minimized.
[0094] S212, if the minimization duration reaches the first preset duration, a notification is sent to the first preview window to display prompt information, so that the first preview window displays the prompt information when it is displayed again;
[0095] If the minimization duration reaches the first preset duration, a notification is sent to the first preview window, which is used to make the first preview window display prompt information that the minimization duration reaches the first preset duration. The prompt information is not directly displayed, but is displayed when the user un-minimizes. The first preset duration can be 30 minutes or 60 minutes, and the specific duration can be set by the user. The specific time length of the first preset duration is not limited here.
[0096] The prompt information can be output in the form of text, image, audio, and video. A feasible method is as shown in Figure 10 The text "whether to close the preview window if the minimization duration of the current preview window reaches the preset duration" is output, and audio prompts and other methods can be used as auxiliary methods to prompt the user to determine whether to close the first preview window. If the user clicks OK, the first preview window is closed. If the user clicks Cancel, the prompt information is closed and the first preview window is displayed.
[0097] S213, if the minimized duration reaches a second preset duration, sending a notification to the first preview window whether to close the first preview window, the second preset duration being greater than the first preset duration;
[0098] If the minimized duration reaches a second preset duration, a notification is sent to the first preview window whether to close the first preview window, prompting the user to close the first preview window, asking whether to close the first preview window, the second preset duration may be, for example, 90 minutes or 120 minutes, and the specific duration can be set by the user. The specific time length of the first preset duration is not limited here.
[0099] Wherein, the second preset duration is greater than the first preset duration, and the second preset duration and the first preset duration can be a time length defined by the user. The specific time length of the first preset duration and the second preset duration is not limited here.
[0100] Wherein, the prompt information can be displayed when the user cancels the first preview window, or the prompt information can be directly displayed to ask whether to close the first preview window. The prompt information can be output in the form of text, image, audio and video. A feasible method is as shown in Figure 10 The text "the minimized duration of the current preview window reaches the preset duration, whether to close the preview window" is output, and audio prompts and other methods can also be used for assistance to prompt the user to determine whether to close the first preview window. If the user clicks Figure 10 The "Confirm" button, the first preview window is closed; if the user clicks Figure 10 The "Cancel" button, the minimized duration is reset to zero and the minimized duration is recorded again; if the display prompt information reaches a third preset duration, the prompt information is closed and the first preview window is closed. The third preset duration can be a time length defined by the user, and the specific time length of the third preset duration is not limited here.
[0101] S214, receiving a confirmation instruction for the prompt information, and controlling to close the first preview window;
[0102] If the user clicks the "Confirm" button in the prompt information options, it is determined that the user's confirmation instruction for the prompt information is received, and the window manager of the main window closes the first preview window.
[0103] Through the embodiments of the present application, by creating the first preview window and hiding when the main window starts, after receiving the file identification of the target file sent from the window, the file identification is identified to determine whether there is an opened preview window displaying the file data corresponding to the same file identification, and the number of opened preview windows is detected to control the number of simultaneously opened windows, thereby reducing the waste of memory resources. When it is determined to use the first preview window to display the file data corresponding to the file identification, the first preview window downloads the file data corresponding to the target file from the data server based on the file identification, so as to display the file data. In addition, when the main window receives the file identification, the second preview window is created for subsequent use, and the first preview window is unhidden after receiving the file identification, and the preloaded display interface is called to display, thereby reducing the time consumed by the file data loading and display. By using the present application, the time consumed by creating the window when previewing the file is saved by pre-creating the preview window, and the file data loading time is saved by pre-loading the display interfaces of various file types, thereby improving the file preview speed and improving the user's file preview experience.
[0104] Please refer to Figure 11 , which shows the structure diagram of the file preview device provided by one exemplary embodiment of the present application. The file preview device can be realized by software, hardware or a combination of both, and is all or part of a terminal. The device 1 includes an identification receiving module 11 and a data display module 12.
[0105] The identification receiving module 11 is configured to receive the file identification of the selected target file sent from the window, and the window displays at least one file.
[0106] The data display module 12 is configured to send the file identification to the first preview window, so that the first preview window acquires the file data corresponding to the target file based on the file identification and displays the file data. The first preview window is a cache window created synchronously when the main window starts.
[0107] Optionally, as shown in Figure 12 , the device 1 further includes:
[0108] The first window creating module 13 is configured to create the first preview window synchronously when the main window starts, and hide the first preview window. The first preview window loads the interface of at least one file type, and the interface is not displayed.
[0109] Optionally, as shown in Figure 12 , the identification receiving module 11 includes:
[0110] The second window creating unit 111 is configured to receive a file identifier for a selected target file sent from a window, create a second preview window synchronously, and hide the second preview window.
[0111] Optionally, as shown in the figure, Figure 13 The identifier receiving module 11 comprises:
[0112] The file identifier receiving unit 112 is configured to receive a file identifier for a selected target file sent from a window.
[0113] The window judging unit 113 is configured to judge whether the target file is opened in the first preview window based on the file identifier.
[0114] The data displaying module 12 comprises:
[0115] The file identifier sending unit 121 is configured to send the file identifier to the first preview window if the target file is not opened in the first preview window.
[0116] Optionally, as shown in the figure, Figure 14 The data displaying module 12 further comprises:
[0117] The first window displaying unit 122 is configured to redisplay the first preview window if the target file is opened in the first preview window.
[0118] Optionally, as shown in the figure, Figure 15 The data displaying module 12 comprises:
[0119] The data downloading unit 123 is configured to send the file identifier to the first preview window, so that the first preview window downloads file data corresponding to the file identifier from the cloud.
[0120] The loading picture displaying unit 124 is configured to control the first preview window to display a loading picture if the first preview window does not receive file data.
[0121] The data displaying unit 125 is configured to control the first preview window to adapt the file data if the first preview window receives file data, and control the first preview window to display the adapted file data.
[0122] Optionally, as shown in the figure, Figure 16 The data displaying module 12 comprises:
[0123] The number detecting unit 126 is configured to detect the number of currently opened preview windows.
[0124] The window destroying unit 127 is configured to destroy the first opened preview window if the number of the opened preview windows is equal to the preset number, and execute the step of sending the file identifier to the first preview window.
[0125] If the number of the opened preview windows is less than the preset number, the step of sending the file identifier to the first preview window is executed.
[0126] Optionally, as shown in Figure 17 the device 1 further comprises:
[0127] The time length detecting module 14 is configured to record the time length of the minimization of the first preview window when the first preview window is minimized.
[0128] The first notification sending module 15 is configured to send a notification of displaying prompt information to the first preview window if the time length of the minimization reaches a first preset time length, so that the first preview window displays the prompt information when it is displayed again.
[0129] The second notification sending module 16 is configured to send a notification of whether to close the first preview window to the first preview window if the time length of the minimization reaches a second preset time length, the second preset time length being greater than the first preset time length.
[0130] Optionally, as shown in Figure 17 the device 1 further comprises:
[0131] The window closing module 17 is configured to receive a confirmation instruction for the prompt information, and control to close the first preview window.
[0132] Through the embodiments of the present application, by creating the first preview window and hiding when the main window is started, after receiving the file identification of the target file sent from the window, the file identification is identified to determine whether there is an opened preview window displaying the file data corresponding to the same file identification, and the number of opened preview windows is detected to control the number of simultaneously opened windows, thereby reducing the waste of memory resources. When it is determined to use the first preview window to display the file data corresponding to the file identification, the first preview window downloads the file data corresponding to the target file from the data server based on the file identification, so as to display the file data. In addition, when the main window receives the file identification, the second preview window is created for subsequent use, the first preview window is unhidden after receiving the file identification, and the preloaded display interface is called to display, thereby reducing the time consumed for loading and displaying the file data. By using the present application, the time consumed for creating the window when previewing the file is saved by pre-creating the preview window, and the file data loading time is saved by pre-loading the display interfaces of various file types, thereby improving the file preview speed and improving the user's file preview experience.
[0133] It should be noted that the file preview device provided in the above embodiments is used to execute the file preview method, and only the division of the above functional modules is used as an example for illustration. In actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above described functions. In addition, the file preview device and the file preview method embodiments provided in the above embodiments belong to the same concept, and the implementation process is described in detail in the method embodiments, which will not be described here.
[0134] The serial numbers of the above embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.
[0135] The embodiments of the present application also provide a computer storage medium, which can store a plurality of instructions, the instructions being suitable for being loaded and executed by a processor to perform the method steps of the embodiments of the above Figures 1-10 The specific implementation process can be referred to the specific description of the embodiments of the above Figures 1-10 The specific implementation process can be referred to the specific description of the embodiments of the above
[0136] The present application also provides an electronic device, which stores at least one instruction, the at least one instruction being loaded and executed by the processor to perform the specific description of the embodiments of the above Figures 1-10 The specific implementation process can be referred to the specific description of the embodiments of the above
[0137] Please refer to Figure 18 , which provides a structural schematic diagram of an electronic device. As shown in Figure 18As shown, the electronic device 1000 can include at least one processor 1001, at least one network interface 1004, a user interface 1003, a memory 1005, at least one communication bus 1002.
[0138] The communication bus 1002 is configured to realize the connection communication between the components.
[0139] The user interface 1003 can include a display, a camera, and optionally a standard wired interface and a wireless interface.
[0140] The network interface 1004 can optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
[0141] The processor 1001 can include one or more processing cores. The processor 1001 connects various parts of the entire electronic device 1000 through various interfaces and lines, executes various functions of the electronic device 1000 and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 1005, and calling data stored in the memory 1005. Optionally, the processor 1001 can be implemented in at least one of a digital signal processing (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 1001 can be integrated with a combination of one or more of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU is mainly used to process the operating system, user interface and application programs; the GPU is used to render and draw the content to be displayed on the display; and the modem is used to process wireless communication. It can be understood that the above-mentioned modem can also not be integrated into the processor 1001, but can be realized by a separate chip.
[0142] The memory 1005 can include a random access memory (RAM) and can also include a read-only memory (ROM). Optionally, the memory 1005 includes a non-transitory computer-readable storage medium. The memory 1005 can be used to store instructions, programs, codes, code sets, or instruction sets. The memory 1005 can include a program storage area and a data storage area, where the program storage area can store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area can store data involved in the above-mentioned various method embodiments, etc. The memory 1005 can also be at least one storage device located away from the aforementioned processor 1001. As shown in Figure 18 The memory 1005 as a computer storage medium can include an operating system, a network communication module, a user interface module, and a file preview application.
[0143] In the electronic device 1000 shown in Figure 18 In the electronic device 1000 shown in, the user interface 1003 is mainly used to provide an interface for user input and obtain user input data; and the processor 1001 can be used to call the file preview application stored in the memory 1005 and specifically perform the following operations:
[0144] In one embodiment, when the processor 1001 performs the operations of determining a calibration position in the three-dimensional background and determining a calibration plane of the three-dimensional coordinate system based on the calibration position, it specifically performs the following operations:
[0145] Receiving a file identifier for the selected target file sent from a window, the window displaying at least one file;
[0146] Sending the file identifier to the first preview window to enable the first preview window to obtain file data corresponding to the target file based on the file identifier and display the file data, the first preview window being a cache window created synchronously when the main window is started.
[0147] In one embodiment, before the processor 1001 performs the operation of receiving a file identifier for the selected target file sent from a window, it further performs the following operation:
[0148] Creating a first preview window synchronously when the main window is started and hiding the first preview window, the first preview window loading an interface of at least one file type, the interface not being displayed.
[0149] In one embodiment, the processor 1001, in a process for receiving a file identifier for a selected target file sent from a window, performs the following operations:
[0150] receiving a file identifier for a selected target file sent from a window, synchronously creating a second preview window, and hiding the second preview window.
[0151] In one embodiment, the processor 1001, in a process for receiving a file identifier for a selected target file sent from a window, performs the following operations:
[0152] receiving a file identifier for a selected target file sent from a window;
[0153] judging whether the target file is opened in a first preview window based on the file identifier;
[0154] the sending of the file identifier to the first preview window comprises:
[0155] if the target file is not opened in the first preview window, sending the file identifier to the first preview window.
[0156] In one embodiment, the processor 1001 further performs the following operations:
[0157] if the target file is opened in the first preview window, redisplaying the first preview window.
[0158] In one embodiment, the processor 1001, in a process for sending the file identifier to the first preview window to enable the first preview window to acquire file data corresponding to the file identifier and display the file data, performs the following operations:
[0159] sending the file identifier to the first preview window to enable the first preview window to download file data corresponding to the file identifier from the cloud;
[0160] if the first preview window does not receive the file data, controlling the first preview window to display a loading screen;
[0161] if the first preview window receives the file data, controlling the first preview window to adapt the file data, and controlling the first preview window to display the adapted file data.
[0162] In one embodiment, the processor 1001, in a process for sending the file identifier to the first preview window, performs the following operations:
[0163] detecting the number of currently opened preview windows;
[0164] if the number of the opened preview windows equals to a preset number, destroying a first opened window among the opened preview windows, and performing the step of sending the file identifier to the first preview window;
[0165] if the number of the opened preview windows is less than the preset number, performing the step of sending the file identifier to the first preview window.
[0166] In one embodiment, the processor 1001 further performs the following operations:
[0167] detecting that the first preview window is minimized, and recording a minimized duration of the first preview window;
[0168] if the minimized duration reaches a first preset duration, sending a notification of displaying prompt information to the first preview window, so that the prompt information is displayed when the first preview window is displayed again;
[0169] if the minimized duration reaches a second preset duration, sending a notification of whether to close the first preview window to the first preview window, the second preset duration being greater than the first preset duration.
[0170] In one embodiment, the processor 1001 further performs the following operations:
[0171] receiving a confirmation instruction for the prompt information, and controlling to close the first preview window.
[0172] Through the embodiments of the present application, by creating a first preview window and hiding when the main window is started, when receiving the file identifier of the target file sent from the window, the file identifier is identified to determine whether there is an opened preview window displaying the file data corresponding to the same file identifier, and the number of opened preview windows is detected to control the number of simultaneously opened windows, so as to reduce the waste of memory resources. When it is determined to display the file data corresponding to the file identifier using the first preview window, the first preview window downloads the file data corresponding to the target file from the data server based on the file identifier, so as to display the file data. In addition, when the main window receives the file identifier, a second preview window is created for subsequent use, and the first preview window is unhidden after receiving the file identifier, and the preloaded display interface is called to display, so as to reduce the time consumed by file data loading and display. By using the present application, the time consumed by creating a window when previewing a file is saved by pre-creating a preview window, and the file data loading time is saved by pre-loading display interfaces of various file types, so as to improve the file preview speed and improve the user's file preview experience.
[0173] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing relevant hardware. The program can be stored in a computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. The storage medium can be a magnetic disc, an optical disc, a read-only memory, a random access memory, etc.
[0174] The above disclosure is merely preferred embodiments of the present application and is not intended to limit the scope of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope of the present application.
Claims
1. A file preview method characterized by, The method applied to a main window comprises: Synchronously creating a first preview window when the main window is started, and hiding the first preview window, the first preview window loading an interface of at least one file type, the interface not being displayed; Receiving a file identifier of a selected target file sent from a window, the window displaying at least one file; Sending the file identifier to the first preview window, so that the first preview window acquires file data corresponding to the target file based on the file identifier and displays the file data, the first preview window being a cache window synchronously created when the main window is started; The sending of the file identifier to the first preview window so that the first preview window acquires file data corresponding to the file identifier and displays the file data comprises: The sending of the file identifier to the first preview window so that the first preview window downloads file data corresponding to the file identifier from the cloud; If the first preview window receives the file data, the first preview window is controlled to adapt the file data, and the first preview window is controlled to display the adapted file data, the adaptation of the file data representing the adaptation of the file data to the interface called in the first preview window.
2. The method of claim 1, wherein, The receiving of the file identifier of the selected target file sent from the window comprises: Synchronously creating a second preview window and hiding the second preview window.
3. The method of claim 1, wherein, The receiving of the file identifier of the selected target file sent from the window comprises: Receiving a file identifier of a selected target file sent from a window; Judging whether the target file is opened in the first preview window based on the file identifier; The sending of the file identifier to the first preview window comprises: If the target file is not opened in the first preview window, the file identifier is sent to the first preview window.
4. The method of claim 3, wherein, The method further comprises: If the target file is opened in the first preview window, the first preview window is re-displayed.
5. The method of claim 1, wherein, The sending of the file identifier to the first preview window so that the first preview window acquires file data corresponding to the file identifier and displays the file data further comprises: If the first preview window does not receive the file data, the first preview window is controlled to display a loading picture.
6. The method of claim 1, wherein, The sending of the file identifier to the first preview window comprises: If the number of opened preview windows is equal to a preset number, the first opened window in the opened preview windows is destroyed, and the sending of the file identifier to the first preview window is performed; If the number of opened preview windows is less than the preset number, the sending of the file identifier to the first preview window is performed.
7. The method of claim 1, wherein, The method further comprises: When the first preview window is minimized, a minimization duration of the first preview window is recorded; If the minimization duration reaches a first preset duration, a notification of displaying prompt information is sent to the first preview window, so that the prompt information is displayed when the first preview window is displayed again; If the minimum time length reaches a second preset time length, a notification of whether to close the first preview window is sent to the first preview window, and the second preset time length is greater than the first preset time length.
8. The method of claim 7, wherein, The method further includes: receiving a confirmation instruction for the prompt information, and controlling to close the first preview window.
9. A file preview apparatus characterized by comprising: The device is applied to a main window, and includes: a first window creation module, configured to create a first preview window synchronously when the main window is started, and hide the first preview window, the first preview window loading an interface of at least one file type, and the interface not being displayed; an identification receiving module, configured to receive a file identification for a selected target file sent from a slave window, the slave window displaying at least one file; a data display module, configured to send the file identification to the first preview window, so that the first preview window acquires file data corresponding to the target file based on the file identification and displays the file data, the first preview window being a cache window created synchronously when the main window is started; wherein the data display module includes: a data downloading unit, configured to send the file identification to the first preview window, so that the first preview window downloads file data corresponding to the file identification from a cloud; a data display unit, configured to, if the first preview window receives the file data, control the first preview window to adapt the file data, and control the first preview window to display the adapted file data, the adaptation of the file data representing that the file data is adapted to the first preview window and a called interface.
10. A computer storage medium, characterized in that, The computer storage medium has a plurality of instructions, the instructions being adapted to be loaded and executed by the processor to perform the method steps of any one of claims 1-8.
11. An electronic device, comprising: including: a processor and a memory; wherein the memory stores a computer program, and the computer program is adapted to be loaded and executed by the processor to perform the method steps of any one of claims 1-8.
Citation Information
Patent Citations
Method and system for quickly starting camera previewing of intelligent equipment and intelligent equipment
CN102968315A
File preview method and device, storage medium and electronic device
CN109558551A