A terminal learning software running performance monitoring and abnormality identification system

By designing a terminal learning software performance monitoring and anomaly identification system, the problem of unclear resource ownership during cross-functional unit switching was solved, and accurate anomaly root cause location and performance optimization were achieved.

CN122195719APending Publication Date: 2026-06-12HUNAN DIGITAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HUNAN DIGITAL TECHNOLOGY CO LTD
Filing Date
2026-05-13
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

Existing terminal learning software cannot accurately distinguish resource ownership when switching between functional units, making it difficult to locate the root cause of abnormal resource release and loading, thus affecting the technical direction of performance optimization.

Method used

Design a terminal learning software performance monitoring and anomaly identification system, including an anomaly judgment module, a coexistence monitoring module, a resource identity tracing module, and an anomaly root cause location module. By listening to switching commands, fully tracking the attributes of system resource objects and assigning them identity tags, the system can quantitatively analyze resource occupancy status and identify the root cause of switching performance anomalies.

Benefits of technology

It enables timely monitoring and accurate location of performance anomalies during switching, reduces false alarm rate, and improves the accuracy of anomaly identification and the targeted nature of performance optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122195719A_ABST
    Figure CN122195719A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of learning software performance monitoring, and relates to a terminal learning software running performance monitoring and abnormality identification system. The system captures switching instructions between internal functional units of the learning software by monitoring a terminal message bus, determines whether switching performance abnormality occurs according to end-to-end time consumption of switching, opens a concurrent monitoring window in response to the switching performance abnormality, traces system resource occupation object properties generated by a kernel in full, gives identity tags to memory objects, file handles, network sockets and active threads, extracts resource real-time sampling values carrying the identity tags, quantitatively analyzes resource occupation overlapping situations and change rules in a resource release process of a preceding unit and a resource loading process of a subsequent unit, identifies a root cause of the switching performance abnormality and outputs a report. The application can trace abnormal root causes in a learning software switching delay state, and helps improve software running stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of learning software performance monitoring technology, and relates to a terminal learning software performance monitoring and anomaly identification system. Background Technology

[0002] Terminal learning software typically includes multiple functional units such as symbol recognition, pronunciation practice, and semantic translation. Users frequently switch between units during use, so cross-unit interaction can be viewed as traversing the learning path. At the boundary of unit switching, it is necessary to simultaneously handle the release of resources from the previous unit and the loading of resources for the next unit, and the efficiency of resource scheduling directly affects the smoothness of software response.

[0003] Currently, there are two main approaches to performance monitoring during the switching process: one is application-layer timing, which records the total time from the issuance of the switching command to the display of the first frame on the interface of the subsequent module, in order to detect switching latency; the other is system-level resource sampling, which monitors the peak usage of CPU, memory, and other resources at the moment of switching, in order to determine whether overload has occurred.

[0004] However, existing technologies still have the following limitations: when current terminal learning software detects switching latency, it can only report the overall resource usage value and cannot distinguish whether the monitored resources such as memory, threads, and file handles belong to the preceding or following unit. This lack of attribution and tracing capability makes it impossible for the system to determine whether the abnormal resource usage is caused by resource residue due to incomplete resource destruction in the preceding unit, excessive loading impact in the following unit, or resource race conflicts caused by mutual interference between the two at the switching boundary. Because the root cause of the anomaly cannot be located, the switching latency is generally classified as an overall performance degradation, and the respective contributions of the preceding release phase and the following loading phase cannot be decomposed, resulting in a lack of clear technical direction for performance optimization. Summary of the Invention

[0005] In view of this, in order to solve the problems mentioned in the background technology, a terminal learning software performance monitoring and anomaly identification system is proposed.

[0006] The objective of this invention can be achieved through the following technical solution: This invention provides a terminal learning software performance monitoring and anomaly identification system, including: an anomaly determination module, a coexistence monitoring module, a resource identity tracing module, and an anomaly root cause localization module.

[0007] The anomaly determination module is connected to the coexistence monitoring module, the coexistence monitoring module is connected to the resource identity tracing module, and the resource identity tracing module is connected to the anomaly root cause localization module.

[0008] The anomaly detection module listens to the terminal message bus to capture switching instructions between functional units within the learning software, and determines whether a switching performance anomaly has occurred based on the end-to-end switching time.

[0009] The coexistence monitoring module, in response to switching performance anomalies, opens a coexistence monitoring window with a span of time covering the resource destruction phase of the preceding unit and the initialization and loading phase of the following unit.

[0010] The resource identity tracing module fully tracks the attributes of system resource occupancy objects generated by the kernel within the concurrent monitoring window. Through process context and memory page table mapping, it assigns identity tags to memory objects, file handles, network sockets, and active threads to distinguish whether resources belong to the preceding or following unit.

[0011] The anomaly root cause localization module extracts real-time sampled values ​​of resources carrying identity tags, quantitatively analyzes the overlapping status and changing patterns of resource occupation during the resource release process of the preceding unit and the resource loading process of the following unit, identifies the root cause of switching performance anomalies based on preset anomaly judgment rules, and outputs a report.

[0012] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0013] (1) The present invention monitors the terminal message bus to capture the switching instructions between functional units, determines whether the switching performance is abnormal based on the end-to-end switching time, and only starts the concurrent monitoring window when the switching time exceeds the standard, so as to avoid the consumption of system resources by continuous monitoring under normal conditions, and at the same time ensure that the entire process of resource release and loading can be captured in a timely manner when an anomaly occurs.

[0014] (2) This invention fully tracks the system resource occupancy object attributes generated by the kernel within a concurrent monitoring window, and assigns identity tags to memory objects, file handles, network sockets and active threads through process context and memory page table mapping, so as to distinguish whether the resources belong to the preceding unit or the following unit. Thus, when tracing the source of anomalies, it can clearly distinguish the source of resources of different execution units, and overcome the difficulty of locating resources caused by unclear resource ownership in the prior art.

[0015] (3) The present invention defines the release resistance quantization value corresponding to the resource residue anomaly, the loading impact quantization value corresponding to the loading overload anomaly, and the overlap intensity quantization value corresponding to the race state conflict anomaly. The main cause type is determined by the deviation amplitude of the historical average level, and a secondary verification is triggered to confirm the actual occurrence of the anomaly, which helps to reduce the false alarm rate and improve the accuracy of anomaly identification. Attached Figure Description

[0016] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a schematic diagram of the module connection of the present invention;

[0018] Figure 2 This is a schematic diagram of the execution logic of the anomaly determination module of the present invention;

[0019] Figure 3 This is a schematic diagram of the execution logic of the abnormal root cause localization module of the present invention. Detailed Implementation

[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0021] Please see Figure 1 As shown, the present invention provides a terminal learning software performance monitoring and anomaly identification system, including: an anomaly determination module, a coexistence monitoring module, a resource identity tracing module, and an anomaly root cause localization module.

[0022] The anomaly determination module is connected to the coexistence monitoring module, the coexistence monitoring module is connected to the resource identity tracing module, and the resource identity tracing module is connected to the anomaly root cause localization module.

[0023] Reference Figure 2 As shown, the anomaly determination module listens to the terminal message bus to capture switching instructions between functional units within the learning software, and determines whether a switching performance anomaly has occurred based on the end-to-end switching time.

[0024] In this embodiment, determining whether a handover performance anomaly has occurred based on the end-to-end handover time includes:

[0025] By deploying the message distribution layer on the terminal operating system, the switching instructions issued by each functional component of the learning software are obtained, and the preceding unit identifier as the starting item and the following unit identifier as the target item are extracted from them.

[0026] Record the time difference from receiving the switching instruction from the subsequent unit to the top-level view corresponding to the subsequent unit completing the first frame layout drawing and obtaining input focus, and mark it as the end-to-end switching time.

[0027] If the end-to-end switching time exceeds the baseline response threshold dynamically calculated by the current hardware configuration, a switching performance anomaly is determined to have occurred.

[0028] It should be noted that the first frame layout drawing includes view initialization, view hierarchy construction, layout measurement and layout, and first frame rendering output. By registering the global layout listener interface of the view tree observer of the root view of the subsequent unit, when the layout completion callback method of the global layout listener interface is triggered for the first time, it can be determined that the subsequent unit has completed the first frame layout drawing.

[0029] The process of the top-level view obtaining input focus includes the top-level root view completing system focus application, input event binding, and preempting global input interaction permission after switching. By listening to the window focus change callback interface of the window where the subsequent unit is located, when the focus status parameter passed by the window focus change callback interface indicates that focus has been obtained, it can be determined that the top-level view has obtained input focus.

[0030] The calculation process of the baseline response threshold is as follows: obtain the current CPU frequency and active core count of the terminal device, and calculate the product of the two as the processing capacity baseline; select the average interrupt response latency of the system within 0.5 seconds before the switching instruction is issued; multiply the processing capacity baseline by the current remaining memory capacity of the terminal device after normalization, and use the ratio of the product result to the average interrupt response latency as the baseline response threshold.

[0031] The coexistence monitoring module, in response to switching performance anomalies, opens a coexistence monitoring window with a span of time covering the resource destruction phase of the preceding unit and the initialization and loading phase of the following unit.

[0032] In this embodiment, the concurrent monitoring window performs the following opening and closing process:

[0033] The call time of the first resource release function in the process space of the preceding unit is captured by the application layer hooking technology, and used as the start time of the concurrent monitoring window;

[0034] If no resource release function call is captured within the preset waiting time after the handover performance is determined to be abnormal, the start time is changed to the handover performance abnormality determination time. The preset waiting time is dynamically determined based on the average resource release delay of the preceding unit when the handover performance abnormality occurs. Specifically, the time interval from the receiving of the exit instruction by the preceding unit to the first resource release function being called in the last five handovers of the same type can be extracted, and the maximum time interval is selected as the preset waiting time. If there are less than five records, the system default value (50 milliseconds) is used as the preset waiting time.

[0035] The closing of concurrent monitoring windows requires both of the following conditions to be met simultaneously:

[0036] a. All resource tags belonging to the preceding unit have been marked as destroyed or invalid, and no new resource objects belonging to the preceding unit have been added in two consecutive scans;

[0037] The criteria for determining whether the resource tag of the preceding unit is destroyed or invalid include:

[0038] The memory page of the memory object has been returned to the system's free memory pool, or the reference count of the memory object is zero and its occupied space has not been reallocated by other units;

[0039] The file handle descriptor has been reclaimed by the kernel, or the file path that the handle points to has been removed from the list of open files;

[0040] The active thread has finished executing its exit routine, and its kernel control block is marked as terminated and is no longer scheduled by the scheduler.

[0041] The network socket has been explicitly closed, and the port number and connection status have been removed from the active list of the network protocol stack.

[0042] b. The sequence of adjacent change amplitudes of the resource occupancy belonging to the subsequent unit in multiple consecutive sampling periods shows an alternating positive and negative sign and an overall decreasing trend in the absolute value of adjacent change amplitudes; wherein, the adjacent change amplitude is specifically the resource occupancy of the current sampling point minus the resource occupancy of the previous sampling point. The trend of alternating positive and negative signs and an overall decreasing trend in the absolute value of adjacent change amplitudes means that there are no two consecutive adjacent change amplitudes with the same sign, and more than half of the adjacent change amplitude pairs in the sequence satisfy that the absolute value of the latter is less than or equal to the absolute value of the former, and there is no situation where more than three consecutive absolute values ​​increase.

[0043] When both conditions a and b are met, close the concurrent monitoring window.

[0044] If the maximum span of the concurrent monitoring window is exceeded from the start time of the window and the above two conditions (specifically referring to condition a and condition b) are still not met simultaneously, the concurrent monitoring window will be forcibly closed and this switch will be marked as a window timeout non-convergence anomaly.

[0045] It should be noted that condition a, which is required for the concurrent monitoring window to be closed, indicates that the resource release process of the preceding unit has been completely completed and no longer occupies system resources. Condition b indicates that the resource loading process of the following unit has entered a stable convergence state, and the loading fluctuation has decayed to a negligible level. When both conditions a and b are met, it means that the concurrent monitoring window has fully covered the resource destruction phase of the preceding unit and the initialization loading phase of the following unit, and therefore the monitoring window can be closed.

[0046] The maximum span duration data of the concurrent monitoring window is preset from the screen refresh cycle of the terminal device. Specifically, it can be set to a preset multiple of the screen refresh cycle, with 10 times selected by default.

[0047] The resource identity tracing module fully tracks the attributes of system resource occupancy objects generated by the kernel within the concurrent monitoring window. Through process context and memory page table mapping, it assigns identity tags to memory objects, file handles, network sockets, and active threads to distinguish whether resources belong to the preceding or following unit.

[0048] In this embodiment, distinguishing whether a resource belongs to a preceding or succeeding unit includes:

[0049] Memory objects: Intercept the call stack of dynamic memory allocation functions, trace back the call path of the allocation request, and mark it as a resource of the previous unit if the call path points to the binary segment space or dynamic link library of the previous unit; if it points to the entry function or resource pool address space of the next unit, it is marked as a resource of the next unit.

[0050] Specifically, the interception of the call stack of the dynamic memory allocation function is achieved through kernel-level... , , and The memory allocation function is implemented by setting an inline hook, or by replacing the function address in the global offset table for user-mode interception; the backtracking call path obtains the return address of each layer by traversing the stack frame of the current thread, and compares the return address with the base address and offset range of each functional unit code segment loaded into memory; if the return address falls within the address range of the preceding unit code segment or its loaded dynamic link library, it is determined that the memory object belongs to the preceding unit; otherwise, the address range of the following unit is further compared.

[0051] Active thread: By calling the thread information query interface provided by the operating system, the thread group identifier in the task control block is read, and the base address of the thread code segment is compared with the load address range of each functional unit. If the thread is executing the destructor or cleanup callback defined in the preceding unit, it is marked as a preceding resource; if the thread is executing the initialization function or loading routine of the following unit, it is marked as a following resource.

[0052] File handle: tracks the list of open file descriptors, through... Identify the resource file path pointed to by the handle. If the path involves the offline courseware package or configuration directory of the previous unit, it is marked as a resource of the previous unit; if it involves the audio, image or script model file of the subsequent unit, it is marked as a resource of the subsequent unit.

[0053] Network sockets: Intercept socket creation and binding system calls, and record the port number and connection status of the socket. If the socket is created by the network request thread of the preceding unit and still holds a connection during its destruction phase, specifically, the socket remains in the ESTABLISHED state after the preceding unit exits, and the socket's creator thread has been marked as the preceding unit, then it is marked as a preceding unit resource. If the socket is created by the initialization process of the following unit and is in a data transmission and reception state, specifically, the socket is created during the initialization process of the following unit and is not explicitly closed, then it is marked as a following unit resource.

[0054] When the ownership of a resource cannot be confirmed, it is marked as a neutral resource and is not included in the statistics of the preceding or succeeding units.

[0055] Reference Figure 3 As shown, the abnormal root cause localization module extracts real-time sampled values ​​of resources carrying identity tags, quantitatively analyzes the overlapping status and changing patterns of resource occupation during the resource release process of the preceding unit and the resource loading process of the following unit, identifies the root cause of switching performance abnormality according to preset abnormal judgment rules, and outputs a report.

[0056] In this embodiment, the quantitative analysis of the overlapping status and changing patterns of resource occupancy during the resource release process of the preceding unit and the resource loading process of the following unit includes:

[0057] Within the concurrent monitoring window, resource sampling values ​​are extracted at a fixed sampling period to form the preceding unit resource sequence and the following unit resource sequence, respectively.

[0058] Calculate the total resources for each sampling point, as well as the resource change between adjacent sampling points within the resource sequence. The resource change of the preceding unit is marked as the release amount, and the resource change of the following unit is marked as the loading amount. The total resources are the sum of the resource occupancy of the preceding unit and the resource occupancy of the following unit at the same sampling point.

[0059] The concurrent monitoring window is divided into a first partition and a second partition, with the midpoint of the window time as the boundary: the number of the center sampling point is obtained by dividing the total number of sampling points in the window by two and rounding down. The first partition is the time from the start of the window to the corresponding time of the center sampling point, and the second partition is the time from the center sampling point to the end of the window.

[0060] Within the second partition, sampling points whose total resources exceed their own average in the first partition are counted. The number of sampling points is multiplied by a fixed sampling period to obtain the cumulative duration. The proportion of this cumulative duration to the total duration of the second partition is used as the quantification value of the overlap intensity. The average in the first partition is the arithmetic mean of the total resources of all sampling points in the first partition.

[0061] The maximum number of sampling periods during which the release volume is continuously lower than its own average value in the first partition is used as the release retardation quantification value; among them, the state in which the release volume is continuously lower than its own average value in the first partition is called the low activity state.

[0062] The ratio of the maximum load value to its average value in the first partition is used as the quantification value of the load impact.

[0063] In this embodiment, the preset anomaly determination rules include the following:

[0064] Based on the quantitative analysis results, the root causes of switching performance anomalies corresponding to different quantification values ​​are defined as follows: release inhibition quantification value corresponds to resource residue anomaly, loading impact quantification value corresponds to loading overload anomaly, and overlap intensity quantification value corresponds to race state conflict anomaly.

[0065] By comparing the performance of each quantification value in this handover with the historical average level of the same type of handover for the same device, the root cause corresponding to the quantification value with the largest deviation is selected as the main cause type, and a secondary verification process for the main cause type is triggered.

[0066] The maintenance and updating process of the historical average level is as follows: the system maintains a historical database for each type of switching event. The switching event type is determined by the preceding unit identifier and the following unit identifier. The historical database stores the most recent... The records of each quantized value in a normal handover event. Normal operation means that the end-to-end handover time does not exceed the baseline response threshold. The historical average levels include: historical average overlap intensity, historical average release delay, and historical average loading impact. All three are the most recent... The arithmetic mean of all quantization values ​​during a normal switch. The value is a preset positive integer, ranging from 5 to 20; when there are insufficient records during normal switching. Next, calculate the arithmetic mean based on the existing records, or skip the comparison of quantified value deviations and directly execute the secondary verification process for resource residue anomalies, overload anomalies, and race condition anomalies in sequence, and output all anomaly types with true verification results as the primary cause type; when the number of records reaches After this, for each new normal switch record, the oldest record is removed to keep the historical database size within a certain limit. Second-rate;

[0067] For any quantized value obtained from this switch, its deviation is calculated by dividing the absolute difference between the quantized value and the historical average level by the historical average level.

[0068] In this embodiment, the secondary verification process for resource residue anomalies includes:

[0069] For the resource subsequence of the preceding unit in the second partition of the coexisting monitoring window, the decay trend analysis is performed. If the release amount of multiple (three or more) consecutive adjacent sampling points is in the preset low value range, it is determined that there is a cleanup blockage. Then, residual resource reference chain analysis is performed on each resource object that is still alive and belongs to the preceding unit. When it is determined that the reference chain of at least one resource object is in an invalid holding state, it is confirmed that a resource residual anomaly has occurred.

[0070] It should be noted that the preset low value range is defined as follows: ,in A preset minimum positive threshold is used to determine whether the release amount is close to zero; The acquisition method is as follows: The absolute values ​​of the release amounts at each sampling point within the first partition are collected during the five most recent normal handovers of the preceding unit. The absolute arithmetic mean of the release amounts at each sampling point is then calculated, and 10% of this absolute arithmetic mean is taken as the threshold value. If there are fewer than five normal record switching attempts, then... Use the smallest unit of measurement for the resource usage of the preceding unit. For example, when memory is measured in pages, the default is... The default value is 4KB, and file handles are listed in units of number. =1;

[0071] The execution process of the residual resource reference chain analysis is as follows: traverse all resource objects in the current operating system kernel that are still alive and whose identity tags belong to the previous unit. The resource objects include memory objects, file handles, network sockets and active threads.

[0072] For each resource object, the reference chain is formed by reading the reference count table maintained by the kernel or the object holder record and tracing the threads or processes that reference the resource object layer by layer.

[0073] Determine if the reference chain satisfies any of the following invalid holding conditions:

[0074] (i) The end-holder thread of the reference chain has terminated, but has not released the reference to the resource object;

[0075] (ii) The reference count of the resource object has been reduced to zero, but the memory block it occupies has not been reclaimed, or the file handle has not been closed;

[0076] (iii) The handle associated with the resource object is open, but there are no active read / write streams, and the thread that opened it has exited;

[0077] If any of the above invalid holding conditions are met, the resource object is determined to be in an invalid holding state;

[0078] It should be noted that the basis for confirming a resource residue exception by checking if the reference chain of a resource object is in an invalid holding state is that the resource residue exception manifests as the preceding unit failing to fully release the system resources it occupies during the exit or destruction phase, resulting in the resource still being recorded by the kernel but no longer having a valid user. An invalid holding state means that the resource object still maintains a holding relationship, while the source of this holding relationship (thread, process, etc.) has terminated or no longer has a legitimate need for use. Therefore, once a resource object belonging to a preceding unit is in an invalid holding state, it proves that the preceding unit should have released it during the destruction phase but failed to do so, constituting a residue.

[0079] In this embodiment, the secondary verification process for overload anomalies includes:

[0080] A loading quantity sequence is constructed according to the sampling point sequence. The upper quartile and interquartile range of the loading quantity sequence are calculated, and the limit value is set as the sum of the upper quartile and the interquartile range.

[0081] Sampling points with load amounts greater than or equal to the over-limit threshold are defined as over-limit sampling points. If the over-limit sampling points are clustered on the time axis, and the ratio of the load amounts of adjacent over-limit sampling points is greater than the upper quartile of the ratio of the load amounts of all adjacent sampling points (including non-over-limit sampling points) in the load amount sequence, then an overload anomaly is confirmed. The clustering of over-limit sampling points on the time axis specifically means that there are three or more consecutive over-limit sampling points, and there are no non-over-limit sampling points between the consecutive over-limit sampling points. The ratio of the load amounts of adjacent over-limit sampling points is specifically the load amount of the subsequent over-limit sampling point divided by the load amount of the previous over-limit sampling point.

[0082] In this embodiment, the secondary verification process for race condition conflict anomalies includes:

[0083] Calculate the coefficient of variation of the total resource sequence of the first and second partitions within the concurrent monitoring window. The coefficient of variation is defined as the standard deviation of the total resource sequence divided by the mean. A resource race condition is determined when the following conditions are met simultaneously:

[0084] I. The coefficient of variation of the second partition is greater than the coefficient of variation of the first partition;

[0085] II. Calculate the median of the release amount and the loading amount in the first partition of the coexisting monitoring window, and use them as the comparison release amount and the comparison loading amount, respectively. Search for the number of sampling points in the second partition that simultaneously satisfy the condition that the release amount is less than the comparison release amount and the loading amount is less than the comparison loading amount. The number of sampling points is greater than half of the total number of sampling points in the second partition.

[0086] By intercepting the hardware resource request interface and recording the unit identifier holding the lock, the lock status and request response of exclusive hardware resources are monitored. If, in any sampling period within the concurrent monitoring window, the preceding unit has not yet released the hardware lock and the hardware request issued by the subsequent unit is returned to the device busy state or timed out without receiving a reply, it is determined to be a hardware interface race condition.

[0087] When at least one of the above resource race condition determination and hardware interface race condition determination is met, a race condition conflict anomaly is confirmed.

[0088] It should be noted that conditions I and II above are used to determine resource race conditions based on the following: the essence of resource race conditions lies in the mutual interference between preceding releases and subsequent loads, causing abnormal fluctuations in the total resource occupancy. The first partition is dominated by unilateral operations, resulting in relatively stable fluctuations; the second partition enters an overlapping phase, where the conflict intensifies the fluctuations. Therefore, the coefficient of variation of the total resource sequence in the second partition is greater than that in the first partition, indicating the existence of a conflict.

[0089] Meanwhile, mutual blocking causes the efficiency of release and loading to decrease synchronously at the same time. The median release and loading amounts in the first partition represent the typical level under conditions of no conflict or mild conflict. In the second partition, if the release and loading amounts of more than half of the sampling points are lower than the corresponding median, it indicates that both are synchronously inefficient for most of the time, which is direct quantitative evidence of mutual blocking.

[0090] In this embodiment, the output report includes:

[0091] The generated report contains a textual description of the root cause of the anomaly and a detailed list of the specific resource types that caused the anomaly. The detailed list of specific resource types includes the thread identifier and a list of unclosed file handles or network socket port numbers that caused the resource residue anomaly, the specific resource file path or initialization step call stack information that caused the load overload anomaly, and the conflicting resource type or the hardware component identifier involved that caused the race condition anomaly.

[0092] To further clarify, the resource race conditions corresponding to the above-mentioned conflicting resource types are determined by monitoring the resource lock or queue with the longest waiting time in the kernel during the conflict, and the hardware component identifiers involved correspond to hardware interface race conditions.

[0093] The results of each anomaly identification are associated with and stored along with the software version number and terminal hardware parameters;

[0094] The report is fed back to the performance optimization unit of the learning software through an asynchronous callback interface. Based on the root cause type identified in the report, the performance optimization unit automatically triggers targeted optimization actions, including: forced resource reclamation for resource residue, delayed asynchronous initialization configuration for overload, and switching sequence queuing scheduling for resource race conditions.

[0095] The above content is merely an example and illustration of the concept of the present invention. Those skilled in the art can make various modifications or additions to the specific embodiments described, or use similar methods to replace them, as long as they do not deviate from the concept of the invention or exceed the scope defined by the present invention, and all such modifications and additions should fall within the protection scope of the present invention.

Claims

1. A system for monitoring the performance and identifying anomalies in terminal learning software, characterized in that, include: The anomaly detection module listens to the terminal message bus to capture switching instructions between functional units within the learning software, and determines whether a switching performance anomaly has occurred based on the end-to-end switching time. The coexistence monitoring module, in response to switching performance anomalies, opens a coexistence monitoring window with a span of time covering the resource destruction phase of the preceding unit and the initialization and loading phase of the following unit. The resource identity tracing module fully tracks the attributes of system resource occupancy objects generated by the kernel within the concurrent monitoring window. Through process context and memory page table mapping, it assigns identity tags to memory objects, file handles, network sockets, and active threads to distinguish whether resources belong to the preceding or following unit. The anomaly root cause localization module extracts real-time sampled values ​​of resources carrying identity tags, quantitatively analyzes the overlapping status and changing patterns of resource occupation during the resource release process of the preceding unit and the resource loading process of the following unit, identifies the root cause of switching performance anomalies based on preset anomaly judgment rules, and outputs a report.

2. The terminal learning software performance monitoring and anomaly identification system according to claim 1, characterized in that, The method of determining whether a handover performance anomaly has occurred based on the end-to-end handover time includes: By deploying the message distribution layer on the terminal operating system, the switching instructions issued by each functional component of the learning software are obtained, and the preceding unit identifier as the starting item and the following unit identifier as the target item are extracted from them. Record the time difference from receiving the switching instruction from the subsequent unit to the top-level view corresponding to the subsequent unit completing the first frame layout drawing and obtaining input focus, and mark it as the end-to-end switching time. If the end-to-end switching time exceeds the baseline response threshold dynamically calculated by the current hardware configuration, a switching performance anomaly is determined to have occurred.

3. The terminal learning software performance monitoring and anomaly identification system according to claim 1, characterized in that, The concurrent monitoring window performs the following opening and closing process: The call time of the first resource release function in the process space of the preceding unit is captured by the application layer hooking technology, and used as the start time of the concurrent monitoring window; If no resource release function call is captured within the preset waiting time after the switching performance is determined to be abnormal, the starting time will be the time when the switching performance is determined. The closing of concurrent monitoring windows requires both of the following conditions to be met simultaneously: a. All resource tags belonging to the preceding unit have been marked as destroyed or invalid, and no new resource objects belonging to the preceding unit have been added in two consecutive scans; b. The sequence of adjacent changes in the resource occupancy of the subsequent unit over multiple consecutive sampling periods shows an alternating positive and negative sign and an overall decreasing trend in the absolute value of adjacent changes. When both conditions a and b are met, close the concurrent monitoring window. If the maximum span of the concurrent monitoring window is exceeded from the start time of the window and the above two conditions are still not met simultaneously, the concurrent monitoring window will be forcibly closed and the switch will be marked as a window timeout non-convergence anomaly.

4. The terminal learning software performance monitoring and anomaly identification system according to claim 1, characterized in that, The distinction between resources belonging to a preceding or succeeding unit includes: Memory objects: Intercept the call stack of dynamic memory allocation functions, trace back the call path of the allocation request, and mark it as a resource of the previous unit if the call path points to the binary segment space or dynamic link library of the previous unit; if it points to the entry function or resource pool address space of the next unit, it is marked as a resource of the next unit. Active thread: Reads the thread group identifier within the task control block, compares the base address of the thread code segment with the load address range of each functional unit, marks the cleanup thread of the destruction process as the preceding unit resource, and marks the initialization thread of the loading process as the following unit. File handle: Track the list of open file descriptors, identify the resource file path pointed to by the handle, and mark it as a resource of the previous unit if the path involves the offline courseware package or configuration directory of the previous unit; mark it as a resource of the previous unit if the path involves the audio, image or script model file of the next unit. Network sockets: Intercept system calls for socket creation and binding, and record the port number and connection status of the socket; if the socket is created by the network request thread of the preceding unit and still holds a connection during its destruction phase, it is marked as a resource of the preceding unit; if it is created by the initialization process of the following unit and is in a data transmission and reception state, it is marked as a resource of the following unit. When the ownership of a resource cannot be confirmed, it is marked as a neutral resource and is not included in the statistics of the preceding or succeeding units.

5. The terminal learning software performance monitoring and anomaly identification system according to claim 1, characterized in that, The quantitative analysis of the resource occupation overlap and change patterns during the resource release process of the preceding unit and the resource loading process of the following units includes: Within the concurrent monitoring window, resource sampling values ​​are extracted at a fixed sampling period to form the preceding unit resource sequence and the following unit resource sequence, respectively. Calculate the total resources at each sampling point, as well as the resource change between adjacent sampling points within the resource sequence. The resource change of the preceding unit is marked as the release amount, and the resource change of the following unit is marked as the loading amount. The concurrent monitoring window is divided into a first partition and a second partition, with the midpoint of the window time as the boundary. The percentage of cumulative duration during which the total statistical resources exceed the average of the first partition of the window is used as the quantification value of overlap intensity; the longest sampling period during which the statistical release volume continuously maintains a low-activity state is used as the quantification value of release stagnation; and the deviation between the maximum and average values ​​of the statistical loading volume is used as the quantification value of loading impact.

6. The terminal learning software performance monitoring and anomaly identification system according to claim 5, characterized in that, The preset anomaly detection rules include the following: Based on the quantitative analysis results, the root causes of switching performance anomalies corresponding to different quantification values ​​are defined as follows: release inhibition quantification value corresponds to resource residue anomaly, loading impact quantification value corresponds to loading overload anomaly, and overlap intensity quantification value corresponds to race state conflict anomaly. By comparing the performance of each quantification value in this handover with the historical average level of the same type of handover for the same device, the root cause corresponding to the quantification value with the largest deviation is selected as the primary cause type, and a secondary verification process for the primary cause type is triggered.

7. The terminal learning software performance monitoring and anomaly identification system according to claim 6, characterized in that, The secondary verification process for resource residue anomalies includes: For the resource subsequence of the preceding unit in the second partition of the coexisting monitoring window, the decay trend analysis is performed. If the release amount of multiple consecutive adjacent sampling points is in the preset low value range, it is determined that there is a cleanup blockage. For each resource object that is still alive and belongs to the preceding unit, the residual resource reference chain analysis is performed. When it is determined that the reference chain of at least one resource object is in an invalid holding state, the resource residual anomaly is confirmed to have occurred.

8. The terminal learning software performance monitoring and anomaly identification system according to claim 6, characterized in that, The secondary verification process for overload exceptions includes: A loading quantity sequence is constructed according to the sampling point sequence, the upper quartile and interquartile range of the loading quantity sequence are calculated, and the over-limit limit value is set based on the calculation results. Sampling points with loading amounts greater than or equal to the over-limit threshold are defined as over-limit sampling points. If the over-limit sampling points are clustered on the time axis and the ratio of the loading amounts of adjacent over-limit sampling points is greater than the upper quartile of the ratio of the loading amounts of all adjacent sampling points in the loading amount sequence, then an overload anomaly is confirmed to have occurred.

9. A terminal learning software performance monitoring and anomaly identification system according to claim 6, characterized in that, The secondary verification process for race condition conflict anomalies includes: Calculate the coefficient of variation of the total resource sequence of the first and second partitions within the concurrent monitoring window. A resource race condition is determined when the following conditions are met simultaneously: I. The coefficient of variation of the second partition is greater than the coefficient of variation of the first partition; II. Calculate the median of the release amount and the loading amount in the first partition of the coexisting monitoring window, and use them as the comparison release amount and the comparison loading amount, respectively. Search for the number of sampling points in the second partition that simultaneously satisfy the condition that the release amount is less than the comparison release amount and the loading amount is less than the comparison loading amount. The number of sampling points is greater than half of the total number of sampling points in the second partition. Monitor the lock status and request response of exclusive hardware resources. If, within any sampling period in the concurrent monitoring window, the preceding unit has not yet released the hardware lock and the hardware request issued by the subsequent unit is returned to the device busy state or timed out without receiving a response, it is determined to be a hardware interface race condition. When at least one of the above two determinations is true, a race condition conflict anomaly is confirmed.

10. A terminal learning software performance monitoring and anomaly identification system according to claim 6, characterized in that, The output report includes: The generated report includes a textual description of the root cause of the anomaly and details of the specific resource type that caused the anomaly; The results of each anomaly identification are associated with and stored along with the software version number and terminal hardware parameters; The report is fed back to the performance optimization unit of the learning software through an asynchronous callback interface. Based on the root cause type identified in the report, the performance optimization unit automatically triggers targeted optimization actions, including: forced resource reclamation for resource residue, delayed asynchronous initialization configuration for overload, and switching sequence queuing scheduling for resource race conditions.