Detection report generation method, system and equipment and storage medium
By installing a detection program on an electronic device, automatically detecting and submitting data to the server side, and generating a detection report, the problem of inaccurate reports caused by manual recording is solved, and high-accuracy automatic detection report generation is achieved.
Patent Information
- Application Number
- CN202411502346.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-02-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing electronic device inspection report generation system relies on manual records, which is prone to problems such as keyboard input errors, data reading errors and missing data, resulting in inaccurate inspection reports.
By installing a detection program on an electronic device, automatically detecting and recording the detection results, submitting them to the server for analysis, generating a detection report and report encoding, generating a QR code on the device side, and repairers scan to obtain the report.
It improves the accuracy and completeness of inspection reports, reduces the possibility of human errors, and realizes automated and digital inspection reports generation.
Smart Images

Figure CN119440966A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of software, and specifically to a method, system, device and storage medium for generating a test report. Background Art
[0002] With the continuous advancement of technology, electronic devices have become an indispensable communication and information processing tool in modern society. With the increase in frequency of use and the complexity of functions, the number of electronic device failures and damages has also increased, leading to a growing demand for mobile phone repair services.
[0003] In the related technology, electronic equipment test report generation systems have achieved certain developments. Some electronic equipment test software can assist maintenance personnel in recording some test results and perform functional tests through the test software, thus reducing the workload of manual operations.
[0004] However, most systems require maintenance personnel to manually record the test results and then generate a test report. During this process, manual operation is prone to data transcription errors such as keyboard input errors, data reading errors, and missing data. In addition, complex functional testing and fault diagnosis are still highly dependent on manual operation and judgment, resulting in the inability to generate accurate test reports. Summary of the invention
[0005] The present application provides a test report generation method for generating a test report, which improves the accuracy of the test report.
[0006] In a first aspect, the present application provides a method for generating a test report, which is applied to an electronic device, wherein a test program is installed on the electronic device, and the method comprises the following steps: Testing the electronic device through the testing program to obtain testing data; Submitting the test data to a server so that the server analyzes the test data and generates a test report and a report code corresponding to the test report; Receive the report code returned by the server, and generate a QR code corresponding to the report code; In response to a scanning instruction for the QR code, the detection report is obtained from the server based on the QR code.
[0007] Optionally, the electronic device is tested by the testing program to obtain testing data, specifically including: hardware testing of the electronic device is performed by the testing program to obtain hardware testing data, the hardware testing data including component status and performance indicators and real-time hardware testing data, the real-time hardware testing data including temperature change data of hardware components, power consumption data, and hardware component load data; Performing software detection on the electronic device through the detection program to obtain software detection data, wherein the software detection data includes evaluation data of CPU, GPU, network, and multi-tasking processing capabilities and real-time software detection data, wherein the real-time software detection data includes system resource usage data, network usage data, and application performance data; Collecting user feedback data through the detection program; The hardware detection data, the software detection data, and the user feedback data are used as the detection data.
[0008] In a second aspect, the present application provides a method for generating a test report, which is applied to a server, and the method comprises the following steps: Receiving detection data sent by an electronic device, where the detection data is obtained by the electronic device detecting the electronic device through a detection program; Analyze the test data to generate a test report and a report code corresponding to the test report; The report code is returned to the electronic device so that the electronic device generates a QR code corresponding to the report code; a report acquisition request sent by the electronic device based on the QR code is received, and the detection report is sent to the electronic device.
[0009] Optionally, analyzing the test data to generate a test report and a report code corresponding to the test report specifically includes: Extracting key features from the detection data; Performing cluster analysis on the key features to obtain cluster analysis results; Performing anomaly detection according to the cluster analysis results to obtain abnormal data; Comparing the abnormal data with the benchmark data of the same model of equipment to obtain comparative data; The test report is obtained based on the comparison data, and the test report includes a summary of basic information of the equipment, detailed results of various test indicators, problem diagnosis and severity assessment, optimization suggestions and solutions; Generate a report code that uniquely corresponds to the test report.
[0010] Optionally, anomaly detection is performed according to the cluster analysis result to obtain abnormal data, specifically including: Calculating the distance between a data point in the cluster analysis result and the center of the cluster to which the data point belongs; Setting a distance threshold, marking the data points whose distance exceeds the distance threshold as potential anomalies, so as to obtain potential anomaly data; Analyzing the size and density of clusters according to the potential abnormal data to obtain potential abnormal cluster data; According to the potential abnormal clustering data, local outlier factors of data points in the potential abnormal clustering data are calculated, and data points whose local outlier factor values are higher than a set threshold are marked as abnormal to obtain abnormal data.
[0011] Optionally, after receiving the detection data sent by the electronic device, the method further includes: storing the detection data in a database; Creating an index for the detection data to obtain the database index; Classifying the detection data according to the database index to obtain classified detection data; storing the classified detection data; The classified detection data is backed up.
[0012] Optionally, after analyzing the test data and generating a test report and a report code corresponding to the test report, the method further includes: Accessing the database to query historical detection data associated with the detection data; Generate a historical test report based on the historical test data; The historical test report is compared with the test report to generate a comparative test report.
[0013] Optionally, receiving a report acquisition request sent by the electronic device based on the QR code, and sending the detection report to the electronic device specifically includes: Encrypting the test report to obtain an encrypted test report; Parsing a verification request containing identity information of a maintenance person, wherein the identity information includes a user name and a password; Compare and verify the identity information with the user information in the database to obtain a first verification result; Comparing the current geographical location of the maintenance personnel with the geographical range allowed to be accessed, to obtain a second verification result; When both the first verification result and the second verification result indicate that the verification is passed, the encrypted detection report is decrypted and sent to the electronic device.
[0014] In the third aspect of the present application, an electronic device is provided, including a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are both used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes any one of the methods described above.
[0015] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores instructions, and when the instructions are executed, any of the methods described above is executed.
[0016] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: 1. The equipment-side detection program automatically detects and records the various operation test results of the maintenance personnel, obtains the corresponding test data, submits the test data to the server side for reception and storage, analyzes the test data, generates a test report and the report code corresponding to the test report, and the server side returns the report code to the equipment side, generates a QR code based on the report code, and the maintenance personnel only need to scan the QR code, and after verification, they can obtain the complete test report data from the server side. It effectively solves common problems in traditional manual recording methods, such as data transcription errors such as keyboard input errors, data reading errors, and missing data. Through automation and digitalization, the accuracy and completeness of the test report are ensured, the possibility of human errors is reduced, and accurate test reports are generated.
[0017] 2. By conducting hardware testing, software testing and collecting user feedback information, we can obtain comprehensive status evaluation data of electronic equipment. Based on the comprehensive test data, we can make problem diagnosis more accurate and maintenance plans more targeted, effectively solving the problems of single test data and lack of dynamic test data, thereby reducing misjudgment and return repair rate, and improving maintenance quality and user satisfaction.
[0018] 3. The server receives and analyzes data and generates report codes. According to the report codes that are unique to the test reports, the test data are analyzed and integrated, which effectively solves the problem of data dispersion in the existing technology and realizes the standardization and traceability of the test reports. The centralized processing of test data is realized, which is convenient for long-term tracking and analysis of test data.
[0019] 4. Through key feature extraction, cluster analysis, anomaly detection and data comparison, the device side is compared with the benchmark data of the same model equipment to obtain in-depth data analysis results and accurate problem diagnosis, which effectively solves the problems of shallow data analysis and inaccurate diagnosis in the existing technology, and then generates more accurate detection reports, reducing maintenance time and costs, and improving maintenance efficiency.
[0020] 5. Through historical data query and comparative analysis, a longitudinal comparison of equipment performance is carried out, which solves the problem of lack of historical data reference and realizes the analysis and prediction of equipment performance change trends.
[0021] 6. By encrypting the test data, the test report can be obtained only after identity authentication and geographic location verification, which ensures the security of the test data, effectively solves the problem of insufficient security in accessing the test report, and realizes the secure transmission and authorized access of the test report. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a flow chart of a method for generating a test report in an embodiment of the present application; Figure 2 This is another flow chart of the method for generating a test report in an embodiment of the present application; Figure 3 It is a schematic diagram of the structure of an electronic device in an embodiment of the present application.
[0023] Reference numerals: 301, processor; 302, communication bus; 303, user interface; 304, network interface; 305, memory. DETAILED DESCRIPTION
[0024] In order to enable technicians in this field to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.
[0025] In the description of the embodiments of the present application, words such as "for example" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "for example" or "for example" is intended to present related concepts in a specific way.
[0026] In the description of the embodiments of the present application, the meaning of the term "multiple" refers to two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "include", "comprise", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0027] Figure 1 It is a flow chart of a method for generating a test report in an embodiment of the present application.
[0028] See also Figure 1In an embodiment of the present application, a method for generating a test report is applied to an electronic device, including a test program, and the method includes: S101, testing the electronic device through the testing program to obtain testing data; Specifically, the electronic device is subjected to hardware detection through a detection program to obtain hardware detection data, which includes the status and performance indicators of the components and real-time hardware detection data, and the real-time hardware detection data includes the temperature change data of the hardware components, the power consumption data, and the load data of the hardware components. The electronic device is subjected to software detection through a detection program to obtain software detection data, which includes the evaluation data of the central processing unit (CPU), the graphics processing unit (GPU), the network, and the multi-tasking processing capability, and real-time software detection data, and the real-time software detection data includes the system resource usage data, the network usage data, and the application performance data. User feedback data is collected through the detection program. The hardware detection data, the software detection data, and the user feedback data are used as the detection data.
[0029] Among them, the detection program first performs static hardware detection. At this stage, the detection program identifies and records the basic information of all hardware components in the device. Hardware components include but are not limited to the processor, memory, storage device, graphics card, network adapter and battery of the electronic device. The basic information of the hardware components includes: manufacturer, model, serial number, production date, etc. Check the firmware version of each component to ensure that they are up to date and compatible with each other. Firmware is a software program embedded in a hardware device. It controls the basic functions and behaviors of the device. The firmware includes parts such as the motherboard, processor, hard disk, network card, and graphics card. The detection software usually reads the basic input and output system (BIOS) or unified extensible firmware interface (UEFI) settings of the device, or uses a special diagnostic tool to identify and record the currently installed firmware version number of each hardware component, compare the current firmware version with the latest version released by the manufacturer, and identify the components that need to be updated. At the same time, it is also necessary to ensure that the firmware is compatible with each other. Different hardware components need to work together, and their firmware versions may affect this collaboration. For example: the motherboard firmware (BIOS / UEFI) may need to match the CPU firmware version to support certain advanced features; the storage controller's firmware may need to be compatible with a specific version of the hard disk firmware to ensure optimal performance and stability; the graphics card firmware may need to be compatible with a specific version of the motherboard firmware to ensure correct PCIe communication.
[0030] After obtaining the status and performance indicators of the components, the electronic device is tested in real time. First, the built-in sensors and monitoring modules are initialized. For example, temperature sensors, power consumption monitors, and performance counters are activated. The detection program ensures that all monitoring components are in normal working condition. Before starting the actual test, the detection program collects idle state data as a benchmark for subsequent comparisons. The detection data includes the initial temperature of each component, the basic power consumption of the system, and the idle load level of each hardware component.
[0031] Real-time hardware detection data includes temperature change data of hardware components, power consumption data, and hardware component load data. When collecting real-time temperature changes, the detection program continuously collects temperature data according to the system sampling frequency and records the real-time temperature value of each monitored component. These data will be marked with a timestamp so that the timeline of temperature changes can be accurately tracked during subsequent analysis. Under normal operating conditions, the program will maintain a fixed system sampling frequency. When it detects that the system has entered a high-load state, such as performing intensive computing tasks or high-definition video rendering, the program automatically increases the sampling frequency to capture the rapid temperature changes that may occur under high-intensity working conditions. As data is continuously collected, the program will calculate and update the temperature statistics of each component in real time, including the minimum temperature, maximum temperature, average temperature, and temperature change rate. The detection program will also compare the collected temperature data with pre-set safety thresholds. These thresholds are usually set based on the specifications provided by the hardware manufacturer. If the temperature of the component exceeds the preset safety threshold, the detection program will record the abnormal information and obtain temperature change data.
[0032] When collecting power consumption data from real-time hardware detection data, the detection program continuously collects power consumption data according to the system sampling frequency, continuously collects data through power consumption sensors, and records the real-time power consumption of the overall system and various hardware components such as the central processing unit (CPU), graphics processing unit (GPU), and storage devices. For mobile devices, the battery discharge rate, charging performance, and number of cycles are also monitored. The program records this data at fixed system time intervals, calculates average power consumption, peak power consumption, and estimates long-term energy consumption trends. At the same time, it compares the collected data with the preset threshold, and the detection program records abnormal information to obtain power consumption data.
[0033] When collecting hardware component load data in real-time hardware detection data, the detection program continuously collects hardware component load data according to the system sampling frequency through performance counters and monitoring modules, and continuously collects specific performance indicators of each component through performance counters and monitoring modules. For the central processing unit (CPU), the usage, clock speed and temperature are monitored; for the graphics processing unit (GPU), the utilization, memory usage and rendering performance are tracked; for the memory, the usage and read and write speed are recorded; for storage devices, the I / O operation frequency and response time are monitored; for network adapters, the data throughput and connection quality are tracked. The program dynamically adjusts the sampling frequency, performs preset load tests and analyzes the data in real time to identify performance bottlenecks and abnormal situations, and finally obtains the hardware component load data. After all the above operations, the hardware detection data is obtained.
[0034] Next, the detection program performs software detection, which includes static software detection and real-time software detection. The static software detection data includes evaluation data of the central processing unit (CPU), graphics processing unit (GPU), network, and multi-tasking processing capabilities, and real-time software detection data. The real-time software detection data includes system resource usage data, network usage data, and application performance data. When performing static software detection, the detection program runs a series of standardized test tasks, covering core hardware components such as the central processing unit (CPU), graphics processing unit (GPU), network adapter, storage device, and memory. These tests include complex mathematical operations, data encryption and decryption, 2D and 3D graphics rendering, video processing, network throughput testing, multi-tasking simulation, and large-scale data read and write operations. The detection system obtains evaluation data of the central processing unit (CPU), graphics processing unit (GPU), network, and multi-tasking processing capabilities by measuring the execution time, resource usage, and output quality of these tasks, and obtains static software detection data.
[0035] After obtaining the static software detection data, real-time software detection is performed. The real-time software detection data includes system resource usage data, network usage data, and application performance data. Among them, the detection program initializes the system-level API and performance counters to obtain real-time data access rights. The detection program periodically samples the state of the central processing unit (CPU) core and calculates the time allocation of the central processing unit (CPU) in user state, system state, and idle state, thereby obtaining the overall and single-core utilization of the central processing unit (CPU). Real-time detection of memory usage involves tracking the allocation of physical memory and virtual memory, including used memory, available memory, cache and buffer usage, and page scheduling frequency. Real-time detection of storage device I / O operations requires recording the number of read and write operations, data volume, and response time, which is usually achieved through system I / O counters or dedicated disk performance monitoring tools. The detection of graphics processing unit (GPU) usage requires access to the API provided by the graphics driver to obtain data such as graphics processing unit (GPU) core utilization, memory bandwidth usage, and temperature. System resource usage data is obtained through the above process.
[0036] When collecting network usage data and application performance data, the detection program initializes the network real-time detection module and obtains access to the network interface through the network API provided by the system or a dedicated network analysis library. The detection program continuously captures data packets passing through all network interfaces and records the size, source address, destination address, protocol type and other information of each data packet. Through real-time analysis of these data packets, the network upload and download speeds and overall bandwidth utilization are calculated. At the same time, the detection program will detect network connection quality indicators in real time, regularly send detection packets (such as ICMP packets) to the preset target server, and measure the round-trip time (RTT) to evaluate network latency. By analyzing the loss of detection packets, the program can calculate the packet loss rate. In addition, the detection program will also detect the establishment and disconnection process of network connections in real time, and record connection failures or instability. At the application level, the detection program will track the network usage of various applications and services. This is usually achieved by real-time detection of the system's network connection table, recording information such as the number of network connections and data transmission volume of each process. The detection program may also use deep packet inspection (DPI) technology to analyze the content of data packets to identify the network traffic characteristics of specific applications. Network usage data and application performance data are obtained through the above process.
[0037] When collecting user feedback data, the test program integrates a feedback collection module into the user interface, which may be presented in the form of a pop-up questionnaire, a rating system, or a feedback button. At key points in the use of the device, such as when an application is launched, a task is completed, or the system status changes, the test program will actively invite users to provide feedback. The feedback content usually includes subjective evaluations of device response speed, application running smoothness, system stability, battery life, etc. The test program uses tools such as Likert scales or sliders to allow users to quantitatively rate these aspects. At the same time, an open text input box is provided to allow users to describe in detail the specific problems they encountered or suggestions for improvement. In order to associate with hardware and software test data, the test program automatically records the current system status when the user provides feedback, including CPU usage, memory usage, network status, etc. This helps to correspond the user's subjective feelings with objective performance indicators. Collect user feedback data through the above process.
[0038] The above hardware detection data, software detection data, and user feedback data are used as detection data.
[0039] S102, submitting the test data to a server, so that the server analyzes the test data and generates a test report and a report code corresponding to the test report; The detection program integrates the collected hardware detection data, software detection data and user feedback data into a structured data packet. The data packet is formatted into a format that is easy to transmit and parse, such as JSON or Protocol Buffers. The data packet will contain metadata such as a device unique identifier, timestamp, data version number, etc., so that the server can classify the data and store it in the corresponding database according to the metadata in the data packet. The specific steps of classification and storage are described in detail after step S201.
[0040] S103, receiving the report code returned by the server, generating a QR code corresponding to the report code; receiving the report code from the server through HTTP or HTTPS protocol, and after receiving the report code, the electronic device verifies the report code, including checking whether the format of the code is correct, whether the length meets expectations, and whether it contains any illegal characters, which helps to ensure the integrity of the received data and prevent errors that may occur in subsequent processing. Encode the processed report code using a QR code (Quick Response Code), and use the Zebra Crossing library to convert the report code into a matrix representation of a QR code.
[0041] S104: In response to a scanning instruction for the QR code, obtaining the detection report from the server based on the QR code.
[0042] In response to the scanning instruction of the QR code, a request for obtaining the test report is sent to the server, and the identity information is submitted for identity authentication, allowing the server to obtain the current geographic location of the maintenance personnel for geographic location verification. After identity authentication and geographic location verification, the server sends the test report to the electronic device.
[0043] Figure 2 It is another flow chart of a method for generating a test report in an embodiment of the present application.
[0044] See also Figure 2 In an embodiment of the present application, a method for generating a test report includes: S201, receiving detection data sent by an electronic device, where the detection data is obtained by the electronic device detecting the electronic device through a detection program; The server configures and maintains a dedicated API endpoint for receiving detection data from electronic devices. This API usually uses the HTTPS protocol to ensure the security of data transmission. The server implements a load balancing mechanism to handle a large number of device data requests that may arrive at the same time. When the electronic device collects data through the detection program, it packages the data and sends it to the predefined server API endpoint. After receiving the data reception request, the server performs authentication and authorization checks to ensure the legitimacy of the data source. This is usually achieved through device tokens, API keys or other authentication mechanisms. After verification, the server will perform integrity and format checks on the received data. This includes verifying that the structure of the data packet conforms to the predefined pattern and checking whether the necessary fields exist.
[0045] S202. Analyze the test data to generate a test report and a report code corresponding to the test report; specifically, extract key features from the test data, perform cluster analysis on the key features to obtain cluster analysis results; perform anomaly detection based on the cluster analysis results to obtain abnormal data; compare the abnormal data with benchmark data of the same model of equipment to obtain comparative data; obtain a test report based on the comparative data, the test report including a summary of basic equipment information, detailed results of various test indicators, problem diagnosis and severity assessment, optimization suggestions and solutions; generate a report code uniquely corresponding to the test report.
[0046] Among them, the detection data is preprocessed. The system cleans the erroneous data that exceeds the reasonable range according to the preset reasonable range of each feature data. These erroneous data are caused by sensor failure, data transmission problems or recording system errors. These erroneous data have nothing to do with the performance or status of the device itself. For example, for a temperature sensor, a reasonable range of -50℃ to 200℃ may be set. The system scans the entire data set and marks the values that exceed this range. For these abnormal values, several processing methods can be adopted: directly delete, replace with the nearest valid value, or mark as a special value for further analysis.
[0047] Then, machine learning techniques such as principal component analysis (PCA) or feature importance assessment are used to identify the key features that are most indicative of equipment performance and status. These key features may include key indicators such as temperature, pressure, vibration frequency, and energy consumption.
[0048] The obtained key features are clustered using a clustering algorithm. Common clustering algorithms include K-means clustering, hierarchical clustering, or density-based clustering (such as DBSCAN). The system will select an appropriate clustering algorithm based on the characteristics of the data and use multiple algorithms for comparison. During the clustering process, the system will automatically determine the optimal number of clusters and use methods such as the elbow rule or silhouette analysis to obtain cluster analysis results. The cluster analysis results include cluster labels, cluster centers, cluster sizes, internal distances within clusters, distances between clusters, and silhouette coefficients.
[0049] Based on the results of cluster analysis, the system performs anomaly detection.
[0050] Specifically, the distance from a data point in the cluster analysis result to the center of the cluster to which the data point belongs is calculated; a distance threshold is set, and data points whose distance exceeds the distance threshold are marked as potential anomalies to obtain potential anomaly data; the size and density of the clusters are analyzed based on the potential anomaly data to obtain potential anomaly cluster data; based on the potential anomaly cluster data, the local outlier factor of the data point in the potential anomaly cluster data is calculated, and the data points whose local outlier factor value is higher than the set threshold are marked as abnormal to obtain abnormal data.
[0051] The system calculates the distance from each data point to the cluster center to which the data point belongs. The system automatically selects the calculation method based on the characteristics of the data point. For example, the Euclidean distance is selected for continuous data. The Euclidean distance is the most commonly used distance measurement method. The calculation formula is: where x i is the coordinate of the data point, c i is the coordinate of the cluster center. The weighted Euclidean distance is calculated for the data points with key features, and the calculation formula is: Among them, x iis the coordinate of the data point, c i are the coordinates of the cluster center, w i is the weight of each feature, and the weight of each feature is obtained when extracting key features.
[0052] A threshold is set for each cluster separately, and the distance from all points in the cluster to the cluster center is calculated for each cluster. The statistics of the distance (such as the mean, standard deviation, or specific percentile) are calculated separately for each cluster, and a separate threshold is set for each cluster based on these statistics. Data points whose distance exceeds the distance threshold are marked as potential anomalies and recorded to obtain potential abnormal data.
[0053] When analyzing cluster size, the total number of data points in each cluster is calculated, and the number of data points marked as potential anomalies is used to calculate the proportion of anomalies in each cluster. When analyzing cluster density, for low-dimensional data, the volume of the cluster is directly calculated (for example, the area in two-dimensional data) and the number of points is divided by the volume. For high-dimensional data, more complex methods are used, such as calculating the average distance between points or using kernel density estimation to obtain potential anomaly cluster data. The system combines the analysis results of cluster size and cluster density. For example, a cluster of normal size but very low density may represent a group of scattered anomalies. Conversely, a small and dense cluster may be a group of anomalies that are tightly clustered but different from the main data pattern.
[0054] For each data point in the abnormal cluster data, find its k nearest neighbors. The K value is a parameter automatically set by the system during the cluster analysis process. Calculate the LOF value of each data point. The LOF value of each data point is the average of the ratio of the local reachable density of the k nearest neighbors of the data point to the local reachable density of the data point itself. The system calculates the average and standard deviation of the LOF values of all data points, sets the threshold to the average plus n times the standard deviation (n is usually 2 or 3), and compares the LOF value of each data point with the set threshold. If the LOF value of a point is higher than the threshold, it is marked as an abnormal point to obtain abnormal data.
[0055] Use methods such as Z-score standardization or Min-Max scaling to standardize the abnormal data, perform statistical analysis on the abnormal data, compare the abnormal data with the benchmark data, and check the difference between the abnormal data and the benchmark data through t-test or Mann-Whitney U test method. Generate box plots, scatter plots and heat maps based on the comparison data of the abnormal data and the benchmark data. The system generates a test report through box plots, scatter plots and heat maps. The test report includes a summary of basic equipment information, detailed results of various test indicators, problem diagnosis and severity assessment, optimization suggestions and solutions.
[0056] S203, returning the report code to the electronic device, so that the electronic device generates a QR code corresponding to the report code; The server prepares the data and queries and verifies the report code in the database to verify the validity and integrity of the code. The server formats the report code into an appropriate response format, such as JSON (JavaScript Object Notation) format, because it is easy to parse and widely supported. After the formatting is completed, the server sends the response back to the electronic device via HTTP or HTTPS protocol. After receiving the report code, the electronic device generates a QR code corresponding to the report code; S204: Receive a report acquisition request sent by the electronic device based on the QR code, and send the detection report to the electronic device.
[0057] Specifically, the test report is encrypted to obtain an encrypted test report; the verification request containing the maintenance personnel's identity information is parsed, and the identity information includes a user name and a password; the identity information is compared and verified with the user information in the database to obtain a first verification result; the current geographic location of the maintenance personnel is compared with the geographic scope allowed to be accessed to obtain a second verification result; when both the first verification result and the second verification result indicate that the verification is passed, the encrypted test report is decrypted and sent to the electronic device.
[0058] Among them, the test report is encrypted using an encryption algorithm such as AES (Advanced Encryption Standard) or RSA (Public Key Cryptography System). The system receives a verification request for the identity information of the maintenance personnel sent through a secure communication channel (such as HTTPS). The system parses the verification request and extracts the identity information in the verification request, mainly including the user name and password. The extracted identity information is compared and verified with the user information stored in the database, and the record matching the provided user name is searched in the database. After finding the username matching record, the system uses a password verification method (such as bcrypt or Argon2) to compare the provided password with the password stored in the database, and the comparison result will be used as the first verification result.
[0059] The current location of the maintenance personnel is obtained through GPS coordinates or IP address geographic location mapping, and the current location of the maintenance personnel is compared with the predefined geographic range of allowed access. The system uses geographic information system (GIS) technology to determine whether the current location is within the allowed range. The result of this comparison will be used as the second verification result.
[0060] Evaluate the first verification result and the second verification result, and when both verification results show that the verification is passed, decrypt the previously encrypted test report. The decryption process uses the decryption algorithm and key corresponding to the encryption. After decryption, the system will perform an integrity check on the report content to ensure that the decryption process did not introduce any errors or damage. The system will then prepare to send the decrypted report to the requesting electronic device. The sending process is usually carried out through a secure communication protocol (such as HTTPS) to ensure the security of the transmission process. The system may also format the report before sending to ensure that it is suitable for the display and processing capabilities of the receiving device.
[0061] Optional, in Figure 2 After step S201 of the illustrated embodiment, the steps of classification and storage may be performed, which are specifically as follows: storing the detection data in a database; Creating an index for the detection data to obtain the database index; Classifying the detection data according to the database index to obtain classified detection data; storing the classified detection data; The classified detection data is backed up.
[0062] After the server receives the detection data sent by the electronic device, the detection data is stored in a high-performance, scalable database system such as PostgreSQL, MongoDB, or Cassandra. The structure and relationship of the data will be considered during the storage process of the detection data. For example, hardware detection data, software detection data, and user feedback data may be stored in different tables or collections. Each data record will contain fields such as device identifier, timestamp, and specific detection indicators. The database will use a transaction mechanism to ensure the integrity and consistency of the data. During the storage process, the server will also perform data normalization and cleaning, such as processing missing values, converting data formats, etc., to ensure the quality of the stored data.
[0063] In order to improve the efficiency of subsequent queries and analysis, the server creates appropriate indexes for the stored test data. Determine the key fields of the index, such as equipment identifiers, timestamps, specific test indicators and other fields. These key fields are retrieved through the database query mode, which includes point query, range query, aggregate query and join query. Point query is to quickly retrieve a single record by unique identifier, range query is to retrieve a set of records that meet a specific range of conditions, and aggregate query is to perform statistical and summary operations on data. Join query is a complex query involving the relationship between multiple tables.
[0064] Use query analysis tools such as Percona PMM (MySQL) to analyze the structure, conditions, and frequency of common queries, and identify types such as point queries, range queries, aggregate queries, and join queries. Select the corresponding index based on the query type. Point queries are usually suitable for single-column or unique indexes, range queries require single-column or composite indexes, aggregate queries are suitable for composite indexes or function indexes, and join queries usually require indexes on the join columns.
[0065] Using the created index, the server systematically classifies the detection data. Classify by device type: group device data of different models or types; Classify by time period: aggregate data by day, week, or month; Classify by performance indicator: classify data such as CPU performance, memory usage, and network status separately; Classify by user feedback type: store positive, negative, and neutral feedback separately; The classification process may involve complex database queries and data processing operations. When the amount of data is large, MapReduce or other big data processing technologies can be used. Store the classified detection data.
[0066] Perform regular full backups based on data changes. Perform incremental or differential backups between full backups to capture and save the latest data changes, thereby reducing the risk of data loss. At the same time, adopt a multi-layer backup strategy, including local quick recovery backups to cope with daily data recovery needs, and off-site disaster recovery backups to prevent data loss caused by large-scale disasters. And regularly test the backup and recovery process, by simulating various data loss scenarios and attempting to recover, to ensure the integrity and availability of the backup data.
[0067] Optional, in Figure 2 After step S202 of the illustrated embodiment, the following steps may be performed: Access the database to query historical test data associated with the test data; Generate historical test reports based on historical test data; Compare historical test reports with test reports to generate comparative test reports.
[0068] The system determines the key parameters required for the query, such as report code, detection type, and time range. The detection system extracts the report code from the currently received detection data. If there is no clear report code in the current data, the detection system uses other identification methods, such as a combination of IP address or MAC address, to uniquely identify the device. Based on these parameters, the system builds an SQL query structure, which includes but is not limited to SELECT, FROM, WHERE, ORDER BY, and LIMIT clauses. In the SELECT part, the detection system selects the columns to be queried, and the selected columns are based on the needs of subsequent data processing and analysis. The system builds the WHERE clause, uses parameterized queries to prevent SQL injection, and ensures that the conditions can make full use of database indexes. Add an ORDER BY clause to ensure that the results are sorted by time, and use LIMIT to control the amount of data returned, combining all parts into a complete query structure. Bind the determined parameter values such as report code, detection type, and time range to the query, for example: report_code:"REP12345" detection_type:"PERFORMANCE_CHECK" start_time:"2023-01-01 00:00:00" end_time:"2023-12-31 23:59:59" The system executes the constructed parameterized query to obtain historical detection data associated with the detection data. The detection data includes historical hardware detection data, historical software detection data and historical user feedback data.
[0069] For example, a query might retrieve all detection records for a specific device within the past year. After executing the query, the system receives the returned data set from the database and loads it into memory for subsequent processing. The purpose of this step is to obtain enough historical data to provide a basis for subsequent analysis and comparison.
[0070] The detection system generates historical detection reports based on historical detection data. The detection system converts the data of the current detection report and the historical detection report into a unified data format. After the unified data format, the system compares the preset key indicators, which are performance indicators and resource utilization. When comparing, the current report can be compared with the most recent historical report, or with a historical report at a specific time point, or even with a report from the same period last year. The choice of time range depends on the specific analysis needs.
[0071] The system will calculate the differences of various indicators, including but not limited to absolute differences, relative differences, mean comparisons and standard deviation analysis. Based on the calculated data, the system will generate a structured comparative test report. The comparative test report includes a comparative summary, an overview of the overall performance changes, detailed comparison results for each indicator, visual charts, explanations of significant changes and possible causes.
[0072] This embodiment also discloses an electronic device, referring to Figure 3 The electronic device may include: at least one processor 301 , at least one communication bus 302 , a user interface 303 , a network interface 304 , and at least one memory 305 .
[0073] The communication bus 302 is used to realize the connection and communication between these components.
[0074] The user interface 303 may include a display screen (Display) and a camera (Camera), and the optional user interface 303 may also include a standard wired interface and a wireless interface.
[0075] The network interface 304 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0076] Among them, the processor 301 may include one or more processing cores. The processor 301 uses various interfaces and lines to connect various parts in the entire server, and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory, and calling data stored in the memory. Optionally, the processor 301 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 301 can integrate one or more combinations of a central processing unit (Central Processing Unit, CPU), a graphics processor 301 (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 301, and it can be implemented separately through a chip.
[0077] Among them, the memory 305 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 305 includes a non-transitory computer-readable storage medium. The memory 305 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 305 may optionally be at least one storage device located away from the aforementioned processor 301. As Figure 3 As shown, the memory 305 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an application program for generating a detection report.
[0078] exist Figure 3 In the electronic device shown, the user interface 303 is mainly used to provide an input interface for the user and obtain data input by the user; and the processor 301 can be used to call the application program for generating the detection report stored in the memory 305. When executed by one or more processors 301, the electronic device executes one or more methods in the above-mentioned embodiments.
[0079] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.
[0080] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0081] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0082] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0083] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0084] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory 305 and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned memory 305 includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk.
[0085] The above is only an exemplary embodiment of the present disclosure and cannot be used to limit the scope of the present disclosure. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the disclosure of the specification, those skilled in the art will easily think of other embodiments of the present disclosure. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the technical field that are not recorded in the present disclosure. The description and examples are only regarded as exemplary, and the scope and spirit of the present disclosure are defined by the claims.
Claims
1. A method for generating a test report, characterized in that: Applied to an electronic device, the electronic device having a detection program installed thereon, the method comprising: Testing the electronic device through the testing program to obtain testing data; Submitting the test data to a server so that the server analyzes the test data and generates a test report and a report code corresponding to the test report; Receive the report code returned by the server, and generate a QR code corresponding to the report code; In response to a scanning instruction for the QR code, the detection report is obtained from the server based on the QR code.
2. The method according to claim 1, characterized in that The detecting the electronic device by the detection program to obtain the detection data specifically includes: Performing hardware detection on the electronic device through the detection program to obtain hardware detection data, wherein the hardware detection data includes component status and performance indicators and real-time hardware detection data, wherein the real-time hardware detection data includes temperature change data, power consumption data, and hardware component load data of the hardware component; Performing software detection on the electronic device through the detection program to obtain software detection data, wherein the software detection data includes evaluation data of CPU, GPU, network, and multi-tasking processing capabilities and real-time software detection data, wherein the real-time software detection data includes system resource usage data, network usage data, and application performance data; Collecting user feedback data through the detection program; The hardware detection data, the software detection data, and the user feedback data are used as the detection data.
3. A method for generating a test report, characterized in that: Applied to the server side, the method includes: Receiving detection data sent by an electronic device, where the detection data is obtained by the electronic device detecting the electronic device through a detection program; Analyze the test data to generate a test report and a report code corresponding to the test report; Returning the report code to the electronic device so that the electronic device generates a QR code corresponding to the report code; Receive a report acquisition request sent by the electronic device based on the QR code, and send the detection report to the electronic device.
4. The method according to claim 3, characterized in that The analyzing the test data to generate a test report and a report code corresponding to the test report specifically includes: Extracting key features from the detection data; Performing cluster analysis on the key features to obtain cluster analysis results; Performing anomaly detection according to the cluster analysis results to obtain abnormal data; Comparing the abnormal data with the benchmark data of the same model of equipment to obtain comparative data; The test report is obtained based on the comparison data, and the test report includes a summary of basic information of the equipment, detailed results of various test indicators, problem diagnosis and severity assessment, optimization suggestions and solutions; Generate a report code that uniquely corresponds to the test report.
5. The method according to claim 4, characterized in that The performing anomaly detection according to the cluster analysis result to obtain abnormal data specifically includes: Calculating the distance between a data point in the cluster analysis result and the center of the cluster to which the data point belongs; Setting a distance threshold, marking the data points whose distance exceeds the distance threshold as potential anomalies, so as to obtain potential anomaly data; Analyzing the size and density of clusters according to the potential abnormal data to obtain potential abnormal cluster data; According to the potential abnormal clustering data, local outlier factors of data points in the potential abnormal clustering data are calculated, and data points whose local outlier factor values are higher than a set threshold are marked as abnormal to obtain abnormal data.
6. The method according to claim 3, characterized in that After receiving detection data sent by the electronic device, wherein the detection data is obtained by the electronic device detecting the electronic device through a detection program, the method further includes: storing the detection data in a database; Creating an index for the detection data to obtain the database index; Classifying the detection data according to the database index to obtain classified detection data; storing the classified detection data; The classified detection data is backed up.
7. The method according to claim 3, characterized in that After analyzing the test data and generating a test report and a report code corresponding to the test report, the method further includes: Accessing the database to query historical detection data associated with the detection data; Generate a historical test report based on the historical test data; The historical test report is compared with the test report to generate a comparative test report.
8. The method according to claim 3, characterized in that The receiving the report acquisition request sent by the electronic device based on the QR code, and sending the detection report to the electronic device specifically includes: Encrypting the test report to obtain an encrypted test report; Parsing a verification request containing identity information of a maintenance person, wherein the identity information includes a user name and a password; Compare and verify the identity information with the user information in the database to obtain a first verification result; Comparing the current geographical location of the maintenance personnel with the geographical range allowed to be accessed, to obtain a second verification result; When both the first verification result and the second verification result indicate that the verification is passed, the encrypted detection report is decrypted and sent to the electronic device.
9. An electronic equipment test report generating device, characterized in that: include: one or more processors and memory; The memory is coupled to the one or more processors, and the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the mobile phone detection report generation system to execute the method as described in any one of claims 1-2 or 3-7.
10. A computer-readable storage medium comprising instructions, characterized in that: When the instruction is executed on the mobile phone detection report generation system, the mobile phone detection report generation system executes the method as described in any one of claims 1-2 or 3-7.