Log generation method and device, storage medium and electronic equipment
By conducting separate and overall risk assessment of server component test data, abnormal components are automatically identified and positioning logs are generated, which solves the problem that logs require manual analysis in the existing technology, and achieves fast and accurate abnormal positioning.
Patent Information
- Application Number
- CN202510534288.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2025-08-08
AI Technical Summary
In the prior art, the logs generated by server component tests require manual analysis, and the problems during the test cannot be quickly located, resulting in low efficiency of abnormal positioning and error-prone.
By obtaining the test data of the test components, conducting separate and overall risk assessments, obtaining parameter risk values, determining component risk values, automatically identifying abnormal components and generating abnormal component positioning logs.
Automatic positioning of abnormal parts is realized, the efficiency of positioning of test problems is improved, manual analysis time is reduced, and the accuracy and reliability of test results are improved.
Smart Images

Figure CN120448201A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a log generation method, device, storage medium, and electronic device. Background Art
[0002] Server component testing is a key step in ensuring the reliability and performance of server hardware. During server component testing, generating logs is an important process for recording component operating status and test results.
[0003] Currently, related technologies usually generate logs of various operating states of components, but the logs generated in this way require manual analysis and cannot quickly locate problems in the testing process. Summary of the Invention
[0004] The present disclosure provides a log generation method, device, storage medium, and electronic device. Its main purpose is to address the technical problem that related technologies typically generate logs of each component's operating status, but this log generation method requires manual analysis and cannot quickly locate problems encountered during the test process.
[0005] In a first aspect, the present application provides a log generation method, comprising:
[0006] Obtain test data corresponding to the test component;
[0007] Perform individual risk assessment and overall risk assessment on the test parameters in the test data to obtain the parameter risk values corresponding to the test parameters;
[0008] Determine the component risk value corresponding to the test component based on the parameter risk value;
[0009] Determining abnormal components from the test components based on component risk values corresponding to the test components;
[0010] Generate an abnormal component location log corresponding to the abnormal component.
[0011] In a second aspect, the present application provides a log generation device, comprising:
[0012] An acquisition module is configured to acquire test data corresponding to the test component;
[0013] a determination module configured to perform individual risk assessment and overall risk assessment on the test parameters in the test data, and obtain parameter risk values corresponding to the test parameters;
[0014] a determination module configured to determine a component risk value corresponding to the test component based on the parameter risk value;
[0015] a determination module configured to determine abnormal components from the test components based on component risk values corresponding to the test components;
[0016] The generating module is configured to generate an abnormal component location log corresponding to the abnormal component.
[0017] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the method of the first aspect when the computer program is executed by a processor.
[0018] In a fourth aspect, the present application provides an electronic device comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the method of the first aspect when executing the computer program.
[0019] In a fifth aspect, the present application provides a computer program product having a computer program stored thereon, which implements the method of the first aspect when the computer program is executed by a processor.
[0020] The present disclosure provides a log generation method, device, storage medium, and electronic device, wherein the method includes: first obtaining test data corresponding to a test component; then performing individual risk assessment and overall risk assessment on the test parameters in the test data to obtain parameter risk values corresponding to the test parameters; then determining component risk values corresponding to the test components based on the parameter risk values; determining abnormal components from the test components based on the component risk values corresponding to the test components; and finally generating an abnormal component location log corresponding to the abnormal components. In this way, the present disclosure can first obtain the test parameters in the test data of each test component, perform individual risk assessment and overall risk assessment on the test parameters, obtain corresponding parameter risk values, evaluate the parameter risk values from the perspectives of single parameter assessment and overall parameter assessment, then perform component risk assessment on the test components based on the parameter risk values assessed from multiple perspectives, finally determine abnormal components based on the component risk values, and generate an abnormal component location log. The abnormal component location log can directly reflect problems existing in the test process and provide more intuitive feedback to the tester, thereby realizing automatic location of abnormal components and eliminating the need for the tester to analyze the logs of each test component, effectively improving the efficiency of locating test problems.
[0021] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0023] Figure 1 A flow chart of a log generation method provided in an embodiment of the present application is shown;
[0024] Figure 2 A flow chart of another log generation method provided in an embodiment of the present application is shown;
[0025] Figure 3 A schematic diagram showing an example provided by an embodiment of the present application is shown;
[0026] Figure 4 A schematic diagram showing another example provided by an embodiment of the present application is shown;
[0027] Figure 5 A schematic structural diagram of a log generation device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0028] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0029] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0030] Against the backdrop of accelerated digital transformation, information technology infrastructure faces challenges in complex scenarios such as high concurrency and elastic computing. Server cluster loads exhibit dynamic fluctuations, and the commonly used static threshold alarm mechanism is unable to effectively cope with performance bottlenecks caused by instantaneous traffic peaks and resource competition. Therefore, in the field of server testing, dynamic mixed load stress testing needs to be carried out for actual application scenarios. However, related technologies usually require manual analysis of dynamic mixed load test logs. Manual log analysis is inefficient, and locating the root cause of anomalies is cumbersome. It requires analysis of multiple component logs, which is time-consuming and prone to misreading or missing logs, resulting in deviations in test results and an inability to quickly locate problems. In view of this, automated testing technology that integrates real-time load perception and intelligent log analysis has become a key breakthrough direction.
[0031] In the related art, when it is detected that the server to be tested triggers a timeout response, the dump log is received from the server to be tested according to the baseboard management controller, which is highly dependent on the baseboard server. Once the operating system (OS) and the baseboard management controller (BMC) are down at the same time, the log cannot be obtained according to the preset instructions, resulting in the inability to reproduce the downtime problem. Secondly, if the server downtime phenomenon itself is not recorded and analyzed in a targeted manner, it may cause difficulties in reproducing problems (such as low-frequency problems). In some embodiments, if the server has an abnormal downtime and is subsequently automatically recovered, it may cause a misjudgment of the server quality problem. At the same time, once a large amount of stability and stress testing is pulled, it poses a serious challenge to the test stability.
[0032] In order to improve the current related technology, logs of various operating states of components are usually generated. However, the logs generated in this way require manual analysis and cannot quickly locate problems in the test process.
[0033] This embodiment provides a log generation method, such as Figure 1 As shown, the method comprises the following steps:
[0034] Step 101: Acquire test data corresponding to the test component.
[0035] In some embodiments, at least one component to be tested is determined based on test requirements (such as performance, compatibility, and stability). The test component may be a server component to be tested, which may include but is not limited to storage devices, network cards, central processing units (CPUs), network communication modules, etc. It may be necessary to combine server configuration and test scenarios, such as high concurrent access, large data volume processing, etc., and formulate test strategies with reference to component functional characteristics, set specific test goals, such as performance testing, stability testing, compatibility testing, etc. According to the test goals, detailed test cases are written, including test steps, expected results, etc., and the specific scope of the test is determined, including the test environment, test time, test load, etc. The tests are executed one by one according to the steps of the test case, and the test data during the test process is recorded. The test data may include performance data, log data, etc. For example, monitoring tools can be used to monitor the performance indicators of the server in real time and record relevant performance data; log analysis tools can also be used to collect the server's log data, such as system logs, security logs, operation logs, etc.
[0036] Step 102: Perform individual risk assessment and overall risk assessment on the test parameters in the test data to obtain parameter risk values corresponding to the test parameters.
[0037] For example, the test parameters may include but are not limited to CPU utilization, frequency, temperature, power consumption, etc., memory utilization, error rate, bandwidth, etc., storage I / O rate, latency, read / write speed, number of bad blocks, etc., and network bandwidth utilization, packet loss rate, latency, etc.
[0038] In some embodiments, the parameter risk value may include but is not limited to a single parameter risk value corresponding to a separate risk assessment, a full parameter risk value corresponding to an overall risk assessment, etc., which is used to evaluate the risk of the test parameters, so as to determine whether the test parameters are abnormal, and then evaluate whether the test components are abnormal.
[0039] Among them, individual risk assessment may refer to the individual assessment of each test parameter involved in the test component, obtaining the single parameter risk value corresponding to each test parameter, and evaluating each test parameter one by one from the perspective of a single assessment of the single parameter; overall risk assessment may refer to the overall assessment of all test parameters involved in the test component, obtaining the full parameter risk value corresponding to the overall test parameter, and performing an overall assessment of all test parameters of the test component from the perspective of the overall assessment of all parameters (multi-parameters), thereby realizing a comprehensive risk assessment of all parameters of each test component. In this way, the test parameters corresponding to the test component can be analyzed and quantified from multiple perspectives such as the single parameter perspective and the overall parameter perspective, thereby improving the accuracy of the risk assessment.
[0040] Step 103: Determine the component risk value corresponding to the test component according to the parameter risk value.
[0041] In some embodiments, component risk assessments can be performed on each test component based on the parameter risk values corresponding to the test data, obtaining a comprehensive risk assessment value representing the overall health of each test component. This allows the performance of each test component under different conditions to be evaluated, helping to identify potential risk points. In specific application scenarios, weights can be assigned to each test parameter based on its importance to component performance. Based on the weights and the risk values corresponding to each parameter, a weighted average method is then used to calculate the comprehensive risk value for each component, serving as the component risk value.
[0042] Step 104: Determine abnormal components from the test components based on the component risk values corresponding to the test components.
[0043] In some embodiments, the component risk values corresponding to the tested components can be sorted by numerical value, and at least one component ranked high can be identified as an abnormal component. This allows for a comprehensive understanding of the overall health of each server component and, based on this, the identification of abnormal components, eliminating the need for manual analysis of test data or test monitoring, thus reducing manual analysis time. In specific application scenarios, one or more thresholds can also be defined to distinguish between normal and abnormal components, setting expected thresholds or standards for each component or parameter.
[0044] For example, a scoring system is defined, such as a scoring range of 0 to 10, to divide component risk values into multiple levels. Low risk is 0-3 points, which may indicate that the component is operating well and does not require special attention; medium risk is 4-6 points, which may indicate that there are potential problems and it is recommended to conduct regular inspections and take preventive measures; high risk is 7-10 points, which may indicate that there are significant problems and require immediate investigation and resolution to avoid failures. Accordingly, high-risk components can be identified as abnormal components, which facilitates the adoption of preventive measures to avoid downtime or other failures, thereby providing a basis for optimizing system performance and improving stability.
[0045] Step 105: Generate an abnormal component location log corresponding to the abnormal component.
[0046] Exemplarily, the abnormal component location log may include a log with abnormal component location information. The abnormal component location information may include but is not limited to the marking information of the abnormal component log, the abnormal parameter marking information in the abnormal component, the expected parameter marking information corresponding to the abnormal parameter, etc., thereby providing users with test data related to the abnormal component, facilitating problem location or reproduction, eliminating the need for manual analysis of the log, and improving problem location efficiency.
[0047] In some embodiments, after the abnormal component is determined, the log corresponding to the abnormal component can be marked in each component log. Specifically, the abnormal parameters and the expected parameters corresponding to the abnormal parameters can be marked, so that the location information of the abnormal component is directly fed back to the tester, helping the tester to quickly locate the cause of the problem and take corresponding measures, formulate corresponding maintenance plans or optimization strategies, and thus improve the reliability and stability of the system.
[0048] Compared with the current existing technology, this embodiment can first obtain the test parameters in the test data of each test component, perform individual risk assessment and overall risk assessment on the test parameters, obtain the corresponding parameter risk value, evaluate the parameter risk value from the perspective of single parameter evaluation and the perspective of overall parameter evaluation, and then perform component risk assessment on the test component based on the parameter risk value evaluated from multiple angles. Finally, the abnormal component is determined according to the component risk value, and an abnormal component location log is generated. The abnormal component location log can directly reflect the problems existing in the testing process and provide more intuitive feedback to the tester, thereby realizing automatic positioning of the abnormal component. There is no need for the tester to analyze the logs of each test component, which effectively improves the efficiency of locating test problems.
[0049] In order to further illustrate the specific implementation process of the method of this embodiment, this embodiment provides the following Figure 2 The specific method shown includes:
[0050] Step 201: Acquire test data corresponding to the test component.
[0051] In some embodiments, a separate security device can be built to record server current and connected to a switch. This device uses interfaces such as RESTful to capture BMC information and commands such as lsCPU to monitor the status of various components in the OS. Commands are sent and logged every five seconds, and the logs are stored within a preset timeframe (recommended 30 minutes, but this timeframe can be overwritten based on actual needs) as data to be analyzed. The security device can be equipped with a backup power supply to power the circuitry of the test machine in the event of an unexpected power outage, ensuring continued execution of the test data collection process.
[0052] Optionally, the overall data can be obtained using a sliding window algorithm to enhance the efficiency of data recording and storage. For example, when a test anomaly is detected or the execution machine sends it to the device, data is intercepted within the sliding window.
[0053] Step 202: Perform separate risk assessments on different test parameters in the test data to obtain single parameter risk values corresponding to the different test parameters.
[0054] Optionally, step 202 may specifically include: obtaining expected test data corresponding to the test component; and obtaining single parameter risk values corresponding to different test parameters based on different test parameters and expected parameters in the expected test data.
[0055] In some embodiments, the expected test data can be basic data obtained from basic testing of the server (such as stress testing, functional testing, performance testing, security testing, compatibility testing, etc.), which serves as standard data for measuring the actual test data. Specifically, a single parameter risk value calculation formula can be used to obtain the single parameter risk value corresponding to the test parameter to be evaluated based on the test parameter to be evaluated and the expected parameter corresponding to the test parameter. For example, the single parameter risk value calculation formula corresponding to a single parameter of a single component is as follows:
[0056]
[0057] Where S z It can represent the single parameter risk value corresponding to the test parameter, X can represent the data value of the test parameter, μ is the average value of the basic data (expected parameter) corresponding to the test parameter, σ can represent the expected difference, when S z The larger the value, the higher the abnormal risk of the test parameters of the test component. In this way, risk assessment can be performed on each test parameter separately to facilitate the positioning of abnormal parameters and improve the efficiency of positioning abnormal parameters.
[0058] Step 203: Perform an overall risk assessment on the test parameters in the test data to obtain a full parameter risk value.
[0059] Optionally, step 203 may specifically include: obtaining a test parameter vector corresponding to the test parameter and an expected parameter vector corresponding to the expected test data; and obtaining a full parameter risk value based on the test parameter vector and the expected parameter vector.
[0060] In some embodiments, a full-parameter risk value calculation formula for a component can be used to obtain a test parameter vector based on all test parameters corresponding to the test component to be evaluated, and then evaluate the full-parameter risk value corresponding to the test component based on the expected parameter vector of all expected parameters corresponding to the test component. Exemplarily, the full-parameter risk value calculation formula for a single component is as follows:
[0061] S a =(X-μ) T ∑ -1 (X-μ)
[0062] Where S αIt can represent the full parameter risk value corresponding to the test component, X can represent the vector value in the multidimensional space R composed of all parameters and time of the test component, μ can represent the mean vector in R when collecting basic data of the entire server, and Σ-1 can represent the inverse covariance matrix of the data set.
[0063] Accordingly, since the pressure on each component of the server during the test is within a certain range, when the server data is reorganized to use the pressure of the server component as the time axis and the remaining parameters (such as temperature, current, voltage, reading rate, etc.) as other multidimensional axes for calculation, its parameters should satisfy the normal distribution, that is, when the pressure is constant, the other parameters should satisfy the normal distribution, and since the combination of any two parameters of a single component obviously also satisfies the normal distribution, in the multidimensional space constructed by all the parameters of a component, all its parameters satisfy the multivariate normal distribution conditions. Therefore, based on the full parameter risk value calculation formula, the abnormal values of all parameters of a single component can be analyzed.
[0064] In this way, all test parameters of each test component can be evaluated for risk as a whole to obtain more comprehensive and accurate parameter risk assessment indicators, which helps to improve system stability.
[0065] Step 204: Determine the component risk value corresponding to the test component based on the single parameter risk value and the full parameter risk value.
[0066] Optionally, step 204 may specifically include: determining a component risk value corresponding to the test component based on the single parameter risk value and the preset risk weights corresponding to the single parameter risk values, respectively, and in combination with the full parameter risk value.
[0067] In some embodiments, based on the importance of the impact of each test parameter on the performance of the component, a preset risk weight corresponding to the single parameter risk value of each test parameter can be set. For example, for the CPU, the weight of the utilization risk value can be preset to 0.4, the weight of the temperature risk value can be preset to 0.4, and the weight of the power consumption risk value can be preset to 0.2. Then, based on the preset weights and the risk values corresponding to each parameter, as well as the full parameter risk value corresponding to the CPU, the weighted average method is used to calculate the comprehensive risk value of the CPU as the component risk value.
[0068] In some embodiments, a component risk value calculation formula can be used to obtain the component risk value corresponding to the test component based on the single parameter risk value of the test component to be evaluated and the preset risk weight corresponding to the single parameter risk value, and combined with the full parameter risk value of the test component. For example, the component risk value calculation formula (the overall score empirical formula for a single component) is as follows:
[0069]
[0070] Where S cIt can represent the component risk value corresponding to the test component, X can represent the vector value in the multidimensional space R composed of all parameters and time of the test component, μ can represent the mean vector in R when collecting basic data of the entire server, Σ-1 can represent the inverse covariance matrix of the data set, ω can represent the preset weight corresponding to each test parameter, S z It can represent the single parameter risk value corresponding to the test parameters involved in the test component.
[0071] Optionally, the changing trends of all parameters can be continuously monitored and analyzed, and the preset risk weights corresponding to the risk values of single parameters can be dynamically adjusted based on real-time data to ensure timely response to any deviation from normal operations.
[0072] By assigning appropriate weights to the single-parameter risk values of different test parameters, their proportion in the final risk score can be adjusted according to their impact on the overall performance. By comprehensively assessing component risks based on the full-parameter risk value and the single-parameter risk value, the overall risk level of each component can be quantified more accurately, thereby improving the accuracy of locating abnormal components.
[0073] Step 205: Determine abnormal components from the test components based on the component risk values corresponding to the test components.
[0074] Optionally, step 205 may specifically include: sorting the components from high to low in terms of component risk value, selecting a preset number of components with the highest ranking from the test components, and determining them as abnormal components; or determining components with component risk values greater than a preset risk threshold as abnormal components.
[0075] The preset number may be a preset number of abnormal components that need to be marked in the log, for example, 3. For example, after calculating the component risk values corresponding to all test components, the component risk values may be ranked from high to low, and the top three components may be marked as high-risk weighted components, as abnormal components.
[0076] Accordingly, the preset risk threshold can be a preset risk threshold corresponding to each test component, thereby clarifying the risk threshold of each component and determining that a test component exceeding the corresponding preset risk threshold is an abnormal component. For example, the preset risk threshold corresponding to memory can be set to 8. If, after testing, the component risk value corresponding to memory is 9, the memory is determined to be an abnormal component.
[0077] Step 206: Generate an abnormal component location log corresponding to the abnormal component.
[0078] Optionally, step 206 may specifically include: marking the log corresponding to the abnormal component in the log corresponding to the test component; and generating an abnormal component location log based on the marked log and expected test data corresponding to the abnormal component.
[0079] For example, the abnormal component location log may include the abnormal component name, component risk value, full parameter risk value, single parameter risk value, etc.
[0080] In some embodiments, the log corresponding to the abnormal component and the log location corresponding to the abnormal parameter can be determined in all logs corresponding to the test data, and the log of the abnormal component can be marked, for example: a yellow alarm is added to the log of the abnormal component, and the expected data range corresponding to the abnormal data is marked as green, etc., and the log is saved to the abnormal component location log, all logs are integrated, and the reminder log is regenerated, and the regenerated reminder log is returned to the execution machine to provide testers with a way to quickly locate the problem.
[0081] In this way, the generated abnormal component location log can provide the specific component name, risk score and specific values of each key parameter, helping testers to quickly identify the problem without manual analysis, thereby quickly and accurately finding the source of the fault, which can greatly shorten the time from problem discovery to problem resolution, thereby reducing the time the system is unavailable.
[0082] As a possible implementation, Figure 3 As shown, a circuit connection diagram of the intermediate device is shown. This embodiment provides an intermediate device for stress testing such as multi-component stress testing and dynamic mixed stress testing. The device may include a backup power supply, power consumption monitoring, and a data collection terminal, which can be connected to the power supply (backup power supply) of the server motherboard to be tested, and is used to record the server status and supply power to the server when it is abnormally powered off, thereby ensuring the stable recording of test data. Once an abnormal scenario such as a downtime occurs, the cause of the downtime is analyzed through the device data, and the downtime scenario is restored. This solves the problem of long server stress testing time and difficulty in analyzing a large number of logs of multiple components, and points out the direction for test engineers to accurately and quickly locate test problems, ensuring that data before and after the downtime can be stably recorded. By analyzing the test data, the positioning log is obtained, thereby ensuring that downtime and abnormal problems can be quickly located.
[0083] Specifically, the test process is as follows Figure 4 As shown, the following steps may be included:
[0084] 1) Component inspection and test tool installation and inspection for usability
[0085] Taking the CPU as an example, stress testing may involve tools such as stress, stess-ng, and ptat. CPU inspection may involve the BMC RESTful interface, lsCPU, and top commands. Before testing begins, the execution machine must complete all tool inspections on the test machine to ensure the availability of subsequent testing and inspection tools, thereby ensuring the overall test feasibility.
[0086] (2) Set basic conditions for components and check basic availability
[0087] Set test conditions for each server component before stress testing. For example, the hard drive may involve setting up a redundant array of independent disks (RAID). The CPU may set Basic Input / Output System (BIOS) options to confirm whether overclocking is required, whether the power supply needs to be set to redundant mode, and whether both the primary and backup power supplies can be switched.
[0088] (3) Components generate test scripts and collect basic server data
[0089] Read the test components that need to be monitored in this round of testing from the server, such as CPU usage, power output current, etc.
[0090] The server is subjected to a multi-component mixed complex stress test. For example, each component takes five minutes, and the entire test can be completed within half an hour. This step will collect the temperature, voltage, current, and other targeted data of each component of the server under load, such as: CPU operating frequency, current occupancy, power redundancy mode, hard disk raid status, etc.
[0091] At the same time, record the power consumption of the entire server.
[0092] (4) Synchronous test case information:
[0093] Based on the test case information and the current steps, confirm whether the machine's power on / off status is abnormal. For example, for a clock test, the first step is to record the time, the second step is to shut down and wait 24 hours, and the third step is to restart the machine to check whether the time is accurate. In the first three steps, the OS must be able to connect, but in the second step, the OS must not be able to connect.
[0094] (5) Monitor server status
[0095] A separate intermediate device (security device) is used to monitor the test parameters of server test components and record server current. The device is connected to the switch and uses interfaces such as RESTful to capture BMC information. The lsCPU command is used to monitor the status of various components in the OS.
[0096] Specifically, commands can be sent and relevant logs recorded every five seconds, and logs within the preset time period are added to the data to be analyzed. The recommended preset time period is 30 minutes, which can be overwritten according to actual needs. Accordingly, a sliding window algorithm is used for the overall data to enhance the efficiency of data recording and storage.
[0097] (6) Test result information analysis
[0098] When a test anomaly is detected or the execution machine sends it to the device, the data inside the sliding window is first intercepted, and a weighted formula analysis is performed on all monitored components. High-risk components are screened out through the high-risk model calculation algorithm. After calculating the data of all components, the data scores are arranged from high to low, and the top three can be marked as high-risk weighted components.
[0099] Specifically, the logs of such components can be marked, for example, with yellow warnings, and the logs can be saved to the logs that require reminders. The expected data range can be marked green, and all logs can be integrated and returned to the execution machine to allow test engineers to quickly locate problems.
[0100] In this way, the server can automatically detect the status of the entire server and each component under multi-component stress testing, record the data to be analyzed through a sliding window algorithm, and when the remote execution machine schedules or self-checks that the machine to be tested is abnormal, it will automatically analyze the data and check the high-risk components. The component log annotations are returned to the execution machine and provided to the test engineer for rapid problem location, thereby speeding up problem analysis and facilitating the reproduction of downtime scenarios.
[0101] Compared with the current existing technology, this embodiment can perform risk assessment on each test parameter separately, and can also perform risk assessment on all test parameters of each test component as a whole, to obtain more comprehensive and accurate parameter risk assessment indicators. By assigning appropriate weights to the single parameter risk values of different test parameters, and then comprehensively assessing the component risk based on the full parameter risk value, single parameter risk value, and preset risk weights corresponding to the single parameter risk value, the overall risk level of each component can be quantified more accurately, and the accuracy of locating abnormal components can be improved. The abnormal component locating log is used to feed back abnormal component information to testers, helping testers to quickly identify the problem without manual analysis, thereby quickly and accurately finding the source of the fault, which can greatly shorten the time from problem discovery to problem resolution, and thus reduce the time the system is unavailable.
[0102] The embodiment of the present application also provides a log generation device, as Figure 1 and Figure 2 The specific implementation of the method shown is as follows Figure 5 As shown, the device includes: an acquisition module 31, a determination module 32, and a generation module 33.
[0103] An acquisition module 31 is configured to acquire test data corresponding to a test component;
[0104] The determination module 32 is configured to perform individual risk assessment and overall risk assessment on the test parameters in the test data, and obtain parameter risk values corresponding to the test parameters;
[0105] a determination module 32 configured to determine a component risk value corresponding to the test component based on the parameter risk value;
[0106] a determination module 32 configured to determine abnormal components from the test components based on component risk values corresponding to the test components;
[0107] The generating module 33 is configured to generate an abnormal component location log corresponding to the abnormal component.
[0108] In some examples of this embodiment, the determination module 32 is specifically configured to perform separate risk assessments on different test parameters in the test data to obtain single parameter risk values corresponding to different test parameters; perform an overall risk assessment on the test parameters in the test data to obtain a full parameter risk value; and determine a component risk value corresponding to the test component based on the parameter risk value, including: determining a component risk value corresponding to the test component based on the single parameter risk value and the full parameter risk value.
[0109] In some examples of this embodiment, the determination module 32 is specifically configured to obtain expected test data corresponding to the test component; and obtain single parameter risk values corresponding to different test parameters based on different test parameters and expected parameters in the expected test data.
[0110] In some examples of this embodiment, the determination module 32 is specifically configured to obtain a test parameter vector corresponding to the test parameter and an expected parameter vector corresponding to the expected test data; and obtain a full parameter risk value based on the test parameter vector and the expected parameter vector.
[0111] In some examples of this embodiment, the determination module 32 is specifically configured to determine the component risk value corresponding to the test component based on the single parameter risk value and the preset risk weight corresponding to the single parameter risk value, and in combination with the full parameter risk value.
[0112] In some examples of this embodiment, the determination module 32 is specifically configured to select a preset number of components with the highest ranking from the test components according to the ranking of the components from high to low risk values, and determine them as abnormal components; or, determine components with component risk values greater than a preset risk threshold as abnormal components.
[0113] In some examples of this embodiment, the generation module 33 is specifically configured to mark the log corresponding to the abnormal component in the log corresponding to the test component; and generate the abnormal component location log based on the marked log and the expected test data corresponding to the abnormal component.
[0114] It should be noted that for other corresponding descriptions of the functional units involved in the log generation device provided in this embodiment, please refer to Figure 1 and Figure 2The corresponding description in will not be repeated here.
[0115] Based on the above Figure 1 and Figure 2 The method shown in FIG. 1 is a method for performing the above-mentioned steps. Accordingly, this embodiment further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the computer program can realize the above-mentioned steps. Figure 1 and Figure 2 The method shown.
[0116] Based on the above Figure 1 and Figure 2 The method shown in FIG. 1 is a method for performing the above-mentioned operations. Accordingly, this embodiment further provides a computer program product having a computer program stored thereon. When the computer program is executed by a processor, the above-mentioned Figure 1 and Figure 2 The method shown.
[0117] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, USB flash drive, mobile hard disk, etc.), and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods of various implementation scenarios of the present application.
[0118] Based on the above Figure 1 and Figure 2 The method shown, and Figure 5 In order to achieve the above-mentioned purpose, the embodiment of the present application further provides an electronic device, such as a personal computer or a server, which includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 1 and Figure 2 The method shown.
[0119] In some embodiments, the physical device may further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a Wi-Fi module, etc. The user interface may include a display, an input unit such as a keyboard, etc. Optional user interfaces may also include a USB interface, a card reader interface, etc. The network interface may include, in some embodiments, a desired wired interface, a wireless interface (such as a Wi-Fi interface), etc.
[0120] Those skilled in the art will understand that the above-mentioned physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different component arrangements.
[0121] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the physical device, supporting the execution of information processing programs and other software and / or programs. The network communication module is used to enable communication between components within the storage medium, as well as with other hardware and software within the physical information processing device.
[0122] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus the necessary general hardware platform, or by hardware. By applying the solution of this embodiment, compared with the current existing technology, this embodiment can perform risk assessment on each test parameter separately, or perform risk assessment on all test parameters of each test component as a whole, so as to obtain a more comprehensive and accurate parameter risk assessment index. By assigning appropriate weights to the single parameter risk values of different test parameters, and then comprehensively assessing the component risk based on the full parameter risk value, the single parameter risk value, and the preset risk weight corresponding to the single parameter risk value, the overall risk level of each component can be quantified more accurately, and the accuracy of abnormal component positioning can be improved. The abnormal component positioning log is used to feed back abnormal component information to the tester, helping the tester to quickly identify the problem without manual analysis, thereby quickly and accurately finding the source of the fault, which can greatly shorten the time from problem discovery to problem resolution, thereby reducing the time the system is unavailable.
[0123] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device that includes the element.
[0124] The above are merely specific embodiments of the present application, which are intended to enable those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to these embodiments herein, but rather is intended to conform to the widest scope consistent with the principles and novel features of the present application.
Claims
1. A log generation method, characterized in that: include: Obtain test data corresponding to the test component; Performing individual risk assessment and overall risk assessment on the test parameters in the test data to obtain parameter risk values corresponding to the test parameters; Determining a component risk value corresponding to the test component according to the parameter risk value; determining abnormal components from the test components according to component risk values corresponding to the test components; Generate an abnormal component location log corresponding to the abnormal component.
2. The method according to claim 1, characterized in that The performing individual risk assessment and overall risk assessment on the test parameters in the test data to obtain parameter risk values corresponding to the test parameters includes: Performing separate risk assessments on different test parameters in the test data to obtain single parameter risk values corresponding to the different test parameters; Performing an overall risk assessment on the test parameters in the test data to obtain a full-parameter risk value; Determining the component risk value corresponding to the test component according to the parameter risk value includes: A component risk value corresponding to the test component is determined according to the single parameter risk value and the full parameter risk value.
3. The method according to claim 2, characterized in that The performing separate risk assessments on different test parameters in the test data to obtain single parameter risk values corresponding to the different test parameters includes: Obtaining expected test data corresponding to the test component; Based on the different test parameters and the expected parameters in the expected test data, single parameter risk values corresponding to the different test parameters are obtained.
4. The method according to claim 3, characterized in that The performing of an overall risk assessment on the test parameters in the test data to obtain a full parameter risk value includes: Obtaining a test parameter vector corresponding to the test parameter and an expected parameter vector corresponding to the expected test data; The full parameter risk value is obtained based on the test parameter vector and the expected parameter vector.
5. The method according to claim 2, characterized in that Determining the component risk value corresponding to the test component according to the single parameter risk value and the full parameter risk value includes: Based on the single parameter risk value and the preset risk weights respectively corresponding to the single parameter risk values, and in combination with the full parameter risk value, a component risk value corresponding to the test component is determined.
6. The method according to claim 1, characterized in that The determining of abnormal components from the test components according to component risk values corresponding to the test components includes: According to the order of the risk values of the components from high to low, a preset number of components ranked at the top are selected from the test components and determined as the abnormal components; or, The component whose component risk value is greater than a preset risk threshold is determined as the abnormal component.
7. The method according to claim 1, characterized in that The generating of the abnormal component location log corresponding to the abnormal component includes: In the log corresponding to the test component, mark the log corresponding to the abnormal component; The abnormal component location log is generated according to the annotated log and the expected test data corresponding to the abnormal component.
8. A log generation device, characterized in that: include: An acquisition module is configured to acquire test data corresponding to the test component; a determination module configured to perform individual risk assessment and overall risk assessment on the test parameters in the test data, and obtain parameter risk values corresponding to the test parameters; a determination module configured to determine a component risk value corresponding to the test component according to the parameter risk value; a determination module configured to determine abnormal components from the test components based on component risk values corresponding to the test components; The generating module is configured to generate an abnormal component location log corresponding to the abnormal component.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. An electronic device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.