Data processing method and apparatus, and device, storage medium and program product

By collecting and analyzing on-site information about non-responsiveness at the operating system level, identifying fault points and repairing them, the universal problem of application non-responsiveness in the operating system is solved, the stability of the system and applications is improved, and it is suitable for a variety of scenarios. .

WO2024012003A9PCT designated stage expired Publication Date: 2024-09-12TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/090470
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2022-07-13
Filing Date
2023-04-25
Publication Date
2024-09-12

AI Technical Summary

Technical Problem

Existing technologies are difficult to effectively solve the universal problem of application unresponsiveness (ANR) in operating systems, resulting in insensitive application responses and affecting user experience. Moreover, existing solutions are limited to specific scenarios and are not very versatile.

Method used

By collecting and analyzing on-site information about application unresponsiveness from the operating system level, we conduct commonality analysis to determine the fault point, and based on this, repair the system code to reduce the probability of occurrence of unresponsiveness.

Benefits of technology

It effectively solves the problem of application unresponsiveness from the operating system level, improves the stability of the system and applications, has strong versatility, and is suitable for a variety of scenarios, including cloud games, terminals, and simulators.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023090470_12092024_PF_FP_ABST
    Figure CN2023090470_12092024_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present application are a data processing method and apparatus, and a device and a storage medium. The method comprises: acquiring field information of each of various types of non-responding phenomena of a target application, wherein any non-responding phenomenon is generated during the process of running the target application on the basis of a system code of an operating system, and the field information is used for describing an execution situation of the system code when a corresponding non-responding phenomenon is generated; performing common-characteristic analysis on the field information of the various types of non-responding phenomena, so as to obtain a common-characteristic analysis result, and determining, from the system code and according to the common-characteristic analysis result, a fault point at which the non-responding phenomenon is generated; and performing repair processing on the system code according to the fault point, so as to run the target application on the basis of a repaired system code. The present application can be executed by a cloud server, such that a non-responding phenomenon of a target application can be solved in an operating system level, so as to reduce the probability of occurrence of any non-responding phenomenon; and the universality is high, and the overall stability can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Data processing method, device, equipment, storage medium and program product

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on July 13, 2022, with application number 202210819928.7 and application name “Data processing method, device, equipment and storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present invention relates to the field of computer technology, and in particular to data processing. Background Art

[0003] With the development of computer technology, the open source nature of some operating systems allows them to be redeveloped and customized. The more interesting and practical functions provided by the operating systems continue to bring people a convenient experience.

[0004] The operating system supports the running of various applications. However, if the application is not responsive enough, ANR (Application Not Responding) may occur, which affects the user experience. However, most current solutions to ANR are based on the analysis experience of others to locate the ANR problem encountered. They conduct specific analysis of the specific ANR problem, which is limited by specific scenarios such as the operating system version and application version. It does not necessarily guarantee that ANR will not occur again due to other reasons after the current ANR is resolved, and its universality is not strong.

[0005] Summary of the Invention

[0006] The embodiments of the present application provide a data processing method, apparatus, device, storage medium and program product, which can effectively solve the unresponsiveness of the target application from the operating system level, reduce the probability of any unresponsiveness phenomenon, have strong versatility, and improve overall stability.

[0007] In one aspect, an embodiment of the present application provides a data processing method, comprising:

[0008] Obtaining on-site information of various unresponsiveness phenomena among multiple unresponsiveness phenomena of a target application, wherein each unresponsiveness phenomenon is generated during the process of running the target application based on system code of an operating system; and each on-site information of the unresponsiveness phenomenon is used to describe: an execution status of the system code when the corresponding unresponsiveness phenomenon occurs;

[0009] Performing a commonality analysis on the on-site information of various unresponsive phenomena to obtain a commonality analysis result, and determining the fault point causing the unresponsive phenomenon from the system code based on the commonality analysis result; wherein the commonality analysis result includes: common information in the on-site information of the various unresponsive phenomena;

[0010] The system code is repaired according to the fault point, so as to run the target application based on the repaired system code.

[0011] In one aspect, an embodiment of the present application provides a data processing device, comprising:

[0012] an acquisition module, configured to acquire on-site information of various unresponsiveness phenomena of a target application, wherein each unresponsiveness phenomenon is generated during the process of running the target application based on system code of an operating system; and each on-site information of the unresponsiveness phenomenon is used to describe: an execution status of the system code when the corresponding unresponsiveness phenomenon occurs;

[0013] a processing module configured to perform commonality analysis on the on-site information of various unresponsive phenomena to obtain commonality analysis results, and determine the fault point causing the unresponsive phenomenon from the system code based on the commonality analysis results; wherein the commonality analysis results include: common information in the on-site information of the various unresponsive phenomena;

[0014] The processing module is used to repair the system code according to the fault point, so as to run the target application based on the repaired system code.

[0015] Accordingly, an embodiment of the present application provides a computer device, comprising: a processor, a memory, and a network interface; the processor is connected to the memory and the network interface, wherein the network interface is used to provide network communication functions, the memory is used to store computer programs, and the processor is used to call computer programs to execute the data processing method in the embodiment of the present application.

[0016] Accordingly, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it executes the data processing method in the embodiment of the present application.

[0017] Accordingly, an embodiment of the present application provides a computer program product, which includes a computer program or computer instructions. When the computer program or computer instructions are executed by a processor, the data processing method of the embodiment of the present application is implemented.

[0018] In an embodiment of the present application, field information of various unresponsive phenomena of the target application can be obtained, and any of the unresponsive phenomena can be generated in the process of running the target application based on the system code of the operating system, and the corresponding field information can be used to describe the execution of the system code when the unresponsive phenomenon occurs. By performing a common analysis on the field information of various unresponsive phenomena obtained, the execution of the system code can be analyzed from the operating system level, and the common characteristics of the target application generating various unresponsive phenomena can be found from the bottom layer to obtain the common analysis results. Based on the common analysis results, the fault point that generates the unresponsive phenomenon can be determined from the system code, and the system code can be repaired based on the fault point. Running the target application based on the repaired system code can intercept the possible application unresponsiveness phenomenon (i.e., the target application unresponsiveness phenomenon) from the operating system side, and avoid the occurrence of application unresponsiveness as much as possible. It can be seen that this method starts from the operating system level, collects on-site information of various actual unresponsive phenomena, analyzes common characteristics, and repairs the system code of the native operating system based on the results of the analysis. It can fundamentally solve the problem of unresponsive applications on the operating system. It has strong versatility and can reduce the occurrence of any unresponsive phenomenon in the target application on the operating system, thereby effectively improving the stability of the system or application. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] FIG1a is a schematic diagram of a classification of application unresponsiveness provided by an embodiment of the present application;

[0020] FIG1b is a schematic diagram of a process for triggering an application unresponsiveness phenomenon provided by an embodiment of the present application;

[0021] FIG1c is a schematic diagram of a process of starting a service provided in an embodiment of the present application;

[0022] FIG1d is a schematic diagram of a process of generating a no-response phenomenon of a service type provided by an embodiment of the present application;

[0023] FIG1e is a schematic diagram of a process of generating a broadcast-type no-response phenomenon provided by an embodiment of the present application;

[0024] FIG1f is a schematic diagram of a process of generating a non-responsive phenomenon of a content provision type provided by an embodiment of the present application;

[0025] FIG1g is a schematic diagram of a process of generating a no-response phenomenon of an input distribution type provided by an embodiment of the present application;

[0026] FIG2a is an architecture diagram of a cloud gaming system provided in an embodiment of the present application;

[0027] FIG2 b is a schematic diagram showing a prompt of an unresponsive phenomenon in a cloud game provided by an embodiment of the present application;

[0028] FIG2c is a schematic diagram of the underlying interaction logic of a system in a server in a cloud gaming scenario provided by an embodiment of the present application;

[0029] FIG3a is a flow chart of a data processing method provided in an embodiment of the present application;

[0030] FIG3 b is a schematic diagram of on-site information of an unresponsive phenomenon generated in a cloud gaming scenario provided by an embodiment of the present application;

[0031] FIG4 is a flow chart of another data processing method provided in an embodiment of the present application;

[0032] FIG5 is a flow chart of another data processing method provided in an embodiment of the present application;

[0033] FIG6 a is a result diagram of a parent process call stack provided by an embodiment of the present application;

[0034] FIG6 b is a schematic diagram of a logic code of an objective function provided in an embodiment of the present application;

[0035] FIG7 is a schematic structural diagram of a data processing device provided in an embodiment of the present application;

[0036] FIG8 is a schematic structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] In order to better understand the solutions of the embodiments of the present application, the relevant terms and concepts that may be involved in the embodiments of the present application are first introduced below.

[0038] Operating System (OS): An operating system is a computer program that manages computer hardware and software resources. It is the most fundamental system software in a computer system. An operating system provides functions such as processor management (e.g., process control and synchronization), memory management (e.g., memory allocation and deallocation, address mapping), device management (e.g., file storage space management and file access and write management), and file management (e.g., buffer management and virtual devices). There are many different types of operating systems, including the common Android (or Android system), Linux, Windows, and iOS.

[0039] Kernel: The kernel is the core of the operating system. The kernel can convert input commands into machine language that the computer hardware can understand. The kernel is in direct contact with the hardware and can inform the hardware of requests initiated by the application. The functions of the kernel include but are not limited to: process management, task scheduling, memory management, etc. Among them, file management refers to the kernel using the file system to organize files, and keeping track of file data storage, file status, and access settings through the file system; process management refers to the kernel deciding which process is run first by the CPU (Central Processing Unit) in a multi-process environment, and how long the allocated running time slice is; memory management means that the kernel can detect memory space, generate or destroy memory to ensure that the application is executed correctly.

[0040] Hardcoding: An application development practice that embeds data directly into the source code of a program or other executable object. Unlike data obtained externally or generated at runtime, hardcoding can typically only be modified by editing the source code and recompiling the executable. In computer programs or text editors, hardcoding is the practice of replacing mutable variables with fixed values.

[0041] ANR: The full name of ANR in English is Application Not Responding, and its Chinese name is Application Not Responding (can be abbreviated as No Response). ANR is a very common phenomenon in operating systems (such as Android systems). For developers, it may be a bug (error) in the code, but for users, it may cause a bad user experience. The operating system needs to complete some events within a certain period of time. If no effective response is obtained after the scheduled time or the response time is too long, ANR will be caused. Generally speaking, a prompt box will pop up on the system interface to inform the object that the current application is not responding. The object can choose to continue waiting (Wait) or force close (Force close). This is a self-protection mechanism of the operating system. In addition, when an application becomes unresponsive, the process where the application becomes unresponsive can be directly closed without popping up a prompt box to prompt the object.

[0042] Target Application: In this application, the target application refers to any application running on a computer device, such as an application in a terminal or a service program in a server. According to the installation method of the application, the target application can be an installation-free application (such as a mini-program, a web application (such as a shopping website)), or a third-party application installed on the computer device. According to the application function, the target application can specifically be any of the following: game applications, audio and video applications, social applications, shopping applications, etc.

[0043] The target application can run based on the environment provided by the operating system. In the process of running the target application based on the system code of the operating system, the target application may become unresponsive (i.e., ANR). In an embodiment of the present application, the ANR generated by the target application may include the following categories: service-type unresponsiveness, broadcast-type unresponsiveness, content-providing-type unresponsiveness, and input-distribution-type unresponsiveness. Taking the Android operating system as an example, the service-type unresponsiveness refers to the unresponsiveness triggered by the service not being completed within a predetermined time (e.g., 20s) (Service Timeout); the broadcast-type unresponsiveness refers to the unresponsiveness triggered by the broadcast not being completed within a predetermined time (e.g., 10s) (BroadcastQueue Timeout); the content-providing-type unresponsiveness refers to the unresponsiveness triggered by the content provider timing out after publishing (ContentProvider Timeout); the input-distribution-type unresponsiveness refers to the unresponsiveness triggered by the input event distribution timeout (InputDispatching Timeout). The above four types of ANR can be classified into the classification diagram of application unresponsiveness as shown in Figure 1a. The generation process (or triggering mechanism) of various types of unresponsiveness phenomena in the above-mentioned applications will be introduced one by one below.

[0044] From the perspective of the system source code of the operating system, the process of triggering ANR can be specifically divided into three steps, as shown in Figure 1b, including: setting the duration threshold, lifting the triggering condition of application unresponsiveness (that is, the unresponsiveness of the application, referred to as ANR), and triggering application unresponsiveness (that is, ANR). By setting the duration threshold, it can be determined whether the actual processing duration of the corresponding event has timed out (that is, the actual processing duration is greater than the set duration threshold). The duration threshold can be set according to the corresponding ANR, and the duration thresholds of different ANRs may be the same or different. If it times out, ANR is triggered. If there is no timeout, ANR will not be triggered, and the ANR triggering condition will be lifted. Here, lifting the ANR triggering condition means canceling the original set duration threshold.

[0045] The following is a detailed introduction to the generation process of various ANRs. Here, we first introduce the common concepts and some terminology involved in the following application unresponsiveness phenomena.

[0046] The target application refers to any application currently running in the computer device. The application process of the target application can interact with the underlying processes of the operating system (such as system service processes) to complete corresponding events.

[0047] The system service process is responsible for launching and managing the entire Java framework. Important system services, such as the Activity Manager Service (AMS) and the Window Manager Service (WMS), are enabled within the system service process. In the Android operating system, the Zygote process (the process used to incubate new processes, referred to here as the incubator) can incubate system service processes and target application processes. The following description uses the system service process within the operating system as the execution entity.

[0048] The Android operating system consists of four major components: Activity, Service, Broadcast Receiver, and Content Provider. ① An Activity (component) is a visual interface for object operations, providing a window for objects to complete operational instructions. ② A Service (service) is an application component that can perform long-running operations in the background without an object interface. Because services typically run in the background and generally do not need to interact with objects, Service components do not have a graphical object interface. Service components are typically used to provide background services for other components or to detect the operating status of other components. ③ A Broadcast Receiver (broadcast receiver) can be used to filter and respond to external events of interest to an application (such as incoming phone calls or the availability of a data network). A Broadcast Receiver can launch an Activity or Service in response to received information or use the NotificationManager (notification manager) to notify objects, such as playing a sound notification or displaying a message in the status bar. ④ A Content Provider (content provider) enables an application's specified data set to be made available to other applications. Other applications can retrieve or store data from the content provider through the ContentResolver class. Specifically, ContentProvider publishes data and can be called through the ContentResolver object in combination with Uri (Universal Resource Identifier). Among them, Uri represents the address of data operation, and each ContentProvider has a unique address when publishing data.

[0049] (1) Unresponsiveness of service types.

[0050] The process of generating the service type unresponsiveness phenomenon includes: responding to the service creation request sent by the application process of the target application and setting a service duration threshold; sending a service creation message to the service process so that the service process notifies the service process to call one or more other processes to perform the service creation work based on the service creation message, and returns feedback information after successfully creating the service; if the feedback information returned by the service process is not received within the service duration threshold, the service type unresponsiveness phenomenon occurs.

[0051] The service creation request sent by the application process of the target application can be used to request the system to create the services required by the target application, such as a listening service or a notification service. In a cloud gaming scenario, this listening service, for example, listens to whether a player's account is logged in or whether the player is online. In response to the service creation request initiated by the application process, the system service process can set a service duration threshold. This service duration threshold can be used to detect whether the service creation has timed out. For example, the foreground service duration threshold and the background service duration threshold are both 20 seconds. The system service process can then send a service creation message to the service process, causing the service process to call one or more processes to perform the service creation task. This service creation task can then create the service required by the target application. The service process can be pre-created by a component in the system service process to manage service requests. Specifically, the main thread in the service process can call one or more other processes (i.e., processes other than the service process) to perform the service creation task. These one or more processes can include processes with a parent-child relationship, and the parent and child processes can share address space. After the service creation task is completed, the main thread in the service process can send feedback information to the system service process. The feedback information here can be a notification message indicating the completion of service creation. If no feedback is received from the service process within the service duration threshold, it indicates that the service creation time is greater than or equal to the service duration threshold, resulting in a service timeout and, in turn, a service-type unresponsiveness phenomenon. Conversely, if feedback is received from the service process within the service duration threshold, it indicates that the service creation time is less than the service duration threshold and no service-type unresponsiveness phenomenon will occur.

[0052] Taking the Android operating system's ANR as an example, the above content will be explained. A service timeout occurs when starting a service. Services can be categorized into two types: foreground services, with a timeout (i.e., service duration threshold) of 20 seconds; and background services, with a timeout of 200 seconds. Starting a service in the target application can be accomplished with a single line of code by calling the startService API. From the Android operating system perspective, the process is illustrated in the simplified startService flowchart shown in Figure 1c. The service creation and startup process is primarily handled by the component management service (AMS, ActivityManagerService) within the system service process. The AMS communicates with Zygote via a socket (a communication method) to request the creation of a process (Create Process) to host the service, including requesting the creation of a thread (ActivityThread, the main thread). Services run in a separate creation process. For local services, the service start process can be omitted; the ActivityThread acts as the application's main thread. Zygote then forks the Zygote process to create a new process and loads the ActivityThread-related resources into the new process. AMS sends a request to create a service to the ActivityThread in the newly generated process through Binder (a cross-process communication mechanism between processes). The ActivityThread starts running the service, specifically by calling the onCreate method to create the service (createservice).

[0053] As shown in Figure 1d, when the application process (i.e., APP process) initiates a request to create a service (startService) (as shown in step 1 in the figure), the system service process (i.e., system_server process) in the system will allocate an idle thread binder_1 (i.e., communication thread 1) to receive the request, and then send a service timeout message SERVICE_TIMEOUT_MSG to the component manager ActivityManager to set the service duration threshold (as shown in step 2 in the figure); next, binder_1 notifies the service process (i.e., service process) of binder_3 (i.e., communication thread 3) to prepare to perform processing work (scheduling to create a service scheduleCreateService) (as shown in step 3 in the figure); after receiving it, binder_3 hands it over to the main thread (i.e., main thread, which can correspond to the main thread ActivityThread in Figure 1c) , add the service creation event to the task queue of the main thread (i.e. send message sendMessage) (as shown in step 4 in the figure); next, the main thread will perform a series of tasks, specifically the service creation work here, which may include the process of creating the service by the ActivityThread thread in Figure 1c (as shown in step 5 in the figure), and complete the startup of the service life cycle (waiting for completion waitToFinish); after completing the above work, the main thread will report to the system_server process that the work has been completed (i.e. completion of the service creation work serviceDoneExecuting), and then the binder_2 thread (i.e. communication thread 2) in the system_server process will receive the message (as shown in step 6 in the figure). If the service creation work is completed within the service duration threshold, the ANR trigger condition can be lifted and ANR will not occur, otherwise ANR will occur.

[0054] (2) Broadcast type of non-response phenomenon.

[0055] The process of generating the broadcast type unresponsiveness phenomenon includes: responding to the broadcast request initiated by the application process of the target application and setting a broadcast duration threshold; sending a broadcast registration message to the broadcast receiving process so that the broadcast receiving process notifies the broadcast receiving process to call one or more other processes to perform the broadcast work based on the broadcast registration message, and returns feedback information after the broadcast is completed; if the feedback information returned by the broadcast receiving process is not received within the broadcast duration threshold, a broadcast type unresponsiveness phenomenon occurs.

[0056] The broadcast mechanism is used for communication between processes / threads, and broadcasts can be divided into broadcast sending and broadcast receiving. Broadcasts can include parallel broadcasts and serial broadcasts. Usually, the unresponsiveness of applications occurs in the scenario of serial broadcasts. Similar to the generation process of service-type ANRs, the system service process can respond to the broadcast request initiated by the application process of the target application and set the broadcast duration threshold. The application process of the target application is the process where the broadcast sender is located. The system service process can send a broadcast registration message to the broadcast receiving process so that the main thread in the broadcast receiving process can call one or more other processes to perform the broadcast work. These one or more processes may include processes with a parent-child relationship, and the parent and child processes can share the address space.

[0057] The broadcast receiving process is the process where the broadcast receiving end is located, which can be used to receive broadcast messages from other applications or the system. The broadcast work can specifically broadcast various events, such as broadcasts of date changes, broadcasts of system startup completion, etc. In the cloud gaming scenario, the broadcast events are, for example, network switching broadcasts, network failure broadcasts, and so on. Before executing the broadcast work, a broadcast receiving queue can be created based on the broadcast registration message to process the received broadcast events in an orderly manner. After the main thread completes the processing of the broadcast work, feedback information can be returned. The feedback information is a notification message indicating that the broadcast work is completed. If the feedback information returned by the broadcast receiving process is not received within the broadcast duration threshold, the time spent on the broadcast work is greater than or equal to the broadcast duration threshold, and a broadcast timeout occurs, resulting in a broadcast type of unresponsiveness. On the contrary, if the feedback information returned by the broadcast process is received within the broadcast duration threshold, it means that the time spent on the broadcast creation work is less than the broadcast duration threshold, and no broadcast type of unresponsiveness will occur.

[0058] Taking the ANR of the Android operating system as an example, the broadcast type ANR is introduced in more detail. Specifically, it can be combined with the schematic diagram of the generation process of the broadcast type ANR shown in Figure 1e. When the application process of the target application initiates a send broadcast request (sendBroadcast) (as shown in step 1 in the figure), the system service process can allocate an idle thread binder_1 (ie, communication thread 1) to receive the send broadcast request, and then send a broadcast timeout message BROADCAST_TIMEOUT_MSG (sendMessage) to the component manager ActivityManager to set the broadcast duration threshold (as shown in steps 2-3 in the figure). Next, binder_1 notifies the binder_3 thread (ie, communication thread 3) of the broadcast receiving process (ie, Reciver process) through a broadcast registration message to prepare to perform processing work (as shown in step 4 in the figure); after receiving it, binder_3 sends a message to the main thread (ie, main thread) to add the event to m The task queue of the ain thread (communication thread 3 sends a message to the main thread, sendMessage, as shown in step 5 in the figure); next, the main thread will perform a series of tasks, including the start of the broadcast work life cycle including the broadcast reception. If it is found that the current process still has SP (SharedPreferences, a data storage method) writing to the file, it is necessary to wait for the SP data to be persisted (that is, the main thread sends a message to the queued work loop thread, sendMessage, as shown in step 6 in the figure), and the queued-work-looper thread (queued work loop thread) reports to the system_server process that the broadcast work has been completed (as shown in step 7 in the figure). Otherwise, the main thread can directly report that the broadcast work has been completed (that is, finishReceiver). Then the binder_2 thread (that is, communication thread 2) in the system_server process will receive the message. If all work is completed within the broadcast duration threshold, the trigger condition of ANR can be lifted and ANR will not occur (step 8 in the figure), otherwise ANR will occur.

[0059] (3) Unresponsiveness of content provider types.

[0060] The process of generating the content provision type unresponsiveness phenomenon includes: responding to a request for obtaining a content provision object initiated by the application process of the target application, detecting the startup status of the content provision process corresponding to the content provision object; if the startup status indicates that the content provision process is not started, creating a content provision process, and notifying the content provision process to call one or more other processes, install the content provision object, and return feedback information after installing the content provision object. The content provision object is configured with an installation time threshold; if no feedback information returned by the content provision process is received within the installation time threshold, the content provision type unresponsiveness phenomenon occurs.

[0061] The content provider object is used to implement data sharing functionality between different applications. The content provider process is used to install and publish the content provider object to provide content data and implement data sharing functionality. The system service process can respond to a request for obtaining the content provider object initiated by the application process of the target application and detect the startup status of the content provider process. If the content provider process is not started, it means that the content provider process may not have been created. In this case, the content provider process can be created and started. After creation, the content provider process can register itself with the system service process and set an installation time threshold. After that, the content provider process is notified to perform the installation of the content provider object, which can be specifically performed by the main thread in the content provider process calling one or more other processes. These one or more processes may include processes with a parent-child relationship, and the parent and child processes can share address space.

[0062] Feedback information can be returned after the installation is complete. The feedback information is a notification message indicating that the work of installing the content provider object is completed. It can also be used to indicate the release of the content provider object to return the content data provided by the acquired content provider object. In the cloud gaming scenario, the content provider object can be an address book in the system, and the content data provided can be relevant data of the contacts in the address book. It can be understood that in the specific implementation of the present application, when the above embodiments of the present application are applied to specific products or technologies, it is necessary to obtain permission or consent from the object, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0063] If no feedback is received from the content provision process within the installation time threshold, the installation time is greater than or equal to the installation time threshold, resulting in a content provision timeout and, consequently, a content provision-type unresponsiveness event. Conversely, if feedback is received from the content provision process within the installation time threshold, the installation time of the content object is less than the installation time threshold, and no content provision-type unresponsiveness event will occur.

[0064] Taking the ANR of the Android operating system as an example, the ANR of the content provider type is introduced in more detail. Specifically, it can be combined with the schematic diagram of the generation process of the broadcast type ANR shown in Figure 1f. When the application thread of the target application initiates a request to obtain the content provider object ContentProvider (getContentProvider) (as shown in step 1 in the figure), the system service process can allocate an idle thread binder_1 (ie, communication thread 1) to receive the request to obtain ContentProvide. If it is detected that the ContentProvider has not been started, a new process is first forked through Zygote (ie, through Zygote Fork creates a new process, as shown in step 2 in the figure), the new ContentProvider process registers itself with the system (attachment lock, additional application lock); the communication thread binder_2 (communication thread 2) of the system_server process receives the registration message (step 3 in the figure), and sends the content provider object release timeout message CONTENT_PROVIDER_PUBLISH_TIMEOUT_MSG message to the ActivityManager inside the system_server process to set the installation time threshold (step 4 in the figure); next, binder_2 notifies the binder_4 thread (communication thread 4) of the provider process (content provider process) to prepare for processing (binding application, bindApplic ation, as shown in step 5 in the figure); after receiving it, binder_4 hands it to the main thread (that is, sends a message to the main thread, sendMessage, as shown in step 6 in the figure), and adds the event to the task queue; next, the main thread will perform a series of tasks, here is the installation of the content provider object, optionally, it can also include the work of publishing the content provider object, and then report to the system_server process that the installation work is completed, and return the content data of the obtained content provider object (publish the content provider object, publishContentProvider, as shown in step 7 in the figure), and then the binder_3 thread in the system_server process (that is, communication thread 3) receives the message. If all the work is completed within the installation time threshold, the trigger condition of ANR can be lifted and ANR will not occur (as shown in step 8 in the figure), otherwise ANR will occur.

[0065] (4) Unresponsiveness of input event distribution type.

[0066] The process of generating the unresponsiveness phenomenon of the input event distribution type includes: if an input event is received, the currently received input event is added to the input queue, and the input distribution thread is awakened. The input distribution thread is used to distribute each input event in the input queue to the application process of the target application in sequence for processing; when the distribution order of the currently received input event arrives, the application process of the target application is processing other input events, and the unresponsiveness phenomenon of the input event distribution type occurs.

[0067] Specifically, the thread in the system service process can listen to the input events reported by the bottom layer, and when receiving the input event, it can add it to the input queue to wait for distribution and processing. At the same time, the input distribution thread can be awakened to distribute the input events in the input queue, and the distribution start time can be set at this time. When the distribution order of the currently received input event arrives, for example, when the distribution time point of the currently received input event is reached, if the application process of the target application is still processing other input events, it means that the application process cannot process the currently received input event to be distributed, and an unresponsive phenomenon of the input event distribution type will occur. In the cloud game scenario, the input event can specifically be an operation event of an object in the game client. The operation event arrives at the server running the cloud game in the form of an operation stream, but cannot be processed, and an ANR occurs.

[0068] In another implementation, when the distribution order of the currently received input event arrives, if the application process of the target application has not processed other input events, the currently received input event will be distributed to the application process through the input distribution thread, so that the application process will call one or more other processes to process the currently received input event and return feedback information after the processing is completed; if the feedback information returned by the application process is not received within the processing time threshold, an unresponsive phenomenon of the input event distribution type will occur.

[0069] When a currently received input event reaches the distribution order, for example, based on the distribution start time and processing duration threshold, the distribution time of the input event is determined. The currently received input event can be distributed to the application process through the input distribution thread, specifically to the target window of the application process. The application process can call one or more other processes to process the currently received input event and return feedback information after processing is complete. The feedback information is a notification message indicating the completion of the input event. The one or more processes called may include processes with a parent-child relationship, and the parent and child processes can share address space.

[0070] If no feedback is received from the application process within the processing time threshold, and a new input event is received, this indicates that the currently received input event was not fully processed within the specified processing time threshold, and the next input event will wait for the processing of the currently received input event, resulting in an input event dispatch-type unresponsiveness phenomenon. Conversely, as long as no new input event is received while processing the currently received input event, regardless of whether feedback is received from the application process within the processing time threshold or whether feedback is received from the application process within the processing time threshold, an input event dispatch-type unresponsiveness phenomenon will not occur.

[0071] Taking the ANR of the Android operating system as an example, the input event distribution type ANR is introduced in more detail. Specifically, it can be combined with the schematic diagram of the generation process of the input event distribution type ANR shown in Figure 1g. First, the InputReader thread (i.e., the input reading thread) listens to the input events reported by the bottom layer through the EventHub (event center). Once the input event is received, it is placed in the mInBoundQueue queue (input queue, used to store the input events to be distributed) and wakes up the InputDispatcher thread (input distribution thread) (as shown in step 1 in the figure); the InputDispatcher thread starts input event distribution, sets the distribution starting time, first checks whether there is an event being processed, if not, takes out the event at the head of the mInBoundQueue queue, and then checks whether the window is ready; when the window is ready, the event is moved to the outBoundQueue queue (output queue, used to store input events to be distributed to the target window); at this time, if the application pipeline is connected normally at the other end The data is taken out of outBoundQueue and put into the waitQueue queue (wait queue, used to store input events waiting for the target window to process) (as shown in steps 2-4 in the figure), and then the InputDispatcher sends a message to inform the target application to prepare for processing; at this time, the main thread of the target application (that is, the main thread) receives the input event and forwards the received input event to the target window for processing layer by layer; after completing the above work, a message will be sent to the system_server process to report the completion of the work (that is, send a completion signal, as shown in step 7 in the figure), and then the system will remove the event from the waitQueue queue; if the current input system is processing a time-consuming operation (such as file operation), each subsequent input event will detect whether the previous input event has timed out, and if so, ANR will be generated.

[0072] Based on the above introduction to the specific principles of ANR and the analysis of the source code (i.e., system code) of the operating system where ANR occurs, it can be seen that the application processes in ANR in scenarios such as Service, BroadcastQueue, ContentProvider, and Input will interact with the system_server process, and will send requests to Zygote to create new processes (partially not shown, it can be understood that the creation of new processes can be achieved through the Zygote process). These are all contents in the underlying operating system.

[0073] In order to solve the ANR problem, the present application provides a solution for repairing the system code to solve the unresponsiveness of the application. Specifically, the on-site information of various unresponsiveness phenomena of the target application can be collected. Based on the on-site information, the execution status of the system code when the target application produces the unresponsiveness phenomenon can be known. By performing a common analysis on the various collected unresponsiveness on-site information, the common analysis results can be determined. The so-called common analysis refers to the analysis of finding common elements. Based on the common analysis results obtained by the common analysis, the fault point that produces the unresponsiveness phenomenon can be determined from the system code of the operating system, so as to repair the system code based on the fault point. In this way, running the target application based on the repaired system code can effectively reduce the probability of the unresponsiveness phenomenon, reduce the situation where the target application or operating system crashes due to the unresponsiveness phenomenon, and is conducive to the stable operation of the system and application. Starting from the perspective of the underlying system, this solution fundamentally solves the problem of application unresponsiveness on the operating system by repairing the system code of the operating system at the operating system level. This is a root solution with universality.

[0074] It can be seen that starting from the operating system level, in-depth research on the generation process of ANR in the operating system, understanding the ANR triggering principle, and analyzing the underlying architectural logic when several types of ANR occur from the source code of the operating system, it is possible to modify the architectural logic of ANR triggering in the operating system by changing the system call function, solving the ANR problem on the operating system from the root, reducing the number of application or system crashes, and improving the compatibility and stability of the system and applications. Since the native operating system is being modified and no hard coding is used, it is not strongly bound to a specific platform and can be applied to various scenarios such as cloud games, terminals, and simulators. It has strong scenario versatility and can handle multiple ANRs, effectively avoiding various ANR problems.

[0075] It is understandable that this solution can be applied to various scenarios where applications become unresponsive, such as terminals, simulators, and cloud gaming scenarios. When applied to cloud gaming scenarios, it can solve the ANR problem in cloud gaming scenarios, improve the compatibility and stability of the cloud gaming platform, and enhance the user experience. Among them, the target application can be a cloud gaming application. The so-called cloud gaming refers to an online gaming technology based on cloud computing technology.

[0076] Cloud computing technology is a type of cloud technology. The so-called cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network within a wide area network or local area network to achieve data computing, storage, processing, and sharing. Among them, cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, enabling various application systems to obtain computing power, storage space, and information services as needed. The network that provides resources is called a "cloud." To users, the resources in the "cloud" are infinitely scalable and can be accessed at any time, used on demand, expanded at any time, and paid for on a per-use basis. As a provider of basic cloud computing capabilities, a cloud computing resource pool (referred to as a cloud platform, generally referred to as an IaaS (Infrastructure as a Service) platform) will be established. Various types of virtual resources will be deployed in the resource pool for external customers to choose to use. The cloud computing resource pool mainly includes: computing devices (virtualized machines, including operating systems), storage devices, and network devices. In this application, cloud computing technology can also be used for the common analysis of on-site information.

[0077] In a cloud gaming scenario, games can be run on cloud servers. High-cost rendering calculations can be performed on these servers, and the images and sounds are transmitted to the player's gaming terminal via the network using audio and video streams. User operation instructions are then transmitted to the cloud server via operation streams for corresponding calculations. Benefiting from the rapid development of current mobile communication technologies, such as 5G (5th Generation Mobile Communication Technology), higher transmission bandwidth and stronger concurrency capabilities have led to lower network latency, creating more development opportunities and greater potential for cloud gaming.

[0078] The environment for running cloud games can be called a cloud gaming environment. In this cloud gaming environment, multiple operating systems can be run on one or more independent servers (such as servers using ARM / x86 architectures) by running system containers, and the relevant images can be transmitted to a remote receiving program for processing via video streaming. The ARM architecture is a 32-bit or 64-bit reduced instruction set processor architecture, and the x86 architecture is a computer language instruction set executed by microprocessors. Containers are a type of operating system-level virtualization that can be used to host operating systems. Through isolation mechanisms (such as namespaces), containers enable: in kernel mode, multiple operating systems (i.e., server operating systems and device operating systems) to share the same kernel; in user mode, multiple operating systems remain independent of each other. Server operating systems here refer to general-purpose operating systems within servers, such as Linux and Android; device operating systems refer to operating systems within containers, such as Android and iOS.

[0079] Correspondingly, a system container refers to an instance of a container, which can be run based on a server operating system (such as a Linux operating system); for example, the system container can be an Android container running on a Linux operating system, and the Android container loads an Android image. The so-called image is a form of file storage; by merging multiple files into one image file through the image, the distribution and use of files can be facilitated. It should be understood that the system container mentioned in the embodiment of the present application is not limited to the Android container; for example, if the IOS operating system supports open source research and development, the system container can also be an IOS container, and so on. It can be seen that in the cloud gaming environment proposed in the embodiment of the present application, a large number of system containers can be deployed on an independent server, making full use of the powerful CPU (Central Processing Unit) and GPU (Graphics Processing Unit) capabilities of the server side to achieve high concurrency in the execution of system operations and improve the running speed of cloud games.

[0080] The cloud gaming environment can be supported by corresponding operating resources provided by the devices in the cloud gaming system. Referring to the architectural diagram of the cloud gaming system shown in FIG2a, the cloud gaming system may include at least one edge server 11, multiple game clients 12, and at least one analysis server 13. Among them, the edge server is a server running a cloud game. At least one system container can be deployed in each edge server as shown in FIG2a, and one or more game APPs (Applications) can be installed in the system container. One or more cloud games can be run through these game APPs. In this way, cloud games can be run through the system container. Each system container can be connected to at least one game client 12, so that the game screen and sound transmission of the cloud game are connected to the game client 12. In addition, when an ANR occurs during the process of the edge server 11 running the cloud game, a prompt can be displayed on the game client 12, as shown in FIG2b.

[0081] The analysis server 13 is a server for analyzing the phenomenon of application non-response. During the operation of the cloud gaming application in the system container in at least one edge server 11, there may be different types of non-response phenomena in the applications in one or more edge servers. At this time, the analysis server 13 can collect the on-site information generated when at least two non-response phenomena occur in a cloud gaming application in the edge server 11, and perform a common analysis on the on-site information of various non-response phenomena. Based on the results of the common analysis, the common fault point that produces the non-response phenomenon is found, the system code of the operating system is repaired through the common fault point, and the cloud gaming application is run based on the repaired system code to solve the problem of application non-response. In another embodiment, the above work can also be performed by a target edge server, that is, any edge server in at least one edge server 11 can obtain on-site information of multiple non-response phenomena, and repair the system code of the operating system based on the same principle as above to solve and circumvent the application non-response phenomenon.

[0082] It should be noted that the edge server and analysis server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms, but is not limited to these.

[0083] The game client 12 can be a terminal device that provides basic capabilities such as streaming media playback, human-computer interaction, and communication. It can also be an application running on the terminal device. Terminal devices include, but are not limited to, mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, aircraft, and other devices, which are not limited in this application. It should be understood that Figure 2a is merely an exemplary representation of the system architecture of a cloud gaming system and does not limit the specific architecture of the cloud gaming system. For example, in other embodiments, the cloud gaming system may also include a backend server for scheduling, etc.

[0084] Based on the cloud gaming environment and cloud gaming system introduced above, for cloud gaming deployed on the server side, its underlying layer can be based on containerization technology, system and kernel technology, and on this basis, it can also combine audio and video technology, network optimization, computing resource management and other aspects to create a corresponding cloud gaming platform (which can provide a running environment and services for cloud gaming), in which a variety of cloud games can be run. Below, taking the underlying layer of cloud gaming based on the Android native operating system and the Linux kernel as an example, the interaction logic related to the system level of the cloud gaming operation process is exemplified. As shown in Figure 2c, the underlying interaction logic of the system in the server specifically involves the interaction between the system container, the Linux kernel and the hardware provided by the server.

[0085] In the process of running cloud games in the system container, the system container or the game APP in the system container can send an operation request to the operating system, and the operating system interacts with the Linux kernel therein, and the Linux kernel receives the operation request. Based on the operation request, the Linux kernel can call the relevant hardware (such as one or more of the central processing unit, graphics processor, memory, etc.) to complete the operation corresponding to the operation request. After the hardware executes the operation request, the operation result corresponding to the operation request can be returned to the system container through the Linux kernel. For example, when the operation request is a rendering request, the graphics processor (GPU, Graphics Processing Unit) provided by the server can be called based on the rendering request to execute the rendering event corresponding to the rendering request, obtain the rendered game screen, and return the rendered game screen through the Linux kernel. In one implementation, the encoding module in the system container can also be called to perform image compression processing on the returned game screen to obtain a compressed image. During the image compression process, the underlying hardware resources can be called by the Linux kernel for encoding to obtain encoded data (i.e., compressed image), and the compressed image is returned to the operating system through the Linux kernel. After obtaining the encoded data, the compressed image is transmitted to the game client in the form of a video stream.

[0086] Since cloud gaming is also based on the operating system, and ANR is a common phenomenon in operating systems, you may also encounter ANR issues when running cloud games. You can use the solution mentioned above to fix the system code to solve the application unresponsiveness problem.

[0087] Based on the above-mentioned solution of repairing the system code to solve the problem of application unresponsiveness, the present application provides a data processing method, which can be executed by a computer device, which can be a terminal or a server. When the target application is a cloud gaming application, the computer device here can be, for example, any analysis server 13 in the cloud gaming system shown in Figure 2a. Of course, the data processing method can also be executed jointly by the terminal and the server, and there is no limitation to this; for ease of understanding, the following description is based on the example of the data processing method being executed by a computer device.

[0088] It is understandable that the terminal can be a mobile phone, computer, intelligent voice interaction device, smart home appliance, vehicle terminal, aircraft and other devices, and this application does not limit this. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, but is not limited to these.

[0089] Please refer to FIG3a, which is a flowchart of a data processing method provided in an embodiment of the present application. The data processing method may include the following S301-S303:

[0090] S301 : Acquire on-site information of various unresponsiveness phenomena among multiple unresponsiveness phenomena of a target application.

[0091] Multiple unresponsiveness phenomena of the target application refer to at least two unresponsiveness phenomena of the target application, such as at least two of the service type unresponsiveness phenomenon, broadcast type unresponsiveness phenomenon, content provision type unresponsiveness phenomenon, and input event distribution type unresponsiveness phenomenon introduced above.

[0092] Any unresponsiveness phenomenon occurs when the target application is running in the operating system's system code. Target application unresponsiveness refers to the phenomenon where the target application fails to respond, specifically when some events fail to respond within the scheduled time or when the response time is excessively long. For ease of description, target application unresponsiveness is referred to as application unresponsiveness (ANR) or simply the ANR phenomenon.

[0093] An operating system (OS) controls and manages the hardware and software resources of a computer system. It also organizes and schedules computer tasks and resource allocation, providing a convenient interface and environment for objects and other software. Examples of operating systems include, but are not limited to, Android, Windows, Linux, and iOS.

[0094] The operating system can provide a running environment for the application, and the application can complete some events by calling the functions provided by the operating system (i.e., system calls). Therefore, running the target application based on the system code of the operating system means that the system code of the operating system can be called in the process of running the target application. In this process, the target application may become unresponsive. For example, when the system code of the Android operating system is called to run the target application, the listening service required by the target application is not created within the predetermined time, causing the unresponsiveness. The target application refers to any application running in a computer device. For example, an application running in a terminal, or a service program running in a server. The target application can specifically be any one of a game application, an audio and video application, a social application, a shopping application, etc. Taking the cloud gaming scenario as an example, the target application can refer to a cloud gaming application or a cloud gaming service program deployed in the system container of the server.

[0095] The unresponsiveness of the target application can occur in different scenarios, and the unresponsiveness generated in one scenario can correspond to a type of unresponsiveness. Taking the Android operating system as an example, the unresponsiveness will occur in the following scenarios: ① Service Timeout, including foreground service timeout and background service timeout, such as the foreground service is not completed within 20 seconds; ② Broadcast Timeout, including foreground broadcast timeout and background broadcast timeout, such as the foreground broadcast is not completed within 10 seconds; ③ Content Provider Timeout, such as the content provider becomes unresponsive after a 10-second timeout after publishing; ④ Input Dispatching Timeout, including key and touch events, specifically including key response distribution timeout and touch event distribution timeout. For example, the default key response distribution timeout is 5 seconds, and unresponsiveness will occur if it exceeds this time.

[0096] Each unresponsiveness phenomenon can automatically generate and collect field information when it occurs. Each unresponsiveness phenomenon corresponds to a type of field information. The field information for any unresponsiveness phenomenon is used to describe the execution status of the system code when the corresponding unresponsiveness phenomenon occurs.

[0097] The on-site information of the unresponsive phenomenon refers to the relevant information captured by the operating system when the unresponsive phenomenon occurs. The on-site information can be used to describe the execution of the system code of the operating system when the unresponsive phenomenon occurs. The execution status of the system code is, for example, at which step of the system code execution the unresponsive phenomenon occurs, in which process or thread the event response times out, etc. It can be seen from the ANR generation process introduced in Figures 1d to 1g above that many processes will be run when ANR occurs. For example, the processes running in the service-type ANR are: system service process, service process and other processes not shown. Therefore, the on-site information can include relevant information of the process being run in the system code, such as the process ID of the process. Optionally, the on-site information may include but is not limited to the following: the time of occurrence of the ANR, a trace file for recording the stack of each thread of the process before and after the occurrence of the ANR, the type of ANR, information of each process when the ANR is generated (such as process number, process name, process execution start time and end time), etc. Various unresponsive on-site information can be recorded in relevant logs. During specific analysis, all or part of the on-site information can be obtained for further analysis.

[0098] For example, taking the cloud gaming scenario as an example, the scene where an application is unresponsive on a cloud gaming platform can be shown in Figure 3b. Among them, docker exec–it b23 sh b2343985639e means entering the container named b2343985639e and searching for the location of the configuration file of the corresponding image. ps-ef|grep Sgame means that the process containing the sgame keyword will be found and displayed in the container named b2343985639e. As shown in Figure 3b, the scene where the cloud gaming platform produces an unresponsive application, the scene information obtained includes the process information of each process in the container (only part of it is displayed). Taking the first line of information displayed as an example, it includes the process ID (PID, Process Identification) of the process 1910, the ID of the parent process (PPID, Parent Process Identification) of the process 110, the percentage of CPU resources used 16, the system startup time 12:54:18, the CPU usage time 00:03:15, and the process name "com.ten.tmgp.sgame".

[0099] By collecting on-site information about various unresponsiveness events, we can determine the execution status of the operating system's system code when the unresponsiveness event occurs. This facilitates subsequent analysis of the common characteristics of these unresponsiveness events, effectively preventing unresponsiveness in applications running on the operating system. For details, see the description of S302 and S303.

[0100] S302 , performing commonality analysis on the on-site information of various non-response phenomena to obtain commonality analysis results, and determining the fault point causing the non-response phenomenon from the system code based on the commonality analysis results.

[0101] Commonality analysis is an analytical method that identifies common characteristics. Here, commonality analysis of field data from various unresponsiveness phenomena involves identifying the common characteristics that cause these unresponsiveness phenomena and generating commonality analysis results. These commonality analysis results include common information among the field data from various unresponsiveness phenomena, such as the common process ID found in all the field data from these unresponsiveness phenomena.

[0102] Based on the commonality analysis results, the fault point causing the unresponsiveness phenomenon can be identified within the system code. This fault point is the common point across various unresponsiveness phenomena. This fault point can be the code within the system code that causes various unresponsiveness phenomena. For example, unresponsiveness phenomena often occur when using system call functions. This fault point can further reveal the common cause of application unresponsiveness, facilitating the identification of system code repair methods.

[0103] Since there are many reasons that lead to ANR, such as deadlock leading to ANR, insufficient I / O resources leading to ANR, and main thread dead loop leading to ANR, etc., if the specific analysis method for a specific ANR is limited to the specific scenario (such as operating system version, application version, terminal, etc.), the solution to solve ANR in another scenario may not be applicable. Therefore, it is not very universal for various scenarios. The analysis mechanism provided in this solution is a common analysis mechanism, which obtains common analysis results by finding the common characteristics between the on-site information of various unresponsive phenomena, and obtains the fault points of various unresponsive phenomena based on the common analysis results. Then, through subsequent repair processing, any of the various unresponsive phenomena of the target application can be overcome, effectively reducing the probability of application unresponsiveness, and it is universal and stable for various scenarios.

[0104] S303: Repair the system code according to the fault point, so as to run the target application based on the repaired system code.

[0105] Because the fault point is determined from the underlying system code, the operating system's system code can be repaired based on the fault point, resulting in a repaired system code. Repair processing here can refer to modifications to the system code, with the repaired system code optimizing the original system code based on the fault point. The target application can be run based on the repaired system code, and the repaired system code can be called while the target application is running. Since the system code optimizes the fault point where the unresponsiveness occurs, unresponsiveness can be effectively avoided during application execution.

[0106] In this way, the native operating system is transformed by repairing the system code of the operating system. Since it is a modification of the system code, it can solve the problem of various ANRs occurring in principle, and the operating system can be deployed on any device or platform. In this way, this solution can not only be applied to the cloud gaming platform, but also effectively solve the instability of the cloud gaming platform due to the occurrence of ANR and improve the stability of the cloud gaming platform. It can also be applied to real terminals (such as mobile phones), simulators (such as Android simulators) products and operating system platforms (such as other Android platforms), etc. It has strong scenario versatility and can effectively avoid various ANR phenomena.

[0107] The data processing solution provided by the embodiment of the present application supports the collection of on-site information of various unresponsive phenomena of the target application. Since the on-site information is used to describe the execution of the system code when the unresponsive phenomenon occurs, by performing a common analysis on the on-site information of various ANRs, the execution of the system code can be analyzed from the operating system level, and the common characteristics of the various unresponsive phenomena can be found from the bottom layer to obtain the common analysis results. Based on the common analysis results, the fault point that produces the unresponsive phenomenon is determined, and then the system code of the operating system is repaired based on the fault point, and the target application can be run based on the repaired system code. In this way, during the operation of the target application, the repaired system operation can intercept the possible occurrence of the unresponsive phenomenon from the operating system side, which can well deal with most ANR scenarios and avoid most ANR problems. It can be seen that this solution can solve the problem of ANR on the operating system from the root by starting from the underlying system code of the operating system. It has strong versatility and can reduce the occurrence of any unresponsive phenomenon in the operating system or the target application, thereby effectively improving the stability of the system or application. When applied to a cloud gaming platform, it can improve the compatibility and stability of the cloud gaming platform and enhance the gaming experience of players.

[0108] Please refer to FIG4 , which is a flowchart of another data processing method provided in an embodiment of the present application. The data processing method may include S401 to S406:

[0109] S401 : Acquire on-site information of various unresponsiveness phenomena among multiple unresponsiveness phenomena of a target application.

[0110] S402: Perform commonality analysis on the on-site information of various non-response phenomena to obtain commonality analysis results.

[0111] In one embodiment, the system code includes multiple processes and code segments executed by each process; the on-site information of any unresponsiveness phenomenon includes: the process identifiers of each process being run in the system code when the corresponding unresponsiveness phenomenon occurs.

[0112] System code can contain multiple processes. A process is a program's execution phase. Once an executable program is running, it becomes a process. A process can execute code within the runtime environment. System code includes code snippets executed by each of these multiple processes. A code snippet is a portion of the system code executed by a process. Specifically, after system code is compiled and then run, it can be split into multiple process instances, each of which executes a corresponding code snippet.

[0113] Since the unresponsiveness occurs during the execution of the target application, which calls the operating system's system code, each process included in the system code can be executed to execute the corresponding code fragment. Therefore, the scene information can include the process ID corresponding to the executed process. The process ID is information used to identify the process, and the process ID can be the process name or a keyword in the process name, etc.

[0114] Based on the above, commonality analysis can be performed based on the process identifiers contained in the field information. An optional implementation of S402 can be: for any field information in the field information of various unresponsive phenomena, traverse each process identifier in any field information; search for the currently traversed process identifier in each field information other than any field information; if the currently traversed process identifier is found, add the currently traversed process identifier to the commonality analysis results; if the currently traversed process identifier is not found, continue to traverse each process identifier in any field information.

[0115] Any field information refers to the field information of any unresponsive phenomenon among the field information of various unresponsive phenomena obtained. Each process identifier in any field information can be traversed. During the traversal process, for the process identifier currently being traversed, the currently traversed process identifier can be searched in the field information of other unresponsive phenomena. The currently traversed process identifier is the process identifier being traversed in any field information. If the currently traversed process identifier is found, it means that the same process identifier as the currently traversed process identifier exists in other field information, and the process corresponding to the process identifier is also running when other unresponsive phenomena occur. The currently traversed process identifier found is the process identifier shared by various unresponsive phenomena. The currently traversed process identifier can be added to the common analysis results. If the currently traversed process identifier is not found, it means that the same process identifier as the currently traversed process identifier does not exist in other field information, and then the other process identifiers in any unresponsive field information can be traversed.

[0116] For example, the field information of the various unresponsive phenomena obtained includes 4 types of unresponsive phenomena, and the field information of the 4 types of unresponsive phenomena are: field information a of type A unresponsive phenomenon, field information b of type B unresponsive phenomenon, field information c of type C unresponsive phenomenon, and field information d of type D unresponsive phenomenon. Assuming that the process identifier contained in the field information is a process name, and the process name game in the field information a is currently being traversed, it can be searched in the field information b, field information c, and field information d. When the process name is found in the field information b, field information c, and field information d, the found process name can be added to the analysis result. It can be understood that the specific implementation method of the above commonality analysis is an optional method, and other methods can also be used for commonality analysis, such as commonality analysis based on threads, which is not limited here.

[0117] It can be seen that by taking the process identifier being traversed in any field information of the unresponsive phenomenon as a benchmark and searching for the same process identifier in other field information, the common characteristics in the system code can be analyzed. Usually, the process identifier is a concise representation, such as a number or a simple character, which can effectively search for the same process identifier and improve the efficiency of common analysis.

[0118] In one implementation, the commonality analysis results include process identifiers shared across various instances of unresponsiveness. Based on this, the fault point can be determined from the system code using the commonality analysis results, using the following implementations of S403 to S405. The shared process identifiers can be implemented using the optional implementation described in S402 above, or other methods.

[0119] S403: Determine M target processes based on the process identifiers in the commonality analysis results.

[0120] Because process IDs are used to label processes, the process corresponding to each process ID in the commonality analysis results can be identified as a target process, resulting in M ​​target processes. M is a positive integer greater than 1, and its value is equal to the number of process IDs in the commonality analysis results. For example, if the commonality analysis results include two process IDs: process1 and process2, then both the process corresponding to process1 and the process corresponding to process2 can be used as target processes. Thus, two target processes can be identified based on the two process IDs in the commonality analysis results.

[0121] S404: Determine the association relationship between each target process in the M target processes, and obtain the code fragment executed by each target process from the system code.

[0122] The association relationship between target processes can be used to describe the hierarchical relationship between at least two of the M target processes. This association relationship includes, but is not limited to, parent-child relationships and sibling relationships. A process can have an association relationship with one or more other processes. For example, process 1 is the parent of process 2, which in turn is the child of process 4. This means that process 1 and process 2 are in a parent-child relationship, and process 1 and process 4 are also in a parent-child relationship, but process 1 plays a different role in the parent-child relationship.

[0123] In one embodiment, the M target processes include a first process and a second process, that is, two target processes. The first process and the second process are common processes when various unresponsiveness phenomena occur, specifically referring to processes that will be run before the unresponsiveness phenomenon occurs.

[0124] The specific implementation method of determining the association relationship between each target process in M ​​target processes may include the following: obtaining attribute information of the first process and attribute information of the second process from the on-site information of various unresponsive phenomena; the attribute information of any process includes: the process number of any process and the process number of the process that calls any process; if the attribute information of the second process includes the process number of the first process or the attribute information of the first process includes the process number of the second process, then determining that the association relationship between the first process and the second process is a parent-child relationship.

[0125] The on-site information for any unresponsiveness phenomenon may include: attribute information corresponding to the process being run in the system code when the unresponsiveness phenomenon occurs. Attribute information of the process corresponding to the process identifier in the common analysis results (i.e., the target process) can be obtained from the on-site information for various unresponsiveness phenomena. Here, the target process includes a first process and a second process, and the process attribute information obtained from the on-site information specifically includes attribute information of the first process and attribute information of the second process. Process attribute information is information used to describe the characteristics of a process. The attribute information of any process includes the process ID of the process and the process ID of the process that calls the process. For example, if any process is process A, and process B calls process A, the attribute information of process A may include the process ID of process A (i.e., the process ID of any process) and the process ID of process B (i.e., the process ID of the process that calls the process). Through this attribute information, the process ID of the process itself and the specific process that called the current process can be determined. A process ID (PID) is a unique identifier assigned to a process by an operating system when the process is created. The process ID can be represented by a natural number, such as 123 or 605, or by a binary number, such as 001 or 010. There is no restriction on the representation of the process ID.

[0126] The attribute information of the first process includes the process ID of the first process and the process ID of the process that called the first process. The attribute information of the second process includes the process ID of the second process and the process ID of the process that called the second process. You can then select the attribute information of any process for analysis, including the following situations:

[0127] (1) If the attribute information of the second process includes the process number of the first process, it means that the process number of the process that calls the second process in the attribute information of the second process is the process number of the first process, that is, the second process is called by the first process or the first process calls the second process. Then, it can be determined that the association relationship between the first process and the second process is a parent-child relationship, and the first process is the parent process of the second process, and the second process is the child process of the first process.

[0128] (2) If the attribute information of the first process includes the process ID of the second process, it means that the process ID of the process that calls the first process in the attribute information of the first process is the process ID of the second process, that is, the first process is called by the second process or the second process calls the first process. Then it can also be determined that the association relationship between the first process and the second process is a parent-child relationship, and the first process is the child process of the second process, and the second process is the parent process of the first process.

[0129] For example, as shown in Figure 3b above, the scene of the cloud game ANR is that various unresponsive scenes will generate this scene, and the scene information will be collected. Therefore, the common analysis results may include the relevant content of the process shown in Figure 3b. As shown in Figure 3b, the operating system has two sgame processes at the same time, namely a process with process number 1910 and a process with process number 4697. According to the process number, it can be found that the parent process number of the second process (that is, the process with process number 4697) is 1910, which is the first sgame process. From this, it can be seen that the two processes are in a parent-child relationship, and the second process is a child process of the first process, and the first process is a child process of the process with process number 110.

[0130] (3) If the attribute information of the second process does not include the process number of the first process, and the attribute information of the first process does not include the process number of the second process, it means that the process calling the second process is not the first process but another process, and the process calling the first process is not the second process but another process. Then it can be determined that the association relationship between the first process and the second process is not a parent-child relationship, but another relationship, such as a sibling relationship, that is, the first process and the second process are both child processes of the same process. For example, assuming that the first process with process number 1910 and the second process with process number 4906 are both sgame processes, but the parent process numbers of the first and second processes are both 110, that is, the first and second processes are both child processes of the process with process number 110. It can be determined that the two processes are siblings.

[0131] It can be seen that the relationship between the process numbers of other processes can be determined through the process number of the process itself and the process number of the process that calls the process included in the process attribute information, thereby very conveniently determining the association relationship between processes.

[0132] Since the process will execute the corresponding code snippet in the system code when running, the code snippet executed by each target process can be obtained from the system code. Since there are M target processes, M code snippets can be obtained to facilitate the subsequent determination of the fault point causing the unresponsiveness phenomenon from each code snippet. For details, please refer to the following S405.

[0133] S405 , based on the association relationship, determine the fault point causing the unresponsiveness phenomenon from the M acquired code snippets.

[0134] Each of the M code snippets is executed by the corresponding process in the M processes. Through the association relationship between each process in the M target processes, the fault point that causes the unresponsiveness phenomenon can be determined from the M code snippets obtained. The fault point may be a code statement or a piece of code in a code snippet among the M code snippets. Since the code snippet is executed when various unresponsiveness phenomena occur, this fault point is a common fault point for various unresponsiveness phenomena. Due to the existence of this fault point, any unresponsiveness phenomenon may be triggered. The specific type of unresponsiveness phenomenon triggered can be judged in combination with other information, such as the event type of process execution. For example, if the process executes an input distribution event, it can be determined that it is an ANR due to input distribution timeout.

[0135] In the above steps S403 to S405, the target process can be determined by the process identifier included in the common analysis results, and the correlation between each target process can be further determined. The code snippets executed by each target process are obtained from the system code, and the fault point that produces the unresponsive phenomenon is analyzed based on the correlation and the obtained code snippets. This method starts from the system code of the underlying operating system, and after a common analysis of various unresponsive phenomena, the common analysis results are used to determine the system code that is executed when various unresponsive phenomena occur, and the fault point is determined from the system code, and then the common cause of ANR can be determined from the system level, so as to fundamentally repair and solve the problem of ANR.

[0136] S406: Repair the system code according to the fault point, so as to run the target application based on the repaired system code.

[0137] The solution provided by the embodiment of the present application can perform a common analysis on the field information of various unresponsive phenomena obtained, and find out the common processes (such as the processes corresponding to the common process identifiers) that are run when the target application becomes unresponsive. These common processes can be further analyzed as target processes, and specifically can be returned to the system code of the operating system. The fault point that causes the unresponsive phenomenon is determined based on the association relationship and the code fragment executed by the target process. The fault point is specifically determined from the code fragment executed by the target process. In this way, the root cause of the application unresponsiveness phenomenon can be determined from the bottom of the system, so as to solve the problem of application unresponsiveness from the root. After the system code is repaired based on the fault point, the repaired system code can effectively reduce the occurrence of unresponsiveness during the operation of the target application, thereby improving the application operation and the overall stability of the system.

[0138] Please refer to FIG5 , which is a flowchart of another data processing method provided in an embodiment of the present application. The data processing method may include S501 to S507:

[0139] S501 : Acquire on-site information of various unresponsiveness phenomena among multiple unresponsiveness phenomena of a target application.

[0140] S502: Perform commonality analysis on the on-site information of various no-response phenomena to obtain commonality analysis results.

[0141] S503: Determine M target processes based on the process identifiers in the commonality analysis results.

[0142] S504 , determining the association relationship between each target process in the M target processes, and obtaining a code segment executed by each target process from the system code.

[0143] S505 , based on the association relationship, determine the fault point causing the unresponsiveness phenomenon from the M acquired code snippets.

[0144] In one embodiment, the M target processes include a first process and a second process, and the association relationship between the first process and the second process is a parent-child relationship; wherein the first process is the parent process of the second process, and the second process is the child process of the first process. The association relationship between the first process and the second process can be determined by using the process numbers included in the process attribute information as described in the above embodiment.

[0145] Based on the contents introduced in the relevant part of the embodiment corresponding to Figure 4, the specific implementation method of S505 may include the following contents: based on the parent-child relationship, the code snippet executed by the obtained first process is determined as the benchmark code snippet; and the first code statement is determined from the benchmark code snippet, and the first code statement refers to: the code statement executed by the first process before the unresponsive phenomenon occurs; when the first code statement is a statement for implementing a function call operation, the call stack of the first process is analyzed along the first code statement in the code snippet executed by the first process, and the call stack includes various functions called by the first process; if there is a target function in the call stack that fails to call, the logic code of the target function is determined from the benchmark code snippet; based on the code snippet executed by the second process, the fault point causing the unresponsive phenomenon is determined from the logic code of the target function.

[0146] The code snippet executed by the first process contains many code statements. Before the unresponsiveness occurs, the first process may have executed some of the code statements in the code snippet and then stopped executing. The second process works in a similar principle. Since the first process and the second process are in a parent-child relationship, the first process acts as the parent process, and the code it executes may contain code for creating the second process. Therefore, the code snippet executed by the first process can first be determined as a baseline code snippet for analysis. The baseline code snippet is a code snippet used as an analysis benchmark. The first code statement can be determined from the baseline code snippet. The first code statement is the code statement executed by the first process before the unresponsiveness occurs. The first code statement can be judged to determine whether it meets the analysis conditions, and then further analysis can be performed. Specifically:

[0147] (1) When the first code statement is a statement for implementing a function call operation, the call stack of the first process can be analyzed along the first code statement in the code segment executed by the first process.

[0148] Based on the first code statement, the relevant executable program or system command can be called to implement the function call operation. For example, the first code executed by the first process as the parent process can specifically be a statement to execute Runtime.getRuntime().exec("xxx.exe"). Among them, Runtime.getRuntime().exec() is used to call an external executable program or a system command, Runtime.getRuntime() returns the Runtime object of the current application, and the exec() method of the object instructs to create a child process to execute the specified executable program (here it is an executable program named "xxx.exe", "xxx.exe" represents the name of the program to be executed), and returns the Process object instance corresponding to the child process. Through Process, the execution of the child process can be controlled or the information of the child process can be obtained.

[0149] The last code statement executed by the parent process before the ANR occurred is the first code statement. This first code statement can be further analyzed: within the code snippet executed by the first process, the call stack of the first process can be analyzed along the first code statement. This call stack includes the various functions called by the first process. Call stack analysis can be performed using appropriate debugging tools based on the type of code snippet executed by the first process. For example, if the code snippet executed by the first process is Java code, printStackTrace (a debugging tool that prints the location and cause of the program error in the command line) can be used. If the code snippet executed by the first process is Native C code, strace (a debugging tool used to intercept and record system calls executed by a process and signals received by the process) can be used. These debugging tools can analyze the call stack of the corresponding process. The call stack can also be understood as a mechanism by which an interpreter (such as the JavaScript interpreter in a browser) tracks the flow of function execution. This mechanism allows us to determine which function is executing and which functions are called within the executed function body.

[0150] Taking an ANR in a cloud gaming scenario as an example, we analyzed the ANR's on-site information on the cloud gaming platform and determined that the operating system had two sgame processes running simultaneously, with these two processes in a parent-child relationship. Using debugging tools, we captured the call stack and determined that the parent process was executing the Runtime.getRuntime().exec() statement (i.e., executing the first code statement) before the ANR. Following Runtime.getRuntime().exec(), we can find the parent process's call stack, as shown in Figure 6a. Specifically, the Runtime class calls the exec method, which creates the ProcessBuilder class. The ProcessBuilder.start() method creates the ProcessImpl class, which then uses the start() method to create a Unix process. A Unix process object is created using new UnixProcess. A new process is then forked from the Unix process object. This new process executes different program code from the Unix process, resulting in UnixProcess_md.c. A new process is then forked from the UNIX process and executes different program code from the UNIX process. Finally, the startChild function is called. This is the parent process's call stack. The last function call in the parent process's call stack, the startChild function, is the approximate location of the program error.

[0151] If a target function fails to be called in the call stack, it indicates an error in the code snippet executed by the first process, and the error is located in the target function. For example, in Figure 6a above, the function call in the parent process call stack only shows the startChild function, indicating that the first process crashed when it called the startChild function. Therefore, the target function can be further analyzed: the logic code of the target function is determined from the code snippet executed by the first process. This logic code is part of the code snippet executed by the first process. Based on the code snippet executed by the second process, the fault point that caused the unresponsiveness is determined from the logic code corresponding to the target function. In this case, the fault point is specifically the code statement in the logic code corresponding to the target function.

[0152] (2) When the first code statement is not a statement for implementing a function call operation, for example, when the first code statement is another code statement, the code statements related thereto may be analyzed based on the execution status of the code statement.

[0153] It can be seen that by analyzing the code snippets executed by processes with a parent-child relationship, specifically by analyzing the call stack of the first process of the parent process, we can roughly know the actual execution status of the code snippet by the parent process. Based on the actual execution status, we can determine the specific fault point that will cause the unresponsiveness phenomenon in the logic code of the target function that crashed, and further narrow the positioning range.

[0154] In one implementation, the logic code of the target function includes a process creation statement, which is a statement for creating a child process, and the child process created by the process creation statement shares the same address space with the corresponding parent process.

[0155] For example, based on the target function in the parent process call stack of FIG. 6a , the logic code for the target function is provided as shown in FIG. 6b , which includes a process creation statement. The target function is the startChild function analyzed based on the parent process call stack of FIG. 6a . The specific logic of the startChild function, as shown in FIG. 6b , is as follows: If START_CHILD uses vfork (if START_CHILD_USE_VFORK), a process can be created using the process creation statement Volatile pid_t resultPid = vfork() . This approach is explained as follows: Separating the call to vfork into a separate startChild function prevents the child stack from corrupting the parent stack, as suggested by the gcc warning. Specifically, the gcc warning states: Variable "foo" may be corrupted by "longjmp" or "vfork." foo represents a variable representing data, function, or command, and longjmp is a jump method. vfork is a Linux system call that creates processes that share the address space of the parent and child processes. That is to say, the child process created by the system call vfork shares the same address space with its corresponding parent process. In this way, the child process runs completely in the address space of the parent process. If the child process modifies a variable, it will directly affect the parent process.

[0156] For a first process and a second process that have a parent-child relationship, the second process is the child of the first process. That is, the first process is the parent process and the second process is the child process. The first process creates the second process by executing the process creation statement in the target function. Thus, the first and second processes share the same address space. An address space is the collection of all available resources. This shared address space can be either a physical address space or a virtual address space.

[0157] Based on the code snippet executed by the second process, an implementation method for determining the fault point causing the unresponsiveness phenomenon from the logic code of the target function may include the following: determining a second code statement from the code snippet executed by the second process; when the second code statement is a statement for implementing a data reading operation, determining the target resource required to be read by the second process based on the second code statement; if the target resource is held by the first process, determining the process creation statement in the logic code of the target function as the fault point causing the unresponsiveness phenomenon; wherein the second process is a child process of the first process; if the target resource is held by the first process, the second process is blocked; and when the time length for which the second process is blocked is greater than a time length threshold, the unresponsiveness phenomenon is triggered.

[0158] First, the second code statement can be determined from the code snippet executed by the second process. The second code statement refers to the code statement executed by the second process before the unresponsiveness occurs. Because the second process may execute multiple code statements in the corresponding code snippet before the ANR occurs, some code statements may not be suitable for subsequent analysis. Therefore, the second code statement can be judged to determine whether it meets the analysis conditions. Specifically:

[0159] (1) When the second code statement is a statement for implementing a data read operation, it indicates that the second code statement meets the analysis conditions, and the second code statement can be further analyzed: when the second code statement executes the data read operation, the read data will be locked, that is, other processes cannot access the data, and the target resource required for the second process to execute the data read operation can be determined. The statement for the data read operation can be, for example, a code statement for reading a file resource. For example, the second process executes the readdir() function to read / proc / self / fd, where readdir() is often used to traverse files in a folder, and / proc / self / fd represents the file descriptor in the current process directory.

[0160] The target resource required by the second process to perform the data read operation can be an available resource in the address space, such as hardware resources like CPU and memory. If the target resource is held by the first process, indicating that the first process holds the target resource required by the second process to read the data, and the address space between the first and second processes is shared, the second process will be blocked and wait for the first process to release the target resource. If the second process is blocked for a duration greater than a threshold (for example, if the second process is blocked for 10 seconds and the threshold is 8 seconds), an unresponsiveness phenomenon will occur. Based on the above analysis, this is caused by the method of process creation. Therefore, the process creation statement in the target function's logic code can be identified as the fault point causing the unresponsiveness phenomenon. Conversely, if the target resource is not held by the first process, indicating that the second process can use the target resource, the unresponsiveness phenomenon will not occur.

[0161] (2) When the second code statement is not a statement for implementing a data reading operation, other contents may be analyzed based on the specific contents indicated by the second code statement.

[0162] It can be seen that the analysis of the target function is implemented in combination with the code snippet executed by the second process. Since there is a statement for data reading operation in the code snippet executed by the second process, when the target resource required for the data reading operation is held by the first process, the address space is shared between the two processes, which will trigger the unresponsiveness of the target application. Based on this logic, it can be determined that the unresponsiveness is caused by the process creation statement in the logic code of the target function, and it can be identified as the fault point.

[0163] Based on the above description of the method for determining the failure point that causes the unresponsiveness phenomenon, it is clear that the failure point includes the target function of the code segment executed by the first process, specifically the process creation statement within the target function. Therefore, the implementation of the target function can be modified in the operating system. In one embodiment, the method for repairing the system code based on the failure point can be as described in S506 to S507 below.

[0164] S506: Determine a target statement for creating a child process.

[0165] The target statement for creating a child process is a different code statement than the process creation statement. Although it has similar functionality to the process creation statement, namely, it can create a child process, the child process created by the target statement uses a separate address space from the corresponding parent process. The corresponding parent process is the process that calls the child process created by the target statement. The child process and the corresponding parent process do not share address space. Therefore, when the child process performs data read operations, the target resources required are not held by the first process but are instead in a separate address space, effectively preventing application unresponsiveness.

[0166] In one embodiment, a process creation statement includes a function field, and the function field stores a first system call function. The process creation statement creates a child process through the first system call function. The function field included in the process creation statement can store the first system call function, which can be provided by the operating system. In the system code of the operating system, the process creation statement can create a child process through the first system call function. For example, in the aforementioned process creation statement Volatile pid_t resultPid = vfork(), the function field is resultPid, and vfork() is the first system call function.

[0167] Based on the above content, the specific implementation content of S506 includes: modifying the first system call function in the function field in the process creation statement to the second system call function, and obtaining a target statement for creating a child process; wherein, the target statement creates the child process through the second system call function.

[0168] The second system call function is different from the first system call function and is also provided by the operating system. Under the second system call function, the address spaces of the child process created by the second system call function and the corresponding parent process are independent of each other. Because the system call function is a kernel function provided by the operating system, modifications to the system call function are performed at the kernel level. This can resolve the ANR problem on the operating system at the system kernel level, improve the compatibility and stability of the platform, and effectively prevent and avoid ANR phenomena.

[0169] S507: Replace the process creation statement in the system code with the target statement to repair the system code.

[0170] After determining the target statement, the process creation statement in the original system code can be replaced with the target statement. In this way, the first system call function can be disabled and replaced with the second system call function, thereby repairing the system code at the kernel level. When the first process is the parent process and the second process is the child process, the second process created by the target statement uses a different address space independently from the first process. When the target application is run based on the repaired system code, it can smoothly use the target resources to perform data reading operations without blocking, thereby avoiding unresponsiveness.

[0171] For example, the process creation statement Volatile pid_t resultPid = vfork() can be modified to the target statement Volatilepid_tresultPid = fork(), and if START_CHILD_USE_VFORK can be modified to if START_CHILD_USE_FORK, thus disabling vfork() and switching to fork().

[0172] It is understandable that, given the holistic nature of the operating system, modifying the process creation statement in the target function may affect other parts of the operating system's system code beyond the target function. Therefore, other parts of the system code can also be adaptively modified to accommodate the specific repairs described above. This method allows the system code to be repaired and the repaired system code to be generated, allowing the target application to run based on the repaired system code.

[0173] It can be seen that the repair content for the system code of the operating system is a customized modification to the system code. This modification involves changing the system calls of the kernel, which can intercept the possible occurrence of ANR from the kernel side and the system side, and deal with the vast majority of scenarios where ANR may occur. In addition, the modification content has no policies that are strongly bound to a specific platform, and there are no hard-coded parts. Therefore, it can achieve loose coupling with the device or platform itself, so that the repaired operating system can be applied to any scenario, such as cloud gaming, real terminal devices or simulators, etc., which can effectively avoid the phenomenon of application unresponsiveness and improve the stability and compatibility of the platform or device.

[0174] In one implementation, for customized modified system codes, it is also possible to: perform a quality check on the repaired system code. The quality check includes: code review and security testing during the system code writing process. Performing a security check during the code writing process can discover security issues in the customized system code and ensure the security of the repaired system code. Code review (Code Review), also known as code review, refers here to an operation that checks the compliance of source code with coding standards and code quality by reading the code. Code review can improve code quality and identify potential errors (bugs). Both security checks and code reviews can be performed using corresponding analysis tools. In this way, it can be ensured that all data meets expectations and that the problem of unresponsive applications is solved while ensuring the compatibility and stability of the operating system.

[0175] By implementing the above-mentioned fix, in cloud gaming scenarios, the cloud gaming platform experienced no ANRs during testing and actual online service, based on the repaired code. This reduced the frequency of ANRs. It is understandable that since the cloud gaming platform is an operating system and operates on the system side, with numerous other gaming apps and other apps running on it, a small number of ANRs may still occur, but the probability is extremely low.

[0176] The data processing solution provided by the embodiment of the present application can obtain and collect on-site information of various unresponsive phenomena of the target application. Since the on-site information is used to describe the execution of the system code when the unresponsive phenomenon occurs, by performing a common analysis on the on-site information of various ANRs, the execution of the system code can be analyzed from the operating system level, and the common characteristics that produce various unresponsive phenomena can be found from the bottom layer to obtain the common analysis results. The common analysis results here include a common process identifier, based on which multiple common target processes are determined, and the code snippets executed by each target process are analyzed. Specifically, the execution of the code snippets of the process can be tracked through the call stack, and a more specific fault point can be determined based on the execution logic of the call stack and other code snippets. In this process, various debugging tools can be used to track and debug the problem to determine the fault point. Based on the fault point, the operating system can be customized. Specifically, the system function called when the process is created can be modified from the kernel level, thereby effectively solving the occurrence of application unresponsiveness. Since the problem of application unresponsiveness of the operating system is solved by repairing the system kernel level, compatibility and stability can be significantly improved.

[0177] Please refer to Figure 7, which is a schematic diagram of the structure of a data processing device provided in an embodiment of the present application. The above-mentioned data processing device can be a computer program (including program code) running on a computer device, for example, the data processing device is an application software; the data processing device can be used to execute the corresponding steps of the method provided in an embodiment of the present application. As shown in Figure 7, the data processing device 700 can include at least one of the following: an acquisition module 701 and a processing module 702.

[0178] An acquisition module 701 is configured to acquire on-site information of various unresponsiveness phenomena of a target application, wherein each unresponsiveness phenomenon is generated during the process of running the target application based on system code of an operating system; and each on-site information of the unresponsiveness phenomenon is used to describe the execution status of the system code when the corresponding unresponsiveness phenomenon occurs;

[0179] Processing module 702 is configured to perform commonality analysis on the on-site information of various unresponsive phenomena to obtain commonality analysis results, and determine the fault point causing the unresponsive phenomenon from the system code based on the commonality analysis results; wherein the commonality analysis results include: common information in the on-site information of the various unresponsive phenomena;

[0180] The processing module 702 is configured to repair the system code according to the fault point, so as to run the target application based on the repaired system code.

[0181] In one embodiment, the system code includes multiple processes and code snippets executed by each process; the field information of any unresponsive phenomenon includes: the process identifiers of each process being run in the system code when the corresponding unresponsive phenomenon occurs; the processing module 702 is specifically used to: for any field information in the field information of various unresponsive phenomena, traverse each process identifier in any field information; in each field information other than any field information, search for the currently traversed process identifier; if the currently traversed process identifier is found, add the currently traversed process identifier to the common analysis result; if the currently traversed process identifier is not found, continue to traverse each process identifier in any field information.

[0182] In one embodiment, the common analysis results include: process identifiers shared by the on-site information of various unresponsive phenomena; a processing module 702 is specifically used to: determine M target processes based on the process identifiers in the common analysis results, where the value of M is equal to the number of process identifiers in the common analysis results; determine the association relationship between each target process in the M target processes, and obtain the code snippets executed by each target process from the system code; based on the association relationship, determine the fault point that causes the unresponsive phenomenon from the M code snippets obtained.

[0183] In one embodiment, the M target processes include a first process and a second process; the processing module 702 is specifically used to: obtain attribute information of the first process and attribute information of the second process from the field information of various unresponsive phenomena; the attribute information of any process includes: the process number of any process and the process number of the process that calls any process; if the attribute information of the second process includes the process number of the first process or the attribute information of the first process includes the process number of the second process, then the association relationship between the first process and the second process is determined to be a parent-child relationship.

[0184] In one embodiment, the M target processes include a first process and a second process, and the association relationship between the first process and the second process is a parent-child relationship; wherein the first process is the parent process of the second process; the processing module 702 is further specifically used to: based on the parent-child relationship, determine the code snippet executed by the acquired first process as a benchmark code snippet; and determine a first code statement from the benchmark code snippet, the first code statement refers to: the code statement executed by the first process before the unresponsive phenomenon occurs; when the first code statement is a statement for implementing a function call operation, the call stack of the first process is analyzed along the first code statement in the code snippet executed by the first process, the call stack includes various functions called by the first process; if there is a target function that fails to call in the call stack, the logic code of the target function is determined from the benchmark code snippet; based on the code snippet executed by the second process, the fault point causing the unresponsive phenomenon is determined from the logic code of the target function.

[0185] In one embodiment, the logic code of the target function includes a process creation statement, which is a statement for creating a child process, and the child process created by the process creation statement shares the same address space with the corresponding parent process; the processing module 702 is specifically used to: determine a second code statement from the code fragment executed by the second process, the second code statement refers to: the code statement executed by the second process before the unresponsiveness phenomenon occurs; when the second code statement is a statement for implementing a data read operation, determine the target resource required for the second process to perform the data read operation according to the second code statement; if the target resource is held by the first process, determine the process creation statement in the logic code of the target function as the fault point that produces the unresponsiveness phenomenon; wherein the second process is a child process of the first process; if the target resource is held by the first process, the second process is blocked; and when the second process is blocked for a period greater than a time threshold, the unresponsiveness phenomenon is triggered.

[0186] In one embodiment, the processing module 702 is specifically used to: determine a target statement for creating a child process, the child process created by the target statement and the corresponding parent process independently use a different address space; use the target statement to replace the process creation statement in the system code to repair the system code.

[0187] In one embodiment, the process creation statement includes a function field, and the function field stores a first system call function. The process creation statement creates a child process through the first system call function. The processing module 702 is specifically used to: modify the first system call function in the function field in the process creation statement to a second system call function, and obtain a target statement for creating a child process; wherein the target statement creates the child process through the second system call function.

[0188] In one embodiment, the various unresponsive phenomena of the target application include a service-type unresponsive phenomenon; the process of generating the service-type unresponsive phenomenon includes: responding to a service creation request sent by the application process of the target application, setting a service duration threshold; sending a service creation message to the service process, so that the service process notifies the service process to call one or more other processes to perform service creation work based on the service creation message, and returns feedback information after successfully creating the service; if the feedback information returned by the service process is not received within the service duration threshold, a service-type unresponsive phenomenon occurs.

[0189] In one embodiment, the various unresponsive phenomena of the target application include a broadcast-type unresponsive phenomenon; the process of generating the broadcast-type unresponsive phenomenon includes: responding to a broadcast request initiated by the application process of the target application, setting a broadcast duration threshold; sending a broadcast registration message to the broadcast receiving process, so that the broadcast receiving process notifies the broadcast receiving process to call one or more other processes to perform the broadcast work based on the broadcast registration message, and returns feedback information after the broadcast is completed; if the feedback information returned by the broadcast receiving process is not received within the broadcast duration threshold, a broadcast-type unresponsive phenomenon occurs.

[0190] In one embodiment, the various unresponsive phenomena of the target application include a content provision type unresponsive phenomenon; the process of generating the content provision type unresponsive phenomenon includes: responding to a request initiated by the application process of the target application to obtain a content provision object, detecting the startup status of the content provision process corresponding to the content provision object; if the startup status indicates that the content provision process is not started, creating a content provision process, and notifying the content provision process to call one or more other processes, install the content provision object, and return feedback information after installing the content provision object. The content provision object is configured with an installation time threshold; if the feedback information returned by the content provision process is not received within the installation time threshold, the content provision type unresponsive phenomenon occurs.

[0191] In one embodiment, the various unresponsiveness phenomena of the target application include an unresponsiveness phenomenon of the input event distribution type; the process of generating the unresponsiveness phenomenon of the input event distribution type includes: if an input event is received, the currently received input event is added to the input queue, and the input distribution thread is awakened, and the input distribution thread is used to distribute each input event in the input queue to the application process of the target application in sequence for processing; when the distribution order of the currently received input event arrives, the application process of the target application is processing other input events, and an unresponsiveness phenomenon of the input event distribution type occurs.

[0192] It is understood that the functions of the various functional modules of the data processing device described in the embodiments of the present application can be specifically implemented according to the methods in the above-mentioned method embodiments. The specific implementation process can refer to the relevant description of the above-mentioned method embodiments and will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated.

[0193] Please refer to Figure 8, which is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device 800 may include an independent device (such as one or more of a server, a node, a terminal, etc.), or may include components inside an independent device (such as a chip, a software module, or a hardware module, etc.). The computer device 800 may include at least one processor 801 and a communication interface 802. Further optionally, the computer device 800 may also include at least one memory 803 and a bus 804. The processor 801, the communication interface 802, and the memory 803 are connected via a bus 804.

[0194] Among them, the processor 801 is a module that performs arithmetic operations and / or logical operations, and can specifically be a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor unit (MPU), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a complex programmable logic device (CPLD), a coprocessor (assisting the central processing unit to complete corresponding processing and applications), a microcontroller unit (MCU), and other processing modules, or a combination of multiple thereof.

[0195] The communication interface 802 can be used to provide information input or output for at least one processor. Furthermore, the communication interface 802 can be used to receive data sent externally and / or send data externally. It can be a wired link interface such as an Ethernet cable, or a wireless link interface (Wi-Fi, Bluetooth, general wireless transmission, in-vehicle short-range communication technology, or other short-range wireless communication technology). The communication interface 802 can serve as a network interface.

[0196] Memory 803 is used to provide storage space for storing data such as the operating system and computer programs. Memory 803 can be one or a combination of random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or compact disc read-only memory (CD-ROM).

[0197] The at least one processor 801 in the computer device 800 is used to call a computer program stored in at least one memory 803 to execute the data processing method described in the embodiment shown in this application.

[0198] In one possible implementation, the processor 801 in the computer device 800 is configured to call a computer program stored in at least one memory 803 to perform the following operations:

[0199] In one embodiment, the processor 801 is specifically used to: obtain field information of various unresponsive phenomena among multiple unresponsive phenomena of a target application, any of which is generated in the process of running the target application based on the system code of the operating system; and the field information of any unresponsive phenomenon is used to describe: the execution status of the system code when the corresponding unresponsive phenomenon occurs; perform commonality analysis on the field information of various unresponsive phenomena to obtain commonality analysis results, and determine the fault point that generates the unresponsive phenomenon from the system code based on the commonality analysis results; repair the system code based on the fault point to run the target application based on the repaired system code; wherein the commonality analysis results include: the common information in the field information of the various unresponsive phenomena.

[0200] It should be understood that the computer device 800 described in the embodiments of the present application can execute the description of the data processing method in the corresponding embodiments above, and can also execute the description of the data processing device 700 in the embodiment corresponding to FIG. 7 above, and will not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated here.

[0201] In addition, it should be noted that an exemplary embodiment of the present application further provides a storage medium that stores a computer program for the aforementioned data processing method. When one or more processors load and execute the computer program, the data processing method described in the embodiment can be implemented, which will not be repeated here. The description of the beneficial effects of using the same method will also not be repeated here. It is understood that the program instructions can be deployed on one or multiple computer devices that can communicate with each other for execution.

[0202] The computer-readable storage medium may be the data processing device provided in any of the aforementioned embodiments or the internal storage unit of the computer device, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device. Furthermore, the computer-readable storage medium may also include both the internal storage unit of the computer device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.

[0203] In one aspect of the present application, a computer program product is provided, the computer program product including a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the method of the embodiments of the present application.

[0204] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs.

[0205] The modules in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.

[0206] The above disclosure is only part of the embodiments of the present application, and it is certainly not intended to limit the scope of the rights of the present application. A person skilled in the art can understand that all or part of the processes of the above embodiments and equivalent changes made in accordance with the claims of the present application are still within the scope of the invention.

Claims

1. A data processing method, the method being executed by a computer device, the method comprising: Acquiring on-site information of various unresponsiveness phenomena among a plurality of unresponsiveness phenomena of a target application, wherein any one of the unresponsiveness phenomena is generated during the process of running the target application based on a system code of an operating system; And the field information of any unresponsive phenomenon is used to describe: the execution status of the system code when the corresponding unresponsive phenomenon occurs; Performing commonality analysis on the field information of the various unresponsive phenomena to obtain commonality analysis results, and determining the fault point causing the unresponsive phenomenon from the system code according to the commonality analysis results; wherein the commonality analysis results include: common information in the field information of the various unresponsive phenomena; The system code is repaired according to the fault point, so as to run the target application based on the repaired system code.

2. The method according to claim 1, wherein the system code comprises a plurality of processes and a code segment executed by each process; The on-site information of any one of the unresponsive phenomena includes: the process identifiers of each process being run in the system code when the corresponding unresponsive phenomenon occurs; The commonality analysis of the on-site information of the various non-response phenomena is performed to obtain commonality analysis results, including: For any field information of the various unresponsive phenomena, traverse each process identifier in the field information; In each field information except any field information, searching for the process identifier of the current traversal; If the process identifier of the current traversal is found, the process identifier of the current traversal is added to the commonality analysis result; If the currently traversed process identifier is not found, then continue to traverse each process identifier in any field information.

3. The method according to claim 1 or 2, wherein the commonality analysis results include: A process identifier shared by the field information of the various unresponsive phenomena; Determining the fault point causing the unresponsiveness phenomenon from the system code according to the commonality analysis result includes: Determine M target processes based on each process identifier in the commonality analysis result, where the value of M is equal to the number of process identifiers in the commonality analysis result; Determine the association relationship between each target process in the M target processes, and obtain the code fragment executed by each target process from the system code; Based on the association relationship, a fault point causing the unresponsiveness phenomenon is determined from the acquired M code fragments.

4. The method according to claim 3, wherein the M target processes include a first process and a second process; and determining the association relationship between each of the M target processes comprises: Acquire attribute information of the first process and attribute information of the second process from the on-site information of the various unresponsive phenomena; The attribute information of any process includes: the process ID of the any process and the process ID of the process that calls the any process; If the attribute information of the second process includes the process number of the first process or the attribute information of the first process includes the process number of the second process, it is determined that the association relationship between the first process and the second process is a parent-child relationship.

5. The method according to claim 3, wherein the M target processes include a first process and a second process, and the association relationship between the first process and the second process is a parent-child relationship; wherein, The first process is the parent process of the second process; The determining, based on the association relationship, a fault point causing the unresponsive phenomenon from the acquired M code fragments includes: Based on the parent-child relationship, the acquired code fragment executed by the first process is determined as a benchmark code fragment; and a first code statement is determined from the benchmark code fragment, wherein the first code statement refers to: a code statement executed by the first process before the unresponsive phenomenon occurs; When the first code statement is a statement for implementing a function call operation, a call stack of the first process is analyzed along the first code statement in the code fragment executed by the first process, wherein the call stack includes various functions called by the first process; If there is a target function that fails to call in the call stack, the logic code of the target function is determined from the benchmark code fragment; based on the code fragment executed by the second process, the fault point that causes the unresponsiveness phenomenon is determined from the logic code of the target function.

6. The method according to claim 5, wherein the logic code of the target function includes a process creation statement, wherein the process creation statement is a statement for creating a child process, and the child process created by the process creation statement shares the same address space with the corresponding parent process; The determining, based on the code fragment executed by the second process, a fault point causing the unresponsive phenomenon from the logic code of the target function includes: Determine a second code statement from the code fragment executed by the second process, where the second code statement refers to: a code statement executed by the second process before the unresponsive phenomenon occurs; When the second code statement is a statement for implementing a data read operation, determining a target resource required for the second process to perform the data read operation according to the second code statement; If the target resource is held by the first process, a process creation statement in the logic code of the target function is determined as a fault point causing the unresponsive phenomenon; The second process is a child process of the first process; if the target resource is held by the first process, the second process is blocked; and when the second process is blocked for a period longer than a time threshold, a no-response phenomenon is triggered.

7. The method according to claim 6, wherein the repairing process of the system code according to the fault point comprises: Determine a target statement for creating a child process, wherein the child process created by the target statement independently uses a different address space from the corresponding parent process; The process creation statement is replaced by the target statement in the system code to repair the system code.

8. The method according to claim 7, wherein the process creation statement comprises a function field, and the function field stores a first system call function, and the process creation statement creates a child process through the first system call function; The step of determining a target statement for creating a subprocess includes: The first system call function in the function field in the process creation statement is modified to the second system call function, Get the target statement for creating a subprocess; Wherein, the target statement creates a child process through the second system call function.

9. The method according to claim 1, wherein the multiple unresponsiveness phenomena of the target application include unresponsiveness phenomena of service type; The process of generating the unresponsive phenomenon of the service type includes: In response to a service creation request sent by an application process of a target application, setting a service duration threshold; Sending a service creation message to the service process, so that the service process notifies the service process to call one or more other processes to perform service creation work based on the service creation message, and returns feedback information after successfully creating the service; If no feedback information returned by the service process is received within the service duration threshold, a non-responsive phenomenon of the service type occurs.

10. The method according to claim 1, wherein the multiple unresponsiveness phenomena of the target application include a broadcast type unresponsiveness phenomenon; The process of generating the broadcast type of no response phenomenon includes: In response to a broadcast request initiated by an application process of a target application, a broadcast duration threshold is set; Sending a broadcast registration message to a broadcast receiving process, so that the broadcast receiving process notifies the broadcast receiving process to call one or more other processes to perform broadcast work based on the broadcast registration message, and returns feedback information after the broadcast is completed; If the feedback information returned by the broadcast receiving process is not received within the broadcast duration threshold, a no-response phenomenon of the broadcast type occurs.

11. The method according to claim 1, wherein the multiple unresponsiveness phenomena of the target application include unresponsiveness phenomena of content provision type; The process of generating the unresponsive phenomenon of the content providing type includes: In response to a request initiated by an application process of a target application to obtain a content providing object, detecting a startup state of a content providing process corresponding to the content providing object; If the startup status indicates that the content providing process is not started, then creating the content providing process, notifying the content providing process to call one or more other processes, installing the content providing object, and returning feedback information after installing the content providing object, wherein the content providing object is configured with an installation time threshold; If no feedback information returned by the content providing process is received within the installation time threshold, a non-responsive phenomenon of the content providing type occurs.

12. The method according to claim 1, wherein the multiple unresponsiveness phenomena of the target application include unresponsiveness phenomena of input event distribution type; The process of generating the unresponsive phenomenon of the input event distribution type includes: If an input event is received, the currently received input event is added to the input queue, and an input distribution thread is awakened, wherein the input distribution thread is used to distribute each input event in the input queue to the application process of the target application in sequence for processing; When the distribution order of the currently received input event arrives, the application process of the target application is processing other input events, and thus a non-responsive phenomenon of the input event distribution type occurs.

13. A data processing device, comprising: an acquisition module, configured to acquire on-site information of various unresponsive phenomena among a plurality of unresponsive phenomena of a target application, any of which is generated during the process of running the target application based on a system code of an operating system; and any The field information of the unresponsive phenomenon is used to describe: the execution status of the system code when the corresponding unresponsive phenomenon occurs; A processing module, configured to perform commonality analysis on the field information of the various unresponsive phenomena to obtain commonality analysis results, and determine the fault point causing the unresponsive phenomenon from the system code according to the commonality analysis results; wherein the commonality analysis results include: common information in the field information of the various unresponsive phenomena; The processing module is used to perform repair processing on the system code according to the fault point, so as to run the target application based on the repaired system code.

14. A computer device comprising: Processor, memory, and network interface; The processor is connected to the memory and the network interface, wherein the network interface is used to provide a network communication function, the memory is used to store a computer program, and the processor is used to call the computer program to execute the data processing method according to any one of claims 1 to 12.

15. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, performs the data processing method according to any one of claims 1 to 12.

16. A computer program product comprising a computer program, which, when executed on a computer, enables the computer to execute the data processing method according to any one of claims 1 to 12.