Test log monitoring method, storage medium and computer equipment

By providing a test log monitoring method, obtaining, monitoring and parsing the log files of the test tool, it solves the problem of difficult collection of test log data, realizes automated log file backup and information storage, and reduces development and maintenance costs.

CN120066885APending Publication Date: 2025-05-30XIAN YOUFANG DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411925549.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

In the prior art, it is difficult to collect test log data and information query. When the tool source code of chip manufacturers is upgraded, the secondary integration tools of terminal manufacturers must also be upgraded, resulting in high development and maintenance costs.

Method used

Provides a test log monitoring method, including obtaining the log file saving path when the test tool is started, monitoring and backing up the newly added log files, and parsing the log files to store them in a preset structure format to the data storage system.

Benefits of technology

It realizes automatic acquisition of new paths and continue monitoring when testing tools are upgraded or path changes, ensuring complete collection and information storage of log files, reducing development and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066885A_ABST
    Figure CN120066885A_ABST
Patent Text Reader

Abstract

The invention discloses a test log monitoring method, a storage medium and computer equipment, and the method comprises the steps: responding to the starting of any monitored test tool, and obtaining a log file storage path corresponding to the started test tool; monitoring the log file storage path, and backing up a newly added log file on the log file storage path; and analyzing the newly added log file, and storing the log content obtained by analysis in a preset structural body format to a data storage system. Through the mode, the log data can be automatically tested, the data collection process is simplified, and the maintenance cost of a collection tool is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data storage, and in particular, to a test log monitoring method, a storage medium, and a computer device. Background Art

[0002] There are many existing production test design solutions for products, and the methods for collecting process data of production tests are very cumbersome, and the development and maintenance workloads are relatively large. In the prior art, a method of obtaining the source code or integrated code of the radio frequency test tool of the chip manufacturer and performing secondary integrated development is provided. In the integrated tool, the production test information is directly written into the MES or the production database. The problems with this method are as follows: First, when the tool source code or integrated code of the chip manufacturer is upgraded, the secondary integrated tool of the terminal manufacturer must also be upgraded accordingly, which will result in very high development and maintenance costs for the terminal manufacturer. Second, the radio frequency tool codes of some chip manufacturers are not open to the public, resulting in the inability to implement this solution. Finally, when the terminal manufacturer has radio frequency test tools from multiple chip manufacturers, all of them need to be integrated and maintained, and the development and maintenance workload is very large.

[0003] Another way provided in the prior art is to manually collect the test log files on each test PC and summarize them in a specified location, only saving the log files without implementing an informatization method. The disadvantage of this method is that it is difficult to query information from a large amount of production data; on each computer, since the save path of the log file in the radio frequency test tool is locally configured, even if it is not saved in the specified location according to the specification, it is not easy to inspect and discover, resulting in the production test log files being difficult to collect completely and the missing files being unable to be queried. Summary of the Invention

[0004] The present application mainly provides a test log monitoring method, a storage medium, and a computer device to solve the problem of difficult collection of test log data.

[0005] To solve the above technical problems, a technical solution adopted by the present application is: to provide a test log monitoring method, including: in response to the startup of any monitored test tool, obtaining the log file save path corresponding to the started test tool; monitoring the log file save path, and backing up the newly added log files on the log file save path; parsing the newly added log files, and storing the parsed log content in a preset structure format into a data storage system.

[0006] In some embodiments, obtaining the log file saving path corresponding to the started test tool includes: obtaining the process name of the test tool in the task manager, and finding the real path of the executable file corresponding to the test tool based on the process name; obtaining the configuration file of the executable file based on the real path and the relative path of the configuration file corresponding to the executable file, to obtain the log file index information of the configuration file, where the relative path of the configuration file is the relative path based on the real path; determining the saving path of the log file based on the log file index information.

[0007] In some embodiments, monitoring the log file saving path and backing up the newly added log files on the log file saving path includes: monitoring the status of the folder where the log file is located based on the log file saving path; in response to a newly added log file in the folder, backing up the newly added log file to the first target folder.

[0008] In some embodiments, parsing the newly added log file and storing the parsed log content in a preset structure format in the data storage system includes: parsing the newly added log file in the first target folder to obtain the log content of the log file; re-saving the log content in the structure format and sending it to the data storage system.

[0009] In some embodiments, re-saving the log content in the structure format includes: renaming the re-saved log content to be different from the name of the log file.

[0010] In some embodiments, re-saving the log content in the structure format further includes: re-saving the log content to the second target folder.

[0011] In some embodiments, storing the parsed log content in a preset structure format in the data storage system further includes: obtaining the database operation interface of the data storage system; sending the log content to the data storage system through the information transmission format corresponding to the database operation interface type.

[0012] In some embodiments, the data storage system is configured in a network server.

[0013] To solve the above technical problems, another technical solution adopted by this application is: providing a storage medium, on which program data is stored, and when the program data is executed by a processor, the steps of the test log monitoring method as described above are implemented.

[0014] The beneficial effects of the storage medium are referred to those of the above-mentioned test log monitoring method and will not be elaborated here.

[0015] The present application also provides a computer device, including a processor and a memory connected to each other. The memory stores a computer program. When the processor executes the computer program, the steps of the above-mentioned test log monitoring method are implemented.

[0016] The beneficial effects of the computer device are referred to those of the above-mentioned test log monitoring method and will not be elaborated here.

[0017] The beneficial effects of the present application are as follows: Different from the prior art, the present application discloses a test log monitoring method, a storage medium and a computer device. In response to the startup of any test tool to be monitored, the log file save path corresponding to the started test tool is obtained, the log file save path is monitored, and the newly added log files on the log file save path are backed up, so as to automatically obtain the new path even when the test log save path changes, and continue to monitor the newly added log files. The newly added log files are parsed, and the parsed log content is stored in the data storage system in a preset structure format, so as to parse and back up the log files, enabling the test log monitoring method to store different types of log files in a unified format for easy reference, while collecting the log files completely, and without the need for later upgrade or secondary development, simplifying the collection process and greatly reducing the development and maintenance costs of terminal manufacturers. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings, where:

[0019] Figure 1 is a flowchart of an embodiment of the test log monitoring method provided by the present application;

[0020] Figure 2 is as Figure 1 shown in the flowchart of an embodiment of step 10 of the method;

[0021] Figure 3 is as Figure 1 shown in the flowchart of an embodiment of step 20 of the method;

[0022] Figure 4 is as Figure 1 shown in the flowchart of an embodiment of step 30 of the method;

[0023] Figure 5 is as follows Figure 4 a schematic flowchart of an embodiment of step 32 of the method shown

[0024] Figure 6 a schematic structural diagram of an embodiment of the storage medium provided by the present application

[0025] Figure 7 a schematic structural diagram of an embodiment of the computer device provided by the present application Detailed implementation manners

[0026] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0027] The terms "first", "second", and "third" in the embodiments of the present application are only used for descriptive purposes, and cannot be construed as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first", "second", and "third" may explicitly or implicitly include at least one of such features. In the description of the present application, the meaning of "a plurality" is at least two, such as two, three, etc., unless otherwise specifically and clearly defined. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes unlisted steps or units, or optionally further includes other steps or units inherent to these processes, methods, products, or devices.

[0028] Referring to

[0029] refer to Figure 1 , Figure 1 is a schematic flowchart of an embodiment of the test log monitoring method provided by the present application. The test log monitoring method includes

[0030] Step 10: In response to the startup of any test tool to be monitored, obtain the log file save path corresponding to the started test tool.

[0031] After the test tool is started, in the process list of the task manager of the test terminal such as a PC, the corresponding test process will appear. The program monitors the running process list in the task manager, obtains the startup information of the test tool, and in response to the startup of any monitored test tool, obtains the save path of the log file corresponding to the started test tool.

[0032] Among them, the test tool is used to test radio frequency chips produced by different manufacturers and correspondingly generate test log files and save them locally.

[0033] The log file is a file that records all activities executed during the software testing process, including test cases, test results, test environment, errors and defects found during the test, and other information.

[0034] Further, referring to Figure 2 , step 10 further includes:

[0035] Step 11: Obtain the process name of the test tool in the task manager and find the real path of the executable file corresponding to the test tool based on the process name.

[0036] According to the process name of the test tool in the task manager, traverse all processes running on the test terminal to find the executable file of the process and the real path corresponding to the executable file.

[0037] Real path

[0038] Step 12: Based on the real path and the relative path of the configuration file corresponding to the executable file, obtain the configuration file of the executable file to obtain the log file index information of the configuration file. The relative path of the configuration file is the relative path based on the real path.

[0039] Combine the real path of the executable file and the relative path of the configuration file to generate the absolute path of the configuration file. Open the configuration file and read its content. According to the format of the configuration file such as INI, JSON, YAML, etc., parse the file content and extract the required log file index information.

[0040] Use the absolute path of the executable file as the reference path and construct a relative path based on this reference path. The relative path describes the path from the reference path to the configuration file but does not include the reference path itself. For example, if the configuration file is located in the "config" subdirectory of the reference path, the relative path may be "config / settings.ini". When accessing the configuration file, use the file system API to parse and concatenate the paths, combining the reference path and the relative path to generate the absolute path of the configuration file.

[0041] Step 13: Determine the save path of the log file based on the log file index information.

[0042] Parse the log file index information obtained from the configuration file. Using the parsed index information, combined with a predetermined log storage directory or naming rule, construct the complete path of the log file.

[0043] Among them, the index information is a string or data structure pointing to the location or naming convention of the log file.

[0044] Step 20: Monitor the save path of the log file and back up the newly added log files on the save path of the log file.

[0045] Based on the monitoring program, monitor the specified save path of the log file, and copy it when a new file is detected. The backup file will be copied to the backup directory and keep the same file name as the source file.

[0046] Furthermore, refer to Figure 3 , Step 20 also includes:

[0047] Step 21: Monitor the status of the folder where the log file is located based on the save path of the log file.

[0048] Deploy and run a monitoring tool or script on the target test process to ensure that it can continuously monitor the status of the specified folder. The monitoring tool or script will detect events in the folder in real time or periodically.

[0049] Step 22: In response to the newly added log file in the folder, back up the newly added log file to the first target folder.

[0050] When the monitoring tool or script detects an event, it will trigger the corresponding processing logic, that is, when a new log file is created, it will be copied to the first target folder in the backup directory.

[0051] Optionally, the first folder can be a local folder of the test terminal, or a cloud folder on a network server or other storage media.

[0052] Step 30: Parse the newly added log file and store the parsed log content in a preset structure format in the data storage system.

[0053] Select an appropriate parser according to the format of the log file to identify and extract the key information in the log. Extract the required fields from the log entries, and then map the extracted fields to a preset structure and store them in the data storage system.

[0054] Among them, the structure defines the representation form of the log entry in memory and should match the table or document structure in the data storage system.

[0055] Further, referring to Figure 4 , step 30 further includes:

[0056] Step 31: Parse the newly added log file in the first target folder to obtain the log content of the log file.

[0057] According to the format of the log file such as plain text, JSON, XML, etc., select an appropriate parser to identify and extract the key information in the log. Use regular expressions, string operations, or a dedicated log parsing library to extract the required fields from the log entries, such as timestamp, log level, message content, source IP, etc.

[0058] Step 32: Resave the log content in a structure format and send it to the data storage system.

[0059] Map the extracted fields to a preset structure. Select a data storage system according to the requirements, create a table or collection in the data storage system, and its structure should match the preset structure.

[0060] Convert the parsed log entries from the structure to a format acceptable to the data storage system, perform the insert operation of the data storage system, and store the log entries in the table or collection.

[0061] Optionally, rename the resaved log content to distinguish it from the name of the log file.

[0062] The resaved date and time can be used as part of the name, or based on multiple versions of the log, add a version number to the name, add descriptive words or phrases to reflect the log content or purpose, etc., to generate a new name different from the original log file name, and ensure that the new name is unique to avoid overwriting other files.

[0063] Optionally, resave the log content to the second target folder.

[0064] Specify the path and name of the second target folder, generate a new file name according to the requirements, and ensure that the new file name is unique in the target folder. Create a new file in the second target folder and write the log content to the file.

[0065] Optionally, the second folder can be a local folder of the test terminal, or a cloud folder on a network server or other storage media.

[0066] Further, referring to Figure 5 , step 32 further includes:

[0067] Step 321: Obtain the database operation interface of the data storage system.

[0068] Obtain the database types of the data storage system such as MySQL, PostgreSQL, MongoDB, etc., and obtain the interfaces or libraries for interacting with the database based on the database type of the data storage system.

[0069] Step 322: Send the log content to the data storage system through the information transmission format corresponding to the database operation interface type.

[0070] Use the functions or methods provided by the database operation interface to establish a connection with the data storage system. According to the database type, construct appropriate SQL statements or query / insert operations. Execute the constructed SQL statements or query / insert operations through the database operation interface to complete the process of sending the log content to the data storage system.

[0071] Use the database operation interface to send the data parsed by the parsing module to the data storage system, which occupies less hard disk storage space compared to file storage, and is also convenient for data retrieval, query, and analysis applications.

[0072] Optionally, the data storage system is configured in a web server.

[0073] Assign a static IP address to the data storage system to ensure that other devices can always find it. To access the data storage system from an external network, port forwarding needs to be set on the router to point a specific port, such as the port of the database or file sharing service, to the IP address of the data storage system. Create database tables or file sharing directories according to requirements to store log data.

[0074] Configure the data storage system in a web server so that the backup log files stored in it are not easily lost and are also convenient for file management.

[0075] Refer to Figure 6 , Figure 6 is a schematic structural diagram of an embodiment of the storage medium provided by the present application.

[0076] The storage medium 300 stores program data 310, and when the program data 310 is executed by a processor, it implements the steps of the test log monitoring method as described in Figure 1 .

[0077] The program data 310 is stored in a storage medium 300 and includes several instructions for causing a network device (which can be a router, a personal computer, a server, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application.

[0078] Optionally, the storage medium 300 may be various media that can store program data, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc.

[0079] Refer to Figure 7 , Figure 7 which is a schematic structural diagram of an embodiment of the computer device provided by the present application.

[0080] The computer device 400 includes a processor 420 and a memory 410 that are interconnected. The memory 410 stores a computer program. When the processor 420 executes the computer program, the steps of the above-mentioned test log monitoring method are implemented.

[0081] Different from the prior art, the present application provides a test log monitoring method, a storage medium, and a computer device. By monitoring the process status of the test tool, the generation status of the log file can be identified in a timely manner, and automated backup, parsing, and storage can be performed in a timely manner, thereby reducing the code dependence and coupling on the test tool and realizing the information-based storage of the log content; without relying on the source code of the chip manufacturer, this case solves the problem of automated storage of production test content from file storage to information storage, not only ensuring the integrity and timeliness of the log file backup, but also greatly saving the development and maintenance costs. At the same time, the monitoring based on the save path can adjust the monitored folder as the path changes, with better adaptability and flexibility, avoiding the absence of the monitored log file.

[0082] Each embodiment in this specification is described in a progressive manner. The same or similar parts among the embodiments can be referred to each other, and the key points of each embodiment are the differences from other embodiments. In particular, for the storage medium embodiment and the computer device embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment.

[0083] The present application can be used in many general-purpose or special-purpose computing system environments or configurations. For example: personal computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, network PCs, small computers, distributed computing environments including any of the above systems or devices, and so on.

[0084] In several implementation manners provided by the present application, it should be understood that the disclosed method and device can be implemented in other ways. For example, the device implementation manner described above is only illustrative. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0085] The unit described as a separation component may or may not be physically separated. The component shown as a unit may or may not be a physical unit, that is, it may be located in one place or may be distributed over multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0086] In addition, each functional unit in various embodiments of the present application can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

[0087] The above are only the embodiments of the present application, and do not limit the patent scope of the present application accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present application.

Claims

1. A test log collection method, characterized in that: include: In response to any monitored test tool being started, obtaining a log file saving path corresponding to the started test tool; Monitor the log file storage path and back up the newly added log files on the log file storage path; The newly added log file is parsed, and the parsed log content is stored in a preset structure format to a data storage system.

2. The test log monitoring method according to claim 1, characterized in that: The obtaining of the log file saving path corresponding to the started test tool includes: Obtaining the process name of the test tool in the task manager, and searching for the real path of the executable file corresponding to the test tool based on the process name; Based on the real path and the relative path of the configuration file corresponding to the executable file, obtaining the configuration file of the executable file to obtain the log file index information of the configuration file, wherein the relative path of the configuration file is a relative path based on the real path; Based on the log file index information, a storage path of the log file is determined.

3. The test log monitoring method according to claim 1, characterized in that: The monitoring of the log file storage path and backing up the newly added log files on the log file storage path includes: Monitoring the status of the folder where the log file is located based on the log file saving path; In response to a new log file being added to the folder, the newly added log file is backed up to the first target folder.

4. The test log monitoring method according to claim 3, characterized in that: The step of parsing the newly added log file and storing the parsed log content in a preset structure format to a data storage system includes: Parsing the newly added log file in the first target folder to obtain log content of the log file; The log content is saved again in the structure format and sent to the data storage system.

5. The test log monitoring method according to claim 4, characterized in that: The re-saving of the log content in the structure format includes: The re-saved log content is renamed to be different from the name of the log file.

6. The test log monitoring method according to claim 4, characterized in that: The re-saving of the log content in the structure format further includes: The log content is saved again in the second target folder.

7. The test log monitoring method according to claim 4, characterized in that: The method further includes storing the parsed log content in a preset structure format to a data storage system: Acquire a database operation interface of the data storage system; The log content is sent to the data storage system via an information transmission format corresponding to the database operation interface type.

8. The test log monitoring method according to claim 1, characterized in that: The data storage system is configured in a network server.

9. A storage medium having program data stored thereon, characterized in that: When the program data is executed by a processor, the steps of the test log monitoring method according to any one of claims 1 to 8 are implemented.

10. A computer device, characterized in that: The method comprises a processor and a memory connected to each other, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the test log monitoring method according to any one of claims 1 to 8 are implemented.