Process restarting method and device, electronic equipment and readable storage medium

By using the URI or interface of the copy file when the process is restarted, the crash problem caused by the loss of URI access rights after the process is restarted is solved, and the normal restart of the process is achieved.

CN118606575APending Publication Date: 2024-09-06VIVO MOBILE COMM CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410673459.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-28
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

When the process is killed and restarted through the recent task interface, the URI access permission to the file is lost, causing the process to crash when restarted.

Method used

When a process restart is triggered, restart the process and open the copy file through the URI of the copy file, the interface associated with the copy file, or the URI of the original file to avoid direct access permission verification.

Benefits of technology

Ensure that the process can still restart normally when it loses URI access rights to avoid crashes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118606575A
    Figure CN118606575A
Patent Text Reader

Abstract

The invention discloses a process restarting method and device, electronic equipment and a readable storage medium, and belongs to the technical field of electronic equipment. The method comprises the steps that under the condition that a first process is triggered to be restarted, a first file is determined, and the first file is a file in a process accessed by the first process; restarting the first process and opening a copy file of the first file on the basis of the first information corresponding to the first file under the condition that the verification of the access permission of the first process to the URI of the first file fails; wherein the first information comprises any one of the following items: a URI (Uniform Resource Identifier) of the copy file, a first interface associated with the copy file and a URI of the first file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of electronic devices, and specifically relates to a process restart method, device, electronic device and readable storage medium. Background Art

[0002] Currently, when a file in a process needs to be opened by another process (hereinafter referred to as process 1), the process 1 will be granted the permission to access the Uniform Resource Identifier (URI) of the file. After the process 1 is killed by the system, the system will revoke the access permission of the process 1 to the URI.

[0003] However, after the process 1 accessing the file is killed, if the process 1 is restarted through the recent tasks interface, since the process 1 no longer has access to the URI, the process 1 cannot access the file normally after restart, which will cause a flash back when the process is restarted. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a process restart method, device, electronic device and readable storage medium, which can avoid the problem of flash back when the process is restarted.

[0005] In a first aspect, an embodiment of the present application provides a process restarting method, the method comprising: in the case of triggering the restart of a first process, determining a first file, the first file being a file in a process accessed by the first process; in the case where the first process fails to verify the access rights to the URI of the first file, restarting the first process and opening a copy file of the first file based on first information corresponding to the first file; wherein the first information comprises any one of the following: the URI of the copy file, the first interface associated with the copy file, the URI of the first file.

[0006] In the second aspect, an embodiment of the present application provides a process restarting device, which includes a determination module and a processing module; the determination module is used to determine a first file when triggering the restart of the first process, and the first file is a file in the process accessed by the first process; the processing module is used to restart the first process and open a copy file of the first file based on first information corresponding to the first file when the first process fails to verify the access permission of the URI of the first file; wherein the first information includes any one of the following: the URI of the copy file, the first interface associated with the copy file, and the URI of the first file.

[0007] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.

[0008] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0009] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.

[0010] In a sixth aspect, an embodiment of the present application provides a computer program / program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.

[0011] In an embodiment of the present application, when the first process is triggered to restart, the first file can be determined, and the first file is a file in the process accessed by the first process; and when the first process fails to check the access rights to the URI of the first file, the first process can be restarted and the copy file of the first file can be opened based on the first information corresponding to the first file; wherein the first information includes any of the following: the URI of the copy file, the first interface associated with the copy file, and the URI of the first file. Through this scheme, when the first process that is killed and accesses the first file is triggered to restart, the first process can be restarted and the copy file of the first file can be opened based on the URI of the copy file of the first file, the first interface associated with the copy file of the first file, or the URI of the first file when the first process fails to check the access rights to the URI of the first file, so the access to the first file can be indirectly achieved by opening the copy file. Therefore, when the first process does not have the access rights to the URI of the first file, the first process can still be restarted normally, so that the flash back phenomenon when the process is restarted can be avoided. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 This is one of the flowcharts of the process restart method provided in the embodiment of the present application;

[0013] Figure 2 This is the second flowchart of the process restart method provided in the embodiment of the present application;

[0014] Figure 3It is a schematic diagram of restarting a first process based on a URI of a copy file in a process restart method provided in an embodiment of the present application;

[0015] Figure 4 This is the third flowchart of the process restart method provided in the embodiment of the present application;

[0016] Figure 5 It is a schematic diagram of generating a URI of a copy file in the process restart method provided in an embodiment of the present application;

[0017] Figure 6 This is the fourth flowchart of the process restart method provided in the embodiment of the present application;

[0018] Figure 7 is a schematic diagram of restarting a first process based on a first interface in a process restarting method provided in an embodiment of the present application;

[0019] Figure 8 This is the fifth flowchart of the process restart method provided in the embodiment of the present application;

[0020] Fig. 9 It is a schematic diagram of the association relationship between the storage path of the copy file created and the first interface in the process restart method provided in the embodiment of the present application;

[0021] Fig.10 This is the sixth flowchart of the process restart method provided in the embodiment of the present application;

[0022] Fig.11 It is a schematic diagram of a strategy for opening a copy file based on the URI of the first file in the process restart method provided in an embodiment of the present application;

[0023] Fig.12 is a schematic diagram of a process restart device provided in an embodiment of the present application;

[0024] Fig.13 is a schematic diagram of an electronic device provided in an embodiment of the present application;

[0025] Fig.14 It is a hardware schematic diagram of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0026] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0027] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0028] The term "indication" in this application can be a direct indication (or explicit indication) or an indirect indication (or implicit indication). A direct indication can be understood as the sender explicitly informing the receiver of specific information, operations to be performed, or request results in the sent indication; an indirect indication can be understood as the receiver determining the corresponding information according to the indication sent by the sender, or making a judgment and determining the operation to be performed or the request result according to the judgment result.

[0029] The terms "at least one (item)", "at least one of" and the like in the specification and claims of the present application refer to any one, any two or a combination of more than two of the objects included therein. For example, at least one (item) of a, b, and c can be represented by: "a", "b", "c", "a and b", "a and c", "b and c" and "a, b and c", where a, b, and c can be single or multiple. Similarly, "at least two (items)" refers to two or more, and its meaning is similar to that of "at least one (item)".

[0030] First, some nouns or terms involved in the specification and claims of this application are explained below.

[0031] URI: A string used to identify a certain Internet resource name. This identifier allows users to interact with any resource (including local and Internet) through a specific protocol. URI is defined by a scheme that includes a certain syntax and related protocols. Through URI, you can get the file path or copy the file.

[0032] The process restart method, device, electronic device and readable storage medium provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.

[0033] For example, assuming that process A needs to open document 1 in process B, the system will grant process A the permission to access the URI of document 1. When process A opens document 1 and stays in the background for a period of time, the system will kill process A based on considerations such as power saving, resource release, or performance improvement, and reclaim process A's access rights to the URI. However, if process A is restarted through the recent tasks interface, since process A no longer has access rights to the URI, it will not be able to access document 1 normally after restart, which will cause a flashback when process A is restarted.

[0034] In order to solve the above problems, the embodiments of the present application provide a process restart method, device, electronic device and readable storage medium. The process restart method provided in the embodiments of the present application can be applied to the scenario of restarting a process that accesses a file across processes.

[0035] In the process restart method provided in the embodiment of the present application, when the restart of the above-mentioned process A is triggered, the above-mentioned document 1 can be determined; and when the process A fails to check the access rights to the URI of the document 1, the process A can be restarted and the copy file of the document 1 can be opened based on the first information corresponding to the document 1; wherein the first information includes any of the following items: the URI of the copy file, the interface associated with the copy file, and the URI of the document 1. Through this scheme, when the killed process A accessing the document 1 is triggered to restart, the process A can be restarted and the copy file of the document 1 can be opened based on the URI of the copy file of the document 1, the first interface associated with the copy file of the document 1, or the URI of the document 1 when the process A fails to check the access rights to the URI of the document 1, so the access to the document 1 can be indirectly achieved by opening the copy file. Therefore, when the process A does not have the access rights to the URI of the document 1, the process A can still be restarted normally, so that the flash back phenomenon when the process is restarted can be avoided.

[0036] It should be noted that the execution subject of the process restart method provided in the embodiments of the present application may be a process restart device, an electronic device, or a functional module in an electronic device, etc. In some embodiments of the present application, an electronic device executing the process restart method is taken as an example to illustrate the process restart method provided in the embodiments of the present application.

[0037] Figure 1 FIG. 1 is a flowchart of a process restart method provided by an embodiment of the present application. Figure 1 As shown, the process restart method provided in the embodiment of the present application may include the following steps 101 and 102.

[0038] Step 101: When a first process is triggered to restart, the electronic device determines a first file.

[0039] The first file is a file in a process accessed by the first process.

[0040] Optionally, in an embodiment of the present application, a process generally corresponds to an application in an electronic device.

[0041] Optionally, in an embodiment of the present application, the above-mentioned first process may correspond to any application in the electronic device, for example, an instant messaging application, a photo album application, or a document editor.

[0042] Optionally, in the embodiment of the present application, the process accessed by the first process may be any process in the electronic device except the first process.

[0043] Optionally, in the embodiment of the present application, the first file may be a file in a process that was most recently accessed by the first process.

[0044] Optionally, in the embodiment of the present application, the first file may be any file such as a document, an image, an audio or a video.

[0045] Optionally, in the embodiment of the present application, the file in a process most recently accessed by the first process may be understood as: a file in a process most recently accessed by the first process when it was started.

[0046] Optionally, in the embodiment of the present application, accessing a file in a process may include: opening the file in the process, sharing the file in the process, or editing the file in the process, etc.

[0047] Optionally, in an embodiment of the present application, the electronic device may trigger the restart of the first process through user input.

[0048] For example, the user may trigger the restart of the first process by inputting an identifier corresponding to the first process in the recent task interface.

[0049] Step 102: When the first process fails to verify the access rights to the URI of the first file, the electronic device restarts the first process and opens a copy of the first file based on the first information corresponding to the first file.

[0050] The first information includes any one of the following: a URI of a copy file of the first file, a first interface associated with the copy file of the first file, and a URI of the first file.

[0051] Optionally, in an embodiment of the present application, the copy file may be a file obtained by copying the first file.

[0052] Optionally, in the embodiment of the present application, the first interface may be an interface on which the copy file was most recently opened by the first process.

[0053] Optionally, in an embodiment of the present application, when the first process fails to verify the access rights to the URI of the first file, the electronic device may generate an error code; the response to the error code may include: the electronic device restarts the first process based on the URI of the first file and opens the copy file.

[0054] For a specific description of verifying the access rights of the URI by the electronic device, please refer to the relevant description in the related technology. In order to avoid repetition, it will not be repeated here.

[0055] It should be noted that when the first process last accessed the first file, the system granted the first process the permission to access the URI of the first file. If the first process is killed by the system, the system will revoke the permission. When the first process is killed, it is accessing the first file. Therefore, when the trigger for restarting the first process is detected, the system will first determine the first file and verify the first process's access rights to the URI of the first file again. If the verification is successful, the first process will be restarted and the interface for opening the first file will be started. If the verification fails, a flashback will occur.

[0056] The specific method for the electronic device to restart the first process and open the copy file based on the first information is described in detail below.

[0057] Optionally, in an embodiment of the present application, the first information includes a URI of a copy file of the first file. Figure 1 ,like Figure 2 As shown, the above step 102 can be specifically implemented through the following steps 102a and 102b.

[0058] Step 102a: When the first process fails to verify the access permission of the URI of the first file, the electronic device verifies the access permission of the first process to the URI of the copy file.

[0059] Optionally, in an embodiment of the present application, the URI of the above-mentioned copy file may be a URI stored in the storage space corresponding to the above-mentioned first process.

[0060] Step 102b: When the first process successfully verifies the access right to the URI of the duplicate file, the electronic device restarts the first process, and accesses the URI of the duplicate file through the first process to open the duplicate file.

[0061] Optionally, in an embodiment of the present application, when the URI of the above-mentioned copy file is a URI stored in the storage space corresponding to the above-mentioned first process, the first process always has access rights to the URI of the copy file, and the verification will usually be successful when verifying the access rights of the first process to the URI of the copy file.

[0062] For example, Figure 3 As shown, assuming that the above-mentioned first process is the process of the document editor, then when it is detected that the process of the document editor is triggered to restart from a recent task, the recent task can request the application management system (Application Management System, AMS) to start an activity (i.e., Activity). At this time, the process of the document editor does not exist, and AMS requests Zygote (i.e., incubator) to create the process, and after the process is created, the process is bound to AMS. When AMS starts the Activity, it first verifies the access rights of the document editor process to the URI (i.e., the URI of the above-mentioned first file), and at this time the access rights have been reclaimed by the system, so the verification will fail; then the access rights of the document editor process to the substitute URI (i.e., the URI of the above-mentioned copy file) are verified, and after the verification is successful, the document editor process is restarted, and the substitute URI is accessed through the document editor process to open the above-mentioned copy file.

[0063] In an embodiment of the present application, when the first process fails to verify the access rights to the URI of the first file, the URI of the above-mentioned copy file can be used to restart the first process, and the first process usually has access rights to the URI of the copy file, so that the copy file can be successfully accessed, avoiding the problem of the process being unable to restart or crashing due to the access rights to the URI of the first file being revoked.

[0064] Optionally, in the embodiment of the present application, combined with Figure 2 ,like Figure 4 As shown, before the above step 101, the process restart method provided in the embodiment of the present application may also include the following steps A and B.

[0065] Step A: When the first process has access rights to the URI of the first file, the electronic device copies the first file to obtain a copy file.

[0066] Optionally, in an embodiment of the present application, the first process has access to the URI of the first file when accessing the first file most recently. At this time, the electronic device can copy the first file according to the URI to obtain the copy file.

[0067] Step B: The electronic device stores the duplicate file in the storage space corresponding to the first process, and generates a URI for the duplicate file.

[0068] Optionally, in the embodiment of the present application, the storage space corresponding to the above-mentioned first process may be a storage space dedicated to the first process in the electronic device.

[0069] Optionally, in the embodiment of the present application, after storing the above-mentioned copy file in the storage space corresponding to the above-mentioned first process, the electronic device can generate a URI of the copy file based on the copy file through the first process.

[0070] It should be noted that, since the URI of the copy file is generated by the first process itself, the first process always has access rights to the URI of the copy file, and there is no problem of the access rights being reclaimed by the system.

[0071] For example, Figure 5 As shown, assuming that the above-mentioned first process is the process of the document editor, then after the interface is started, the process of the document editor can copy a copy file of the file in the communication application (that is, the above-mentioned first file) according to the URI, and save the copy file in the private directory of the document editor process, and generate the URI of the copy file (or substitute URI) based on the copy file, and then set the substitute URI to the recent task.

[0072] In an embodiment of the present application, since the URI of the copy file can be generated when the first process has access rights to the URI of the first file, when the first process is restarted, the copy file can be accessed based on the URI of the copy file to which it always has access rights, thereby avoiding a crash when the process is restarted.

[0073] Optionally, in an embodiment of the present application, the first information includes a first interface associated with a copy file of the first file. Figure 1 ,like Figure 6 As shown, the above step 102 can be specifically implemented through the following step 102c.

[0074] Step 102c: when the first process fails to verify the access rights to the URI of the first file, the electronic device restarts the first process based on the first interface and displays the first interface, and displays the copy file on the first interface.

[0075] Optionally, in an embodiment of the present application, the first interface may be associated with a storage path of the copy file, and the electronic device may use the storage path of the copy file as a parameter Path to open the first interface.

[0076] Optionally, in an embodiment of the present application, the electronic device may first determine the first interface as the interface displayed when the first process is restarted, and then restart the first process and display the first interface.

[0077] Optionally, in an embodiment of the present application, after displaying the above-mentioned first interface, the electronic device can find the copy file according to the storage path of the above-mentioned copy file associated with the first interface, and display the copy file in the first interface.

[0078] For example, Figure 7 As shown, assuming that the above-mentioned first process is the process of the document editor, when the process of the document editor is restarted to check the access rights of the URI (that is, the URI of the above-mentioned first file), since the interface B (that is, the above-mentioned first interface) is not accompanied by the URI when it is started, there is no need to check and go directly to the next step, start the interface B, and after the interface B is started, open the above-mentioned copy file according to the saved path parameters.

[0079] In an embodiment of the present application, since the access permission check of the URI of the first file can be skipped through the first interface when the first process is restarted, and the copy file can be displayed in the first interface according to the copy file associated with the first interface, the problem of the process being unable to restart or crashing due to the recovery of the access permission of the URI of the first file can be avoided.

[0080] Optionally, in the embodiment of the present application, combined with Figure 6 ,like Figure 8 As shown, before the above step 101, the process restart method provided in the embodiment of the present application may also include the following steps C and D.

[0081] Step C: When the first process has access rights to the URI of the first file, the electronic device copies the first file to obtain a copy file.

[0082] Optionally, in an embodiment of the present application, the electronic device copies the first file through the second interface to obtain the copy file.

[0083] Optionally, in the embodiment of the present application, the transparency of the second interface may be greater than or equal to a transparency threshold.

[0084] Optionally, in an embodiment of the present application, the above transparency threshold may be preset by the system, or may be arbitrarily set by the user according to actual usage requirements.

[0085] It can be understood that when the transparency of the second interface is greater than or equal to the transparency threshold, the second interface can be considered as a transparent interface.

[0086] Optionally, in an embodiment of the present application, the second interface may be an interface without any user interface elements, and the second interface may be used only to receive an open request and URI for the first file, and copy the first file according to the URI to obtain the copy file.

[0087] Step D: The electronic device stores the copy file in the storage space corresponding to the first process, and creates an association relationship between the storage path of the copy file and the first interface.

[0088] Optionally, in an embodiment of the present application, after associating the storage path of the copy file with the first interface, the electronic device may use the storage path of the copy file as a parameter Path to open the first interface.

[0089] For example, Fig. 9 As shown, assuming that the first process is the process of the document editor, and interface A is the transparent interface, without any display logic, after starting interface A, the copy file is copied only according to the URI (that is, the URI of the first file), and then the copy file is stored in the storage space corresponding to the process of the document editor, and an association relationship between the storage path of the copy file and interface B (that is, the first interface) is created. Thus, the storage path can be used as the parameter Path to open interface B and close interface A at the same time, which is the same as directly starting interface B (because interface A is a transparent interface).

[0090] In an embodiment of the present application, since the above-mentioned first process has access rights to the URI of the above-mentioned first file, the electronic device can create an association relationship between the storage path of the above-mentioned copy file and the above-mentioned first interface. Therefore, when the first process is restarted, the copy file can be accessed based on the first interface associated with the storage path of the copy file, thereby skipping the access right check for the URI of the first file, thereby avoiding the flash back phenomenon when the process is restarted.

[0091] Optionally, in an embodiment of the present application, the first information includes the URI of the first file. Figure 1 ,like Fig.10 As shown, the above step 102 can be specifically implemented through the following steps 102d to 102f.

[0092] Step 102d: When the first process fails to verify the access rights to the URI of the first file, the electronic device determines the file type of the first file according to the URI of the first file.

[0093] Optionally, in an embodiment of the present application, the electronic device may parse the file suffix of the first file according to the string information of the URI of the first file, and then determine the file type of the first file according to the file suffix.

[0094] For example, assuming that the electronic device parses the string information of the URI of the first file and finds that the file suffix of the first file is "doc", the electronic device can determine that the file type of the first file is a document type based on the parsed file suffix.

[0095] Step 102e: The electronic device determines the second file that is most recently opened by the first process and has the same file type as the first file as a duplicate file.

[0096] Optionally, in an embodiment of the present application, the second file may be a file that was most recently opened by the first process before triggering the restart of the first process, and the file type of the second file is the same as that of the first file.

[0097] For example, assuming that the electronic device determines that the file type of the first file is a document type, the electronic device can determine the second file that is most recently opened by the first process and has a document type as the copy file.

[0098] It can be understood that the file most recently opened by the first process and having the same file type as the first file is the copy file, so that the first process can be restarted normally and the data can be restored.

[0099] Step 102f: The electronic device restarts the first process and opens the copy file according to the storage path of the second file.

[0100] Optionally, in an embodiment of the present application, after the electronic device opens the copy file according to the storage path of the second file, it can record the storage path and the file type of the copy file for use when the process is restarted again.

[0101] Optionally, in an embodiment of the present application, the response to the error code generated after the first process fails to check the access rights of the URI of the first file, may also include: prompting the user "the first file has expired, please reopen the first file" and guiding the user to exit the application.

[0102] For example, Fig.11As shown, assuming that the above-mentioned first process is the process of the document editor, then in the case of failure to verify the access rights of the document editor process to the URI (i.e., the URI of the above-mentioned first file), an error code can be thrown to the exception handling module in the electronic device, and after restarting the process of the document editor, the error code can be collected from the exception handling module, and the error code can be responded to after identifying the error code.

[0103] In an embodiment of the present application, since the first process has access rights to the URI of the first file, the first process can be restarted and the copy file can be opened based on the URI of the first file, thereby ensuring that the process can be restarted normally and avoiding flashbacks.

[0104] It should be noted that the above-mentioned method embodiments, or various possible implementation methods in each method embodiment, can be executed separately, or, under the premise that there is no contradiction, can also be executed in combination with each other. The specific implementation can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.

[0105] In the process restart method provided in the embodiment of the present application, when the killed first process accessing the first file is triggered to restart, the first process can be restarted and the copy file of the first file can be opened based on the URI of the copy file of the first file, the first interface associated with the copy file of the first file, or the URI of the first file when the first process fails to check the access rights to the URI of the first file. Therefore, the access to the first file can be indirectly achieved by opening the copy file. Therefore, when the first process does not have the access rights to the URI of the first file, the first process can still be restarted normally, so that the flash back phenomenon when the process is restarted can be avoided.

[0106] The process restart method provided in the embodiment of the present application can be executed by a process restart device. In the embodiment of the present application, the process restart device provided in the embodiment of the present application is described by taking the process restart method executed by the process restart device as an example.

[0107] like Fig.12 As shown, an embodiment of the present application provides a process restarting device 120 , which may include a determination module 121 and a processing module 122 .

[0108] The determination module 121 can be used to determine the first file in the case of triggering the restart of the first process, where the first file is a file in the process accessed by the first process. The processing module 122 can be used to restart the first process and open a copy of the first file based on the first information corresponding to the first file when the first process fails to verify the access rights to the URI of the first file; wherein the first information includes any of the following: the URI of the copy file, the first interface associated with the copy file, and the URI of the first file.

[0109] In a possible implementation, the first information includes the URI of the copy file. The processing module 12 can be specifically used to verify the access rights of the first process to the URI of the copy file; and if the access rights of the first process to the URI of the copy file are successfully verified, restart the first process, and access the URI of the copy file through the first process to open the copy file.

[0110] In one possible implementation, the processing module 122 can also be used to, when triggering the restart of the above-mentioned first process, determine that before the above-mentioned first file, if the first process has access rights to the URI of the first file, copy the first file to obtain the above-mentioned copy file; and store the copy file in the storage space corresponding to the first process, and generate the URI of the copy file.

[0111] In a possible implementation, the first information includes a first interface associated with the copy file. The processing module 122 may be specifically configured to restart the first process based on the first interface, display the first interface, and display the copy file in the first interface.

[0112] In one possible implementation, the processing module 122 can also be used to, when the restart of the above-mentioned first process is triggered, determine that before the above-mentioned first file, if the first process has access rights to the URI of the first file, copy the first file to obtain the above-mentioned copy file; and store the copy file in the storage space corresponding to the first process, and create an association between the storage path of the copy file and the above-mentioned first interface.

[0113] In a possible implementation, the first information includes the URI of the first file. The processing module 122 can be specifically used to determine the file type of the first file according to the URI of the first file; determine the second file that is most recently opened by the first process and has the same file type as the first file as the copy file; restart the first process, and open the copy file according to the storage path of the second file.

[0114] In the process restart device provided in the embodiment of the present application, when the killed first process accessing the first file is triggered to restart, the process restart device can restart the first process and open the copy file of the first file based on the URI of the copy file of the first file, the first interface associated with the copy file of the first file, or the URI of the first file when the first process fails to check the access right to the URI of the first file. Therefore, the access to the first file can be indirectly achieved by opening the copy file. Therefore, when the first process does not have the access right to the URI of the first file, the first process can still be restarted normally, so that the flash back phenomenon when the process is restarted can be avoided.

[0115] The process restart device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or it can be other devices other than the terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtualreality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personalcomputer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0116] The process restart device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0117] The process restart device provided in the embodiment of the present application can implement the various processes implemented in the above method embodiment and achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0118] like Fig.13As shown, an embodiment of the present application also provides an electronic device 1300, including a processor 1301 and a memory 1302, wherein the memory 1302 stores programs or instructions that can be executed on the processor 1301, and when the program or instructions are executed by the processor 1301, the various steps of the process restart method embodiment described above are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described here.

[0119] It should be noted that the electronic devices in the embodiments of the present application include mobile electronic devices and non-mobile electronic devices.

[0120] Fig.14 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0121] like Fig.14 As shown, the electronic device 1000 includes but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010 and other components.

[0122] Those skilled in the art will appreciate that the electronic device 1000 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 1010 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Fig.14 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0123] Among them, processor 1010 can be used to determine a first file when triggering a restart of the first process, where the first file is a file in a process accessed by the first process; and when the first process fails to verify the access rights to the URI of the first file, restart the first process and open a copy file of the first file based on first information corresponding to the first file; wherein the first information includes any one of the following: the URI of the copy file, the first interface associated with the copy file, and the URI of the first file.

[0124] In a possible implementation, the first information includes the URI of the copy file. The processor 1010 may be specifically configured to verify the access rights of the first process to the URI of the copy file; and if the access rights of the first process to the URI of the copy file are successfully verified, restart the first process, and access the URI of the copy file through the first process to open the copy file.

[0125] In one possible implementation, the processor 1010 may also be used to, when triggering the restart of the first process, determine that before the first file is accessed, if the first process has access rights to the URI of the first file, copy the first file to obtain the copy file; and store the copy file in the storage space corresponding to the first process, and generate the URI of the copy file.

[0126] In a possible implementation, the first information includes a first interface associated with the copy file. The processor 1010 may be specifically configured to restart the first process based on the first interface, display the first interface, and display the copy file in the first interface.

[0127] In one possible implementation, the processor 1010 may also be used to, when triggering the restart of the first process, determine that before the first file is created, if the first process has access to the URI of the first file, copy the first file to obtain the copy file; and store the copy file in the storage space corresponding to the first process, and create an association between the storage path of the copy file and the first interface.

[0128] In a possible implementation, the first information includes the URI of the first file. The processor 1010 may be specifically configured to determine the file type of the first file according to the URI of the first file; determine the second file that was most recently opened by the first process and has the same file type as the first file as the copy file; restart the first process, and open the copy file according to the storage path of the second file.

[0129] In the electronic device provided in the embodiment of the present application, when the killed first process accessing the first file is triggered to restart, the electronic device can restart the first process and open the copy file of the first file based on the URI of the copy file of the first file, the first interface associated with the copy file of the first file, or the URI of the first file when the first process fails to check the access rights to the URI of the first file, so the access to the first file can be indirectly achieved by opening the copy file. Therefore, when the first process does not have the access rights to the URI of the first file, the first process can still be restarted normally, so that the flash back phenomenon when the process is restarted can be avoided.

[0130] It should be understood that in the embodiment of the present application, the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 10041 and a microphone 10042, and the graphics processor 10041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 1007 includes a touch panel 10071 and at least one of other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 may include two parts: a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0131] The memory 1009 can be used to store software programs and various data. The memory 1009 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 1009 may include a volatile memory or a non-volatile memory, or the memory 1009 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 1009 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0132] The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 1010.

[0133] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned process restart method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0134] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0135] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned process restart method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0136] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0137] An embodiment of the present application provides a computer program / program product, which is stored in a storage medium. The program / program product is executed by at least one processor to implement the various processes of the above-mentioned process restart method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0138] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the 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, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0139] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0140] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A process restart method, characterized in that: The method comprises: In the case of triggering the restart of the first process, determining a first file, where the first file is a file in a process accessed by the first process; If the first process fails to verify the access right to the uniform resource identifier URI of the first file, restart the first process and open the copy file of the first file based on the first information corresponding to the first file; The first information includes any one of the following: a URI of the copy file, a first interface associated with the copy file, and a URI of the first file.

2. The method according to claim 1, characterized in that The first information includes the URI of the copy file; The restarting the first process and opening the copy file of the first file based on the first information corresponding to the first file includes: Verifying the access permission of the first process to the URI of the copy file; When the first process successfully verifies the access right to the URI of the duplicate file, the first process is restarted, and the URI of the duplicate file is accessed through the first process to open the duplicate file.

3. The method according to claim 2, characterized in that In the case of triggering the restart of the first process, before determining the first file, the method further includes: When the first process has access rights to the URI of the first file, copy the first file to obtain the copy file; The copy file is stored in a storage space corresponding to the first process, and a URI of the copy file is generated.

4. The method according to claim 1, characterized in that: The first information includes a first interface associated with the copy file; The restarting the first process and opening the copy file of the first file based on the first information corresponding to the first file includes: Based on the first interface, the first process is restarted and the first interface is displayed, and the copy file is displayed on the first interface.

5. The method according to claim 4, characterized in that In the case of triggering the restart of the first process, before determining the first file, the method further includes: When the first process has access rights to the URI of the first file, copy the first file to obtain the copy file; The copy file is stored in a storage space corresponding to the first process, and an association relationship between a storage path of the copy file and the first interface is created.

6. The method according to claim 1, characterized in that The first information includes a URI of the first file; The restarting the first process and opening the copy file of the first file based on the first information corresponding to the first file includes: Determine the file type of the first file according to the URI of the first file; Determine a second file which is most recently opened by the first process and has the same file type as the first file as the copy file; Restart the first process, and open the copy file according to the storage path of the second file.

7. A process restart device, characterized in that: The device comprises a determination module and a processing module; The determining module is used to determine a first file when the restart of the first process is triggered, where the first file is a file in a process accessed by the first process; The processing module is configured to restart the first process and open a copy file of the first file based on the first information corresponding to the first file when the first process fails to verify the access right to the URI of the first file; The first information includes any one of the following: a URI of the copy file, a first interface associated with the copy file, and a URI of the first file.

8. The device according to claim 7, characterized in that The first information includes the URI of the copy file; The processing module is specifically used to verify the access rights of the first process to the URI of the copy file; and if the access rights of the first process to the URI of the copy file are successfully verified, restart the first process, and access the URI of the copy file through the first process to open the copy file.

9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the process restarting method according to any one of claims 1 to 6 are implemented.

10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the process restarting method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Method and device for determining object main copy file in object storage system

    CN112711376A

  • Application program running method and device, equipment and storage medium

    CN114372256A

  • File updating method and electronic equipment

    CN117785548A

  • Method of installing device driver

    JP2014191353A

  • Information processing method and information processing device

    WO2015173857A1