A computer operation log generation method and system
By using external screen signal replication and keyframe recognition technology, the problems of high computational load and parameter loss caused by window closure in non-intrusive operation log collection in closed software environments are solved, and real-time and complete operation log generation is realized in closed environments.
Patent Information
- Application Number
- CN202611392453.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-09
- Publication Date
- 2026-11-27
AI Technical Summary
Existing technologies cannot achieve non-intrusive computer operation log collection in closed software environments, and full frame recognition has too high a computational load. The instantaneous closing of the window causes the loss of key operation parameters, making it impossible to generate complete structured operation logs.
The video output signal is acquired by an external screen signal copying device. Combined with keyframe recognition and lightweight target detection, local depth recognition is performed only when the state changes are triggered. The circular frame data cache is used to backtrack and extract images before the keyframe to generate a structured operation log.
It enables non-intrusive real-time operation log collection in a closed software environment, reduces computational load, ensures the integrity of operation parameters and button focus states, and meets the stability and real-time requirements of industrial-grade log collection.
Smart Images

Figure CN123178223A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer vision, screen image understanding and operation behavior log generation technology. Specifically, it relates to a computer operation log generation method and system based on non-intrusive screen acquisition and keyframe recognition. Background Technology
[0002] In industrial control, production process recording, equipment operation recording, remote operation and maintenance, and high-safety scenarios such as nuclear power plant control, it is often necessary to record in detail the operator's interaction process on the target computer. For example, whether the operator opened a specific key operation window, whether the entered process parameters were accurate, and whether the confirmation button was clicked.
[0003] Currently, traditional methods for obtaining computer operation logs mainly rely on embedding points within the business system or installing log collection clients on the operating system. These methods require modifying software code within the target computer or accessing application programming interfaces (APIs), constituting intrusive data collection. However, in closed software environments, dedicated industrial control terminals, or highly secure classified equipment, modifying business code is strictly prohibited, and installing any additional data collection drivers is not allowed. Therefore, intrusive solutions cannot be implemented in these scenarios. To meet non-intrusive auditing requirements, existing technologies attempt to generate logs by externally capturing screen images. However, current processing technologies based on external screen images still have the following significant drawbacks:
[0004] First, full-scale processing consumes enormous computing power. Performing full optical character recognition and target detection on every frame of a continuous screen video stream would result in an extremely large computational load, severe system response latency, and difficulty in meeting the stable real-time processing requirements of industrial-grade log collection.
[0005] Second, the triggering mechanism is easily interfered with. Some existing technologies use a method that triggers screenshots based on changes in screen pixels or the overall image reaching a set threshold. This triggering mechanism is highly susceptible to interference from irrelevant elements such as blinking cursors and scrolling UI animations, resulting in a large number of invalid screenshots.
[0006] Third, operation parameters are easily lost when the window closes instantly. Computer interface interactions are highly time-sensitive. When an operator enters parameters in a critical window and clicks the "OK" or "Cancel" button, the window closes instantly and disappears from the screen. If a screenshot is triggered by "window closing" or "drastic pixel changes," due to the inter-frame delay in the trigger itself, the target window often no longer exists in the current screen image actually captured by the system, resulting in only a clean desktop background being captured. This leads to the complete loss of the last entered critical operation parameters and the focus state when the button was pressed, making it impossible to generate a complete, traceable, structured operation log. Summary of the Invention
[0007] The purpose of this invention is to solve the technical problems in existing log collection technologies, such as the need to intrude into the target system, the excessive computational load of full-frame video stream recognition, and the loss of key operating parameters due to instantaneous window closure.
[0008] To achieve the above objectives, the present invention provides a method and system for generating computer operation logs based on non-intrusive screen capture and keyframe recognition.
[0009] According to a first aspect of the present invention, a method for generating computer operation logs based on non-invasive screen capture and keyframe recognition is provided, the method comprising the following steps:
[0010] The video output signal of the target computer is obtained through an external screen signal copying device and captured by a video acquisition device to form continuous real-time screen frames.
[0011] The real-time screen frame is preprocessed, and the preprocessed real-time screen frame is input into the key window target detection module for target detection to obtain the detection result containing the target category and target bounding box. The detection result and the corresponding real-time screen frame are organized into a frame data packet and continuously written into the circular frame data buffer.
[0012] Based on the detection results in the frame data packets of multiple consecutive frames, it is determined whether the key window meets the state change triggering condition for appearance or disappearance; when the state change triggering condition is met, the current frame that confirms the event is marked as the event triggering frame, and the event triggering frame is marked as a key frame.
[0013] Once the keyframe is marked, a set of frames near the keyframe containing N frames before the keyframe and the current keyframe is extracted from the circular frame data buffer. A key identification frame is then selected from the set of frames near the keyframe according to the type of the triggering event, where N is a positive integer. Specifically, for a key window disappearance event, the key identification frame is selected from the N frames before the keyframe.
[0014] Perform local depth recognition on a specified region of the selected key recognition frame to obtain local recognition results;
[0015] The detection results and the local recognition results are integrated according to a preset field mapping relationship to generate and output a structured operation log containing a keyframe evidence index.
[0016] Optionally, before determining whether the key window meets the state change triggering condition for appearance or disappearance based on the detection results in the frame data packets of multiple consecutive frames, the computer operation log generation method further includes:
[0017] For the candidate key windows output by the key window target detection module, according to the preset scene configuration package, a specified small region is cropped from the target bounding box of the candidate key window, and region optical character recognition is performed on the small region.
[0018] The results of the regional optical character recognition in the micro-area are matched with the preset content confirmation rules;
[0019] If the match is successful, the candidate key window content is confirmed to be valid and included in the judgment process of the state change trigger condition.
[0020] Optionally, the determination of whether the key window meets the state change triggering condition for appearance or disappearance includes:
[0021] When the key window that confirms the content appears for the first time and appears in K consecutive frames, it is determined that the event has occurred, and the current frame in which the event has been confirmed is marked as the event trigger frame.
[0022] When a critical window that has appeared is not detected for the first time and is not detected in any of the subsequent L consecutive frames, a disappearance event is determined to be established, and the current frame that confirms the disappearance event is marked as the event trigger frame; where K and L are both positive integers.
[0023] Optionally, for the key window disappearance event, selecting the key identification frame from N frames preceding the key frame includes:
[0024] For the critical window disappearance event, the critical window no longer exists in the event triggering frame. Based on the effectiveness of the target detection box, the integrity of the window region, the degree of mouse occlusion, the image clarity, and the time proximity to the event triggering frame, each candidate frame within N frames before the critical frame is scored.
[0025] Candidate frames that meet the scoring criteria are selected as key identification frames for the disappearance event in order to extract the state content of the key window at the moment before it disappears.
[0026] Optionally, performing local depth recognition on a specified region of the selected key recognition frame includes performing at least one of the following algorithms:
[0027] Optical character recognition in a specified area;
[0028] Optical character numerical recognition within a specified area;
[0029] Template matching;
[0030] Small target recognition;
[0031] The process of mouse operation recognition in a specified area is as follows: grayscale and adaptive threshold binarization are performed on the specified button candidate area to extract the dark pixel area, edge detection and morphological closing operation are performed to connect the button edges, the outer contour is found and a rectangular candidate box is fitted; the black edge pixel ratio of the top, bottom, left and right sides of the rectangular candidate box is voted on, and when the voting value of all four sides reaches the preset threshold, the corresponding button is determined to be the focus button.
[0032] Optionally, after generating the structured operation log, the computer operation log generation method further includes the step of performing incremental log sequence analysis:
[0033] The newly generated structured operation log is used as the log to be analyzed. Based on the event type of the log to be analyzed, the matching log sequence rules in the preset scenario configuration package are searched. The log sequence rules include order rules, dependency rules, or mutual exclusion rules.
[0034] The historical structured operation logs corresponding to the target computer are retrieved only within a preset time range prior to the occurrence time of the log to be analyzed.
[0035] Based on the found log sequence rules, determine whether the log to be analyzed and the retrieved historical structured operation logs meet the operation process constraints.
[0036] If the conditions are not met, a sequence rule result log is generated that records the exception type and evidence index.
[0037] Optionally, the target computer is a nuclear power plant operator human-machine interface terminal, the external screen signal copying device is a screen splitter or a KVM switch, and the structured operation log is a structured operation monitoring record for the nuclear power plant operator human-machine interface terminal.
[0038] The scenario configuration package is an HMI scenario configuration package specific to nuclear power scenarios. The HMI scenario configuration package defines key window target categories, target detection model weights, optical character recognition areas, numerical field definitions, template libraries, small target categories, mouse operation recognition rules, record field mapping relationships, and nuclear power log sequence rules for specific operation pages of nuclear power plants.
[0039] Optionally, the key window target category includes a setting value window;
[0040] When the setting value window meets the disappearance event triggering condition and triggers a key frame based on the frame data packet, the selected key recognition frame is used to perform text recognition on the title area configured in the setting value window and to perform numerical recognition on the configured numerical area to extract the maximum value, minimum value, original value and setting value parameters.
[0041] Based on mouse operation recognition in the specified area within the configured button candidate area, determine the focus state of the confirm button or cancel button;
[0042] The extracted parameters are combined with the button focus state to generate the structured operation monitoring record corresponding to the disappearance event of the setting value window.
[0043] Optionally, the key window target category also includes an operation confirmation window;
[0044] When the operation confirmation window meets the disappearance event triggering condition and triggers a key frame based on the frame data packet, the middle content area of the selected key recognition frame is used to perform text recognition to extract operation category keywords, and the focus state of the button in the operation confirmation window is identified to generate the structured operation monitoring record corresponding to the disappearance event of the operation confirmation window.
[0045] The nuclear power plant log sequence rules include dependency rules for manual shutdown pre-operation. The verification logic is as follows: when the window type of the log to be analyzed is operation confirmation window, the extracted operation category keyword is manual shutdown, and the focus button is confirmation, the historical structured operation monitoring records are retrieved within a preset time range before the occurrence time of the log to be analyzed; if no pre-operation history record with the operation category keyword "turbine shutdown" and the focus button "confirmation" is found, a sequence rule result log indicating that the pre-operation rule is not satisfied is generated.
[0046] According to a second aspect of the present invention, a computer operation log generation system based on non-invasive screen capture and keyframe recognition is provided, the system comprising:
[0047] The external signal acquisition link includes an external screen signal copying device for acquiring the video output signal of the target computer, and a video acquisition device for acquiring and forming continuous real-time screen frames.
[0048] A frame preprocessing module is used to preprocess the real-time screen frames;
[0049] The key window target detection module is used to perform target detection on the preprocessed real-time screen frame, obtain the detection result containing the target category and the target bounding box, and organize the detection result and the corresponding real-time screen frame into a frame data packet, which is continuously written into the circular frame data cache.
[0050] The keyframe identification module is used to determine whether a key window meets the state change triggering condition for appearance or disappearance based on the detection results in the frame data packets of multiple consecutive frames; when the state change triggering condition is met, the current frame that confirms the event is marked as the event triggering frame, and the event triggering frame is marked as a keyframe.
[0051] The keyframe proximity frame extraction module is used to extract a set of keyframe proximity frames containing N frames before the keyframe and the current keyframe from the circular frame data buffer after the keyframe is marked, and select a key identification frame from the set of keyframe proximity frames according to the type of the triggering event, where N is a positive integer; wherein, for the key window disappearance event, the key identification frame is selected from the N frames before the keyframe.
[0052] The depth recognition module is used to perform local depth recognition on a specified region of the selected key recognition frame and obtain local recognition results;
[0053] The structured log generation module is used to integrate the detection results and the local recognition results according to the preset field mapping relationship, and generate and output a structured operation log containing keyframe evidence index.
[0054] The beneficial effects of this invention are as follows:
[0055] This invention acquires video streams by configuring an external screen signal copying device, without requiring the installation of any acquisition client or driver on the target computer, nor requiring access to system APIs, and can fully meet the deployment requirements of various closed software and demanding security computing environments.
[0056] This invention abandons the high-cost OCR method of performing full video frames, and instead uses a target detection model for continuous lightweight monitoring. Only after a state change triggers a key frame, it performs depth recognition on a local area of a selected key recognition frame. It constructs a lightweight computing power scheduling pipeline to ensure stable real-time processing performance under continuous video stream input.
[0057] This invention creatively establishes a circular frame data cache and a backtracking extraction mechanism. When a key window disappears (i.e., the target has actually disappeared from the current screen), the system breaks the conventional limitation of forward-looking screenshots. By backtracking in the circular frame data cache, it extracts historical images within N frames before the key frame as key recognition frames. This mechanism can accurately capture the complete screen in the last instant before the window closes, successfully preserving the parameters entered by the operator and the button focus state, ensuring the data integrity of the structured operation log.
[0058] Other features and advantages of the present invention will be described in detail in the following detailed description section. Attached Figure Description
[0059] The present invention can be better understood by referring to the following description taken in conjunction with the accompanying drawings, in which the same or similar reference numerals are used throughout the drawings to denote the same or similar parts.
[0060] Figure 1 The system architecture diagram provided for embodiments of the present invention;
[0061] Figure 2 An external video signal acquisition link diagram provided for embodiments of the present invention;
[0062] Figure 3 A flowchart of real-time key window recognition and key frame triggering provided for embodiments of the present invention;
[0063] Figure 4 This is a flowchart of a multi-algorithm identification process near keyframes provided in an embodiment of the present invention;
[0064] Figure 5 Log sequence flow analysis diagram provided for embodiments of the present invention;
[0065] Figure 6 Screenshot of keyframes appearing in the ValueSetting window of the nuclear power plant operator HMI interface provided in this embodiment of the invention;
[0066] Figure 7 This is a screenshot of a key identification frame for the disappearance event of the ValueSetting window provided in an embodiment of the present invention;
[0067] Figure 8 This is a cropped image of the target area before the ValueSetting window disappears, provided in an embodiment of the present invention.
[0068] Figure 9 This is a diagram showing the focus recognition result of the ValueSetting window button provided in an embodiment of the present invention. Detailed Implementation
[0069] To enable those skilled in the art to more fully understand the technical solutions of the present invention, exemplary embodiments of the present invention will be described more comprehensively and in detail below with reference to the accompanying drawings. Obviously, the one or more embodiments of the present invention described below are merely one or more specific ways to implement the technical solutions of the present invention, and are not exhaustive. It should be understood that other ways belonging to a general inventive concept can be used to implement the technical solutions of the present invention, and should not be limited to the embodiments described exemplary. Based on one or more embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0070] Example: The abbreviations and key terms involved in the embodiments of this invention are defined as follows:
[0071] Target computer: The computer whose screen display is being captured and analyzed, including industrial control computers, nuclear power plant operator HMI workstations / terminals, dedicated terminals, remote desktop terminals, or virtual machine display terminals. No client software for this system needs to be installed on the target computer.
[0072] A splitter is a hardware device used to copy the video output signal of a target computer. It can be implemented by an HDMI / DP / VGA / DVI splitter, a KVM, or a device with equivalent video signal copying capabilities.
[0073] Non-intrusive acquisition: The screen image is acquired through an external video signal link without modifying the business software / HMI software on the target computer, without accessing the target system API, and without installing a log acquisition client or driver on the target computer.
[0074] Screen frame: A single frame of image captured by a video capture device from the output screen of the target computer.
[0075] Defined scenarios: A pre-defined range of target computer operation scenarios, such as a certain type of business software, a certain type of equipment operation interface, a nuclear power plant operator HMI page operation monitoring scenario, a certain type of remote desktop window, or a certain type of parameter input process. This system performs model training, template configuration, and rule definition for the defined scenarios.
[0076] Scene configuration package (and HMI scene configuration package): A set of configuration data used to describe a specific scene, including key window categories, target detection model weights, OCR recognition areas, numerical field definitions, template library, small target categories, mouse operation recognition rules, log field mapping relationships (or monitoring record field mapping relationships) and log sequence rules.
[0077] Key window targets: Key windows or key control targets identified by the target detection model in the screen frame. Output information includes target category, bounding box, confidence score, frame number, timestamp, and tracking identifier.
[0078] Keyframe: An event frame marked when a key window appears, disappears, or its state changes according to preset conditions. It is used to bind the event's occurrence time, trigger type, and screenshot evidence. For disappearance events, the keyframe can be the event trigger frame that confirms the disappearance event.
[0079] Key recognition frames and frames near key frames: Key recognition frames are image frames selected from the set of frames near key frames and actually used for OCR, template matching, button focus recognition, or other depth recognition. Frames near key frames consist of N frames preceding the key frame and the current key frame, used to identify the state before the operation, screen changes before the key frame is triggered, and the window state in the current key frame. N can be set according to the frame rate, service response time, and recognition latency, for example, it can be 1-10 frames.
[0080] Object detection model: A machine vision model used to detect key windows, key controls, or small objects from screen frames. This model can be trained, incrementally trained, or replaced for a specified scenario.
[0081] OCR: Optical Character Recognition, used to identify text, values, units, field labels, prompts, etc. from screen images.
[0082] Template matching: Matches the screen area with preset window templates, button templates, icon templates, or interface layout templates to help determine the window type, control position, and target semantics.
[0083] Structured logs (structured operation monitoring records): Log records organized according to unified fields, including time, data collection source, scene identifier, key window category, trigger type, recognized text, recognized value, template hit, small target recognition result, mouse operation, event semantics, confidence level, and screenshot evidence of key event recognition frames, etc. Structured logs and structured operation monitoring records belong to the same data representation format in this invention.
[0084] Log sequence analyzer: used to analyze the sequential relationships, dependencies, time constraints, and conflict relationships between multiple structured logs to determine whether the operation process conforms to preset rules.
[0085] Reference Figure 1 The present invention provides a computer operation log generation system based on non-intrusive screen capture and keyframe recognition, including an external screen signal copying device, a video capture device, a real-time screen frame capture module, a frame preprocessing module, a key window target detection module, a region OCR / template matching auxiliary module, a ring frame data cache, a keyframe identification module, a keyframe nearby frame extraction module, a depth recognition module, a structured log generation module, a log sequence analyzer, a log evidence storage module, and a scene configuration package.
[0086] The workflow of the computer operation log generation system based on non-intrusive screen capture and keyframe recognition in this embodiment of the invention is as follows:
[0087] 1) External screen signal acquisition link.
[0088] like Figure 2As shown, the target computer's video output is connected to an external screen signal replication device (a splitter, KVM, or device with equivalent screen signal replication capabilities). This device physically replicates the target computer's screen signal into at least two paths: one path is output to the target computer's monitor, allowing the operator to view and operate the computer normally; the other path is output to a video capture device, where the recognition and computing device acquires the screen image. The video capture device captures the screen image at a preset frame rate (e.g., 20-30 frames / second), forming continuous real-time screen frames. This capture link is completely independent of the target computer's software system.
[0089] 2) Frame preprocessing and scene configuration loading.
[0090] After real-time screen frames enter the frame preprocessing module, the system performs processes such as timestamp annotation, effective display area cropping, resolution normalization, brightness correction, color space conversion, scaling correction, noise reduction, and mouse pointer area enhancement. The preprocessed frames are used for both key window target detection and subsequent depth recognition.
[0091] Before the system is put into operation, the scene configuration package corresponding to the specified scenario is loaded first. The scene configuration package provides all configuration parameters to the regional OCR / template matching auxiliary module, keyframe identification module, deep recognition module, structured log generation module, and log sequence analyzer.
[0092] 3) Target detection in critical windows and frame data packet generation.
[0093] The preprocessed screen frame is input to the key window target detection module. This module identifies key window targets and key control targets in the screen frame based on a target detection model trained under a specified scenario, and outputs results such as target category, target bounding box, target confidence score, frame number, and timestamp.
[0094] The key window target detection module organizes the detection results of each frame into frame data packets. Each frame data packet includes at least: the original frame, frame number, timestamp, target category, target bounding box, target confidence score, video channel identifier, and preliminary identification results related to that frame. Frame data packets serve as the foundation for subsequent processing modules.
[0095] 4) Regional OCR / template matching assistance confirmation.
[0096] After the key window target detection module outputs key window candidates, the system, based on the scene configuration package, crops a specified small region (such as the title bar, prompt word region, number region, key field label region, or status text region) from the bounding box of the candidate target and performs region OCR recognition. For cases where the same target category corresponds to multiple different window contents, the system matches the region OCR recognition result with confirmation keywords, text patterns, field formats, or dictionary rules to confirm whether the candidate window belongs to the specific window content that needs attention in the current specified scene.
[0097] The system can also match key window candidate areas with window templates, partial templates, or control templates in the template library to confirm the window layout or control area. The output of the auxiliary confirmation includes content confirmation results, template hit results, auxiliary confidence scores, and auxiliary confirmation failure indicators, which are sent to the keyframe identification module to prevent false triggering caused by misidentification by the target detection model.
[0098] 5) Circular frame data buffer.
[0099] The system continuously writes real-time screen frames, preprocessing results, frame data packets, and regional OCR / template matching auxiliary results into a circular frame data cache. The circular frame data cache cyclically saves frame data within a recent time period (e.g., within 3-10 seconds) in chronological order, and is used to provide subsequent modules with the N frames before the key frame and the current key frame after the event trigger frame or key frame is identified.
[0100] 6) Keyframe identifier.
[0101] The keyframe identification module determines whether the key window meets the triggering conditions based on the target detection results, auxiliary confirmation results, and continuous frame status. Figure 3 As shown.
[0102] When a key window of the same category and whose content has been confirmed appears for the first time and then appears stably for K consecutive frames, the key window appearance event is determined to be valid, and the current frame confirming the appearance event is marked as the appearance event trigger frame and the key frame. When a target disappears for the first time and is not detected for L consecutive frames, the key window disappearance event is determined to be valid, and the current frame confirming the disappearance event is marked as the disappearance event trigger frame and the key frame of the disappearance event. K and L are set according to the acquisition frame rate and stability. The key frame marking module combines continuous frame voting, confidence weighting, and tracking marker association to smooth out interface flickering and misidentification.
[0103] 7) Keyframe Nearby Frame Extraction and Frame Selection Scoring Algorithm.
[0104] Once a keyframe is marked, the keyframe neighborhood frame extraction module extracts the N frames preceding the keyframe and the current keyframe from the circular frame data buffer to form a keyframe neighborhood frame set.
[0105] When a window event occurs, the system directly uses the event keyframe as the key recognition frame.
[0106] For window disappearance events, since the target window is already closed and no longer exists in the event trigger frame, the system selects one or more frames from the candidate set of the previous N frames as key recognition frames based on the key recognition frame selection algorithm. These frames are used to extract the window content, mouse position, and button state just before the disappearance. The key recognition frame selection algorithm performs a multi-dimensional weighted score based on the effectiveness of the target detection box, the integrity of the window region, the quality of OCR pre-detection of small regions, the degree of mouse occlusion, image clarity, and temporal proximity to the event trigger frame, selecting the candidate frame with the highest score as the key recognition frame.
[0107] 8) Local depth recognition.
[0108] like Figure 4 As shown, the depth recognition module performs depth recognition tasks only on a specified region of the selected key recognition frames, and does not perform full recognition on the entire video stream. The depth recognition module includes: specified region OCR text recognition, specified region OCR numerical recognition, OCR information normalization, specified region OpenCV image algorithm recognition, specified region small object recognition, specified region mouse operation recognition, and specified region template matching.
[0109] 9) Structured log generation.
[0110] The structured log generation module receives target detection results, auxiliary confirmation results, keyframe identification results, deep recognition results, and mapping relationships from the scene configuration package, and generates a single structured log entry. The structured log entry includes the log number, timestamp, scene identifier, target computer identifier, event trigger frame number, keyframe number, key recognition frame number, keyframe trigger type, key window category, key window position, OCR-recognized text, numerical values, small targets, mouse operations, event results, confidence level, and keyframe and key recognition frame screenshot evidence indexes.
[0111] 10) Incremental log sequence analysis and evidence storage.
[0112] like Figure 5 As shown, each time a new structured log is generated, the log sequence analyzer treats it as a log to be analyzed and searches for matching rules based on the scenario configuration package. The system only searches for historical logs of the same target computer and the same specified scenario within a preset time range before the time the log to be analyzed occurred (e.g., within X minutes before the current log), without performing a full comparison of all historical logs.
[0113] The comparison rules include: sequence rules (determining if a specified preceding log exists before the current log), dependency rules (determining if the parameters, objects, or states in the current log are consistent with the preceding logs), and mutual exclusion rules (determining if the current log conflicts with historical states or mutually exclusive events). If a rule is not satisfied, a sequence rule result log is generated, recording the exception type, trigger log, and evidence index. Subsequently, the structured log, rule result log, and screenshot evidence are written to the log database.
[0114] For example, this embodiment of the invention uses the nuclear power plant operator HMI operation interface as a specific scenario to elaborate in detail the operation monitoring record and sequence rule verification process of the value setting window and the operation confirmation window.
[0115] After the system starts, it first loads the "HMI scenario configuration package" specific to nuclear power plants. This configuration package defines the target categories, model weight files, OCR recognition areas, button reference positions, record field mapping rules, and nuclear power operation sequence rules for ValueSetting and ConfirmWindow.
[0116] The video output signal from the nuclear power plant operator's HMI target computer is replicated via a splitter, with one output going to a monitor for operator use and the other to a video capture card. The video capture card transmits the video stream to the recognition and processing computer at a frame rate of 30 frames per second. The frame preprocessing module extracts frame data at a processing frame rate of 15 frames per second, adds timestamps, frame numbers, and acquisition source identifiers, and performs normalization and image enhancement.
[0117] The preprocessed frame data is input into the key window target detection module, which calls the pre-trained model for real-time detection. The detection time for a single frame is about 15ms.
[0118] When the ValueSetting target is detected to have changed from non-existent to present and is consistently detected for the next 5 consecutive frames, it is marked as the ValueSetting window has appeared (e.g., ...). Figure 6 (As shown). The system takes the current frame as the event trigger frame, key frame, and key recognition frame, performs OCR recognition on the title area, and generates a ValueSetting window appearance log.
[0119] When the ValueSetting target changes from present to non-existent and remains undetected for the next 5 consecutive frames, the system marks the current frame where the disappearance event is confirmed as the disappearance event trigger frame and a key frame. The system extracts a set of candidate frames preceding the disappearance event trigger frame from the circular frame buffer and selects the key frame based on the frame selection algorithm. Figure 7 The frame shown serves as the key identification frame for the disappearance event, and the ValueSetting target area is cropped out (e.g., Figure 8 (As shown).
[0120] For the cropped area, the system performs OCR recognition on the title area (approximately 7ms) and OCR recognition on the numerical area specified in the configuration package (approximately 20ms). After cleaning and integration, the maximum value is 100, the minimum value is 0, the original value is 14.25, and the set value is 23. The overall time for a single keyframe event is between 20-100ms, ensuring a stable real-time recognition rate of 15-20 frames per second.
[0121] Within the candidate button area, the system executes a button focus recognition algorithm based on OpenCV edge detection and morphological contour analysis: grayscale conversion and adaptive threshold binarization are performed on the candidate button area to extract dark pixels; edge detection and morphological closing operations are performed to connect button edges partially occluded by the mouse or interrupted by anti-aliasing; the outer contour is found and a rectangular candidate box is fitted; finally, the top, bottom, left, and right sides of the candidate box are voted on for the percentage of black edge pixels. When the voting values of all four sides reach a preset threshold, the button is determined to be the focus button. The recognition results are as follows: Figure 9 As shown, the "Confirm" button is determined to be the focus button (selected 1.00), and the "Cancel" button is the non-focus button (unselected 1.00).
[0122] The system combines the above identification results to generate a structured operation monitoring record of the disappearance of the ValueSetting window.
[0123] Subsequently, the system detected the appearance of the ConfirmWindow target and its stable appearance for 5 consecutive frames. The system used the current frame as the keyframe, identified the title and middle content, extracted the keyword "manually stop the heap", and generated a ConfirmWindow appearance log.
[0124] When ConfirmWindow fails to be detected for 5 consecutive frames, a disappearance event is determined to be true. The system backtracks from the circular buffer to select key recognition frames and crops out the area corresponding to ConfirmWindow. The system performs recognition and extraction of "Manual Stop Stacking" from the title and middle content, and determines the focus button as "Confirm" using a button focus algorithm, generating a ConfirmWindow disappearance log.
[0125] After generating the ConfirmWindow disappearance log, the log sequence analyzer matched a dependency rule: "For a manual reactor shutdown operation with the focus button set to 'Confirm,' there must have been a preceding operation within 10 minutes prior to its occurrence, where the turbine shutdown operation with the focus button set to 'Confirm.'" The system only searches historical logs within the 10-minute timeframe preceding this log occurrence. Since no preceding operation log meeting the condition was found, the system determined that the preset process rule was not met and generated a sequence rule result log.
[0126] Specifically, in this embodiment of the invention, the external video acquisition device can be replaced by an HDMI splitter, DP splitter, VGA splitter, DVI splitter, KVM, acquisition box, acquisition card, video matrix, or remote video stream mirroring device. The target detection model can adopt a lightweight detection model, an edge detection model, or a model combining rule detection and machine vision. The key window can be expanded to a partial area of a window, a webpage area, a remote desktop embedded window, a virtual machine window, a pop-up window, a menu, a button group, or a table area. The scene configuration package can be stored as a configuration file, a database record, a model version package, a template folder, or a rule script. The key frame triggering condition can be triggered by a combination of window state changes, key control changes, key text changes, numerical changes, mouse click candidate events, or status light changes. The area for small area auxiliary confirmation can be a title bar, a prompt word area, a numbered area, or a field label, and the rule can be a regular expression, text similarity, or dictionary matching. The first N frames can be set according to a time window (e.g., 0.5 seconds before the key frame), and the key recognition frame selection algorithm can be dynamically selected based on the effectiveness, completeness, and clarity of the detection box. OCR can employ end-to-end text detection and recognition models, dedicated digit recognition models, or seven-segment display recognition models. Template matching can utilize feature point matching, hash matching, layout matching, or structural similarity matching. Small target recognition can be achieved through independent detection models, local ROI magnification detection, color thresholding, or edge detection. Structured logs can be in JSON, XML, CSV, database tables, message queue events, or Protobuf formats. Evidence storage can utilize original keyframe screenshots, anonymized screenshots, partial screenshots, short video clips, or image hashes. Process rule verification results can output whether the process conforms to preset process rules, does not conform to preset process rules, is suspected of not conforming to preset process rules, requires manual review, or has an anomaly level alarm.
[0127] The technical solutions of the embodiments of the present invention can solve other technical problems and achieve other beneficial effects as a whole, as follows:
[0128] First, it improves the accuracy of business semantics in triggering key events. Compared with ordinary screen pixel change threshold triggering, this invention triggers key frames by the appearance, disappearance, or state change of trained key window targets, which can effectively avoid false triggering caused by irrelevant minor changes such as cursor blinking, animation refresh, and page scrolling.
[0129] Secondly, it reduces the misidentification rate of similar windows of the same category. When key windows of the same category correspond to multiple different contents, the system first verifies the content through micro-region OCR or template matching after target detection. Only when the verification is successful will the key frame be triggered, which greatly reduces the misidentification rate of windows of the same category.
[0130] Third, it improves the semantic integrity and traceability of evidence in operation logs. A single structured log not only includes time and screenshots, but also deeply integrates key window categories, OCR text, numerical fields, template hits, small target status, mouse operations, confidence levels, and key frame and key recognition frame screenshot indexes, providing comprehensive data support for subsequent tracing and responsibility determination.
[0131] Fourth, it significantly reduces the storage overhead of massive amounts of video data. Compared to storing full high-definition screen recordings around the clock, this invention only stores lightweight structured logs and key frame screenshots, saving massive storage resources while meeting audit traceability requirements.
[0132] Fifth, it achieves incremental automated verification of operation process rules. The log sequence analyzer performs incremental comparisons only on relevant historical logs based on a time sliding window, supports sequential, dependency, and mutual exclusion rule verification, and can detect violations such as skipping steps, missing steps, and out-of-order operations in near real time, significantly improving the safety assurance capabilities of industrial control and nuclear power operation.
[0133] While one or more embodiments of the present invention have been described above, those skilled in the art will recognize that the present invention can be implemented in any other form without departing from its spirit and scope. Therefore, the embodiments described above are illustrative and not restrictive, and many modifications and substitutions will be apparent to those skilled in the art without departing from the spirit and scope of the invention as defined in the appended claims.
Claims
1. A method for generating computer operation logs based on non-intrusive screen capture and keyframe recognition, characterized in that, include: The video output signal of the target computer is obtained through an external screen signal copying device and then captured by a video acquisition device to form continuous real-time screen frames. The real-time screen frame is preprocessed, and the preprocessed real-time screen frame is input into the key window target detection module for target detection to obtain the detection result containing the target category and target bounding box. The detection result and the corresponding real-time screen frame are organized into a frame data packet and continuously written into the circular frame data buffer. Based on the detection results in the frame data packets of multiple consecutive frames, determine whether the key window meets the state change triggering conditions for appearance or disappearance; When the state change triggering condition is met, the current frame that confirms the event is marked as the event trigger frame, and the event trigger frame is marked as a key frame; Once the keyframe is marked, a set of frames near the keyframe containing N frames before the keyframe and the current keyframe is extracted from the circular frame data buffer. A key identification frame is then selected from the set of frames near the keyframe according to the type of the triggering event, where N is a positive integer. Specifically, for a key window disappearance event, the key identification frame is selected from the N frames before the keyframe. Perform local depth recognition on a specified region of the selected key recognition frame to obtain local recognition results; The detection results and the local recognition results are integrated according to a preset field mapping relationship to generate and output a structured operation log containing a keyframe evidence index.
2. The computer operation log generation method based on non-intrusive screen capture and keyframe recognition according to claim 1, characterized in that, Before determining whether the key window meets the state change triggering condition for appearance or disappearance based on the detection results in the frame data packets of multiple consecutive frames, the method further includes: For the candidate key windows output by the key window target detection module, according to the preset scene configuration package, a specified small region is cropped from the target bounding box of the candidate key window, and region optical character recognition is performed on the small region. The results of the regional optical character recognition in the micro-area are matched with the preset content confirmation rules; If the match is successful, the candidate key window content is confirmed to be valid and included in the judgment process of the state change trigger condition.
3. The computer operation log generation method based on non-intrusive screen capture and keyframe recognition according to claim 2, characterized in that, The determination of whether the key window meets the state change triggering condition for appearance or disappearance includes: When the key window that confirms the content appears for the first time and appears in K consecutive frames, it is determined that the event has occurred, and the current frame in which the event has been confirmed is marked as the event trigger frame. When a critical window that has appeared is not detected for the first time and is not detected in any of the subsequent L consecutive frames, a disappearance event is determined to be established, and the current frame that confirms the disappearance event is marked as the event trigger frame; where K and L are both positive integers.
4. The computer operation log generation method based on non-intrusive screen capture and keyframe recognition according to claim 3, characterized in that, The step of selecting the key recognition frame from N frames preceding the key frame for the key window disappearance event includes: For the critical window disappearance event, the critical window no longer exists in the event triggering frame. Based on the effectiveness of the target detection box, the integrity of the window region, the degree of mouse occlusion, the image clarity, and the time proximity to the event triggering frame, each candidate frame within N frames before the critical frame is scored. Candidate frames that meet the scoring criteria are selected as key identification frames for the disappearance event in order to extract the state content of the key window at the moment before it disappears.
5. The computer operation log generation method based on non-intrusive screen capture and keyframe recognition according to claim 1, characterized in that, Performing local depth recognition on a specified region of the selected key recognition frame includes executing at least one of the following algorithms: Optical character recognition in a specified area; Optical character numerical recognition within a specified area; Template matching; Small target recognition; The process of mouse operation recognition in a specified area is as follows: grayscale and adaptive threshold binarization are performed on the specified button candidate area to extract the dark pixel area, edge detection and morphological closing operation are performed to connect the button edges, the outer contour is found and a rectangular candidate box is fitted; the black edge pixel ratio of the top, bottom, left and right sides of the rectangular candidate box is voted on, and when the voting value of all four sides reaches the preset threshold, the corresponding button is determined to be the focus button.
6. The computer operation log generation method based on non-intrusive screen capture and keyframe recognition according to claim 1, characterized in that, After generating the structured operation log, the process also includes performing incremental log sequence analysis. The newly generated structured operation log is used as the log to be analyzed. Based on the event type of the log to be analyzed, the matching log sequence rules in the preset scenario configuration package are searched. The log sequence rules include order rules, dependency rules, or mutual exclusion rules. The historical structured operation logs corresponding to the target computer are retrieved only within a preset time range prior to the occurrence time of the log to be analyzed. Based on the found log sequence rules, determine whether the log to be analyzed and the retrieved historical structured operation logs meet the operation process constraints. If the conditions are not met, a sequence rule result log is generated that records the exception type and evidence index.
7. The computer operation log generation method based on non-invasive screen capture and keyframe recognition according to claim 6, characterized in that, The target computer is a nuclear power plant operator human-machine interaction terminal, the external screen signal copying device is a screen splitter or KVM switch, and the structured operation log is a structured operation monitoring record for the nuclear power plant operator human-machine interaction terminal. The scenario configuration package is an HMI scenario configuration package specific to nuclear power scenarios. The HMI scenario configuration package defines key window target categories, target detection model weights, optical character recognition areas, numerical field definitions, template libraries, small target categories, mouse operation recognition rules, record field mapping relationships, and nuclear power log sequence rules for specific operation pages of nuclear power plants.
8. The computer operation log generation method based on non-intrusive screen capture and keyframe recognition according to claim 7, characterized in that, The key window target category includes the setting value window; When the setting value window meets the disappearance event triggering condition and triggers a key frame based on the frame data packet, the selected key recognition frame is used to perform text recognition on the title area configured in the setting value window and to perform numerical recognition on the configured numerical area to extract the maximum value, minimum value, original value and setting value parameters. Based on mouse operation recognition in the specified area within the configured button candidate area, determine the focus state of the confirm button or cancel button; The extracted parameters are combined with the button focus state to generate the structured operation monitoring record corresponding to the disappearance event of the setting value window.
9. The computer operation log generation method based on non-intrusive screen capture and keyframe recognition according to claim 8, characterized in that, The key window target category also includes the operation confirmation window; When the operation confirmation window meets the disappearance event triggering condition and triggers a key frame based on the frame data packet, the middle content area of the selected key recognition frame is used to perform text recognition to extract operation category keywords, and the focus state of the button in the operation confirmation window is identified to generate the structured operation monitoring record corresponding to the disappearance event of the operation confirmation window. The nuclear power plant log sequence rules include dependency rules for manual shutdown pre-operation. The verification logic is as follows: when the window category of the log to be analyzed is operation confirmation window, the extracted operation category keyword is manual shutdown, and the focus button is confirmation, the historical structured operation monitoring records are retrieved within a preset time range before the occurrence time of the log to be analyzed. If no previous historical records with the operation category keyword "turbine shutdown" and the focus button "confirm" are found, a sequence rule result log indicating that the previous operation rule was not met will be generated.
10. A computer operation log generation system based on non-intrusive screen capture and keyframe recognition, characterized in that, include: The external signal acquisition link includes an external screen signal copying device for acquiring the video output signal of the target computer, and a video acquisition device for acquiring and forming continuous real-time screen frames. A frame preprocessing module is used to preprocess the real-time screen frames; The key window target detection module is used to perform target detection on the preprocessed real-time screen frame, obtain the detection result containing the target category and the target bounding box, and organize the detection result and the corresponding real-time screen frame into a frame data packet, which is continuously written into the circular frame data cache. The key frame identification module is used to determine whether the key window meets the state change triggering conditions for appearance or disappearance based on the detection results in the frame data packets of multiple consecutive frames. When the state change triggering condition is met, the current frame that confirms the event is marked as the event trigger frame, and the event trigger frame is marked as a key frame; The keyframe proximity frame extraction module is used to extract a set of keyframe proximity frames containing N frames before the keyframe and the current keyframe from the circular frame data buffer after the keyframe is marked, and select a key identification frame from the set of keyframe proximity frames according to the type of the triggering event, where N is a positive integer; wherein, for the key window disappearance event, the key identification frame is selected from the N frames before the keyframe. The depth recognition module is used to perform local depth recognition on a specified region of the selected key recognition frame and obtain local recognition results; The structured log generation module is used to integrate the detection results and the local recognition results according to the preset field mapping relationship, and generate and output a structured operation log containing keyframe evidence index.
