CN116662045A - Process name acquisition method, terminal equipment and storage medium - Google Patents

Process name acquisition method, terminal equipment and storage medium Download PDF

Info

Publication number
CN116662045A
CN116662045A CN202211449312.1A CN202211449312A CN116662045A CN 116662045 A CN116662045 A CN 116662045A CN 202211449312 A CN202211449312 A CN 202211449312A CN 116662045 A CN116662045 A CN 116662045A
Authority
CN
China
Prior art keywords
name
character
character string
field
information
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.)
Granted
Application number
CN202211449312.1A
Other languages
Chinese (zh)
Other versions
CN116662045B (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.)
Honor Device Co Ltd
Original Assignee
Honor Device Co 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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202211449312.1A priority Critical patent/CN116662045B/en
Publication of CN116662045A publication Critical patent/CN116662045A/en
Application granted granted Critical
Publication of CN116662045B publication Critical patent/CN116662045B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/079Root cause analysis, i.e. error or fault diagnosis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the application provides a process name acquisition method, terminal equipment and a storage medium, and relates to the field of application program management. The method comprises the following steps: if the application process is detected to crash, a runtime module in the application process acquires crash information and an identification name; the runtime module generates a name character string based on the identification name, adds the name character string to the crash information, and sends the crash information to the system process; the system process identifies the name character string from the collapse information and obtains an identification name according to the name character string; if the system process does not query the process information of the application process according to the process identification information of the application process, the system process takes the identification name as the process name of the application process. The embodiment of the application can effectively determine the process name of the application process with the crash.

Description

Process name acquisition method, terminal equipment and storage medium
Technical Field
The present application relates to the field of application program management, and in particular, to a process name acquiring method, a terminal device, and a storage medium.
Background
Various Applications (APP) installed on the terminal device can provide different services for the user. The application creates one or more application processes (processes) at runtime through which the functionality of the application is implemented. If the application process crashes (crash), the application cannot run normally, even the system is blocked because of the memory and the CPU occupied by the application, and the user cannot operate the terminal normally. Therefore, the crashed application process needs to timely feed back relevant information so as to be able to be solved in time, however, after a part of application processes crash, the system process cannot obtain the corresponding process name, so that the problems of the application are difficult to be timely checked and solved, the normal use of the system or the application by a user is affected, and the user experience is poor.
Disclosure of Invention
The embodiment of the application discloses a process name acquisition method, terminal equipment and a storage medium, which can provide the process name of an application process when a system process cannot inquire the process information of the application process according to crash information, so that the process name recorded in a crash file generated by the system process is not null.
The first aspect of the present application discloses a process name acquisition method, applied to a terminal device, where the terminal device includes an application process and a system process, the application process includes a runtime module, and the method includes:
if the application process is detected to crash, the runtime module acquires crash information and identification names of the application process; the runtime module generates a name character string based on the identification name, adds the name character string to the crash information, and sends the crash information to the system process; the system process identifies the name character string from the collapse information and obtains the identification name according to the name character string; if the process information of the application process is not queried according to the process identification information of the application process, the system process takes the identification name as the process name of the application process.
According to the method, before the runtime module sends the crash information to the system process, the identification name can be added in the sent crash information, so that when the system process cannot inquire the application information according to the process identification information, the identification name can be determined to be the process name of the application process, and the process name recorded in the crash file generated by the system process is not null. Meanwhile, the identification name is added in the crash file, so that the original realization of the fact that the crash information is sent to the system process by the module during operation is not influenced, and the normal flow of the crash information transmission to the system process by the application process is not influenced.
In some alternative embodiments, the runtime module generates a name string based on the identification name, comprising:
and generating a name character string corresponding to the identification name according to the identification name and a preset character string construction rule, wherein the character string construction rule comprises the step of marking the identification name by adopting preset characters.
According to the method, through the character string construction rule, consistency of the name character string generated according to the identification name can be improved, and the name character string can be conveniently identified by a subsequent system process.
In some alternative embodiments, the method further comprises:
the system process deletes the name string from the crash information. According to the method, after the system process receives the collapse information added with the name character string, the name character string is deleted after the name character string is identified, the original collapse information is restored, and the interference to the user for reading the collapse information is avoided.
In some alternative embodiments, the crash information is a CrashInfo object.
In some alternative embodiments, the runtime module adding the name string to the crash information comprises: and adding the name character string into field content corresponding to a target field in the CrashInfo object. According to the method, only the field content corresponding to the target field in the collapse information is required to be inquired, so that the inquiring efficiency of the name character string can be effectively improved, the field content corresponding to all the fields in the collapse information is not required to be inquired, and therefore the workload of a system process for identifying the collapse information added with the name character string is reduced.
In some optional embodiments, the adding, by the runtime module, the name string to a field content corresponding to a target field in the CrashInfo object includes: and adding the name character string to the original field content of the target field. According to the method, only the field content corresponding to the target field in the collapse information is required to be inquired, so that the inquiring efficiency of the name character string can be effectively improved, the field content corresponding to all the fields in the collapse information is not required to be inquired, and therefore the workload of a system process for identifying the collapse information added with the name character string is reduced.
In some optional embodiments, the adding, by the runtime module, the name string to a field content corresponding to a target field in the CrashInfo object includes: and adding the name character string to the original field content corresponding to the target field. According to the method, only the field content corresponding to the target field in the collapse information is required to be inquired, so that the inquiring efficiency of the name character string can be effectively improved, the field content corresponding to all the fields in the collapse information is not required to be inquired, and therefore the workload of a system process for identifying the collapse information added with the name character string is reduced.
In some alternative embodiments, the system process identifying the name string from the crash information comprises: and identifying the name character string from the collapse information according to the character string construction rule. According to the method, the name character string is identified according to the character string construction rule, and the identification accuracy of the name character string can be improved.
In some optional embodiments, the character string construction rule marks the identification name with a first character and a second character, and the identifying the name character string from the crash information according to the character string construction rule includes: starting from the last field of the field content corresponding to the target field, determining whether the second character exists in the field content according to the sequence from back to front; if the second character exists, determining whether the first character exists in a field before the second character in the field content; and if the first character exists in a field before the second character in the field content, determining the character strings consisting of the first character, the second character and the characters between the first character and the second character as the name character string.
When the added position of the name character string is behind the original field content corresponding to the target field, inquiring from the last field in the field content corresponding to the target field according to the sequence from back to front to determine a second character; according to the determined second character, the first character is continuously queried from the back to the front, so that the condition that the field in the original field of the target field is determined to be the first character or the second character can be reduced, and the accuracy of determining the name character string is improved.
In some optional embodiments, the character string construction rule marks the identification name with a first character and a second character, and the identifying the name character string from the crash information according to the character string construction rule includes: determining whether the first character exists in the field content from the target field in a front-to-back order; if the first character exists, determining whether the second character exists in a field after the first character in the field content; and if the second character exists in the field after the first character in the field content, determining the character string formed by the first character, the second character and the characters between the first character and the second character as the name character string.
When the added position of the name character string is between the target field and the original field corresponding to the target field, inquiring from the target field according to the sequence from front to back to determine a first character; according to the determined first character, the second character is continuously queried from the front to the back, so that the condition that the field in the original field of the target field is determined to be the first character or the second character can be reduced, and the accuracy of determining the name character string is improved.
A second aspect of the present application discloses a computer readable storage medium comprising computer instructions which, when run on a terminal device, cause the terminal device to perform the process name acquisition method according to the first aspect.
A third aspect of the present application discloses a terminal device, the terminal device comprising a processor and a memory, the memory being configured to store instructions, the processor being configured to invoke the instructions in the memory, so that the terminal device performs the process name acquisition method according to the first aspect.
It should be understood that, the computer readable storage medium according to the second aspect and the terminal device according to the third aspect provided above correspond to the method according to the first aspect, and therefore, the advantages achieved by the method may refer to the advantages in the corresponding method provided above, and are not repeated herein.
Drawings
FIG. 1 is a flow chart of an application process crash processing method.
Fig. 2 is an application scenario schematic diagram of a process name obtaining method according to an embodiment of the present application.
FIG. 3 is a schematic diagram of an application scenario in which an application process and a system process communicate based on a binder according to an embodiment of the present application.
Fig. 4 is a flowchart of a process name obtaining method according to an embodiment of the present application.
Fig. 5 is a flowchart of a process name obtaining method according to an embodiment of the present application.
Fig. 6 is a flowchart of a process name obtaining method according to an embodiment of the present application.
Fig. 7 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
The terms "first" and "second" are used below for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In describing embodiments of the present application, words such as "exemplary," "or," "such as," and the like are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "for example" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary," "or," "such as," and the like are intended to present related concepts in a concrete fashion.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. It is to be understood that, unless otherwise indicated, a "/" means or. For example, A/B may represent A or B. The "and/or" in the present application is merely one association relationship describing the association object, indicating that three relationships may exist. For example, a and/or B may represent: a exists alone, A and B exist simultaneously, and B exists alone. "at least one" means one or more. "plurality" means two or more than two. For example, at least one of a, b or c may represent: seven cases of a, b, c, a and b, a and c, b and c, a, b and c. It will be appreciated that the order of the steps shown in the flowcharts herein may be changed and some may be omitted.
Various Applications (APP) installed on the terminal device can provide different services for the user. The application creates one or more application processes (processes) at runtime through which the functionality of the application is implemented. If the application process crashes (crash), the application cannot run normally, even the system is blocked because of the memory and the CPU occupied by the application, and the user cannot operate the terminal normally. Therefore, the crashed application process needs to timely feed back relevant information so as to be able to be solved in time, however, after a part of application processes crash, the system process cannot obtain the corresponding process name, so that the problems of the application are difficult to be timely checked and solved, the normal use of the system or the application by a user is affected, and the user experience is poor.
The life cycle process of the application process is scheduled by the system process, so that after the application process crashes, crash information is sent to the system process, and the system process generates a crash file of the application process according to the crash information. The system process can inquire the process information of the application process according to the process identification information. When an application process crashes, the application process sends process identification information to a system process, so that the system process queries the process information of the application process according to the process identification information. Because the process information records the process name, the process name of the application process can be obtained according to the process information.
However, sometimes the system process does not query the process information of the application process according to the process identification information. If the process information cannot be queried, the process name of the application process cannot be obtained, so that the process name recorded in the crash file generated by the system process is empty, for example, unown. Because the process name recorded in the crash file is empty, the user cannot determine the identity of the crashed application process according to the crash file, and the application process cannot be processed, so that the problems of the application are difficult to check and solve in time, the normal use of the system or the application by the user is influenced, and the user experience is poor.
FIG. 1 is a flow chart illustrating a method for crash processing of an application process. As shown in fig. 1, after an application process crashes, a system interface is called, and crash information is sent to the system process. And the system process queries the process information of the application process according to the received process identification information. If the system process inquires the process information, recording a process name according to the process information; if the system process can not inquire the process information, the process name is recorded as unown, so that the process name of the application process in the generated crash file is recorded as unown, which is equivalent to the condition that the process name recorded in the crash file is empty, and the user can not determine the identity of the crashed application process according to the crash file.
In order to solve the following technical problems: the embodiment of the application provides a process name acquisition method, which can add an identification name into crash information before the application process sends the crash information to the system process, so that when the system process can not inquire the application information according to the crash information, the identification name can be determined as the process name of the application process, the process name recorded in the crash file generated by the system process is not empty, and the application with the crash can be effectively positioned.
The process name acquisition method provided by the embodiment of the application is applied to terminal equipment. By way of example, the terminal device in the embodiments of the present application may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (personal digital assistant, PDA), an artificial intelligence (artificial intelligence, AI) device, a wearable device, a vehicle-mounted device, a smart home device, and/or a smart city device. The embodiment of the application does not limit the specific form of the terminal equipment. An operating system is installed on the terminal equipment, and the operating system can be WindowsSystem, & gt>System and method for controlling a systemOne of the systems or other systems not shown, hereinafter referred to as operating system +.>The system is illustrated as an example. The system process, e.g. system server process, is +.>Important processes in the system, consisting ofThe zygate process fork generates, in which the main services in the system reside, such as actiglymanager service (AMS), packagelmanager service (PMS), windows Manager Service (WMS), etc. An application process of an application may be created by a system process. For example, when a user clicks an application icon displayed by a desktop program of a terminal device, a desktop process corresponding to the desktop program may call an objective function, such as a startActivity () function, and send information to a system process through cross-process communication. In the system process, an AMS notifies a sub-process, i.e., an application process, in the zygate process fork through cross-process communication. The lifecycle processes of all application processes in the application, such as creation, termination, etc., are scheduled by the system process.
The process name acquisition method provided by the embodiment of the application is described below by way of example with reference to the accompanying drawings.
Fig. 2 is an application scenario schematic diagram of a process name obtaining method according to an embodiment of the present application. As shown in fig. 2, both the application process and the system process include a User Space (User Space) and a Kernel Space (Kernel Space). The user space and kernel space within a process may interact with data. Because each process has independent user space, the user spaces of the two processes are isolated, so that the two processes cannot directly communicate through the user space, and the kernel data interaction process between the processes is realized. The application process and the system process can communicate by way of cross-process communication of shared memory, binder, socket, pipelines and the like. The embodiment of the application is illustrated by taking the communication between the application process and the system process based on the binder as an example.
Fig. 3 is a schematic diagram of an application scenario in which an application process and a system process communicate based on a binder according to an embodiment of the present application. As shown in fig. 3, the application process and the system process are driven by a binder to establish communication between the two. The application process and the system process respectively establish communication with the binder driver through system calls, such as input/output control (ioctl) interfaces. The application process and the system process are both the sender and the receiver. The application process holds the binder reference of the system process and the binder entity of the application process itself. The system process holds the binder reference of the application process and the binder entity of the system process itself. When the application process is used as a sender, when a sending operation is executed to the system process through a binder entity of the application process, a sending request is sent to a binder driver to request to send data to the system process through a binder reference of the system process. The binder driver processes the application process request by using the kernel space sharing mechanism to complete the issue of the application process sending data to the system process.
Fig. 4 is a flowchart of a process name obtaining method according to an embodiment of the present application. As shown in fig. 4, the method includes:
the application process crashes, and 201, the application process adds an identification name in the crash information of the application process. The identification name may be added to the crash information in the form of a string.
202, the application process sends crash information with an identification name attached to the system process. The application process may send crash information to the system process by invoking the system processing interface.
203, the system process analyzes the crash information to obtain the identification name.
204, the system process queries the process information of the application process according to the process identification information.
205, the system process determines whether process information has been queried. If the system process queries the process information, the system process records the process name according to the process information, and then executes 206.
If the system process does not query the process information, step 207 is executed, and the parsed identification name is recorded as the process name.
For some specific implementations of the process name acquisition method provided in the embodiments of the present application, reference may be made to the following detailed description of fig. 5.
According to the process name acquisition method provided by the embodiment, before the runtime module sends the crash information to the system process, the identifier name can be added to the sent crash information, so that when the system process cannot query the application information according to the process identification information, the identifier name can be determined to be the process name of the application process, and the process name recorded in the crash file generated by the system process is not null.
Fig. 5 is a flowchart of a process name obtaining method according to an embodiment of the present application. The order of the steps in the flowchart may be changed and some steps may be omitted according to various needs. The method is applied to the terminal equipment, the terminal equipment comprises an application process, a system process and a runtime module. As shown in fig. 5, the method specifically includes the following procedure.
When the application process crashes, a runtime module in the application process detects the crashed application process. The runtime module is a module in the application process and is used for detecting a crash event of the application process. The runtime module may be created within the application process at the same time as the application process is created. After the runtime module detects that the application process crashes, the crash information of the application process can be sent to the system process through the binder driver.
If a crash event of the application process is detected, the runtime module executes 401 to obtain the identification name of the application process.
The identification name may be used to represent the application process. The user may determine the identity of the application process based on the identification name. The runtime module may obtain the identification name by parsing the context information of the application process. The context information includes running environment information of the application Process, may include a Process identifier (Process Identification, PID) and a Process Name (Process Name) of the application Process, and may further include information such as a User Identifier (UID) of the application Process. The identification name includes one or more of a process name of the application process, identity information of the application process. In some embodiments of the present application, the runtime module may directly obtain the process name of the application process by parsing the context information of the application process, and may also obtain the name of the application process, which is not necessarily obtained by parsing with a certain probability, but other related identity information of the application process. The identity information may be used to assist the user in determining the identity of the application process. When resolving the process name of the application process, the runtime module determines the resolved process name as the identification name. If the process name of the application process cannot be resolved, the run-time module takes the identity information of the resolved application process as the identification name. In some embodiments of the present application, if the runtime module parses that the context information of the application process does not obtain the process name of the application process, or does not obtain other related identity information of the application process, the preset field may be determined as the identifier name. The preset field may be set according to the actual situation, e.g. no name.
And 402, the runtime module generates a name character string according to the identification name.
In some embodiments of the present application, a name string corresponding to the identification name may be generated according to the identification name and a preset string construction rule. The string construction rules may be used to generate name strings from identification names. The character string construction rule may be set according to actual situations, and may include marking the identification name with a preset character. For example, the string construction rule may include marking the identification name with a first character and a second character. The marking of the identification name by the first character and the second character means that the identification name can be located and found quickly by the first character and the second character, for example, the identification name is placed between the first character and the second character, namely, the marking is carried out in the form of 'first character + identification name + second character'. The first character and the second character are one or more characters which are preset, such as separators, and can be the same character or different characters. Substituting the identification name into the character string construction rule to obtain the name character string. For example, the character string construction rule is to use a first character and a second character to mark the identification name, wherein the first character and the second character are the same character and are "-pn-" and the identification name is "com.xxx.test", and the identification name is substituted into the character string construction rule, so that the obtained name character string is "-pn-com.xxx.test-pn-".
In some embodiments of the present application, the string construction rule may include marking the identification name with a third character. Wherein the third character is one or more characters set in advance. Specifically, the mark may be in the form of "third character+identification name" or in the form of "identification name+third character". For example, the string construction rule is "third character+identification name", wherein the third character is "-pn-", the identification name is "com.xxx.test", and the identification name is substituted into the string construction rule, and the obtained name string is "-pn-com.xxx.test". For another example, the string construction rule is "identifier name+third character", where the third character is "-pn-", the identifier name is "com.xxx.test", and the identifier name is substituted into the string construction rule, so that the obtained name string is "com.xxx.test-pn-" and the string construction rule can be flexibly set in practical application, and is not limited to the above examples. Through the character string construction rule, consistency of generating the name character string according to the identification name can be improved, and the name character string can be conveniently identified by a subsequent system process.
403, the runtime module adds the name string to the crash information of the application process.
The crash information of the application process is information which needs to be sent to the system process by the runtime module when the application process crashes, and is used for explaining the crash of the application process to the system process. The crash information of the application process may be a CrashInfo object. The CrassInfo object encapsulates information such as Crassinformation file name, crassabnormal class name, method name, code line number corresponding to Crassh, abnormal information and the like related to the application process.
In an embodiment of the present application, the runtime module may add the name string to any one location in the crash information of the application process. In order to facilitate a subsequent system process to read the name string added in the crash information, in some embodiments of the present application, a target field may be predetermined in the crash information of the application process, and the name string may be added to a field content corresponding to the target field in the crash information of the application process. For example, if the crash information of the application process is a CrashInfo object, the CrashInfo object includes a plurality of fields. Each field has its corresponding field content, which is used to describe the field. A field may be determined as a target field among a plurality of fields included in the CrashInfo object, and a name string may be added to original field contents corresponding to the field determined as the target field. The original field content refers to the field content corresponding to the target field before the name character string is added. Can be added to any position in the original field content corresponding to the field. The field "CrashTag" in the CrashInfo object may be determined as the target field; and when the runtime module adds the name character string into the crash information of the application process, adding the name character string into original field content corresponding to the field CrashTag.
To avoid affecting the original field content corresponding to the target field, a name string may be added to the rear of the original field content of the target field, or a name string may be added to the front of the original field content corresponding to the field "CrashTag". For example, the original field content following the target field "CrashTag" is "native_crash", the name string is "-pn-com.xxx.test-pn-", and the name string is changed to "native_crash-pn-com-test-pn-" after being added to the original field content corresponding to the target field. For another example, the original field behind the target field "CrashTag" is "native_crash", the name string is "-pn-com.xxx.test-pn-", and the name string is changed to "-pn-com.xxx.test-pn-native_crash" before being added to the original field content corresponding to the target field.
404, the runtime module sends crash information to the system process adding the name string.
In the embodiment of the application, the crash information added with the name character string can be sent to the system process by calling the system processing interface.
And 405, the system process identifies the crash information added with the name character string, and identifies the name character string.
The name character string is added to the crash information by the runtime module.
In the embodiment of the application, if the name string corresponding to the identification name is determined according to the identification name and a preset string construction rule, in order to improve the identification accuracy of the name string, the crash information added with the name string can be identified according to the string construction rule so as to identify the name string in the crash information. The character string conforming to the character string construction rule in the collapse information to which the name character string is added may be determined as the name character string.
For example, when a string construction rule marks the identification name with a first character and a second character, and marks the identification name with a form of "first character+identification name+second character", wherein the first character and the second character are "—pn-". In the identification process, if the first character and the last character in one character string are identified as "-pn-", the character string can be determined to conform to the character string construction rule, and the character string is determined to be the name character string. For another example, when a string is identified as "third character+identifier name", wherein the third character is "-pn", and when the first character in a string composed of two characters is identified as "-pn", it may be determined that the string conforms to the string construction rule, and the string is determined to be the name string.
In order to clearly and completely describe the identification of the crash information, a plurality of embodiments are provided below for describing a plurality of identification modes of the system process for adding the crash information of the name string, so that the name string can be effectively determined.
In the first embodiment, the name string may be determined by determining the first character first and then determining the second character backward according to the position of the first character. If the character string construction rule adopts the first character and the second character to mark the identification name, the identifying the collapse information of the added name character string according to the character string construction rule may include: determining whether the first character exists in the collapse information of the added name character string; if the first character exists, determining whether the second character exists after the first character; and if the second character exists behind the first character, determining the character string formed by the first character, the second character and the characters between the first character and the second character as the name character string.
Specifically, if the first character can be retrieved in the crash information, character retrieval is started on the characters after the first character, and whether the second character exists after the first character is determined. When the second character is searched after the first character, the character search is stopped, and the character string consisting of the first character, the second character and the characters between the first character and the second character is directly determined as a name character string.
For example, the first character is "-pn-", the second character is "-vn-", and if the character string "-pn-", i.e., the first character exists in the collapse information, it is determined whether the second character "-vn-", exists after the first character. If the second character "-vn-", the character string consisting of the characters between "-pn-", "-vn-" and "-pn-" and "-vn-" is determined as the name character string. If the character between "-pn-" and "-vn-" is "com.xxx.test", the "-pn-com.xxx.test-vn-" is determined as the name string.
The first embodiment can improve the accuracy of determining the first character and the second character by determining the first character first and then determining the second character backwards according to the position of the first character, thereby improving the accuracy of determining the name character string.
In the second embodiment, the name string may be determined by determining the second character first and then determining the first character forward according to the position of the second character. If the character string construction rule adopts the first character and the second character to mark the identification name, the identifying the collapse information of the added name character string according to the character string construction rule may include: determining whether a second character exists in the collapse information of the added name character string; if the second character exists, determining whether the first character exists before the second character; if the first character exists before the second character, determining the first character, the second character and a character string formed by the characters between the first character and the second character as the name character string.
Specifically, if the second character can be retrieved in the crash information, character retrieval is started on the character before the second character, and whether the first character exists before the second character is determined. When the first character is searched after the second character, the character search is stopped, and the first character, the second character and the characters between the first character and the second character are directly obtained as name character strings.
In the third embodiment, when the runtime module adds the name string to the original field content corresponding to the target field in the crash information of the application process, the name string is determined by determining the first character first and then determining the second character backwards according to the position of the first character in the field content corresponding to the target field. The field content corresponding to the target field is the field content corresponding to the target field after the name string is added by the runtime module, wherein the field content comprises the name string added by the runtime module and the original field content corresponding to the target field. If the character string construction rule marks the identification name by using a first character and a second character, and the runtime module adds the name character string into the original field content corresponding to the target field in the collapse information of the application process, the identifying the collapse information of the added name character string according to the character string construction rule, and the obtaining the name character string may include: determining whether a first character corresponding to the first character exists in field content corresponding to the target field; if the first character exists, determining whether a second character corresponding to the second character exists in a field after the first character in the field content; and if the first character exists, determining the first character, the second character and a character string formed by characters between the first character and the second character as the name character string.
For example, if the first character is "-pn-", the second character is "-vn-", and if the target field in the collapse information is "CrashTag", the system process queries in the field content "native-pn-com xxx.test-vn- _crash" corresponding to "CrashTag", and determines whether the "-pn-" exists, that is, whether the first character exists. If the first character "-pn-" exists in the field content "native-pn-com.xxx.test-vn- _crash", determining whether the second character "-vn-" exists in the field "com.xxx.test-vn- _crash" after the first character "-pn-" in the field content. If there is a second character "-vn", and determining a character string consisting of the first character '-pn-', the second character '-vn-', and characters between the first character '-pn-', and the second character '-vn-', as the name character string. If the character between the first character "-pn-" and the second character "-vn-" is "com.xxx.test", the character string "-pn-com.xxx.test-vn-" is determined as a name character string.
Through the third embodiment, only the field content corresponding to the target field in the crash information is required to be queried, so that the query efficiency of the name character string can be effectively improved, and the field content corresponding to all the fields in the crash information is not required to be queried, thereby reducing the workload of the system process when the crash information added with the name character string is identified.
In the fourth embodiment, when the runtime module adds the name string to the original field content corresponding to the target field in the crash information of the application process, the name string may be determined by first determining the second character and then determining the first character according to the position of the second character in the field content corresponding to the target field. If the character string construction rule marks the identification name by using a first character and a second character, and the runtime module adds the name character string into a field content corresponding to a target field in the collapse information of the application process, the identifying the collapse information of the added name character string according to the character string construction rule, and the obtaining the name character string may include: determining whether a second character corresponding to the second character exists in the field content corresponding to the target field; if the second character exists, determining whether a first character corresponding to the first character exists in a field before the second character in the field content; if the first character exists, determining the first character, the second character and a character string formed by characters between the first character and the second character as a name character string.
For example, if the first character is "-pn-", the second character is "-vn-", and if the target field in the collapse information is "CrashTag", the system process queries in the field content "native-pn-com xxx.test-vn- _crash" corresponding to "CrashTag", and determines whether the "-vn-" exists, that is, whether the second character exists. If there is a second character "-vn-" in the field content "active-pn-com. Xxx. Test-vn- _ -crash", it is determined whether the first character "-pn-" is present in the field "active-pn-com.xxx.test" preceding the second character "-vn-" in the field content. If the first character '-pn-', a character string consisting of the first character '-pn-', the second character '-vn-', and characters between the first character '-pn-', and the second character '-vn-', is determined as the name character string. If the character between the first character "-pn-" and the second character "-vn-" is "com.xxx.test", the character string "-pn-com.xxx.test-vn-" is determined as a name character string. Through the fourth embodiment, only the field content corresponding to the target field in the crash information is required to be queried, so that the query efficiency of the name character string can be effectively improved, and the field content corresponding to all the fields in the crash information is not required to be queried, thereby reducing the workload of the system process when the crash information added with the name character string is identified.
In the fifth embodiment, the name string may be determined by first determining the second character and then determining the first character according to the position of the second character in the order from back to front, starting from the last field of the field content corresponding to the target field when the runtime module adds the name string to the original field content corresponding to the target field. If the character string construction rule marks the identification name by using a first character and a second character, and the runtime module adds the name character string to the original field content corresponding to the target field, the identifying the crash information of the added name character string according to the character string construction rule, and the obtaining the name character string may include: determining whether the second character exists in the field content according to the sequence from the last field of the field content corresponding to the target field; if the second character exists, determining whether the first character exists in a field before the second character in the field content; if the first character exists in the field before the second character in the field content, determining the character strings formed by the first character, the second character and the characters between the first character and the second character as name character strings.
The location where the runtime module adds the name string in the crash information of the application process may be preset, for example, after adding to the original field corresponding to the target field, adding between the target field and the original field corresponding to the target field. The system process can directly know the position of the name string added by the runtime module in the crash information of the application process. The field content corresponding to the target field comprises the original field content and the name character string corresponding to the target field.
The order from back to front refers to the order from the last field, moving forward in sequence until the first field.
For example, if the target field is "CrashTag", the original field following "CrashTag" is "native_crash", the name string appended to "CrashTag" is "-vn-com.xxx.test-pn-" where the first character is "-vn-" and the second character is "-pn-" and "vn-com.xxx.test-pn-" is appended to the original field corresponding to the target field, that is, appended to "native_crash", the content of the field corresponding to the field "CrashTag" is "native_crash-vn-com.xxx.test-pn-". Starting from the last field '-pn-' of the field content corresponding to the target field, determining whether the second character '-pn-' exists behind the target field 'CrashTag' according to the sequence from back to front; if the second character "-pn-" exists, judging whether the first character "-vn-" exists in a field "active_crash-vn-com.xxx.test" before the second character in the field content; if the first character "-vn", the first character "-vn-", the second character "-pn-", and the character string "-vn-com.xxx.test-pn-", which is formed by the characters between the first character "-vn-" and the second character "-pn-", is determined as a name string.
In the fifth embodiment, when the position of the name string is added after the original field content corresponding to the target field, starting from the last field in the field content corresponding to the target field, querying is performed in a sequence from back to front to determine a second character; according to the determined second character, the first character is continuously queried from the back to the front, so that the condition that the field in the original field of the target field is determined to be the first character or the second character can be reduced, and the accuracy of determining the name character string is improved.
In the sixth embodiment, the name string may be determined by first determining the first character and then determining the second character according to the position of the first character in a front-to-back direction from the first field of the field content corresponding to the target field when the runtime module adds the name string to the original field content corresponding to the target field. If the character string construction rule marks the identification name by using a first character and a second character, and before the runtime module adds the name character string to the original field content corresponding to the target field, the identifying the crash information of the added name character string according to the character string construction rule, and the obtaining the name character string may include: starting from a first field of field contents corresponding to the target field, determining whether the first character exists in the field contents according to a front-to-back direction; if the first character exists, determining whether the second character exists in a field after the first character in the field content; and if the second character exists in the field after the first character in the field content, determining the character string formed by the first character, the second character and the characters between the first character and the second character as the name character string.
The front-to-back order refers to an order from the first field, sequentially moving back until the last field. In the sixth embodiment, when the position of the name string is between the target field and the original field corresponding to the target field, the first character is determined by searching from the target field in the order from front to back; according to the determined first character, the second character is continuously queried from the front to the back, so that the condition that the field in the original field of the target field is determined to be the first character or the second character can be reduced, and the accuracy of determining the name character string is improved.
And 406, the system process obtains the identification name according to the name character string.
The identification name is the identification name obtained by the runtime module.
In some embodiments of the present application, if the runtime module generates a name string corresponding to the identification name according to the identification name and a preset string construction rule, the system process may determine the identification name in the name string according to the string construction rule. When the character string construction rule is 'first character + identification name + second character', a field between the first character and the second character in the name character string is determined as the identification name. For example, the first character and the second character are both "-pn-", the name string "-pn-com.xxx.test-pn-", and the field "com.xxx.test" is determined as the identification name.
407, the system process deletes the name string in the crash information of the added name string.
In an embodiment of the present application, after a system process identifies a name string, the name string is deleted, and the crash information of the application process is restored, that is, the crash information of the application process before the system process is restored to the state before the name string is added.
Through the embodiment, the system process deletes the name character string after identifying the identification name, so that the application process adds the name character string, and interference to a user when the user reads the crash information is avoided.
408, the system process determines whether the process information of the application process can be queried according to the process identification information.
Because the system process manages each application process and stores the process information of each application process, when an application process crashes, the runtime module can send the process identification information of the application process to the system process, so that the system process queries the process information of the application process in the stored process information according to the process identification information and determines the identity of the application process. The process identification information can comprise a process identifier, a matched application process can be queried according to the process identifier, and process information of the application process is obtained.
If the process information of the application process can be queried, executing 409, and determining the process name of the application process according to the process information.
If the process information of the application process is not queried, 410 is executed, and the identification name is determined as the process name of the application process.
If the process identification information of the application process can be directly used for inquiring the process information of the application process, the system process can directly determine the corresponding process name according to the process information; if the process information of the application process cannot be queried according to the process identification information of the application process, for example, when the process name is empty, the identification name obtained by the identification in the step 406 can be used as the process name of the application process.
According to the process name acquisition method provided by the embodiment, before the runtime module sends the crash information to the system process, the identifier name can be added to the sent crash information, so that when the system process cannot query the application information according to the process identification information, the identifier name can be determined to be the process name of the application process, and the process name recorded in the crash file generated by the system process is not null. Meanwhile, the identification name is added in the crash file, so that the original realization of the fact that the crash information is sent to the system process by the module during operation is not influenced, and the normal flow of the crash information transmission to the system process by the application process is not influenced. Secondly, after the system process receives the crash information added with the name character string, the name character string is identified, and after the identification is completed, the name character string is deleted and restored to the original crash information, so that the interference to the user for reading the crash information can be avoided.
Fig. 6 is a flowchart of a process name obtaining method according to an embodiment of the present application. As shown in fig. 6, the method includes:
when an application crashes, 601 is executed, and the application process obtains the identification name of the currently crashed application process.
The application process determines 602 whether the obtained identification name is null.
When the identification name acquired by the application process is empty, the application process is not acquired the identification name. When the identification name acquired by the application process is not null, the application process acquires the identification name.
And when the application process determines that the acquired identification name is null, directly calling a system interface, and sending the crash information of the application process to the system process. After the crash information of the application process is sent to the system process, 604 is performed.
When the application process determines that the obtained identifier name is not null, it executes 603 to attach a character string corresponding to the identifier name to the back of the target field in the crash information.
In the embodiment of the application, the character string corresponding to the identification name is constructed according to the character string construction rule. In the embodiment shown in fig. 6, the string construction rule is "first character+identification name+second character", where the first character and the second character are identical and are the same separator, such as "-pn-". For example, the first character and the second character are both separators "-pn-" and the identification name is "com.xxx.test", resulting in a string of "-pn-com.xxx.test-pn-". It will be appreciated that in other embodiments, the string construction rules may include a variety of rules corresponding to the embodiment shown in fig. 5. When the character string construction rule is sent to change, the recognition method for adding the character string to the application process by the system process is correspondingly changed.
In the embodiment shown in fig. 6, the position of the character string corresponding to the additional identification name is after the original field corresponding to the target field. In other embodiments, the position of the character string corresponding to the additional identification name may be between the target field and the original field corresponding to the target field. As the position of the character string corresponding to the additional identifier name changes, the recognition method of adding the character string to the application process by the system process will also change accordingly, and some specific embodiments of recognizing the character string may be referred to the related description of 405 in fig. 5 and will not be repeated here.
And after the character string is attached, calling a system interface, and sending the crash information of the application process after the character string is attached to the system process.
It will be appreciated that the steps performed by the application process described above may in fact be performed by a runtime module in the application process.
The system process determines the identification field in the crash information sent by the application process 604.
The identification field is the field content corresponding to the target field in the crash information sent by the application process. The system process can determine the identification field in the crash information sent by the application process according to the target field. For example, the target field is "CrashTag", and the system process determines the field content "native_crash-pn-com.xxx.test-pn-" corresponding to "CrashTag" in the crash information sent by the application process as the identification field, e.g., determines the field content "native_crash-pn-com.xxx.test-pn-" corresponding to "CrashTag" as the identification field.
605, it is determined whether there is a separator in the character string in the identification field.
In this embodiment, the character string includes two identical separators, and it can be determined whether there are separators in the character string in the identification field.
Determining that there is no separator in the character string in the identification field, which indicates that the application process does not add a character string to the crash information, executing 606, and determining the preset field as the identification name. The preset field may be set according to actual situations, for example, may be set as a no name. After the execution 606, the flow goes to 611, and the system process queries the process information of the application process according to the process identification information.
No character string is added to the crash information on the branch 606 to 611, so that the character string does not need to be removed; however, since the character string is added to the crash information on the branch 603 to 611, the added character string needs to be removed in 610 to restore the original crash information.
If it is determined that there is a separator in the character string in the identification field, step 607 is performed, and the position of the last separator in the identification field is denoted as P2.
Since the name string is after the original field corresponding to the target field, in order to avoid determining the separator in the original field after the target field as the separator in the string, it is necessary to query from the last field in the field content corresponding to the target field in a direction close to the target field, so that the position of the separator in the identification field is denoted as P2.
At 608, look forward from P2, a determination is made as to whether another separator is present.
Looking forward from P2 refers to performing a character query in a direction approaching the target field.
If it is determined that another separator does not exist, 606 is performed. After execution 606, execution 611.
If it is determined that another separator exists, 609, the separator is marked as P1 and the field between P1 and P2 is determined as the identification name.
611, the system process queries the process information of the application process according to the process identification information.
612, the system process determines whether process information is queried.
If the system process does not query the process information, 613, recording the identification name as the process name.
If the system process queries for process information, 614, the process name is recorded based on the process information.
For some embodiments of the method shown in fig. 6, reference may be made to the related description of fig. 5, which is not repeated here.
According to the process name acquisition method provided by the embodiment, before the runtime module sends the crash information to the system process, the character string corresponding to the identification name is added to the sent crash information, so that when the system process cannot query the application information according to the process identification information, the identification name can be determined as the process name of the application process, and the process name recorded in the crash file generated by the system process is not null. Meanwhile, the character string corresponding to the identification name is added in the crash file, so that the original realization of the fact that the crash information is sent to the system process by the module during operation is not influenced, and the normal flow of the crash information transmission from the application process to the system process is not influenced. Meanwhile, after the system process receives the collapse information of the added character string, the name character string is identified, the character string in the collapse information of the added character string is deleted, the original collapse information is restored, and the interference to the user for reading the collapse information is avoided. Moreover, when the identification name is not identified, the preset field can be determined as the identification name, so that when the system process cannot query the application information according to the process identification information, the preset field can be determined as the process name of the application process.
Fig. 7 is a schematic structural diagram of a terminal device 100 according to an embodiment of the present application. Referring to fig. 7, the terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge management module 120, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display 194, a user identification module (subscriber identification module, SIM) card interface 195, and the like. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the terminal device 100. In other embodiments of the application, terminal device 100 may include more or less components than illustrated, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I1C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
The I1C interface is a bi-directional synchronous serial bus comprising a serial data line (SDA) and a serial clock line (derail clock line, SCL). The I2S interface may be used for audio communication.
PCM interfaces may also be used for audio communication to sample, quantize and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface.
The UART interface is a universal serial data bus for asynchronous communications. The bus may be a bi-directional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is typically used to connect the processor 110 with the wireless communication module 160. For example: the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement a bluetooth function.
The MIPI interface may be used to connect the processor 110 to peripheral devices such as a display 194, a camera 193, and the like. The MIPI interfaces include camera serial interfaces (camera serial interface, CSI), display serial interfaces (display serial interface, DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the photographing function of terminal device 100. The processor 110 and the display 194 communicate via a DSI interface to implement the display function of the terminal device 100.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal or as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface may also be configured as an I1C interface, an I2S interface, a UART interface, an MIPI interface, etc.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the terminal device 100, or may be used to transfer data between the terminal device 100 and a peripheral device. And can also be used for connecting with a headset, and playing audio through the headset. The interface may also be used to connect other terminal devices 100, such as AR devices, etc.
It should be understood that the interfacing relationship between the modules illustrated in the embodiment of the present application is only illustrative, and does not constitute a structural limitation of the terminal device 100. In other embodiments of the present application, the terminal device 100 may also use different interfacing manners, or a combination of multiple interfacing manners in the foregoing embodiments.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 to power the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be configured to monitor battery capacity, battery cycle number, battery health (leakage, impedance) and other parameters.
The wireless communication function of the terminal device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals.
The mobile communication module 150 may provide a solution including 2G/3G/4G/5G wireless communication applied to the terminal device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 150 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc. applied to the terminal device 100.
The terminal device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor that serves exception alerts, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED) or an active-matrix organic light-emitting diode (matrix organic light emitting diode), a flexible light-emitting diode (flex), a mini, a Micro led, a Micro-OLED, a quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like.
In some embodiments, the terminal device 100 may include 1 or N display screens 194, N being a positive integer greater than 1. The terminal device 100 may implement a photographing function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element.
The internal memory 121 may include one or more random access memories (random access memory, RAM) and one or more non-volatile memories (NVM).
The external memory interface 120 may be used to connect an external nonvolatile memory to realize expansion of the memory capability of the terminal device 100. The external nonvolatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and video are stored in an external nonvolatile memory.
The terminal device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals.
The speaker 170A, also referred to as a "horn," is used to convert audio electrical signals into sound signals. The terminal device 100 can listen to music or to handsfree talk through the speaker 170A.
A receiver 170B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal. When the terminal device 100 receives a call or voice message, it is possible to receive voice by approaching the receiver 170B to the human ear.
Microphone 170C, also referred to as a "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can sound near the microphone 170C through the mouth, inputting a sound signal to the microphone 170C. The terminal device 100 may be provided with at least one microphone 170C. In other embodiments, the terminal device 100 may be provided with two microphones 170C, and may implement a noise reduction function in addition to collecting sound signals. In other embodiments, the terminal device 100 may be further provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the source of sound, implement directional recording functions, etc.
The earphone interface 170D is used to connect a wired earphone. The earphone interface 170D may be a USB interface 130 or a 3.5mm open mobile terminal device 100 platform (open mobile terminal platform, OMTP) standard interface, a american cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 180A is used to sense a pressure signal, and may convert the pressure signal into an electrical signal. The gyro sensor 180B may be used to determine a motion gesture of the terminal device 100. The air pressure sensor 180C is used to measure air pressure. The magnetic sensor 180D includes a hall sensor. The terminal device 100 can detect the opening and closing of the flip cover using the magnetic sensor 180D. The acceleration sensor 180E can detect the magnitude of acceleration of the terminal device 100 in various directions (typically three axes). A distance sensor 180F for measuring a distance. The proximity light sensor 180G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The ambient light sensor 180L is used to sense ambient light level. The fingerprint sensor 180H is used to collect a fingerprint. The temperature sensor 180J is for detecting temperature. The touch sensor 180K, also referred to as a "touch device". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The bone conduction sensor 180M may acquire a vibration signal.
The keys 190 include a power-on key, a volume key, etc. The keys 190 may be mechanical keys. Or may be a touch key. The motor 191 may generate a vibration cue. The indicator 192 may be an indicator light, may be used to indicate a state of charge, a change in charge, a message indicating a missed call, a notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card may be contacted and separated from the terminal apparatus 100 by being inserted into the SIM card interface 195 or by being withdrawn from the SIM card interface 195. The terminal device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support Nano SIM cards, micro SIM cards, and the like. The same SIM card interface 195 may be plugged into multiple frames of cards simultaneously. The multi-frame cards may be of the same type or of different types. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The terminal device 100 interacts with the network through the SIM card to realize functions such as call and data communication. In some embodiments, the terminal device 100 employs esims, namely: an embedded SIM card. The eSIM card can be embedded in the terminal device 100 and cannot be separated from the terminal device 100.
The present embodiment also provides a computer storage medium having stored therein computer instructions which, when executed on the terminal device 100, cause the terminal device 100 to execute the above-described related method steps to implement the process name acquisition method in the above-described embodiments.
The present embodiment also provides a computer program product which, when run on a computer, causes the computer to perform the above-described related steps to implement the process name acquisition method in the above-described embodiments.
In addition, embodiments of the present application also provide an apparatus, which may be embodied as a chip, component or module, which may include a processor and a memory coupled to each other; the memory is used for storing computer-executed instructions, and when the device runs, the processor can execute the computer-executed instructions stored in the memory, so that the chip executes the process name acquisition method in each method embodiment.
The terminal device, the computer storage medium, the computer program product, or the chip provided in this embodiment are used to execute the corresponding methods provided above, so that the beneficial effects thereof can be referred to the beneficial effects in the corresponding methods provided above, and will not be described herein.
From the foregoing description of the embodiments, it will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of functional modules is illustrated, and in practical application, the above-described functional allocation may be implemented by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to implement all or part of the functions described above.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another apparatus, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and the parts displayed as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated unit may be stored in a readable storage medium if implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a device (may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present application and not for limiting the same, and although the present application has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solution of the present application may be modified or substituted without departing from the spirit and scope of the technical solution of the present application.

Claims (12)

1. The process name acquisition method is applied to terminal equipment and is characterized in that the terminal equipment comprises an application process and a system process, the application process comprises a runtime module, and the method comprises the following steps:
if the application process is detected to crash, the runtime module acquires crash information and identification names of the application process;
the runtime module generates a name character string based on the identification name, adds the name character string to the crash information, and sends the crash information to the system process;
the system process identifies the name character string from the collapse information and obtains the identification name according to the name character string;
if the process information of the application process is not queried according to the process identification information of the application process, the system process takes the identification name as the process name of the application process.
2. The process name acquisition method according to claim 1, wherein the runtime module generates a name string based on the identification name, comprising:
and generating a name character string corresponding to the identification name according to the identification name and a preset character string construction rule, wherein the character string construction rule comprises the step of marking the identification name by adopting preset characters.
3. The process name acquisition method according to claim 1, wherein the method further comprises:
the system process deletes the name string from the crash information.
4. The process name acquisition method according to claim 1, wherein the crash information is a CrashInfo object.
5. The process name acquisition method according to claim 4, wherein the runtime module adding the name string to the crash information comprises:
and adding the name character string into field content corresponding to a target field in the CrashInfo object.
6. The process name acquisition method according to claim 5, wherein the runtime module adding the name string to field contents corresponding to a target field in the CrashInfo object includes:
and adding the name character string to the original field content of the target field.
7. The process name acquisition method according to claim 5, wherein the runtime module adds the name string to a field content corresponding to a target field in the CrashInfo object, including:
and adding the name character string to the original field content of the target field.
8. The process name acquisition method according to any one of claims 5 to 7, wherein the system process identifying the name string from the crash information includes:
and identifying the name character string from the collapse information according to the character string construction rule.
9. The process name acquisition method according to claim 8, wherein the character string construction rule marks the identification name with a first character and a second character, and wherein the identifying the name character string from the crash information according to the character string construction rule comprises:
starting from the last field of the field content corresponding to the target field, determining whether the second character exists in the field content according to the sequence from back to front;
if the second character exists, determining whether the first character exists in a field before the second character in the field content;
and if the first character exists in a field before the second character in the field content, determining the character strings consisting of the first character, the second character and the characters between the first character and the second character as the name character string.
10. The process name acquisition method according to claim 8, wherein the character string construction rule marks the identification name with a first character and a second character, and wherein the identifying the name character string from the crash information according to the character string construction rule comprises:
determining whether the first character exists in the field content from the target field in a front-to-back order;
if the first character exists, determining whether the second character exists in a field after the first character in the field content;
and if the second character exists in the field after the first character in the field content, determining the character string formed by the first character, the second character and the characters between the first character and the second character as the name character string.
11. A computer readable storage medium comprising computer instructions which, when run on a terminal device, cause the terminal device to perform the process name acquisition method according to any one of claims 1 to 10.
12. A terminal device, characterized in that the terminal device comprises a processor and a memory for storing instructions, the processor for invoking the instructions in the memory to cause the terminal device to perform the process name acquisition method according to any of claims 1 to 10.
CN202211449312.1A 2022-11-18 2022-11-18 Process name acquisition method, terminal equipment and storage medium Active CN116662045B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211449312.1A CN116662045B (en) 2022-11-18 2022-11-18 Process name acquisition method, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211449312.1A CN116662045B (en) 2022-11-18 2022-11-18 Process name acquisition method, terminal equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116662045A true CN116662045A (en) 2023-08-29
CN116662045B CN116662045B (en) 2024-06-18

Family

ID=87715946

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211449312.1A Active CN116662045B (en) 2022-11-18 2022-11-18 Process name acquisition method, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116662045B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104268473A (en) * 2014-09-23 2015-01-07 龙芯中科技术有限公司 Method and device for detecting application programs
CN106547782A (en) * 2015-09-22 2017-03-29 阿里巴巴集团控股有限公司 The acquisition methods and device of log information
CN107643980A (en) * 2017-08-21 2018-01-30 武汉斗鱼网络科技有限公司 A kind of method and apparatus for positioning crash info
CN109542714A (en) * 2018-09-29 2019-03-29 中国平安人寿保险股份有限公司 Method for monitoring application program and device, computer installation and computer storage medium
CN111459715A (en) * 2019-01-20 2020-07-28 华为技术有限公司 Application exception recovery
CN112311625A (en) * 2020-10-26 2021-02-02 珠海格力电器股份有限公司 Network management method and device, storage medium and electronic device
CN113672465A (en) * 2021-08-23 2021-11-19 一飞(海南)科技有限公司 Method, system, medium, terminal and unmanned aerial vehicle for generating process log system by process name
CN114003470A (en) * 2021-12-30 2022-02-01 北京中科网威信息技术有限公司 User mode process exception handling method, device, equipment and medium
CN115309547A (en) * 2022-07-31 2022-11-08 荣耀终端有限公司 Method and device for processing asynchronous binder call

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104268473A (en) * 2014-09-23 2015-01-07 龙芯中科技术有限公司 Method and device for detecting application programs
CN106547782A (en) * 2015-09-22 2017-03-29 阿里巴巴集团控股有限公司 The acquisition methods and device of log information
CN107643980A (en) * 2017-08-21 2018-01-30 武汉斗鱼网络科技有限公司 A kind of method and apparatus for positioning crash info
CN109542714A (en) * 2018-09-29 2019-03-29 中国平安人寿保险股份有限公司 Method for monitoring application program and device, computer installation and computer storage medium
CN111459715A (en) * 2019-01-20 2020-07-28 华为技术有限公司 Application exception recovery
CN112311625A (en) * 2020-10-26 2021-02-02 珠海格力电器股份有限公司 Network management method and device, storage medium and electronic device
CN113672465A (en) * 2021-08-23 2021-11-19 一飞(海南)科技有限公司 Method, system, medium, terminal and unmanned aerial vehicle for generating process log system by process name
CN114003470A (en) * 2021-12-30 2022-02-01 北京中科网威信息技术有限公司 User mode process exception handling method, device, equipment and medium
CN115309547A (en) * 2022-07-31 2022-11-08 荣耀终端有限公司 Method and device for processing asynchronous binder call

Also Published As

Publication number Publication date
CN116662045B (en) 2024-06-18

Similar Documents

Publication Publication Date Title
EP4027238B1 (en) Card rendering method and electronic device
CN112771900B (en) Data transmission method and electronic equipment
WO2021027630A9 (en) Patching method, related apparatus, and system
CN113254409B (en) File sharing method, system and related equipment
CN113973398B (en) Wireless network connection method, electronic equipment and chip system
CN114079893B (en) Bluetooth communication method, terminal device and computer readable storage medium
WO2021218429A1 (en) Method for managing application window, and terminal device and computer-readable storage medium
WO2022022466A1 (en) Method and apparatus for determining file storage position, and terminal
WO2021185352A1 (en) Version upgrade method and related apparatus
CN113504887A (en) Volume setting method and electronic equipment
CN116662045B (en) Process name acquisition method, terminal equipment and storage medium
CN115022982B (en) Multi-screen cooperative non-inductive access method, electronic equipment and storage medium
WO2021254294A1 (en) Method for switching audio output channel, apparatus, and electronic device
WO2022062902A1 (en) File transfer method and electronic device
WO2022052730A1 (en) Method and apparatus for repairing abnormal application exit, and electronic device
CN113050864B (en) Screen capturing method and related equipment
CN118301581B (en) Bluetooth device management method and electronic device
CN117076089B (en) Application management method, terminal device and storage medium
CN116709609B (en) Message delivery method, electronic device and storage medium
CN116743921B (en) Method for displaying number-carrying network number, electronic equipment and storage medium
CN114006969B (en) Window starting method and electronic equipment
CN116719376B (en) Voltage control method, device, equipment and storage medium
CN114945176B (en) Clipboard access control method, electronic equipment and storage medium
CN116662150B (en) Application starting time-consuming detection method and related device
CN116048324B (en) Desktop management method, electronic device and storage medium

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