CN108595292B - System optimization method, mobile terminal and computer storage medium - Google Patents

System optimization method, mobile terminal and computer storage medium Download PDF

Info

Publication number
CN108595292B
CN108595292B CN201810383563.1A CN201810383563A CN108595292B CN 108595292 B CN108595292 B CN 108595292B CN 201810383563 A CN201810383563 A CN 201810383563A CN 108595292 B CN108595292 B CN 108595292B
Authority
CN
China
Prior art keywords
uid
application
data directory
application data
directory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810383563.1A
Other languages
Chinese (zh)
Other versions
CN108595292A (en
Inventor
莫斯挺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201810383563.1A priority Critical patent/CN108595292B/en
Publication of CN108595292A publication Critical patent/CN108595292A/en
Application granted granted Critical
Publication of CN108595292B publication Critical patent/CN108595292B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1479Generic software techniques for error detection or fault masking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping

Abstract

The application discloses a system optimization method, a mobile terminal and a computer storage medium, wherein the method comprises the following steps: after the system is started, acquiring a unique identifier UID of an application data directory; judging whether the UID of the application data directory is abnormal or not; and if the UID of the application data directory is abnormal, acquiring the UID of the application associated with the application data directory, and replacing the UID of the application data directory with the UID of the application. By the aid of the method and the device, the UID of the application data directory can be automatically repaired when the system is started at each time, the probability of abnormity when a user starts the application is reduced, and the stability of the system is enhanced.

Description

System optimization method, mobile terminal and computer storage medium
Technical Field
The present application belongs to the technical field of mobile terminals, and in particular, to a system optimization method, a mobile terminal, and a computer storage medium.
Background
An Android (Android) operating system is an operating system widely used on current mobile terminals. When using a mobile phone with an Android system, the following problems are often encountered: when the application app is installed, if the mobile phone is powered off unexpectedly, the application is abnormal, for example, when the application is started again, the application data directory corresponding to the application cannot be found. If this happens, the application will not be able to manipulate its own data, resulting in a functional exception.
Disclosure of Invention
In view of this, the present application provides a system optimization method, a mobile terminal, and a computer storage medium, so as to solve the problem that an application cannot operate application data due to a power failure in an application installation process.
A first aspect of the present application provides a method, the method comprising:
after the system is started, acquiring a unique identifier UID of an application data directory;
judging whether the UID of the application data directory is abnormal or not;
and if the UID of the application data directory is abnormal, acquiring the UID of the application associated with the application data directory, and replacing the UID of the application data directory with the UID of the application.
A second aspect of the present application provides an apparatus, comprising:
the UID acquisition unit is used for acquiring the unique identifier UID of the application data directory after the system is started;
the UID detection unit is used for judging whether the UID of the application data directory is abnormal or not;
and the UID repairing unit is used for acquiring the UID of the application associated with the application data directory and replacing the UID of the application data directory with the UID of the application if the UID of the application data directory is abnormal.
A third aspect of the present application provides a mobile terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method according to the first aspect when executing the computer program.
A fourth aspect of the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of the first aspect as described above.
A fifth aspect of the application provides a computer program product comprising a computer program which, when executed by one or more processors, performs the steps of the method as described in the first aspect above.
As can be seen from the above, in the present application scheme, first, after a system is started, a unique identifier UID of an application data directory is obtained, and then, whether the UID of the application data directory is abnormal or not is judged, if the UID of the application data directory is abnormal, the UID of an application associated with the application data directory is obtained, and the UID of the application data directory is replaced with the UID of the application. According to the scheme, the UID of the application data directory is automatically detected and repaired when the system is started every time, the probability of abnormity when the user starts the application is reduced, and the stability of the system is enhanced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic implementation flow diagram of an optimization method of a system according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of another implementation of a system optimization method provided in an embodiment of the present application;
FIG. 3 is a schematic flow chart of another implementation of optimization of a system according to an embodiment of the present disclosure;
fig. 4 is a block diagram illustrating an optimizing apparatus of a system according to an embodiment of the present disclosure;
fig. 5 is a schematic diagram of a mobile terminal provided in an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
In order to explain the technical solution of the present application, the following description will be given by way of specific examples.
Example one
Referring to fig. 1, a method for optimizing a system according to an embodiment of the present application is described below, where the method according to the embodiment of the present application includes:
in step 101, after system startup, the unique identifier UID of the application data directory is obtained.
In this embodiment of the application, the system may be an Android operating system (Android operating system), or an operating system similar to the Android operating system, and the operating system may be run on a smart phone, a tablet computer, a smart television, a router, or other terminal devices. The system starting means that the terminal equipment performs power-on operation when receiving a starting-up instruction, and then the operating system is loaded into the memory to operate, wherein the starting-up instruction can be sent out by a user through operating a starting-up key on the terminal equipment.
In the Android operating system, one user UID uniquely identifies one application. The application is assigned a unique UID at installation, and the UID remains unchanged for the duration of the application on the device. Each application corresponds to an application data directory, the application data directory is usually a file directory/data/data/< package name > on the system, and the application data directory is used for storing a setting file, a database file of the application, data generated during the running of the application, and the like. For example, the WeChat application on the terminal device is installed under a/data/app/< packet name > file directory corresponding to WeChat, and data (including temporary data and permanent data) generated by the WeChat application in the running process is saved in the/data/data/< packet name > file directory corresponding to WeChat. The entry is typically determined by the application provider, for example, the package name of the WeChat is "com. Since the package name may have different expressions, the specific expression of the package name is not limited herein. When an application is installed, the system will create an application data directory, which the system will assign to the same UID as its associated application. In the running process of the application, the application data directory for storing the application running data can be identified in a UID (user identification) mode. The application data directory is used for storing data generated by the application in operation. Applications often need to read data from an application data directory and store data generated during the operation of the application in the application data directory during the operation. For example, chat records generated in the process of chatting by using the WeChat are stored in a data directory of the WeChat application, and when a user sends an instruction for viewing the chat records to the WeChat application, the WeChat application reads relevant data of an application data directory associated with the WeChat application and displays the data on a UI (user interface) for the user to view.
In step 102, it is determined whether the UID of the application data directory is abnormal.
In step 103, if the UID of the application data directory is abnormal, the UID of the application associated with the application data directory is acquired, and the UID of the application data directory is replaced with the UID of the application.
In an embodiment of the present application, if the UID of the application data directory is abnormal, for example, the UID of the application data directory is different from the UID of its associated application. Since the application is by identifying the application data directory having the same UID as itself as its own application data directory. When the UID of the application data directory is different from the UID of the associated application, the application cannot find the own application data directory, so that the data in the application data directory associated with the application cannot be operated, and the UID of the application data directory is considered to be abnormal. And repairing the application data directory by acquiring the UID of the application associated with the application data directory and then replacing the UID of the application data directory with the UID of the application.
According to the method and the device, after the system is started every time and before the application program is started, whether the UID of the application data directory is abnormal or not is detected, if the UID of the application related to the application data directory is abnormal, the UID of the application related to the application data directory is obtained, and the UID of the application data directory is replaced by the UID of the application, so that the UID of the abnormal application data directory can be repaired when the system is started every time, the probability of abnormality when a user starts the application is reduced, the problem that the operation of the application is broken down due to the fact that the related application is started before the UID of the application data directory is not repaired is solved, and the stability of the system is enhanced.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Example two
Fig. 2 is a schematic flow chart of another system optimization method provided in the embodiment of the present application, and as shown in the figure, the method may include the following steps:
in step 201, after the system is started, the UID of the application data directory is acquired through an installd process.
In the embodiment of the application, the installd is a native daemon (daemon), and the installd has root authority and can directly manage the package installation transaction. For example, installd may support installing, uninstalling applications, deleting apks, creating an application data directory, changing the name of an application data directory, and the UID of an application data directory. installd executes the relevant commands by listening to a local socket, which is created by specifying the service attributes in an init. If a socket is connected in, the command character string is read through the socket, and then the command is executed.
In step 202, determining whether the UID of the application data directory is the same as the UID of the instant process;
in step 203, if the UID of the application data directory is the same as the UID of the installd process, it is determined that the UID of the application data directory is abnormal.
In the embodiment of the application, when an install creates an application data directory for an application, the UID of the application data directory being created is set as the UID of the install process, and after the creation of the application data directory is completed, the UID of the application data directory is modified into the UID of the application. In practice, it is found that the installd process operates on the application, such as installing the application. When an installd process is operating on an application data directory (e.g., creating an application data directory for an application). If a sudden power loss event occurs. Since the operation of the instruction process on the application data directory is not completed, the UID of the application data directory is actually the UID of the instruction process, not the UID of the application associated with the application data directory. When the user starts the application after the system is started again, the application searches the corresponding application data directory through the UID, and the UID of the application data directory associated with the application is the UID of the installd process, so that the application cannot operate the data in the application data directory because the associated application data directory cannot be searched, and the application operation is abnormal.
In step 204, if the UID of the application data directory is abnormal, the UID of the application associated with the application data directory is acquired, and the UID of the application data directory is replaced with the UID of the application.
In the embodiment of the application, after the system is started, the install process detects whether an application data directory with the same UID as that of the install process exists in the application data directory, and if the application data directory with the same UID as that of the install process exists, the UID of the application data directory is considered to be abnormal, and the application program cannot operate the application data directory. In this embodiment, the problem of UID abnormality of the application data directory may be repaired by acquiring the UID of the application associated with the application data directory and replacing the UID of the application data directory with the UID of the application.
As can be seen from the above, in this embodiment, when the terminal powers on and starts the operating system, the daemon process is started and the UIDs of all application data directories in the system are detected through the isntald process, and if it is detected that the UID of the application data directory is the same as the UID of the installd process, the UID is repaired by obtaining the UID of the application associated with the application data directory to replace the UID of the application data directory. The UID of the application data directory is detected by using the installd process every time the computer is started, so that the problem that the application cannot operate the data directory due to unexpected power failure is solved, and the stability of the system is enhanced.
Optionally, the obtaining the UID of the application associated with the application data directory includes:
acquiring a package name in the application data directory;
and acquiring the UID of the application associated with the application data directory based on the package name.
In this embodiment of the application, after the installd detects the application data directory with the UID abnormal, the packet name of the application may be obtained through the path information of the application data directory, for example, the path of the application data directory is: and the packet name of the application data directory can be obtained by intercepting the name of the lowest level directory in the path and assigning the intercepted name of the lowest level directory to the character string variable.
The packagemangenerrice service in the Android system is responsible for installation, uninstallation, optimization and UID query of various APK packages, and optionally, the UID of the application designated by the package name can be queried from the packagemangenerrice service through package name information. After the UID of the application is inquired by the PackageManger Serivce, the UID is transmitted to the inside thread process, and then the inside thread process carries out the operation of replacing the UID of the application data directory with the inquired UID of the application with the UID abnormality, thereby finishing the UID repairing work.
According to the embodiment of the application, the package name of the application data directory with the UID abnormal is obtained through the inside, the UID of the application is obtained from the packagemangerSerivce based on the package name, the UID abnormal repairing work after the startup is finished in a mode of cooperation of the inside and the packagemangerSerivce, and the repairing mode has the advantages of being few in occupied system resources, high in repairing speed, free of influence on startup efficiency and the like. And the UID abnormity is repaired when the computer is started, so that the problem that a user does not know how to solve when the application cannot operate the application data directory is avoided, and the user experience is improved.
Optionally, obtaining the UID of the application associated with the application data directory, and replacing the UID of the application data directory with the UID of the application comprises:
searching an application installation directory corresponding to the application data directory;
and if the application installation directory corresponding to the application data directory is found, acquiring the UID of the application associated with the application data directory from the installation directory, and replacing the UID of the application data directory with the UID of the application.
After the instruction insertion process obtains the package name of the application data directory with the abnormal UID, the package name can be searched in the application installation directory (namely/data/app path), if the package name is found, the application is the application installed on the terminal device, UID information of the application is found in the application installation directory, the found UID of the application is transmitted to the instruction insertion process, and the found UID of the application is replaced by the UID of the application data directory with the abnormal UID through the intelligent insertion process, so that UID repairing work is completed.
Optionally, if the application installation directory corresponding to the application data directory is not found, the UID of the application associated with the application data directory is not acquired, and the application data directory is deleted.
In the embodiment of the application, after obtaining the package name of the application data directory with the abnormal UID, the installd process searches the package name under the application installation directory, and if the application installation directory corresponding to the application data directory is found, it indicates that the application may have been unloaded, and since the application has been unloaded, that is, an event for starting the application does not occur, there is no need to repair the UID of the application data directory, and therefore, in the case of finding the application installation directory corresponding to the application data directory, the UID of the application associated with the application data directory is not obtained.
Optionally, the application data directory may be a part that is unexpectedly powered off during the process of unloading the application without completely unloading the application, because the application installation directory corresponding to the application data directory is not found to indicate that the application may have been unloaded. Therefore, when the application installation catalog corresponding to the application data catalog cannot be found, the application data catalog is deleted, and the storage space of the terminal is saved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
EXAMPLE III
In this embodiment, based on the first embodiment or the second embodiment, fig. 3 is a schematic flowchart of another method for optimizing a system according to an embodiment of the present application, where as shown in the figure, the method may include the following steps after replacing the UID of the application data directory with the UID of the application:
step 301, starting the application;
step 302, judging whether the starting of the application is abnormal or not;
step 303, if the application is abnormally started, sending a prompt message to a user or restarting the system.
In this embodiment, after the UID change operation is performed on the application data directory with the UID exception, an operation of starting the application may be automatically performed, for example, when the system detects that the installd performs an operation of replacing the UID of the application data directory, a start instruction of the application is automatically triggered, the start mode may be foreground start or background start, preferably a background start mode is adopted, and after the application is started, whether an exception occurs is determined, and the exception may be, for example, receiving an error report message of the application, or automatically exiting the application. And when detecting that the application starting is abnormal, sending prompt information to a user. Optionally, if an application is started to have an exception after the UID of the application data directory is replaced with the UID of the application, the user may be automatically prompted to restart the system, and after the system is restarted, step 101 and step 103 in embodiment one or step 201 and step 204 in embodiment two are performed here. After the step 101 and 103 in the first embodiment or the step 201 and 204 in the second embodiment are re-executed after the restart, if the application is still abnormal, a prompt message is sent to the user to suggest the user to adopt other solutions, for example, reinstalling the application or performing an upgrade operation on the application.
According to the embodiment of the application, after the UID repairing operation is executed, whether the repairing is successful or not is detected in an automatic application starting mode, and if the repairing is detected to be failed, the repairing operation is executed again after the system is restarted. And the success rate of UID repair is further improved.
Example four
An embodiment of the present application further provides an optimization apparatus of a system, as shown in fig. 3, an optimization apparatus 400 in the embodiment of the present application includes:
a UID obtaining unit 401, configured to obtain a unique identifier UID of the application data directory after the system is started;
a UID detection unit 402 configured to determine whether a UID of the application data directory is abnormal;
a UID repair unit 403, configured to, if the UID of the application data directory is abnormal, obtain the UID of the application associated with the application data directory, and replace the UID of the application data directory with the UID of the application.
Optionally, the obtaining the UID of the application data directory includes:
and acquiring the UID of the application data directory through an installd process.
Optionally, the determining whether the UID of the application data directory is abnormal includes:
judging whether the UID of the application data directory is the same as the UID of the installd process;
and if the UID of the application data directory is the same as the UID of the installd process, determining that the UID of the application data directory is abnormal.
Optionally, the UID repair unit 403 includes:
the searching subunit is used for searching the application installation catalog corresponding to the application data catalog;
and the replacing subunit is used for acquiring the UID of the application associated with the application data directory from the installation directory if the application installation directory corresponding to the application data directory is found, and replacing the UID of the application data directory with the UID of the application.
Optionally, the UID repair unit 403 further includes:
and the deleting subunit is used for not acquiring the UID of the application associated with the application data directory and deleting the application data directory if the application installation directory corresponding to the application data directory is not found.
Optionally, the optimization apparatus 400 further includes:
a detection unit for starting the application;
judging whether the starting of the application is abnormal or not;
and if the application is abnormally started, sending a prompt message to a user or restarting the system.
By using the optimization device of the system in the embodiment of the application, after the system is started each time and before an application program is started, the embodiment of the application detects whether the UID of the application data directory is abnormal or not, if the UID of the application related to the application data directory is abnormal, the UID of the application related to the application data directory is obtained, and the UID of the application data directory is replaced by the UID of the application, so that the UID of the abnormal application data directory can be repaired each time the system is started, the problem that the operation of the application is crashed due to the fact that the related application is started before the UID of the application data directory is not repaired is solved, the probability of the abnormality when a user starts the application is reduced, and the stability of the system is.
EXAMPLE five
An embodiment of the present application provides a mobile terminal, please refer to fig. 5, where the mobile terminal in the embodiment of the present application includes: a memory 501, one or more processors 502 (only one shown in fig. 5), and a computer program stored on the memory 501 and executable on the processors. Wherein: the memory 501 is used for storing software programs and modules, and the processor 502 executes various functional applications and data processing by running the software programs and units stored in the memory 401, so as to acquire resources corresponding to the preset events. Specifically, the processor 502 realizes the following steps by running the above-mentioned computer program stored in the memory 501:
after the system is started, acquiring a unique identifier UID of an application data directory;
judging whether the UID of the application data directory is abnormal or not;
and if the UID of the application data directory is abnormal, acquiring the UID of the application associated with the application data directory, and replacing the UID of the application data directory with the UID of the application.
Given the first possible embodiment described above, in a second possible embodiment provided on the basis of the first possible embodiment,
the obtaining of the UID of the application data directory comprises:
and acquiring the UID of the application data directory through an installd process.
In a third possible embodiment provided on the basis of the second possible embodiment described above,
the judging whether the UID of the application data directory is abnormal comprises the following steps:
judging whether the UID of the application data directory is the same as the UID of the installd process;
and if the UID of the application data directory is the same as the UID of the installd process, determining that the UID of the application data directory is abnormal.
In a fourth possible embodiment provided on the basis of the first possible embodiment described above,
the obtaining the UID of the application associated with the application data directory comprises:
acquiring a package name in the application data directory;
and acquiring the UID of the application associated with the application data directory based on the package name.
In a fifth possible embodiment provided on the basis of the first possible embodiment described above,
obtaining the UID of the application associated with the application data directory, and replacing the UID of the application data directory with the UID of the application comprises:
searching an application installation directory corresponding to the application data directory;
if the application installation directory corresponding to the application data directory is found, acquiring the UID of the application associated with the application data directory from the installation directory, and replacing the UID of the application data directory with the UID of the application;
and if the application installation directory corresponding to the application data directory is not found, not acquiring the UID of the application associated with the application data directory, and deleting the application data directory.
In a seventh possible embodiment provided on the basis of the first possible embodiment described above,
after replacing the UID of the application data directory with the UID of the application, further comprising:
starting the application;
judging whether the starting of the application is abnormal or not;
and if the application is abnormally started, sending a prompt message to a user or restarting the system.
Further, as shown in fig. 5, the mobile terminal 5 may further include: one or more input devices 503 (only one shown in fig. 5) and one or more output devices 504 (only one shown in fig. 5). The memory 501, processor 502, input device 503, and output device 404 are connected by a bus 405.
It should be understood that the mobile terminal 5 may be a computing device such as a smart phone, a tablet computer, etc. The Processor 502 may be a Central Processing Unit (CPU), or other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The input device 503 may include a keyboard, a touch pad, a fingerprint sensor (for collecting fingerprint information of a user and direction information of the fingerprint), a microphone, etc., and the output device 504 may include a screen, a speaker, etc.
Memory 501 may include both read-only memory and random access memory and provides instructions and data to processor 502. Some or all of the memory 501 may also include non-volatile random access memory. For example, the memory 501 may also store device type information.
As can be seen from the above, in the embodiment of the present application, before an application program is started, whether the UID of the application data directory is abnormal is detected, if the abnormality occurs, the UID of the application associated with the application data directory is obtained, and the UID of the application data directory is replaced with the UID of the application, so that the UID of the abnormal application data directory can be repaired at each startup, the problem of application operation crash caused by starting the associated application before the UID abnormality of the application data directory is not repaired is avoided, and thus the stability of the system is enhanced.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned functions may be distributed as different functional units and modules according to needs, that is, the internal structure of the apparatus may be divided into different functional units or modules to implement all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described system embodiments are merely illustrative, and for example, the division of the above-described modules or units is only one logical functional division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The integrated unit may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, all or part of the flow in the method of the embodiments described above may be implemented by a computer program, which may be stored in a computer readable storage medium and used by a processor to implement the steps of the embodiments of the methods described above. The computer program includes computer program code, and the computer program code may be in a source code form, an object code form, an executable file or some intermediate form. The computer readable medium may include: any entity or device capable of carrying the above-mentioned computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signal, telecommunication signal, software distribution medium, etc. It should be noted that the computer readable medium described above may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media excludes electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (8)

1. A method for optimizing a system, characterized in that,
after the system is started every time, acquiring a unique identifier UID of an application data directory through an installd process;
judging whether the UID of the application data directory is abnormal or not;
if the UID of the application data directory is abnormal, acquiring the UID of the application associated with the application data directory, and replacing the UID of the application data directory with the UID of the application;
wherein the determining whether the UID of the application data directory is abnormal comprises:
judging whether the UID of the application data directory is the same as the UID of the installd process;
and if the UID of the application data directory is the same as the UID of the installd process, determining that the UID of the application data directory is abnormal.
2. The method of optimizing a system according to claim 1, wherein the obtaining the UID for the application associated with the application data directory comprises:
acquiring a package name in the application data directory;
and acquiring the UID of the application associated with the application data directory based on the package name.
3. The method of optimizing a system of claim 1, wherein obtaining the UID for the application associated with the application data directory and replacing the UID for the application data directory with the UID for the application comprises:
searching an application installation directory corresponding to the application data directory;
and if the application installation directory corresponding to the application data directory is found, acquiring the UID of the application associated with the application data directory from the installation directory, and replacing the UID of the application data directory with the UID of the application.
4. A method of optimizing a system according to claim 3, further comprising:
and if the application installation directory corresponding to the application data directory is not found, not acquiring the UID of the application associated with the application data directory, and deleting the application data directory.
5. The method of optimizing a system according to any one of claims 1 to 4, further comprising, after replacing the UID of the application data directory with the UID of the application:
starting the application;
judging whether the starting of the application is abnormal or not;
and if the application is abnormally started, sending a prompt message to a user or restarting the system.
6. An apparatus for optimizing a system, comprising:
the UID obtaining unit is used for obtaining the unique identifier UID of the application data directory through an installd process after the system is started every time;
the UID detection unit is used for judging whether the UID of the application data directory is abnormal or not;
the UID repairing unit is used for acquiring the UID of the application associated with the application data directory if the UID of the application data directory is abnormal, and replacing the UID of the application data directory with the UID of the application;
wherein the determining whether the UID of the application data directory is abnormal comprises:
judging whether the UID of the application data directory is the same as the UID of the installd process;
and if the UID of the application data directory is the same as the UID of the installd process, determining that the UID of the application data directory is abnormal.
7. A mobile terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 5.
CN201810383563.1A 2018-04-26 2018-04-26 System optimization method, mobile terminal and computer storage medium Active CN108595292B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810383563.1A CN108595292B (en) 2018-04-26 2018-04-26 System optimization method, mobile terminal and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810383563.1A CN108595292B (en) 2018-04-26 2018-04-26 System optimization method, mobile terminal and computer storage medium

Publications (2)

Publication Number Publication Date
CN108595292A CN108595292A (en) 2018-09-28
CN108595292B true CN108595292B (en) 2021-03-26

Family

ID=63609536

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810383563.1A Active CN108595292B (en) 2018-04-26 2018-04-26 System optimization method, mobile terminal and computer storage medium

Country Status (1)

Country Link
CN (1) CN108595292B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111062032A (en) * 2019-12-13 2020-04-24 上海钧正网络科技有限公司 Anomaly detection method and system and computer-readable storage medium
CN112286712B (en) * 2020-12-25 2021-04-02 成都数联铭品科技有限公司 Fault-tolerant repair method based on unique ID

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8848576B2 (en) * 2012-07-26 2014-09-30 Oracle International Corporation Dynamic node configuration in directory-based symmetric multiprocessing systems
CN106775876A (en) * 2016-12-21 2017-05-31 海马云(天津)信息技术有限公司 The method that Android system quickly starts application

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8848576B2 (en) * 2012-07-26 2014-09-30 Oracle International Corporation Dynamic node configuration in directory-based symmetric multiprocessing systems
CN106775876A (en) * 2016-12-21 2017-05-31 海马云(天津)信息技术有限公司 The method that Android system quickly starts application

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Android平台隐私保护方法研究;洪双喜;《中国优秀博士论文全文数据库》;20180215;第85-86页 *
APK安装流程详解8——PackageManagerService的启动流程(下);佚名;《https://www.jianshu.com/p/b9b2b0f650e9》;20171028;第1-25页 *
佚名.APK安装流程详解8——PackageManagerService的启动流程(下).《https://www.jianshu.com/p/b9b2b0f650e9》.2017,第1-25页. *

Also Published As

Publication number Publication date
CN108595292A (en) 2018-09-28

Similar Documents

Publication Publication Date Title
CN110225078B (en) Application service updating method, system and terminal equipment
CN110209405B (en) Automatic upgrading method and device for distributed system
CN105760200A (en) Terminal device and system updating method thereof
CN110045991B (en) RAID configuration method and device of server, computer equipment and storage medium
CN113312064B (en) Method and device for installing and configuring physical machine and computer readable medium
TW201621647A (en) Operating system updating method
CN108595292B (en) System optimization method, mobile terminal and computer storage medium
CN111488163B (en) Firmware updating method and device, electronic equipment and storage medium
EP3260981B1 (en) Information processing apparatus, information processing system, and information processing method for updating firmware
CN111385613B (en) Television system repairing method, storage medium and application server
CN109446008B (en) Fault reason detection method, fault reason detection device and terminal equipment
CN112015587B (en) Method and device for enhancing reliability of operating system
CN114546537B (en) Starting sequence deployment method and related device for multiple operating systems
CN111198703A (en) Version upgrading method, system, equipment and medium
CN107179911B (en) Method and equipment for restarting management engine
CN114237722B (en) System starting method, device, equipment and engineering vehicle
CN113656063A (en) System version replacing method, device, equipment and computer readable medium
CN110740382B (en) Method, device, television and medium for avoiding undesired automatic restart of television
CN113515291A (en) Equipment online upgrading method and device
CN112328288A (en) Method, system, equipment and storage medium for updating server component
CN107015827B (en) Embedded system and method for automatically operating third-party extension program thereof
CN112148463B (en) Business process control method and device
CN109996262B (en) AC starting method and device
CN111339520B (en) Hardware dog-based online control method, electronic equipment and storage medium
CN115145766A (en) Method and device for recovering system exception

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant