PCIE power consumption test device
By using the operating system kernel event tracking system and deep learning model in the PCIE device power consumption test, the problem of synchronization between hardware power consumption data and software system log time is solved, and accurate diagnosis and optimization of PCIE link abnormal status is achieved.
Patent Information
- Application Number
- CN202510928201.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-07
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2045-07-07
AI Technical Summary
In the existing technology, PCIE device power consumption testing cannot achieve accurate time synchronization between hardware power consumption data and software system logs, making it difficult to accurately attribute and optimize power consumption anomalies.
Using the operating system kernel event tracing system as a data fusion platform, the power consumption sampling points collected in real time by external hardware are injected into the kernel event tracing session as custom events. They coexist with the kernel state change events captured by the system itself at the same high-precision timestamp, and PCIE abnormal patterns are automatically identified through a deep learning model.
It achieves accurate and automatic judgment of abnormal status of PCIE link, and improves the efficiency and accuracy of diagnosis of power consumption problems.
Smart Images

Figure CN120492275B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of power consumption testing, and more particularly, in an embodiment of the present application, relates to a PCIE power consumption testing device. Background Art
[0002] With the rapid development of computer technology, the Peripheral Component Interconnect Express (PCIE) standard has become the mainstream bus interface for connecting central processing units (CPUs) with high-performance peripherals such as graphics processing units (GPUs), solid-state drives (SSDs), and high-speed network cards. The continuous improvement in PCIE device performance has also been accompanied by a significant increase in power consumption and increasingly complex power management strategies. Accurately measuring and analyzing the power consumption characteristics of PCIE devices under different workloads and power states is crucial for ensuring overall system stability, optimizing energy efficiency, and verifying that hardware designs comply with specifications.
[0003] In existing technology, power consumption testing of PCIE devices typically relies on external power measurement hardware (such as a high-precision power meter or oscilloscope) combined with control software running on the operating system. Testers trigger specific workloads or power management instructions through software, while the external hardware simultaneously collects power consumption data. However, this approach has a key inherent flaw: the power consumption data is poorly correlated with system status events. The power consumption data stream collected by the hardware and the system operation log recorded by the software are two independent data sources, and they can only be roughly aligned using timestamps. Due to system interrupts, task scheduling delays, and differences between different clock domains, it is difficult to achieve microsecond-level synchronization between power consumption changes and the specific kernel-level events that triggered them (such as driver calls and power state transition requests). This timing uncertainty makes it difficult to accurately attribute instantaneous power consumption spikes or abnormal fluctuations to specific system behavior, severely impacting the efficiency of problem location and the depth of power consumption optimization.
[0004] Therefore, an optimized PCIE power consumption testing device is desired. Summary of the Invention
[0005] In order to solve the above technical problems, the present application is proposed. An embodiment of the present application provides a PCIE power consumption test device, which can break the barrier between hardware power consumption data and software system logs, and innovatively utilize the operating system kernel event tracing system as a unified data fusion platform. By injecting the power consumption sampling points collected in real time by external hardware as custom events into the kernel event tracing session in real time, it can coexist with the kernel state change events captured by the system itself under the same high-precision timestamp, thereby generating a unified tracing event stream that is perfectly aligned in time. On this basis, PCIE abnormal patterns are further automatically identified from massive tracing data. Through a deep learning model, the local timing features of the power consumption sequence are first encoded, and then the pattern evolution law of the entire time domain is further captured, ultimately achieving accurate and automated judgment of the abnormal state of the PCIE link, thereby helping to improve the diagnostic efficiency and accuracy of power consumption problems.
[0006] According to one aspect of the present application, a PCIE power consumption test device is provided, which includes: a test configuration module, which is used to initialize the connection with the power consumption measurement hardware according to the test configuration file through the software main controller, and configure and start the kernel event tracing session according to the kernel tracing provider list; a power consumption data real-time input module, which is used to start the power consumption data real-time input service to obtain an original power consumption data stream; a kernel tracing module, which is used to call the kernel tracing API to write the original power consumption data stream as a power consumption sampling event into the kernel event tracing session to obtain a unified tracing event stream; a kernel event state change module, which is used to capture the kernel-level state changes caused by the operation of the software main controller through the kernel tracing system and write them into the unified tracing event stream to obtain a state change kernel event; and an original tracing file collection and storage module, which is used to save the state change kernel event into a file after the test is completed to obtain an original tracing file.
[0007] Compared with the prior art, the PCIE power consumption test device provided by this application can break the barrier between hardware power consumption data and software system logs, and innovatively use the operating system kernel event tracing system as a unified data fusion platform. By taking the power consumption sampling points collected in real time by external hardware as custom events and injecting them into the kernel event tracing session in real time, it can coexist with the kernel state change events captured by the system itself under the same high-precision timestamp, thereby generating a unified tracing event stream that is perfectly aligned in time. On this basis, PCIE abnormal patterns are further automatically identified from massive tracing data. Through the deep learning model, the local timing features of the power consumption sequence are first encoded, and then the pattern evolution law of the entire time domain is further captured, and finally the accurate and automatic judgment of the abnormal state of the PCIE link is achieved, which helps to improve the diagnostic efficiency and accuracy of power consumption problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] The above and other purposes, features, and advantages of the present application will become more apparent through a more detailed description of the embodiments of the present application in conjunction with the accompanying drawings. The accompanying drawings are intended to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the drawings, the same reference numerals generally represent the same components or steps.
[0009] Figure 1 4 is a system block diagram of a PCIE power consumption testing device according to an embodiment of the present application.
[0010] Figure 2 Schematic diagram of data flow of a PCIE power consumption test device according to an embodiment of the present application.
[0011] Figure 3 This is a block diagram of a full-time domain power consumption mode feature tracking module in a PCIE power consumption testing device according to an embodiment of the present application.
[0012] Figure 4 This is a block diagram of a power consumption local timing perception window determination unit in a PCIE power consumption testing device according to an embodiment of the present application. DETAILED DESCRIPTION
[0013] Various exemplary embodiments, features, and aspects of the present application will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise indicated.
[0014] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0015] In addition, numerous specific details are provided in the following detailed description to better illustrate the present application. Those skilled in the art will appreciate that the present application can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art are not described in detail in order to highlight the main purpose of the present application.
[0016] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. Throughout the description of this application, "plurality" means two or more, unless otherwise specifically defined.
[0017] To address the technical issues of PCIE power consumption data and system kernel events, making it difficult to accurately synchronize them, and thus to attribute abnormal power consumption, the technical solution of this application proposes a PCIE power consumption test device. This device breaks down the barriers between hardware power consumption data and software system logs, innovatively leveraging the operating system kernel event tracing system as a unified data fusion platform. By injecting power consumption sampling points collected in real time by external hardware into the kernel event tracing session as custom events, these events coexist with kernel state change events (such as API calls and power policy switches) captured by the system itself at the same high-precision timestamp, generating a perfectly time-aligned unified tracing event stream. This fundamentally addresses the issues of heterogeneous data sources and inaccurate timing correlation. Furthermore, this solution automatically identifies PCIE anomaly patterns from massive amounts of tracing data. This process, using a deep learning model, first encodes the local timing features of the power consumption sequence and then captures its full-time pattern evolution. Ultimately, this enables accurate and automated determination of PCIE link anomaly states, thereby improving the efficiency and accuracy of power consumption problem diagnosis.
[0018] Figure 1 4 is a system block diagram of a PCIE power consumption testing device according to an embodiment of the present application. Figure 2 Schematic diagram of data flow of the PCIE power consumption test device according to the embodiment of the present application. Figure 1 and Figure 2As shown, the PCIE power consumption test device 100 according to the embodiment of the present application includes: a test configuration module 110, which is used to initialize the connection with the power consumption measurement hardware according to the test configuration file through the software main controller, and configure and start the kernel event tracing session according to the kernel tracing provider list; a power consumption data real-time input module 120, which is used to start the power consumption data real-time input service to obtain the original power consumption data stream; a kernel tracing module 130, which is used to call the kernel tracing API to write the original power consumption data stream as a power consumption sampling event into the kernel event tracing session to obtain a unified tracing event stream; a kernel event state change module 140, which is used to capture the kernel-level state changes caused by the operation of the software main controller through the kernel tracing system and write it into the unified tracing event stream to obtain a state change kernel event; an original tracing file collection and storage module 150, which is used to save the state change kernel event into a file after the test is completed to obtain the original tracing file. In particular, according to the PCIE power consumption testing device 100 of the embodiment of the present application, it also includes: an offline parsing module 160, which is used to perform offline parsing on the original tracking file to obtain a time series of power consumption data points; a power consumption timing pattern feature extraction module 170, which is used to perform sequence segmentation on the time series of the power consumption data points and then perform power consumption timing pattern feature extraction based on the LSTM model on each local time segment of the power consumption data to obtain a time series of power consumption local timing pattern feature encoding vectors; a full-time domain power consumption pattern feature tracking module 180, which is used to perform full-time domain power consumption pattern feature tracking on the time series of the power consumption local timing pattern feature encoding vectors to obtain full-time domain power consumption timing pattern features; a PCIE power consumption detection module 190, which is used to determine whether there is an abnormality in the PCIE link based on the full-time domain power consumption timing pattern features.
[0019] In the aforementioned PCIE power consumption testing device 100, the nursing information data acquisition module 110 is used to initialize a connection with the power consumption measurement hardware via a software host controller according to a test configuration file, and to configure and initiate a kernel event tracing session based on the kernel trace provider list. It should be understood that to accurately capture the power consumption of PCIE devices and correlate it with system behavior, it is necessary to first ensure that the test software can establish stable and reliable communication with the physical power consumption measurement hardware (such as a power meter) and simultaneously prepare an operating system-level event recording mechanism. Because different power consumption measurement hardware may have different interfaces, protocols, or configuration parameters, initialization via a test configuration file (e.g., containing specific power meter configuration information) provides flexibility and configurability to adapt to different test environments. Furthermore, kernel event tracing is key to capturing changes in the underlying system state. It is necessary to pre-define which types of kernel events are of interest (i.e., the kernel trace provider list) and initiate a session to prepare for recording.
[0020] In particular, in an embodiment of the present application, the test configuration module is used to: initialize the connection between the software main controller and the power consumption measurement hardware according to the power consumption meter configuration in the test configuration file. By initializing the connection between the software main controller and the power consumption measurement hardware according to the test configuration file, and configuring and starting the kernel event tracing session according to the kernel trace provider list, it can ensure the accurate access of the power consumption data source on the one hand, that is, the software main controller can successfully connect and control the power consumption measurement hardware according to the preset configuration, laying the foundation for the subsequent real-time acquisition of the original power consumption data stream (such as voltage, current); on the other hand, it can build a unified event recording framework, that is, configure and start a kernel event tracing session. This session will serve as a unified carrier for subsequent power consumption sampling events and kernel state change events, and is the key to solving the problem of difficulty in accurately aligning power consumption data with system event timestamps.
[0021] In the aforementioned PCIE power consumption test device 100, the real-time power consumption data input module 120 is used to initiate a real-time power consumption data input service to obtain a raw power consumption data stream. It should be understood that to accurately analyze PCIE device power consumption and precisely synchronize it with system kernel events, the primary task is to continuously collect actual power consumption parameters at the physical level. PCIE device power consumption can change rapidly with load and power supply status, so a dedicated module is required to continuously and in real time obtain these dynamically changing raw electrical signals from power consumption measurement hardware (such as the power meter connected in the previous step).
[0022] Specifically, in this embodiment of the present application, the real-time power consumption data input module 120 is configured to initiate a real-time power consumption data input service to obtain a raw power consumption data stream. The module includes: waiting for or polling raw voltage and current data transmitted from the power consumption measurement hardware to ensure timely and continuous data collection; packaging the received raw voltage and current data to obtain power consumption data points, thereby converting the raw, potentially separate voltage and current readings into meaningful, basic units that can be used to calculate instantaneous power consumption; and organizing the power consumption data points along a time dimension to obtain the raw power consumption data stream. This constructs an ordered data sequence that reflects the time-varying trends of power consumption, which is crucial for subsequent timing analysis and event correlation. This allows the power consumption characteristics of PCIE devices (represented by voltage and current) to be converted into digital, software-processable raw data, thereby generating a continuous, time-ordered raw power consumption data stream. This data stream serves as the starting point for all subsequent analysis, directly reflecting the real-time power consumption performance of the PCIE devices during testing and laying a solid data foundation for accurate time synchronization and correlation analysis of power consumption data with kernel state change events.
[0023] In the aforementioned PCIE power consumption test device 100, the kernel tracing module 130 is configured to call the kernel tracing API to write the raw power consumption data stream as power sampling events into the kernel event tracing session, thereby generating a unified tracing event stream. It should be understood that in traditional PCIE power consumption test solutions, the power consumption measurement hardware operates independently of the operating system, and the power consumption data it collects is temporally separated from system status events recorded within the operating system (such as driver invocations, power policy changes, and workload execution). This separation leads to two core issues: first, it is difficult to achieve precise time synchronization between power consumption data and system events, as the two may be driven by different clock sources and experience data transmission and processing delays; second, it is impossible to directly establish a causal relationship between power consumption changes and specific system behaviors, making attribution and problem location of power consumption anomalies difficult and inefficient. It is particularly noteworthy that this solution utilizes the Linux LTTng framework. The kernel tracing module calls the LTTng-UST API to write the raw power consumption data stream as power sampling events into the kernel event tracing session via predefined tracing points. By making it part of the kernel event tracing session, the high-precision timestamp mechanism provided by the operating system kernel itself can be utilized to ensure that power sampling events share the same time base with all other kernel events (such as kernel-level state changes caused by software host controller operations). In this way, any instantaneous change in power consumption can be accurately associated with the system behavior at the same moment or immediately thereafter, thereby achieving deep insight into the power consumption characteristics of PCIE devices and their interaction with the system.
[0024] Specifically, in one specific example of this application, during system initialization, the software host controller configures and starts a dedicated kernel event tracing session using LTTng, based on a preset kernel event list (e.g., specified via the lttng enable-event command). This session serves as a unified collector for all relevant events. Secondly, after receiving raw voltage and current data from the power measurement hardware and packaging it into power data points, these power data points are ready to be converted into traceable events. Next, within the kernel tracing module, for each newly generated power data point, the system calls the tracepoint macro provided by LTTng-UST. When calling this macro, the power data point (e.g., containing voltage and current values, as well as the calculated instantaneous power consumption value) is passed as a field of the event. Furthermore, the LTTng framework ensures that the kernel assigns a high-precision system timestamp to this event, ensuring strict temporal synchronization with other kernel events recorded in the same tracing session (e.g., process scheduling, system calls, driver interrupts, etc.). In this way, the raw power consumption data stream is no longer isolated external data. Instead, it is elevated to power sampling events, on par with internal system events, and written uniformly to a pre-launched kernel event tracing session. Ultimately, this session outputs a unified tracing event stream containing power sampling events and various kernel state change events. This unified event stream serves as the foundation for subsequent offline parsing and intelligent analysis, enabling precise attribution of power consumption anomalies and intelligent detection of PCIE power rail status.
[0025] In the aforementioned PCIE power consumption test device 100, the kernel event state change module 140 is used to capture kernel-level state changes triggered by software host controller operations through the kernel tracing system and write them to the unified tracing event stream to generate state change kernel events. It should be understood that merely obtaining an accurate power consumption data stream is insufficient; it is essential to understand the specific operations that trigger the power consumption changes. Operations performed by the software host controller, such as launching a high-load application or calling an API to change the power policy of a PCIE device, serve as the "input" or "stimulus" for the test. However, these high-level commands are converted into a complex, low-level series of kernel events within the operating system. For example, running a load script involves process creation, thread scheduling, and driver I / O requests; changing the power policy is directly reflected in specific IOCTL (I / O control code) calls to the device driver. Directly capturing these kernel-level events, which are closest to hardware behavior, rather than the high-level commands themselves, provides the most direct and irrefutable evidence of the "cause" of power consumption changes, thereby resolving the fundamental issue of ambiguous correlation between power consumption and system behavior.
[0026] Specifically, in a specific example of the present application, the operation of the software master controller includes at least one of the following: executing a specific workload according to a load script path; calling a system API or driver IOCTL to request a change in the PCle power policy. By writing these state change kernel events and the aforementioned power sampling events into the same event stream, a complete narrative chain is constructed. In this event stream, each power consumption fluctuation point is closely surrounded by the kernel-level activity records that caused it. For example, analysts can clearly see that after a DevicePowerState change event occurs, the power consumption data immediately jumps from one stable value to another; or after a specific driver IOCTL is called, a brief spike appears on the power consumption curve. In this way, the previously isolated power consumption data points are given clear business and system meanings, making the attribution of power consumption anomalies no longer a guesswork, but a diagnosis based on precise data correlation, greatly improving the efficiency and accuracy of problem location.
[0027] In the above-mentioned PCIE power consumption test device 100, the original trace file collection and storage module 150 is used to save the state change kernel event into a file to obtain the original trace file after the test is completed. It should be understood that during the entire test process, a unified trace event stream containing power consumption sampling events and kernel state change events is generated in real time and temporarily stored in the high-speed buffer of the operating system kernel. These buffers have limited capacity and the data is volatile. Once the test program ends or the system is restarted, these valuable, accurately synchronized data will be permanently lost. In addition, real-time in-depth analysis of such a massive, high-frequency event stream requires extremely high computing resources, often interfering with the performance of the system under test itself and affecting the accuracy of the test results. Therefore, after the test is completed, these temporarily stored data must be persistently stored for undisturbed, repeatable offline analysis. By saving the state change kernel event into a file to obtain the original trace file, a complete, permanent and portable data copy can be created. This raw trace file is the final product and "digital snapshot" of the entire test process. It contains a complete, structured sequence of power consumption data, including precise timestamps, and all relevant core events synchronized with it. The generation of this raw trace file completely decouples the data collection and analysis phases. It not only provides a basis for subsequent data processing and PCIE link status determination, but also allows test results to be archived, shared, and reproduced and compared across different analysis tools or platforms.
[0028] Specifically, in a specific example of the present application, when the software main controller determines that the test scenario (for example, all load scripts have been executed) has been completed, it will send an instruction to the kernel event tracing system to stop and process the tracing session. Specifically, first, the software main controller will call a control function. For example, under the LTTng framework, the software main controller will execute corresponding instructions, such as calling the lttng stop and lttng destroy commands to stop and destroy the current tracing session. After receiving these instructions, the LTTng session daemon will complete the collection of all events and flush the data in the kernel buffer to disk, writing it completely to the output file stored in the CTF format. After all the data is written, the tracing system will write the necessary metadata and index information to the file to ensure the integrity and parsability of the file, and finally complete the closing and finalization of the file. In this way, an original tracing file containing all the key information during the test is successfully generated and can be used by subsequent analysis modules.
[0029] In the aforementioned PCIE power consumption test device 100, the offline parsing module 160 is used to perform offline parsing of the raw trace file to obtain a time series of power consumption data points. It should be understood that the raw trace file is a highly compressed, binary-formatted raw data set. While it fully preserves all events, its internal structure is complex and not designed for direct human reading or use by general-purpose data analysis tools. The file contains a mix of various event types, including injected power sampling events, system kernel events, and a large amount of metadata and descriptive information. To conduct subsequent power consumption timing pattern analysis, it is necessary to accurately extract the core data of interest—the power consumption data points—from this complex data set and organize it into a standard, easy-to-process format, namely, a time series of power consumption data points. Each power consumption data point contains a precise timestamp and corresponding power consumption value (calculated from voltage and current). This time series serves as direct input for subsequent advanced analysis. Parsing not only isolates the power consumption data but also preserves its most critical attribute—the high-precision timestamp—ensuring that the dynamic characteristics of power consumption changes are fully preserved. Ultimately, the result is a numerical sequence that can be directly processed by a machine learning model and accurately reflects the entire process of power consumption evolution of the PCIE device during the test.
[0030] Specifically, in one example of this application, a specific tool or library is utilized to read and decode raw trace files in CTF format. Specifically, the offline parsing module can use the Babeltrace tool or its corresponding library. First, the path to the raw trace file to be processed is specified and a parsing component diagram is created. Next, the module needs to set up an event callback function. This is the core of the parsing process: defining one or more functions that are automatically called when the parser encounters a specific type of event in the file. This solution specifically focuses on the previously defined "power sampling event." Therefore, a callback function is set up specifically to handle this event. The parsing process is then initiated, and Babeltrace iterates through each event record in the file in chronological order. This function chronologically iterates through each event record in the file. When it encounters a "power sampling event," the pre-set callback function is triggered. Within the callback function, the program extracts the raw voltage and current values from the event's data payload and calculates the instantaneous power consumption as needed. It also obtains a high-precision timestamp from the event header. Finally, this timestamp and the calculated power consumption value are added as a data point to a list. When the ProcessTrace function traverses the entire file, this list constitutes a complete, time-ordered time series of power consumption data points that can be used by subsequent modules.
[0031] In the above-mentioned PCIE power consumption testing device 100, the power consumption timing pattern feature extraction module 170 is used to segment the time series of the power consumption data points into sequence segments and then perform power consumption timing pattern feature extraction based on the LSTM model on each local time segment of the power consumption data to obtain a time series of power consumption local timing pattern feature encoding vectors. It should be understood that although the time series of the original power consumption data points contains all information, it is a continuous, high-dimensional raw data stream. Direct global analysis or anomaly detection on it is inefficient and difficult to capture fine-grained patterns. The power consumption behavior of PCIE devices often exhibits different local patterns in different time windows, such as power consumption characteristics in the startup phase, low power consumption characteristics in the idle state, and periodic fluctuation characteristics during high-load operation. These local patterns contain rich semantic information and are key to identifying device operating status and potential anomalies. However, traditional statistical methods have difficulty in effectively capturing such complex timing dependencies and pattern characteristics. Therefore, in the technical solution of the present application, after segmenting the time series of the power consumption data points into sequence segments, power consumption timing pattern feature extraction based on the LSTM model is performed on each local time segment of the power consumption data. Sequence segmentation can break down long sequences into several manageable units, allowing the model to focus on local time windows. Feature extraction based on the LSTM model leverages the Long Short-Term Memory (LSTM) network's exceptional ability to process sequential data. It learns and memorizes both long-term and short-term dependencies within a time series, automatically extracting abstract features from each local time segment that characterize the power consumption behavior within that segment. These features are no longer simple power consumption values, but rather high-dimensional, semantically rich vectors that encode complex patterns within that time segment, including trends, periodicity, and volatility.
[0032] In the above-mentioned PCIE power consumption testing device 100, the full-time-domain power consumption pattern feature tracking module 180 is used to perform full-time-domain power consumption pattern feature tracking on the time series of the power consumption local time-series pattern feature encoding vectors to obtain full-time-domain power consumption pattern features. It should be understood that although the previous step successfully extracted the fine features of the local power consumption pattern through the LSTM model, the overall power consumption behavior of the PCIE device is not simply composed of the superposition of these isolated local fragments. The power consumption pattern of a device often has global dependencies, periodicity, or state transition characteristics that span a long time range. For example, the power consumption curve of a PCIE device from idle to fully loaded and then to idle throughout its entire life cycle will exhibit a specific macro-pattern. While the local feature encoding vector sequence captures the changes within each small window, it cannot directly reflect this global, long-range mutual influence and evolution law. In other words, simply analyzing isolated local features cannot capture this macro-dynamic and long-range dependency across multiple time segments. Therefore, in the technical solution of the present application, full-time-domain power consumption pattern feature tracking is further performed on the time series of the power consumption local time-series pattern feature encoding vectors to obtain full-time-domain power consumption pattern features.
[0033] Specifically, first, at the micro level, the model needs to refine and enhance the existing local power consumption features. Rather than directly using the output of the LSTM, it uses a local power consumption temporal perception window and a local power consumption temporal pattern feature enhancement mechanism. This allows each local power consumption temporal pattern feature encoding vector to perceive and integrate the power consumption pattern information of its neighboring time segments, thereby obtaining a sequence of enhanced local power consumption temporal pattern feature encoding vectors with greater contextual awareness. Second, at the macro level, the ultimate goal is to integrate these locally enhanced local power consumption temporal pattern feature encoding vectors into global information integration. Specifically, by leveraging the Transformer's self-attention mechanism, each local power consumption temporal pattern feature in the sequence interacts with all other local power consumption temporal patterns, regardless of their temporal distance. This aims to capture the global patterns, long-range dependencies, and complex interactions of power consumption pattern evolution throughout the entire test period, ultimately generating a "global power consumption temporal pattern feature" that condenses all temporal information.
[0034] Figure 3 FIG. 1 is a block diagram of a full-time domain power consumption mode feature tracking module in a PCIE power consumption test device according to an embodiment of the present application. Figure 3As shown, in an embodiment of the present application, the full-time domain power consumption mode feature tracking module 180 includes: a power consumption local temporal sequence perception window determination unit 181, which is used to determine the window size of the power consumption local temporal sequence semantic enhancement perception window of each power consumption local temporal sequence pattern feature coding vector based on the feature distribution of each power consumption local temporal sequence pattern feature coding vector in the time series of the power consumption local temporal sequence pattern feature coding vector; a power consumption local temporal sequence pattern feature enhancement unit 182, which is used to perform local semantic enhancement on each power consumption local temporal sequence pattern feature coding vector based on all power consumption local temporal sequence pattern feature coding vectors in the power consumption local temporal sequence semantic enhancement perception window of each power consumption local temporal sequence pattern feature coding vector to obtain a sequence of power consumption local temporal sequence pattern feature enhancement coding vectors; a power consumption timing pattern global message transmission unit 183, which is used to input the sequence of power consumption local temporal sequence pattern feature enhancement coding vectors into a message global domain transmission coding network based on the Transformer architecture to obtain a full-time domain power consumption timing pattern feature vector as the full-time domain power consumption timing pattern feature.
[0035] Figure 4 FIG. 1 is a block diagram of a full-time domain power consumption mode feature tracking module in a PCIE power consumption test device according to an embodiment of the present application. Figure 4 As shown, in an embodiment of the present application, the power consumption local temporal series perception window determination unit 181 is used for: a neighbor feature distribution entropy calculation subunit 1811 is used to calculate the neighbor feature distribution entropy of each power consumption local temporal series pattern feature coding vector based on the feature distribution of each power consumption local temporal series pattern feature coding vector to obtain a sequence of neighbor feature distribution entropies; an enhanced perception window size calculation subunit 1812 is used to calculate the window size of the power consumption local temporal series semantic enhanced perception window of each power consumption local temporal series pattern feature coding vector based on the neighbor feature distribution entropy to obtain a sequence of neighbor feature distribution entropies.
[0036] In the PCIE power consumption test device 100, the neighbor feature distribution entropy calculation subunit 1811 is used to calculate the neighbor feature distribution entropy of each power consumption local timing pattern feature coding vector based on the feature distribution of each power consumption local timing pattern feature coding vector to obtain a sequence of neighbor feature distribution entropies, which is expressed as the following formula: ;in, and are respectively the power consumption local temporal pattern feature coding vectors in the time series of the power consumption local temporal pattern feature coding vectors, is the logarithmic function value with base 2, is the one-norm of the vector, is an exponential function with the natural constant e as the base, for and The local timing pattern characteristic metric coefficient of power consumption between is the activity parameter, for and The local timing pattern characteristic metric coefficient of power consumption between is the preset neighborhood, is the second stabilization parameter, for and The local timing pattern neighborhood representation factor of power consumption between The first The neighbor feature distribution entropy of the local timing pattern feature encoding vector of the power consumption is obtained.
[0037] It's understandable that the power consumption patterns of PCIE devices are not uniformly distributed. Some periods may exhibit a very stable, single pattern (such as long periods of idle time), while other periods may contain drastic, rapid state transitions (such as waking from sleep or starting a high-load application). For stable regions, a larger perception window is required to confirm the pattern's persistence; for regions of rapid change, a smaller, more focused window is needed to accurately capture the details of the transition. Therefore, a fixed, unchanging perception window size is inefficient and inaccurate for analyzing complex power consumption time series data. A data-driven approach is needed to dynamically assess the "information complexity" of each time point to tailor the most appropriate perception window size. Neighbor feature distribution entropy is an ideal quantitative metric for this purpose. By calculating the distribution entropy of the neighbors of each power local time series pattern feature encoding vector in its high-dimensional feature space, we can effectively measure the local stability of the power consumption pattern it represents. If the neighboring information of a power local time series pattern feature encoding vector is highly similar and clustered in the feature space (low entropy), this indicates a stable and predictable power consumption pattern. Conversely, if its neighbors are highly dispersed and diverse (high entropy), this indicates that it is at a power consumption transition point or unstable region. Therefore, the ultimate goal of this step is to generate a "neighborhood feature distribution entropy sequence" in parallel with the local power consumption feature sequence. This entropy sequence will serve as a direct basis for determining the size of the adaptive perception window and is the key to achieving the transformation of "intelligent perception" from concept to computation.
[0038] In the PCIE power consumption test device 100, the enhanced perception window size calculation subunit 1812 is configured to calculate the window size of the power consumption local temporal semantics enhanced perception window of each power consumption local temporal pattern feature encoding vector based on the neighbor feature distribution entropy to obtain a sequence of neighbor feature distribution entropies, which is expressed as follows: ;in, is the first stabilization parameter, To preset the maximum window size, To round down, The window size of the awareness window is enhanced for local temporal semantics of power consumption.
[0039] It should be understood that since the "uncertainty" of the power consumption pattern at each time point has been quantified, the local window for intelligent perception cannot be fixed in size. Instead, the scope of its context must be dynamically adjusted based on the characteristics of each data point. The most semantically relevant local environments in a region with high entropy (indicating a drastic change in the power consumption pattern) and a region with low entropy (indicating a stable power consumption pattern) will inevitably have different scales. Therefore, a clear calculation process is required to map the descriptive metric of entropy to the prescriptive parameter of window size. Feature vectors with high entropy in their neighboring feature distributions indicate a rapid transition or instability in the power consumption pattern. In this case, a smaller perception window should be assigned to them to focus on the details of this transient change and avoid being diluted by the information of the preceding and subsequent stable states. Conversely, feature vectors encoding local power consumption temporal patterns with low entropy indicate a stable, continuous power consumption pattern. In this case, a larger perception window should be assigned to fully capture the persistent characteristics of the pattern and smooth out meaningless minor noise. This improves the accuracy and effectiveness of the enhancement of local power consumption timing pattern features, ensuring that the semantic expression ability and context awareness of each local power consumption timing pattern feature are maximized before entering the global analysis, laying a crucial foundation for the ultimate generation of high-quality full-time domain power consumption timing pattern features.
[0040] In the above-mentioned PCIE power consumption test device 100, the power consumption local timing pattern feature enhancement unit 182 is configured to perform local semantic enhancement on all power consumption local timing pattern feature coding vectors in the perception window based on the power consumption local timing semantics of each power consumption local timing pattern feature coding vector to obtain a sequence of power consumption local timing pattern feature enhancement coding vectors, which is expressed as the following formula: ;in, and are the trainable query weight matrix and the trainable value weight matrix, for The scale, for function, for function, for and The local temporal context semantic fusion representation vector of power consumption between is the trainable key weight matrix, For the The local temporal pattern feature of power consumption is enhanced by encoding vectors, A sequence of encoding vectors that enhances the local temporal pattern characteristics of power consumption, are the first, second and third sequences of the power consumption local temporal pattern feature enhanced coding vector. The local temporal pattern feature of power consumption is enhanced with an encoding vector.
[0041] It should be understood that the previous steps merely define the context-aware "field of view" for each local power consumption temporal pattern feature encoding vector, but do not truly incorporate the information within this field of view into the local power consumption temporal pattern feature encoding vector itself. In other words, an isolated local power consumption temporal pattern feature encoding vector (for example, representing a momentary spike) cannot, by itself, indicate whether the spike is isolated noise or the start of a larger power consumption event (such as device wakeup). Therefore, these local power consumption temporal pattern features must be further processed and fused to ensure that each local power consumption temporal pattern feature encoding vector incorporates its most important local context information, thereby enriching and accurately expressing its semantics. For each local power consumption temporal pattern feature encoding vector in the sequence, the model aggregates all local power consumption temporal pattern feature encoding vectors within its dedicated perception window (including itself) and, through a local semantic embedding enhancement mechanism, computes a new, enhanced sequence of local power consumption temporal pattern feature encoding vectors. This process ensures that the final representation of each vector is a highly nonlinear fusion of its own information and its most relevant neighboring information, thereby achieving a deep understanding of local power consumption dynamics.
[0042] In the above-mentioned PCIE power consumption test device 100, the power consumption timing pattern global message transmission unit 183 is used to input the sequence of the power consumption local timing pattern feature enhanced coding vector into the message global transmission coding network based on the Transformer architecture to obtain the full-time-domain power consumption timing pattern feature vector as the full-time-domain power consumption timing pattern feature, which is expressed as the following formula: ;in, It is a message domain transmission encoding network based on Transformer architecture. is the characteristic vector of the full-time-domain power consumption timing pattern.
[0043] It's understandable that many complex PCIE power consumption anomalies aren't defined by a single local event, but rather by a series of local patterns spanning longer timescales, combined in a specific sequence. For example, a failed power state transition might manifest as an abnormal "oscillation pattern" instead of the expected "high-load stable mode" following a "wake-up mode." To identify such long-range dependencies and global behavioral logic, local information enhancement alone is insufficient. Therefore, the sequence of enhanced encoding vectors for local temporal power consumption patterns is further input into a global message passing encoding network based on the Transformer architecture. This specifically aims to leverage the Transformer's ability to parallelize and model global dependencies across the entire sequence of enhanced encoding vectors for local temporal power consumption patterns, enabling each local power consumption pattern feature in the sequence to dynamically evaluate and integrate information from all other local pattern features across the entire test process (over the entire time domain). Through this global message transmission, the model can learn the complex, nonlinear, and long-distance interaction patterns between power modes, thereby capturing the macro power consumption behavior paradigm of the entire test process, and ultimately condensing these insights into a single, fixed-dimensional full-time domain power consumption timing pattern feature vector.
[0044] Here, the activity parameter is introduced into the window size determination of the power consumption local temporal semantic enhancement perception window. and the first stabilization parameter and the second stabilization parameter , so for the power consumption local timing mode enhancement and For example, it is preferred to also consider the morphological change metric to enhance the contextual semantic embedding of the power consumption local temporal pattern under the predetermined power consumption local temporal semantic enhancement perception window.
[0045] Therefore, first for the associated influence vector , linearly interpolate it to the same length as the power consumption local time series pattern feature encoding vector, and then perform nonlinear curvature through one-dimensional convolution to obtain the morphological change feature vector , and the weight matrix and As the mapping target, obtain the morphological change correlation vector: ;in, and They are the key shape change association vector, query shape change association vector and value shape change association vector respectively.
[0046] Then, considering the direct correlation with the morphological change, the deformation-related dominance of the weighted strain can be simplified, that is, it is considered that the non-core high-order complex nonlinear deformation can be simplified. Therefore, the above morphological change correlation vectors are respectively combined with the eigenvectors of the weight matrix, that is, and Associate to modify the weight matrix, expressed as: ;in, is the point product by position, and They are the revised key weight matrix, the revised query weight matrix, and the revised value weight matrix respectively.
[0047] In this way, the weight matrix-based power consumption local timing pattern enhancement can take into account the introduction of geometric strain effects in the window size determination of the power consumption local timing semantic enhancement perception window, thereby improving the associated semantic representation capability of the time series of the power consumption local timing pattern feature encoding vector based on the power consumption local timing semantic enhancement perception window.
[0048] In the above-mentioned PCIE power consumption test device 100, the PCIE power consumption detection module 190 is used to determine whether the PCIE link is abnormal based on the full-time-domain power consumption timing pattern feature. It should be understood that although the full-time-domain power consumption timing pattern feature contains all the full-time-domain power consumption timing pattern information, it is still a high-dimensional, abstract mathematical representation and is not intuitive for test engineers. Therefore, there must be a final decision module to translate this complex feature vector into a simple, clear conclusion that can be directly used to guide subsequent work. Therefore, in the technical solution of the present application, the full-time-domain power consumption timing pattern feature vector is passed through a classifier-based PCIE link status tester to obtain a test result, which is used to indicate whether the PCIE link is abnormal. Using a pre-trained classifier, the input, high-dimensional, full-time-domain power consumption timing pattern feature vector is mapped to a predefined, discrete test result category. This classifier has built a decision boundary from features to conclusions by learning a large number of labeled normal and abnormal power consumption samples. When a new full-time-domain power consumption timing pattern feature is input, the classifier calculates the probability of this vector belonging to the "normal" or "abnormal" category in the feature space and outputs the final judgment result. This essentially uses machine learning models to replace human experts in complex pattern recognition and diagnosis, thereby transforming the entire diagnostic process from relying on human experience to relying on data and algorithms.
[0049] In summary, the PCIE power consumption test device 100 based on the embodiment of the present application is illustrated, which can break the barrier between hardware power consumption data and software system logs, and innovatively use the operating system kernel event tracing system as a unified data fusion platform. By injecting the power consumption sampling points collected in real time by external hardware as custom events into the kernel event tracing session in real time, it can coexist with the kernel state change events captured by the system itself under the same high-precision timestamp, thereby generating a unified tracing event stream that is perfectly aligned in time. On this basis, PCIE abnormal patterns are further automatically identified from massive trace data. Through the deep learning model, the local timing characteristics of the power consumption sequence are first encoded, and then the pattern evolution law of the entire time domain is further captured, and finally the accurate and automatic judgment of the abnormal state of the PCIE link is achieved, which helps to improve the diagnostic efficiency and accuracy of power consumption problems.
[0050] As described above, the PCIE power consumption test device 100 according to the embodiment of the present application can be implemented in various terminal devices. In one example, the PCIE power consumption test device 100 can be integrated into the terminal device as a software module and / or a hardware module. For example, the PCIE power consumption test device 100 can be a software module in the operating system of the terminal device, or can be an application developed for the terminal device; of course, the PCIE power consumption test device 100 can also be one of the many hardware modules of the terminal device.
[0051] Alternatively, in another example, the PCIE power consumption test device 100 and the terminal device may also be separate devices, and the PCIE power consumption test device 100 may be connected to the terminal device via a wired and / or wireless network and transmit interactive information in accordance with an agreed data format.
[0052] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the module division is merely a logical function division, and other division methods may be used in actual implementation.
[0053] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed across multiple network elements. Some or all of the modules may be selected to achieve the purpose of the solution of this embodiment according to actual needs.
[0054] In addition, the functional modules in various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or hardware plus software functional modules.
[0055] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0056] Therefore, the embodiments should be considered in all respects as illustrative and non-restrictive, and the scope of the invention is defined by the appended claims rather than the foregoing description, and all changes that come within the meaning and range of equivalents of the claims are intended to be embraced therein. Any reference to a figure in a claim should not be construed as limiting the claim to which it relates.
[0057] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a system claim may also be implemented by a single unit or device through software or hardware. Second-order terms are used to indicate names and do not imply any particular order.
[0058] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit of the technical solutions of the present invention.
Claims
1. A PCIE power consumption test device, characterized in that: include: A test configuration module is used to initialize the connection with the power consumption measurement hardware according to the test configuration file through the software host controller, and configure and start the kernel event tracing session according to the kernel trace provider list; The power consumption data real-time input module is used to start the power consumption data real-time input service to obtain the original power consumption data stream; A kernel tracing module, configured to call a kernel tracing API to write the original power consumption data stream as a power consumption sampling event into the kernel event tracing session to obtain a unified tracing event stream; A kernel event state change module, configured to capture kernel level state changes caused by operations of the software main controller through a kernel tracing system and write the changes into the unified tracing event stream to obtain kernel state change events; The original trace file collection and storage module is used to save the state change kernel event into a file to obtain the original trace file after the test is completed; An offline parsing module, configured to perform offline parsing on the original tracking file to obtain a time series of power consumption data points; A power consumption timing pattern feature extraction module is used to segment the time series of the power consumption data points into sequence segments and then perform power consumption timing pattern feature extraction based on the LSTM model on each local time segment of the power consumption data to obtain a time series of power consumption local timing pattern feature encoding vectors; A full-time-domain power consumption pattern feature tracking module is used to perform full-time-domain power consumption pattern feature tracking on the time series of the power consumption local timing pattern feature encoding vector to obtain full-time-domain power consumption timing pattern features; The PCIE power consumption detection module is used to determine whether there is an abnormality in the PCIE link based on the full time domain power consumption timing pattern characteristics.
2. The PCIE power consumption test device according to claim 1, wherein: The test configuration module is configured to initialize the connection with the power consumption measurement hardware according to the power consumption meter configuration in the test configuration file through a software main controller.
3. The PCIE power consumption test device according to claim 2, wherein: The power consumption data real-time input module is used to: Waiting for or polling raw voltage data and raw current data transmitted from the power consumption measurement hardware; Packaging the received raw voltage data and raw current data to obtain power consumption data points; The power consumption data points are sorted according to the time dimension to obtain the original power consumption data stream.
4. The PCIE power consumption test device according to claim 3, wherein: The kernel tracing module is used to call the API of LTTng-UST and write the original power consumption data stream as a power consumption sampling event into the kernel event tracing session through a predefined tracing point.
5. The PCIE power consumption test device according to claim 4, characterized in that: The operation of the software main controller includes at least one of the following operations: The software master controller executes the workload according to the load script path; Call the system API or driver IOCTL to request to change the PClE power policy.
6. The PCIE power consumption test device according to claim 1, wherein: The full-time-domain power consumption mode feature tracking module includes: a power consumption local temporal sequence perception window determining unit, configured to determine a window size of a power consumption local temporal sequence semantic enhancement perception window of each power consumption local temporal sequence pattern feature coding vector based on a feature distribution of each power consumption local temporal sequence pattern feature coding vector in a time series of the power consumption local temporal sequence pattern feature coding vector; a power consumption local temporal pattern feature enhancement unit, configured to perform local semantic enhancement on all power consumption local temporal pattern feature coding vectors in a perception window based on the power consumption local temporal semantic enhancement of each power consumption local temporal pattern feature coding vector to obtain a sequence of power consumption local temporal pattern feature enhancement coding vectors; The power consumption timing pattern global message passing unit is used to input the sequence of the power consumption local timing pattern feature enhanced coding vector into the message global transmission coding network based on the Transformer architecture to obtain the full time domain power consumption timing pattern feature vector as the full time domain power consumption timing pattern feature.
7. The PCIE power consumption test device according to claim 6, characterized in that: The power consumption local timing perception window determination unit includes: A neighbor feature distribution entropy calculation subunit, configured to calculate the neighbor feature distribution entropy of each power consumption local time series pattern feature coding vector based on the feature distribution of each power consumption local time series pattern feature coding vector to obtain a sequence of neighbor feature distribution entropies; The enhanced perception window size calculation subunit is used to calculate the window size of the power consumption local temporal semantic enhanced perception window of each power consumption local temporal pattern feature coding vector based on the sequence of neighbor feature distribution entropy obtained by the neighbor feature distribution entropy.
8. The PCIE power consumption test device according to claim 6, characterized in that: The PCIE power consumption detection module is used to: pass the full-time-domain power consumption timing pattern feature vector through a classifier-based PCIE link status tester to obtain a test result, and the test result is used to indicate whether there is an abnormality in the PCIE link.