A method, device and medium for POS device log extraction analysis

By building a log analysis system, unified storage and automated analysis of POS device logs are achieved, solving the problem of low efficiency in POS device log analysis, improving work efficiency and flexibility, and providing a standardized log analysis process and visualization tools.

CN116126661BActive Publication Date: 2026-08-04FUJIAN NEWLAND PAYMENT TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
FUJIAN NEWLAND PAYMENT TECH
Filing Date
2022-12-22
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

In existing technologies, POS device log analysis lacks a unified and standardized process, resulting in low work efficiency, high maintenance costs, poor versatility, and an inability to quickly locate and resolve business problems.

Method used

Build a log analysis system to realize log data storage, real-time search, automated analysis and visualization charts. Through device information input, log file upload, keyword and filter condition configuration, generate a variety of analysis strategies, and automatically match, filter and visualize according to the analysis objectives.

Benefits of technology

It improves the efficiency and flexibility of log analysis, reduces local maintenance costs, and provides practical, concise, and comprehensive log analysis information, making it easy to quickly locate and resolve business problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116126661B_ABST
    Figure CN116126661B_ABST
Patent Text Reader

Abstract

The application discloses a POS device log extraction and analysis method, comprising the following steps: constructing and logging into a log analysis system; inputting device information of a terminal device into the log analysis system; extracting log files from the terminal device, uploading the log files into the log analysis system, and associating the log files with the device information; configuring keyword information and screening conditions; configuring multiple analysis strategies according to the keyword information and the screening conditions; establishing an analysis task according to an analysis target, and sending the analysis task to the log analysis system; after the log analysis system receives and analyzes the analysis task, obtaining target device information, a target analysis strategy and a time period; searching for a target log file according to the target device information and the time period, and matching and screening the target log file according to the target analysis strategy; analyzing the screened final log file, and generating a visual log chart according to an analysis result of the final log file. The application further discloses an electronic device and a computer readable storage medium, and work efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of POS machine technology, and in particular to a method, device, and medium for extracting and analyzing POS device logs. Background Technology

[0002] Log analysis is a primary means for developers to troubleshoot terminal device malfunctions and identify problems. Developers can understand terminal device operation information through logs, and by analyzing error messages in the logs, they can detect and troubleshoot problems, discover the causes of errors, and thus take timely corrective measures. Typically, logs are stored across different terminal devices, so it's necessary to first log into the terminal devices to download and extract the log files.

[0003] Conventionally, the log files need to be manually decompressed, different keywords and filtering conditions need to be set according to different scenarios, and the written code needs to be executed for log analysis. There is no unified and standardized log analysis process, the local maintenance cost is high, and the code has poor universality and flexibility. This makes the work both cumbersome and inefficient. Therefore, a complete log analysis system is needed. Summary of the Invention

[0004] In view of this, the purpose of this invention is to propose a method for extracting and analyzing POS device logs, thereby improving work efficiency.

[0005] To achieve the above-mentioned technical objectives, the technical solution adopted by this invention is as follows:

[0006] A method for extracting and analyzing POS device logs includes the following steps:

[0007] Step 1: Build and log in to the log analysis system;

[0008] Step 2: Enter the device information of all terminal devices that need to be analyzed into the log analysis system;

[0009] Step 3: Extract the log files to be analyzed from each of the terminal devices, upload them to the log analysis system, and associate them with the corresponding device information;

[0010] Step 4: Configure keyword information and filtering conditions on the log analysis system;

[0011] Step 5: Configure multiple analysis strategies on the log analysis system based on the keyword information and filtering conditions;

[0012] Step 6: Create an analysis task based on the analysis objectives and send it to the log analysis system;

[0013] Step 7: After receiving and parsing the analysis task, the log analysis system obtains the target device information, target analysis strategy, and time period.

[0014] Step 8: The log analysis system searches for target log files based on target device information and time period, and matches and filters the target log files according to the target analysis strategy;

[0015] Step 9: Analyze the final filtered log files and generate visual log charts from the analysis results.

[0016] Furthermore, step 2 specifically includes:

[0017] Step 21: Select all terminal devices that need to be analyzed;

[0018] Step 22: Enter the device model and device number of each terminal device into the device information list of the log analysis system in sequence;

[0019] Step 23: Store the different device numbers under the same device model together.

[0020] Furthermore, step 3 specifically includes:

[0021] Step 31: Extract the log files to be analyzed from all the terminal devices that need to be analyzed in sequence;

[0022] Step 32: The browser sends a query list command to the log analysis system. After receiving the command, the log analysis system returns a list of device information to the browser.

[0023] Step 33: The browser selects the corresponding device model and device number from the device information list based on the device model and device number of the terminal device itself, and sends the log file of the terminal device and its binding relationship with the corresponding terminal device to the log analysis system;

[0024] Step 34: After receiving the log file, the log analysis system associates the uploaded log file with the stored device model and device number according to the binding relationship;

[0025] Step 35: Store all uploaded log files on the hard drive, and store the device information list, the binding relationship between the log file and the terminal device, the file storage path, the log file name, and the file upload time in the database.

[0026] Furthermore, step 4 specifically includes:

[0027] Step 41: Configure keyword information on the log analysis system. The keyword information includes keyword type, keyword name, keyword start identifier, keyword end identifier, and keyword exit identifier. The keyword type includes single and combined keywords.

[0028] Step 42: Configure filtering conditions on the log analysis system. The filtering conditions include a filtering name, which is a coarse screening name, and the keyword name is a fine screening name.

[0029] Furthermore, step 5 specifically includes:

[0030] Step 51: Configure the policy name on the log analysis system according to the analysis object;

[0031] Step 52: Configure the strategy type on the log analysis system according to the keyword type in the keyword information. The strategy type includes single and combined strategies.

[0032] Step 53: Configure whether the analysis strategy is open or public on the log analysis system according to the open permissions for the analysis strategy;

[0033] Step 54: Configure the minimum and maximum time consumption on the log analysis system according to the time required to obtain the log files;

[0034] Step 55: Configure the filter name for coarse screening on the log analysis system according to the filtering conditions;

[0035] Step 56: Configure the keyword name, keyword start identifier, keyword end identifier, and keyword exit identifier for fine screening on the log analysis system based on the keyword information.

[0036] Step 57: Configure start and end nodes on the log analysis system according to the filtering order of the keyword names, and number the nodes for different keyword names in sequence;

[0037] Step 58: Freely combine the strategy name, strategy type, whether it is open, minimum time consumption, maximum time consumption, filter name, keyword name, keyword start identifier, keyword end identifier, keyword exit identifier, and the specific content under the start node and end node to form a variety of analysis strategies.

[0038] Furthermore, step 6 specifically includes:

[0039] Step 61: Establish an analysis task based on the analysis objective. The analysis task includes target device information, target analysis strategy, and time period. The target device information is the device model and device number of the terminal device to be analyzed. The target analysis strategy is the analysis strategy to be adopted by the terminal device to be analyzed, which is at least one analysis strategy selected from a variety of analysis strategies configured in the log analysis system.

[0040] Step 62: Send the analysis task to the log analysis system.

[0041] Furthermore, step 8 specifically includes:

[0042] Step 81: The log analysis system searches for the corresponding device model and device number from the device information list in the database based on the device model and device number of the terminal device to be analyzed;

[0043] Step 82: Find the corresponding binding relationship based on the found device model and device number, and find all log file names associated with the terminal device with that device number based on the binding relationship;

[0044] Step 83: Based on all the found log file names and time periods, search the database for the log file names within that time period;

[0045] Step 84: Based on the log file names found within this time period, search the database for the corresponding file storage path;

[0046] Step 85: Locate the corresponding log file on the hard drive based on the found file storage path;

[0047] Step 86: Iterate through each data entry in the target log file, comparing the minimum and maximum time consumption with the actual waiting time. If the actual waiting time is greater than the maximum time consumption, discard the data entry and continue to the next data entry. If the actual waiting time is not greater than the maximum time consumption, proceed to step 87.

[0048] Step 87: Perform the first round of matching and filtering on the target log files according to the filtering names under the corresponding filtering conditions of the target analysis strategy, and obtain the first round of filtering results;

[0049] Step 88: Based on the keyword information, start node, and end node of the target analysis strategy, perform a second round of matching and filtering on the first round of filtering results to obtain the second round of filtering results.

[0050] Furthermore, step 9 specifically includes:

[0051] Step 91: Analyze the final log files after filtering;

[0052] Step 92: Convert the format of the final log file after analysis into a format that the log file can display;

[0053] Step 93: Generate a visual log chart from the analysis results and view the log report.

[0054] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement a method for extracting and analyzing POS device logs as described above.

[0055] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for extracting and analyzing POS device logs as described above.

[0056] By adopting the above technical solution, the present invention has the following beneficial effects compared with the prior art: the log analysis system is an integrated analysis system that combines log data storage, real-time search, automated analysis services, and visualization charts. This log analysis system has powerful filtering, aggregation, statistical, and analytical capabilities, and can provide developers with practical, concise, and complete log analysis information based on comprehensive collection of device log information.

[0057] This invention uploads device information and log files for all terminal devices requiring log analysis to a log analysis system. Device information and log files are linked one-to-one. When log analysis is needed, the corresponding log file is retrieved from the log analysis system. The log analysis system filters and analyzes the imported log files according to the selected analysis strategy, extracting log files that meet the keyword information and filtering conditions. Analysis results are generated according to different preset templates of the log analysis system, and the results are displayed as visualized log analysis charts. The analysis also includes the classification and statistics of operation scenarios and time consumption statistics, enabling developers to more quickly and intuitively locate and resolve business problems. Attached Figure Description

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

[0059] Figure 1 This is a framework diagram of the log analysis system provided in an embodiment of the present invention.

[0060] Figure 2This is an interaction diagram between the log analysis system and the terminal device provided in an embodiment of the present invention.

[0061] Figure 3 This is a flowchart of a method for extracting and analyzing POS device logs provided in an embodiment of the present invention.

[0062] Figure 4 This is a schematic diagram of an electronic device provided in an embodiment of the present invention.

[0063] Figure 5 This is a schematic diagram of a computer-readable storage medium provided in an embodiment of the present invention. Detailed Implementation

[0064] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be particularly noted that the following embodiments are for illustrative purposes only and do not limit the scope of the invention. Similarly, the following embodiments are only some, not all, embodiments of the present invention, and all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0065] like Figure 1 As shown, the log analysis system realizes functions such as log storage, real-time search, automatic filtering analysis, and visualization charts. It no longer performs log analysis on a single device basis. The discrete data logs of various terminal devices are stored centrally on the log analysis system and queried and analyzed using a standardized processing flow.

[0066] At the technical architecture level, based on the habitual log analysis operation process and its universality, multiple management modules were developed, including device management, file management, filter condition management, keyword management, policy management, and task management. These modules are integrated into the operation and use of log analysis, among which the keyword module, filter condition module, and policy module are reusable.

[0067] 1. Project Architecture:

[0068] The project architecture is divided into device management, keyword management, filter condition management, strategy management, file management, and task management.

[0069] 2. Function Introduction:

[0070] 1) Equipment Management:

[0071] Equipment Management: Input and manage information such as equipment serial number (SN) and model number for equipment that requires log analysis;

[0072] Equipment model management: Provides unified management of equipment model information;

[0073] 2) Filtering criteria management:

[0074] Commonly used filtering criteria are summarized and managed here, which facilitates preliminary log filtering and extraction in subsequent log analysis;

[0075] 3) Keyword Management:

[0076] The commonly used operational scenarios of each organization are maintained here as keywords, which makes it easier to extract and use them as keyword identifiers in log analysis later. When viewing logs, key and useful log information can be captured more clearly.

[0077] 4) Strategy Management:

[0078] A strategy can be matched by multiple filtering conditions and multiple keyword rules, and the time range and node range of query logs can be set to make it easier to extract the operation patterns and scenarios of logs.

[0079] 5) File Management:

[0080] Log files extracted from smart terminals will be uploaded and maintained here;

[0081] 6) Task Management:

[0082] Add a task: As preparation for log analysis, select the appropriate strategies and log files to be analyzed, and initiate a task;

[0083] Analysis: Log files are automatically filtered and analyzed based on policy rules;

[0084] Viewing analysis results: You can view the log analysis results based on different strategy dimensions selected, or you can view all the data, which reflects its flexibility and versatility.

[0085] The architecture design integrates and refines the operations and common problems frequently encountered by actual terminal devices in business scenarios, forming the components of the system architecture. It uses core filtering condition modules, keyword modules, strategy modules, and task modules to string together a series of log processing and analysis operation processes, providing developers with standardized operation processes and customizable rules and strategies.

[0086] The filtering module filters logs, the keyword module extracts operational data from the logs, the strategy module integrates rules for defining logs, and the task module performs log analysis and data visualization. The keyword, filtering, and strategy modules are all reusable, significantly reducing maintenance costs. Unlike conventional local log analysis, which requires re-entering and executing various filtering conditions and keywords to view extracted logs or troubleshoot problems, only the filtering conditions, keywords, and strategies need to be reused.

[0087] This log analysis system combines the actual operation scenarios of terminal devices and has customized a complete log analysis and processing method suitable for terminal devices, providing better assistance and support services for terminal devices.

[0088] Please see Figure 2 and Figure 3 The present invention provides a method for extracting and analyzing POS device logs, comprising the following steps:

[0089] Step 1: Build and log in to the log analysis system;

[0090] In this embodiment, after the log analysis system is built, the administrator logs into the log analysis system, enters the user management page from the system management, clicks the add button, fills in the relevant information, and creates a role.

[0091] Click on the Role Management page, select "Regular Role," click "Modify," and modify the menu permissions (including Homepage, Device Management, Keyword Management, Filter Condition Management, Policy Management, and Task Management menus). Click "OK" to complete user creation. Register the user information (username and password), and then log in to the log analysis system using the registered username and password.

[0092] Step 2: Enter the device information of all terminal devices that need to be analyzed into the log analysis system;

[0093] In this embodiment, step 2 specifically includes:

[0094] Step 21: Select all terminal devices that need to be analyzed;

[0095] Step 22: Enter the device model and device number of each terminal device into the device information list of the log analysis system in sequence;

[0096] Step 23: Store different device numbers under the same device model together. The purpose is to facilitate the analysis of terminal devices of the same model and to obtain different device numbers under the same device model more quickly after classification.

[0097] After creating the user, log in with the user's account and password, and then add a new terminal device in the device management section.

[0098] Example: Click the "Add" button on the device management interface.

[0099] Enter the device number, for example, 101;

[0100] Select the device model, such as N910.

[0101] Step 3: Extract the log files to be analyzed from each terminal device, upload them to the log analysis system, and associate them with the corresponding device information; the purpose of association is to make it easier and faster to find the target log files later.

[0102] In this embodiment, step 3 specifically includes:

[0103] Step 31: Extract the log files to be analyzed from all the terminal devices that need to be analyzed in sequence;

[0104] Step 32: The browser sends a query list command to the log analysis system. After receiving the command, the log analysis system returns a list of device information to the browser.

[0105] Step 33: The browser selects the corresponding device model and device number from the device information list based on the device model and device number of the terminal device itself, and sends the log file of the terminal device and its binding relationship with the corresponding terminal device to the log analysis system;

[0106] Step 34: After receiving the log file, the log analysis system associates the uploaded log file with the stored device model and device number according to the binding relationship;

[0107] Step 35: Store all uploaded log files on the hard drive, and store the device information list, the binding relationship between the log file and the terminal device, the file storage path, the log file name, and the file upload time in the database; the log file, file storage path, log file name, and file upload time are one-to-one correspondences, one device number corresponds to one terminal device, one terminal device, one terminal device can upload multiple log files, but one log file corresponds to only one terminal device, one log file name, one file upload time, and one file storage path.

[0108] First, upload a log file in the file management section. For example, you can upload a file up to 300MB in size with the format log / txt / zip / gz / tar / rar, or other file sizes. There is no size limit here. This example uses a portion of the logs from an N910 POS machine dated December 16, 2021.

[0109] Example: Click the upload file button on the file management interface;

[0110] Select device number 101 to bind the log file to the selected device. Selecting this number binds the log file to be uploaded to the corresponding device. Then click "Upload Attachment." A log file (keyword.log) containing 38 log records will appear. Upload this file to the log analysis system. Enter a file description and click "OK." You can refresh the page to check the upload status.

[0111] Step 4: Configure keyword information and filtering conditions on the log analysis system;

[0112] In this embodiment, step 4 specifically includes:

[0113] Step 41: Configure keyword information on the log analysis system. The keyword information includes keyword type, keyword name, keyword start identifier, keyword end identifier, and keyword exit identifier. The keyword type includes single and combined keywords, corresponding to the subsequent strategy types.

[0114] Keyword type refers to whether the keywords being filtered are a single keyword or a combination of multiple keywords. A single keyword belongs to the single keyword type, while a combination of multiple keywords belongs to the combined keyword type.

[0115] Keyword names refer to the specific content to be searched in the log file;

[0116] The keyword start identifier is the trigger condition for starting keyword filtering. When the keyword start identifier is found, the filtering of log files begins. The keyword start identifier cannot be repeated. The keyword start identifier is simply a character added to the keyword name to identify the corresponding keyword name.

[0117] The keyword end identifier is the trigger condition for ending keyword filtering. That is, when the keyword end identifier is found, the filtering of log files will end.

[0118] The keyword exit identifier refers to the identifier that appears between the keyword start identifier and the keyword end identifier, allowing for direct exit without further filtering.

[0119] A single keyword means that there is only one keyword name. As long as the log contains the identifier that starts with that keyword, the condition is met.

[0120] Keyword combination, which requires at least two keyword names, is mainly used in combination filtering strategies. Several keyword names are grouped together, and the condition is met if each of the sequentially arranged log entries corresponds to a keyword in the keyword group.

[0121] Example: Click the "Add Keyword" button on the keyword management interface to create four new keywords (Note: fields not specified when creating new keywords are not required).

[0122] ① Keyword Type: Combined Keyword Name: startScan Keyword Start Identifier: [startScan] Keyword Exit Identifier: scanType, onCancel, initialization, response, onResponse, onFinish:

[0123] ② Keyword Type: Combined Keyword Name: ScanType Keyword Start Identifier: [startScan]scanType

[0124] ③ Keyword type: Combined keyword name: ScanOnResponse Keyword start identifier: [startScan]onResponse:

[0125] ④ Keyword Type: Combined Keyword Name: endScan Keyword Start Identifier: [startScan] response:

[0126] These four keywords are combined into a single keyword. Keyword type: combined; there are four keyword names: startScan, ScanType, ScanOnResponse, and endScan; keyword start identifiers: [startScan], [startScan]scanType, [startScan]onResponse:, and [startScan]response:; keyword exit identifiers: scanType, onCancel, initial.

[0127] `onResponse, onFinish`: If no keyword end marker is set at this point, the log analysis system will default to ending the entry at the end of the log entry.

[0128] Step 42: Configure filtering conditions on the log analysis system. The filtering conditions include a filtering name, which is a coarse screening name, and the keyword name is a fine screening name.

[0129] The filter criteria are user-defined and can be expressed as characters or strings. Any character or string containing the filter criteria in the log file will be considered valid.

[0130] Example: Click the "Add Filter" button on the filter management interface to create four new filter conditions: ① Filter Name: SDK:CCB-AidlPBOCStub; Condition Content: [SDK:CCB-AidlPBOCStub-] ② Filter Name: SDK:CCB-AidlPrinterStub; Condition Content: [SDK:CCB-AidlPrinterStub-] ③ Filter Name: SDK:CCB-AidlScanStub; Condition Content: [SDK:CCB-AidlScanStub-]

[0131] ④ Filter by name: SDK: CCB-ScanViewActivity (within the specified conditions)

[0132] Content:[SDK:CCB-ScanViewActivity-

[0133] The filter name refers to the specific content used for filtering in the log file;

[0134] The condition content refers to adding characters to the filter name, so that the log analysis system can recognize the corresponding filter name when the program runs.

[0135] Step 5: Configure multiple analysis strategies on the log analysis system based on the keyword information and filtering conditions;

[0136] In this embodiment, step 5 specifically includes:

[0137] Step 51: Configure the policy name on the log analysis system according to the analysis object;

[0138] Step 52: Configure the strategy type on the log analysis system according to the keyword type in the keyword information. The strategy type includes single and combined strategies.

[0139] Step 53: Configure whether the analysis strategy is open or public on the log analysis system according to the open permissions for the analysis strategy;

[0140] Step 54: Configure the minimum and maximum time consumption on the log analysis system according to the time required to obtain the log files;

[0141] Step 55: Configure the filter name for coarse screening on the log analysis system according to the filtering conditions;

[0142] Step 56: Configure the keyword name, keyword start identifier, keyword end identifier, and keyword exit identifier for fine screening on the log analysis system based on the keyword information.

[0143] Step 57: Configure start and end nodes on the log analysis system according to the filtering order of the keyword names, and number the nodes for different keyword names in sequence;

[0144] Step 58: Freely combine the strategy name, strategy type, whether it is open, minimum time consumption, maximum time consumption, filter name, keyword name, keyword start identifier, keyword end identifier, keyword exit identifier, and the specific content under the start node and end node to form a variety of analysis strategies.

[0145] Filtering strategies are divided into single filtering strategies and combined filtering strategies. A filtering strategy can include any log filtering condition, but it cannot include keywords of different types. That is, a single filtering strategy can only include a single keyword, while a combined filtering strategy can only include a combination of keywords. Combined strategies allow setting time requirements between keyword nodes.

[0146] Example: Create a new filter strategy

[0147] Strategy Name: QR Code Scanning Strategy Strategy Type: Combination Open / Open: Private

[0148] Minimum execution time: 0 Maximum execution time: 3000

[0149] Start node: 1 End node: 4

[0150] Click the "Create New Keyword" button, select the "startScan" keyword, and assign the node number for this keyword to 1.

[0151] Click the "Create New Keyword" button, select the "ScanType" keyword, and assign the node number 2 to this keyword.

[0152] Click the "Create New Keyword" button, select the "ScanOnResponse" keyword, and assign the node number 3 to this keyword.

[0153] Click the "Create New Keyword" button, select the "endScan" keyword, and assign the node number 4 to this keyword.

[0154] Click the "Add Filter" button and select SDK: CCB-AidlPBOCStub

[0155] Click the "Add Filter Criteria" button and select SDK: CCB-AidlPrinterStub

[0156] Click the "Add Filter" button and select SDK: CCB-AidlScanStub

[0157] Click the "Add Filter" button and select SDK: CCB-ScanViewActivity

[0158] Click OK.

[0159] Step 6: Create an analysis task based on the analysis objectives and send it to the log analysis system;

[0160] In this embodiment, step 6 specifically includes:

[0161] Step 61: Establish an analysis task based on the analysis objective. The analysis task includes target device information, target analysis strategy, and time period. The target device information is the device model and device number of the terminal device to be analyzed. The target analysis strategy is the analysis strategy to be adopted by the terminal device to be analyzed, which is at least one analysis strategy selected from a variety of analysis strategies configured in the log analysis system.

[0162] Step 62: Send the analysis task to the log analysis system.

[0163] An analysis task consists of two parts: analysis strategies and files. An analysis task can contain multiple files and multiple analysis strategies. Different analysis strategies do not affect the file selection and save results independently.

[0164] Example: Click the "Create Task" button in the Task Management interface to create a new task.

[0165] Task Name: QR Code Scanning Task

[0166] Start Time: 2021-12-15 12:00:00 End Time: 2021-12-16 20:00:00

[0167] Equipment Model: N910 Equipment Number: 101

[0168] Click the "Add Strategy" button and select the QR code scanning strategy.

[0169] Click the "Add File" button and select "keyword.log".

[0170] Click OK.

[0171] Step 7: After receiving and parsing the analysis task, the log analysis system obtains the target device information, target analysis strategy, and time period.

[0172] Step 8: The log analysis system searches for target log files based on target device information and time period, and matches and filters the target log files according to the target analysis strategy;

[0173] In this embodiment, step 8 specifically includes:

[0174] Step 81: The log analysis system searches for the corresponding device model and device number from the device information list in the database based on the device model and device number of the terminal device to be analyzed;

[0175] Step 82: Find the corresponding binding relationship based on the found device model and device number, and find all log file names associated with the terminal device with that device number based on the binding relationship;

[0176] Step 83: Based on all the found log file names and time periods, search the database for the names of log files within that time period; (compare the time period with the file upload times in the database to perform the search).

[0177] Step 84: Based on the log file names found within this time period, search the database for the corresponding file storage path;

[0178] Step 85: Locate the corresponding log file on the hard drive based on the found file storage path;

[0179] Step 86: Iterate through each data entry in the target log file, comparing the minimum and maximum time consumption with the actual waiting time. If the actual waiting time is greater than the maximum time consumption, discard the data entry and continue to the next data entry. If the actual waiting time is not greater than the maximum time consumption, proceed to step 86.

[0180] Step 87: Perform the first round of matching and filtering on the target log files according to the filtering names under the corresponding filtering conditions of the target analysis strategy, and obtain the first round of filtering results;

[0181] Step 88: Based on the keyword information, start node, and end node corresponding to the target analysis strategy, perform a second round of matching and filtering on the first round of screening results to obtain the second round of screening results;

[0182] Step 89: If the analysis task contains more than one analysis strategy, repeat steps 87-88 to filter the same target log file using different analysis strategies.

[0183] Step 9: Analyze the final filtered log files and generate visual log charts from the analysis results.

[0184] In this embodiment, step 9 specifically includes:

[0185] Step 91: Analyze the final log files after filtering;

[0186] Step 92: Convert the format of the final log file after analysis into a format that the log file can display;

[0187] Step 93: Generate visual log charts from the analysis results and view the log report;

[0188] Step 94: Switch between different analysis strategies to view the log reports from different dimensions, making it easier to present the log analysis results in a more intuitive and diverse way.

[0189] Example: On the task management page, select the QR code scanning task, click "Analyze," and start executing the task.

[0190] When the task status on the page shows "Completed", click "Results" to view the table and images of the task analysis results.

[0191] The results pop-up window contains two pages: one for displaying data and the other for displaying charts.

[0192] On the data display page, select a scanning strategy, then click the "Display Analysis Results" button to view the nodes that meet the strategy (including strategy name, timestamp, and node execution time). If two records are present, it means that two log entries in keyword.log fully satisfy this combined filtering strategy.

[0193] On the data display page, select a scanning strategy, then click on strategy details to view the keywords in that strategy.

[0194] On the data display page, click "Show All Data" to view all logs that match a specific keyword. There are currently eight records, meaning that eight logs in keyword.log contain the keyword and meet the filter criteria.

[0195] On the chart display page, select a strategy to view an image containing nodes that meet the filtering strategy and their execution time (a single strategy only displays data without a chart). The two nodes on the chart represent two sets of logs, with their execution times on the vertical axis. Click "Export Data" in the bottom right corner of the image to export the results in .xlsx format. Click "Download Image" in the top right corner of the image.

[0196] The log analysis system (hereinafter referred to as "this system") performs log analysis tasks in the following steps:

[0197] First, the system retrieves the relevant filtering strategies and log files from the database based on the task ID, modifies the current task status to "in analysis," and saves the task cache.

[0198] Next, the log files are read in a loop, and the log records are filtered.

[0199] This system filters logs in several layers. First, all log records are filtered according to the filtering criteria in the filtering strategy. Logs that meet any filtering criterion are stored in memory. Second, the operation method varies depending on the filtering strategy. With a single filtering strategy, logs that have passed the first filtering and also meet a keyword in the filtering strategy (i.e., have a keyword start identifier) ​​are considered satisfied and can be saved. However, with a combined filtering strategy, logs that have passed the first filtering are read directly from the log file and should be sorted sequentially. Next, adjacent logs stored in memory are retrieved and compared against the keywords in the combined keyword group. Only logs that are sequentially arranged and each correspond to a keyword in the keyword group, and that meet the time consumption requirements set between nodes in the combined strategy, are considered satisfied and can be saved.

[0200] During keyword filtering, whether using a single keyword or a combination of keywords, this system extracts content from the logs based on the keyword start identifier and keyword end identifier. Furthermore, if a log entry contains a keyword exit identifier, that entry will not be recorded. Log entries that satisfy any keyword will be recorded in t_log.

[0201] Finally, logs or log groups that meet the filtering criteria will be recorded in the t_result table, which can be viewed as charts on the front end.

[0202] Equipment information (equipment model and equipment number) can be entered, modified, and deleted according to user needs; keyword information and filtering conditions can be added, modified, and deleted according to user needs; log files can be uploaded and deleted according to user needs; analysis tasks can be added, modified, and deleted according to user needs.

[0203] Log analysis on terminal devices typically involves downloading log files and executing code locally for analysis. This approach is cumbersome, inefficient, lacks a standardized workflow, and hinders the summarization and reuse of analytical methods across similar organizations and scenarios. Therefore, a log analysis system was developed to address these shortcomings. Based on common organizational practices and similar scenarios, a general workflow for terminal device log analysis was outlined, its modular architecture was defined, and different strategy patterns were developed to facilitate log analysis reuse. The system allows for the selection of multiple strategy dimensions for analyzing collected and uploaded logs, and enables rapid switching between logs from multiple devices for analysis. This results in a powerful, multi-terminal, aggregated, standardized, visualized, and persistent log analysis system, significantly reducing the time developers spend locating and analyzing logs and improving work efficiency.

[0204] Due to the dispersed nature of application deployments on various terminals, logs are scattered across different devices, resulting in high costs for local log analysis and maintenance, weak versatility, and hindering unified management and comprehensive analysis. Log analysis systems address these shortcomings in two key ways: First, they provide a more standardized operational process for log analysis, reducing local maintenance costs and enabling log data storage, visualized data processing, and automated log analysis services. Logs from multiple terminals can be viewed simultaneously on the system, and logs from a single terminal can be analyzed using different strategies and dimensions. The logs and analyses from multiple terminals are all displayed within the system, achieving log aggregation, diversification, and flexibility, significantly improving log analysis efficiency. Second, collected log information allows for better longitudinal comparison, facilitating problem summarization and integration, and enabling deeper exploration of log value. This provides better services for subsequent overall project log report analysis and visualization, and also offers greater assistance for project development and maintenance.

[0205] like Figure 4 As shown, embodiments of the present invention also provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement one of the methods described above.

[0206] like Figure 5 As shown, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described above.

[0207] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0208] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, in essence, 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. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0209] The above description is only a part of the embodiments of the present invention and does not limit the scope of protection of the present invention. Any equivalent device or equivalent process transformation made based on the content of the present invention specification and drawings, or direct or indirect application in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method of POS device log extraction analysis, characterized by, Includes the following steps: Step 1: Build and log in to the log analysis system; Step 2: Enter the device information of all terminal devices that need to be analyzed into the log analysis system; Step 3: Extract the log files to be analyzed from each of the terminal devices, upload them to the log analysis system, and associate them with the corresponding device information; Step 4: Configure keyword information and filtering conditions on the log analysis system; Step 5: Configure multiple analysis strategies on the log analysis system based on the keyword information and filtering conditions; Step 6: Create an analysis task based on the analysis objectives and send it to the log analysis system; Step 7: After receiving and parsing the analysis task, the log analysis system obtains the target device information, target analysis strategy, and time period. Step 8: The log analysis system searches for target log files based on target device information and time period, and matches and filters the target log files according to the target analysis strategy; specifically including: Step 81: The log analysis system searches for the corresponding device model and device number from the device information list in the database based on the device model and device number of the terminal device to be analyzed; Step 82: Find the corresponding binding relationship based on the found device model and device number, and find all log file names associated with the terminal device with that device number based on the binding relationship; Step 83: Based on all the found log file names and time periods, search the database for the log file names within that time period; Step 84: Based on the log file names found within this time period, search the database for the corresponding file storage path; Step 85: Locate the corresponding log file on the hard drive based on the found file storage path; Step 86: Iterate through each data entry in the target log file, comparing the minimum and maximum time consumption with the actual waiting time. If the actual waiting time is greater than the maximum time consumption, discard the data entry and continue to the next data entry. If the actual waiting time is not greater than the maximum time consumption, proceed to step 87. Step 87: Perform the first round of matching and filtering on the target log files according to the filtering names under the corresponding filtering conditions of the target analysis strategy, and obtain the first round of filtering results; Step 88: Based on the keyword information, start node, and end node corresponding to the target analysis strategy, perform a second round of matching and filtering on the first round of screening results to obtain the second round of screening results; Step 9: Analyze the final filtered log files and generate visual log charts from the analysis results.

2. The method of log extraction analysis for a POS device of claim 1, wherein, Step 2 specifically includes: Step 21: Select all terminal devices that need to be analyzed; Step 22: Enter the device model and device number of each terminal device into the device information list of the log analysis system in sequence; Step 23: Store the different device numbers under the same device model together.

3. A method of POS device log extraction analysis as claimed in claim 2, wherein, Step 3 specifically includes: Step 31: Extract the log files to be analyzed from all the terminal devices that need to be analyzed in sequence; Step 32: The browser sends a query list command to the log analysis system. After receiving the command, the log analysis system returns a list of device information to the browser. Step 33: The browser selects the corresponding device model and device number from the device information list based on the device model and device number of the terminal device itself, and sends the log file of the terminal device and its binding relationship with the corresponding terminal device to the log analysis system; Step 34: After receiving the log file, the log analysis system associates the uploaded log file with the stored device model and device number according to the binding relationship; Step 35: Store all uploaded log files on the hard drive, and store the device information list, the binding relationship between the log file and the terminal device, the file storage path, the log file name, and the file upload time in the database.

4. A method of POS device log extraction analysis as claimed in claim 3, wherein, Step 4 specifically includes: Step 41: Configure keyword information on the log analysis system. The keyword information includes keyword type, keyword name, keyword start identifier, keyword end identifier, and keyword exit identifier. The keyword type includes single and combined keywords. Step 42: Configure filtering conditions on the log analysis system. The filtering conditions include a filtering name, which is a coarse screening name, and the keyword name is a fine screening name.

5. A method of POS device log extraction analysis as claimed in claim 4, wherein, Step 5 specifically includes: Step 51: Configure the policy name on the log analysis system according to the analysis object; Step 52: Configure the strategy type on the log analysis system according to the keyword type in the keyword information. The strategy type includes single and combined strategies. Step 53: Configure whether the analysis strategy is open or public on the log analysis system according to the open permissions for the analysis strategy; Step 54: Configure the minimum and maximum time consumption on the log analysis system according to the time required to obtain the log files; Step 55: Configure the filter name for coarse screening on the log analysis system according to the filtering conditions; Step 56: Configure the keyword name, keyword start identifier, keyword end identifier, and keyword exit identifier for fine screening on the log analysis system based on the keyword information. Step 57: Configure start and end nodes on the log analysis system according to the filtering order of the keyword names, and number the nodes for different keyword names in sequence; Step 58: Freely combine the strategy name, strategy type, whether it is open, minimum time consumption, maximum time consumption, filter name, keyword name, keyword start identifier, keyword end identifier, keyword exit identifier, and the specific content under the start node and end node to form a variety of analysis strategies.

6. The method for POS device log extraction analysis of claim 1, wherein, Step 6 specifically includes: Step 61: Establish an analysis task based on the analysis objective. The analysis task includes target device information, target analysis strategy, and time period. The target device information is the device model and device number of the terminal device to be analyzed. The target analysis strategy is the analysis strategy to be adopted by the terminal device to be analyzed, which is at least one analysis strategy selected from a variety of analysis strategies configured in the log analysis system. Step 62: Send the analysis task to the log analysis system.

7. The method for POS device log extraction analysis of claim 1, wherein, Step 9 specifically includes: Step 91: Analyze the final log files after filtering; Step 92: Convert the format of the final log file after analysis into a format that the log file can display; Step 93: Generate a visual log chart from the analysis results and view the log report.

8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements a method for extracting and analyzing POS device logs as described in any one of claims 1 to 7.

9. A computer readable storage medium having stored thereon a computer program, characterized in that, When executed by the processor, the program implements a method for extracting and analyzing POS device logs as described in any one of claims 1 to 7.