Automatic work ticket and operation ticket checking method based on browser plug-in

By using browser plugin technology to automate the verification of work tickets and operation tickets, the problems of low efficiency of manual review and high system verification cost in traditional two-ticket management are solved. It enables real-time feedback and complex rule verification, thereby improving the efficiency and standardization of power safety management.

CN121660709APending Publication Date: 2026-03-13CHINA SOUTHERN POWER GRID EHV POWER TRANSMISSION COMPANY WUZHOU BUREAU
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511828769.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-05
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Traditional two-ticket management methods suffer from low efficiency in manual review, difficulty in ensuring standardization, high maintenance costs of system verification functions, limited HTML5 form validation capabilities, and poor interpretability of deep learning models, leading to frequent power safety accidents.

Method used

An automatic verification method based on browser plugins is adopted to achieve automatic verification of work tickets and operation tickets through the browser plugin infrastructure, including list configuration files, service worker scripts, content scripts and pop-up pages. It monitors DOM changes in real time, dynamically loads form elements, builds a dual verification rule system, and provides instant feedback and non-intrusive prompts.

Benefits of technology

It enables real-time verification of work tickets and operation tickets, improving the accuracy and efficiency of filling them out, reducing deployment and maintenance costs, supporting verification of complex business logic, reducing security risks, and shortening the review time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121660709A_ABST
    Figure CN121660709A_ABST
Patent Text Reader

Abstract

The invention relates to the field of power system operation safety organization management and control digitization, and particularly discloses a work ticket and operation ticket automatic checking method based on a browser plug-in. Based on the browser plug-in infrastructure, the contents of the two tickets are automatically verified; the browser plug-in infrastructure comprises a list configuration file, a service worker script, a content script and a pop-up page; through the browser plug-in technology, real-time verification is achieved in the work ticket and operation ticket filling process, verification rules are automatically triggered in field events, immediate feedback is provided, compared with a traditional system which only conducts verification during submission or manual auditing, error prompt information can be dynamically inserted in the filling process, and the work ticket and operation ticket filling efficiency is improved. In addition, a browser plug-in architecture is adopted, the verification function can be achieved without modifying codes of an original two-ticket management system, and compared with the situation that system built-in verification needs to be developed and deployed again, plug-and-play is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of digital organization and management of power system operation safety, and in particular to a method for automatic verification of work tickets and operation tickets based on browser plugins. Background Technology

[0002] In the power industry, the two-ticket system (work permit and operation permit) is an important system for ensuring safe production. The traditional two-ticket management method has many pain points: power safety accidents are related to the improper completion of the two tickets; a high percentage of small power accidents are caused by operating without a ticket each year; and safety hazards arise due to inadequate management and supervision.

[0003] Current technologies primarily employ the following methods: Traditional manual review requires the work supervisor and work permit issuer to verify the contents of both work tickets item by item, with each work ticket taking an average of 15-30 minutes to review. When there are many work tickets, manual verification becomes extremely inefficient, severely impacting work efficiency. According to official statistics, approximately 30% of power safety accidents are related to improper completion of work tickets, and manual review cannot identify all problems in a short time. Different personnel have varying understandings of the work ticket system, leading to inconsistent filling standards. Manual review is highly subjective, with results significantly influenced by the reviewer's experience and sense of responsibility, making it difficult to guarantee the standardization of work ticket management. Verification rules are rigid; existing work ticket management systems typically use hard-coded verification functions, with verification rules fixed in the system code. When system requirements change, the system code needs to be modified and redeployed, resulting in high maintenance costs and slow response times. Generally, only basic verifications (such as mandatory fields and format verification) are performed, lacking support for complex verifications involving logical relationships and business rules. For logical verifications such as "the work start time must be earlier than the end time" and "the operator cannot be the work supervisor," the system's built-in functions often cannot implement them. Built-in verification requires modifying the existing system code, resulting in high deployment costs and maintenance difficulties. For existing two-ticket management systems, adding verification functionality requires redevelopment, testing, and deployment, leading to a long implementation cycle.

[0004] Furthermore, HTML5 form validation has limitations, including limited validation capabilities. Built-in HTML5 form validation functions (such as the `required`, `pattern`, `min`, and `max` attributes) can only perform basic format checks and cannot handle complex business logic validation. For example, it cannot validate complex rules such as "logical relationships between two fields" or "whether personnel qualifications meet requirements." Browser compatibility issues also exist. Different browsers have varying levels of support for HTML5 form validation, resulting in differences in prompt styles and effects. Some older browsers (such as IE9 and below) do not support HTML5 form validation, requiring additional compatibility code. Error messages cannot be customized. Error messages in HTML5 form validation are controlled by the browser, and the style and content of the prompts cannot be customized. The prompt text is hardcoded, and the text is inconsistent across different browsers, leading to a poor user experience. The limitations of the CNN-BiGRU model also contribute to its limitations, resulting in high model training costs. Automated verification methods for operation tickets based on the CNN-BiGRU model require a large standard operation ticket corpus for training, leading to high data preparation and model training costs. For small and medium-sized power companies, the high costs of data collection and model training are difficult to bear. Finally, interpretability is poor. The decision-making process of deep learning models (CNN-BiGRU) is a "black box," making it difficult to explain why a certain operation ticket is judged as erroneous. In practical applications, staff need to understand the reasons for the error in order to make corrections, and the poor interpretability of the model limits its application scope. Summary of the Invention

[0005] This invention aims to provide an automatic verification method for work tickets and operation tickets based on a browser plugin. Specifically designed for the automatic verification application of work tickets and operation tickets in China Southern Power Grid, this method provides reminders for errors during the filling and review of work tickets, thereby improving the efficiency and safety level of power work organization and management.

[0006] To achieve the above objectives, the present invention provides the following technical solution: An automatic verification method for work tickets and operation tickets based on browser plugins, including the browser plugin infrastructure; Based on a browser plugin infrastructure, the content of the two tickets is automatically verified. The browser plugin infrastructure includes manifest configuration files, service worker scripts, content scripts, and pop-up pages; The manifest configuration file is used as the entry file for the plugin, defining basic information such as plugin name, version, permissions, and script file path. The service worker script is a script that runs in the background of the browser. It is responsible for handling plugin lifecycle events, message communication, and data storage. It adopts an event-driven model, which activates when needed and terminates when idle to save resources. The content script is a script injected into the target webpage. It is responsible for listening to changes in the page's DOM (Document Object Model), locating form elements, and executing validation logic. It shares the DOM with the page but runs in an independent execution environment. The pop-up page is an interactive interface displayed when the user clicks the plugin icon. It displays the verification results and configuration options, and is loaded on demand without occupying resident memory.

[0007] Furthermore, the content script includes page monitoring and element positioning; the page monitoring and element positioning accurately locate form elements after the page is dynamically loaded by real-time monitoring of changes in the DOM (Document Object Model) tree.

[0008] Furthermore, the page monitoring and element location includes an element location strategy; the element location strategy obtains a unique selector by locating the input box, drop-down menu, and date picker DOM (Document Object Model) elements of the work ticket form and analyzing the HTML (Hypertext Markup Language) structure.

[0009] Furthermore, the browser plugin infrastructure also includes validation rule management; the validation rule management is used for standardization validation, checking basic rules such as field mandatoryness, format correctness, and date rationality, implemented using configurable functions or configuration objects; logical validation, verifying the logical relationship between multiple fields, and complex business rules such as the work start time must be earlier than the end time and the operator cannot be the person in charge of the work; and rule configuration, supporting dynamic loading and updating of validation rules, adapting to changes in regulations without modifying the code.

[0010] Furthermore, the verification rule management includes a verification execution engine; The validation execution engine is used for event triggering mechanisms, automatically triggering validation in the events of form fields and providing immediate feedback; the layered validation strategy adopts a layered mechanism of basic rule validation, complex function validation, and asynchronous backend validation to avoid unnecessary calculations and backend calls; the real-time validation feature shortens user waiting time, and multi-dimensional validation of values ​​and formats ensures comprehensive validation.

[0011] Furthermore, the browser plugin infrastructure also includes user interaction and prompts; The user interaction and prompts are used for non-intrusive prompts, dynamically inserting error message information during the filling process, and adopting a friendly feedback mechanism to improve the user experience; as well as error location and display, accurately locating the error location and prompting the error content, supporting the categorized display of error information and manual refresh verification.

[0012] Furthermore, the browser plugin infrastructure also includes data storage and communication; the data storage and communication uses storage provided by the browser for data persistence.

[0013] The application of automatic verification methods for work tickets and operation tickets based on browser plugins allows the browser plugin infrastructure to work collaboratively by injecting content scripts into the work ticket page.

[0014] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0015] This invention utilizes browser plugin technology to achieve real-time validation during the completion of work tickets and operation tickets. Validation rules are automatically triggered in the input or blur events of fields, providing immediate feedback. Compared to traditional systems that only validate upon submission or require manual review, this invention dynamically inserts error messages during the completion process, significantly improving accuracy and efficiency. Furthermore, the browser plugin architecture eliminates the need to modify existing two-ticket management system code for validation. Unlike built-in system validation which requires redevelopment and deployment, this invention offers plug-and-play functionality, reducing deployment costs and increasing maintenance flexibility. In addition, it constructs standardized validation mechanisms, including validation of required fields, format, date validity, and logic; a dual system for time sequence, personnel conflicts, and equipment status; and coverage of complex business rules across single and multiple fields. Its validation capabilities far surpass traditional HTML5 form validation and simple system validation.

[0016] This invention requires no modification to the existing system, reducing deployment costs and shortening the deployment-to-online cycle to a few days. Compared to the months-long development cycle of a system, the time cost is significantly reduced. When regulations change, only the configuration file needs to be updated, without modifying the code, thus reducing maintenance costs. It also supports automatic plugin updates, reducing manual maintenance workload. Errors are prompted in real time during the filling process to prevent errors from continuing and to prevent serious misoperation such as closing the circuit breaker with the ground wire connected, thereby reducing safety risks from the source.

[0017] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0018] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 This is a flowchart illustrating the automatic verification method for work tickets and operation tickets based on browser plugins provided in this application. Detailed Implementation

[0019] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0020] like Figure 1 As shown, the automatic verification method for work tickets and operation tickets based on browser plugins provided in this embodiment is characterized by including a browser plugin infrastructure. Based on the browser plugin infrastructure, the content of the two tickets is automatically verified. The browser plugin infrastructure technology is used to realize the automatic verification of the content of the two tickets without modifying the original two-ticket management system code. The target page is monitored and verified by injecting content scripts. The browser plugin infrastructure includes manifest configuration files, service worker scripts, content scripts, and pop-up pages; The manifest configuration file serves as the entry point for plugins, defining basic information such as plugin name, version, permissions, and script file path. Specifically, the manifest configuration file (manifest.json) adopts the Manifest V3 standard and uses service workers to replace the backend page, improving security and performance.

[0021] Service worker scripts are scripts that run in the background of the browser. They are responsible for handling plugin lifecycle events, message communication, and data storage. They adopt an event-driven model, activating when needed and terminating when idle to save resources. Specifically, JavaScript scripts that run in the browser's background.

[0022] Content scripts are scripts injected into target web pages. They are responsible for listening to changes in the page's DOM, locating form elements, and executing validation logic. They share the DOM with the page but run in an independent execution environment. Specifically, this refers to JavaScript scripts injected into the target webpage.

[0023] A pop-up page is an interactive interface displayed when the user clicks the plugin icon. It displays the verification results and configuration options, and is loaded on demand without occupying persistent memory.

[0024] The content script includes page listening and element positioning; page listening and element positioning accurately locate form elements after the page has dynamically loaded by listening to changes in the DOM tree in real time.

[0025] Specifically, the MutationObserver listening mechanism uses the MutationObserver API to monitor changes in the DOM tree in real time, accurately locates form elements after the page has dynamically loaded, and supports childList, attributes, and subtree configuration options.

[0026] Page listening and element positioning include element positioning strategies; element positioning strategies obtain unique selectors by analyzing the HTML (Hypertext Markup Language) structure by locating the input boxes, drop-down menus, and date pickers of the work ticket form DOM elements.

[0027] Specifically, the element positioning strategy is to locate the input boxes, drop-down menus, and date pickers of the work ticket form using the document.querySelector and document.getElementById methods, and analyze the HTML (Hypertext Markup Language) structure to obtain unique selectors (ID, Class Name, DataAttribute).

[0028] The browser plugin infrastructure also includes validation rule management; validation rule management is used for standardization validation, checking basic rules such as field requirement, correct format, and reasonable date, implemented using configurable functions or configuration objects; logical validation verifies the logical relationship between multiple fields, and complex business rules such as the start time of a task must be earlier than the end time and the operator cannot be the person in charge of the task; rule configuration supports dynamic loading and updating of validation rules, adapting to changes in regulations without modifying the code.

[0029] Specifically, validation rule management is implemented using configurable JavaScript functions or configuration objects.

[0030] Verification rule management includes the verification execution engine; The validation execution engine is used for event-triggered mechanisms, automatically triggering validation in form field events and providing immediate feedback; the layered validation strategy adopts a layered mechanism of basic rule validation, complex function validation, and asynchronous backend validation to avoid unnecessary calculations and backend calls; the real-time validation feature shortens user waiting time, and multi-dimensional validation of values ​​and formats ensures comprehensive validation.

[0031] Specifically, the event triggering mechanism automatically triggers validation in the input or blur events of form fields, providing immediate feedback.

[0032] Browser plugin infrastructure also includes user interaction and prompts; User interaction and prompts include non-intrusive prompts that dynamically insert error messages during the filling process, employing a user-friendly feedback mechanism to enhance the user experience; and error location and display, which accurately locates the error and displays the error content, supporting categorized display of error information and manual refresh verification.

[0033] Browser plugin infrastructure also includes data storage and communication; data storage and communication persists data by using storage provided by the browser.

[0034] Specifically, data persistence is achieved using the browser's storage API, supporting both local and synchronous storage methods. Communication between plugin components is implemented through chrome.runtime.sendMessage and chrome.runtime.onMessage.

[0035] The application of automatic verification methods for work tickets and operation tickets based on browser plugins allows the browser plugin infrastructure to work collaboratively by injecting content scripts into the work ticket page.

[0036] The automatic verification method for work tickets and operation tickets based on browser plugins provided in this embodiment is implemented as follows: The non-intrusive verification architecture based on browser plugins uses browser plugin technology to automate the verification of two-ticket content without modifying the original two-ticket management system code. It achieves listening and verification of the target page by injecting content scripts.

[0037] The real-time dynamic monitoring and element location mechanism uses the MutationObserver API to monitor changes in the DOM (Document Object Model) tree in real time, accurately locating the work ticket form element after the page is dynamically loaded. It supports childList, attributes, and subtree configuration options, and locates form fields using the document.querySelector and document.getElementById methods.

[0038] The dual-validation rule system constructs a dual system of normative validation and logical validation. Normative validation checks the basic rules of field mandatoryness, format correctness, and date reasonableness. Logical validation verifies the logical relationships between multiple fields (such as "work start time must be earlier than end time" and "operator cannot be the person in charge of the work").

[0039] The system features real-time feedback and user interaction mechanisms. It automatically triggers validation in the input or blur events of form fields, dynamically inserts error messages in a non-intrusive manner, and provides real-time feedback during the filling process to improve user experience.

[0040] Designed for cross-browser compatibility, it is developed based on the WebExtensions API standard and supports mainstream browsers such as Chrome and Firefox, exhibiting excellent cross-platform compatibility.

[0041] Browser plugin (Tampermonkey): Metadata parser: Responsible for parsing the metadata in the script header (such as @match, @grant, @require) to determine the injection page, required permissions, and external dependencies of the script.

[0042] Content script: The core logic carrier of the script is injected into the matching work ticket system page, interacts with the page DOM (Document Object Model) but runs in an independent sandbox environment.

[0043] Permission Gateway: Acts as a bridge between scripts and browser-specific APIs (such as GM_setValue, GM_notification), the permissions declared by scripts via @grant are managed by this gateway.

[0044] Validation Engine: This is the core of the architecture, containing four working sub-modules: Page monitoring module: Uses MutationObserver API or timer polling to dynamically monitor the loading and changes of DOM (Document Object Model) elements in the work ticket form, ensuring that the input boxes and drop-down menu elements that need to be validated can be accurately captured.

[0045] The rules engine module is the core of the validation logic. It maintains a configurable library of validation rules (such as normative validation: required fields, format; logical validation: time sequence, personnel conflicts) and executes these rules. Rules can be abstracted as standalone JavaScript functions or configuration objects and support dynamic updates.

[0046] User interaction module: responsible for displaying validation error information on the page in a non-intrusive manner (such as dynamically inserting prompt elements next to fields), and can call the GM_notification API for more eye-catching desktop notifications.

[0047] Submission interception module: Listens for form submission events or submit button click events. Triggers a full validation before final submission; if errors are found, it prevents form submission and displays a summary of all issues.

[0048] Data and Dependencies: DOM element acquisition and state monitoring: This refers to the structured document object model of the page itself, which is the source of validation data and the target of monitoring.

[0049] Verification rule base: Stores all specific verification rules and logic, and is the "knowledge base" for the operation of the rule engine module.

[0050] Error message and notification system: This refers to the mechanisms provided by browsers for user feedback, including DOM manipulation and browser notification APIs.

[0051] Brief description of data flow: Initialization: The plugin injects the content script into the work ticket page according to the @match rule. The metadata parser is configured with permissions and dependencies (such as day.js).

[0052] Listening and capturing: The page listening module starts working, waiting for and locating form elements.

[0053] Validation trigger: The validation engine is triggered when the user fills in the form (such as during input or blur events) or when finally submitting the form.

[0054] Rule execution: The rule engine module validates the corresponding fields or the logic between fields based on the predefined rule library.

[0055] Results Feedback: The user interaction module will display the validation results (error messages) to the user. If validation fails during the submission phase, the submission interception module will prevent the form from being submitted.

[0056] Data persistence and notifications: Through the permission gateway, scripts may need to store data (such as verifying configurations) or send desktop notifications.

[0057] This architecture enhances the automated verification capabilities of the existing work ticket system in a non-intrusive manner through browser plugin technology. Each module has a clear responsibility and works collaboratively to achieve real-time and standardized ticket filling assistance.

[0058] The specific embodiments provided in this invention comprehensively cover a complete implementation scheme from basic verification to advanced functions. The examples are arranged according to the construction steps, ranging from simple required field verification to complex comprehensive verification systems, and from basic event binding to advanced performance optimization and security mechanisms, forming a complete technical solution system.

[0059] This invention reduces the single-ticket review time from 25 minutes of traditional manual review to seconds, significantly improving efficiency. It can process 32 work tickets simultaneously, completing automatic verification in just 5 minutes. Real-time verification during the filling process avoids rework after submission. Through a dual verification system, the accuracy of ticket issue identification is improved, and it supports complex business logic verification, such as ensuring the work start time is earlier than the end time and that the operator cannot be the person in charge of the work, reducing human error. At the same time, it uses the MutationObserver API to replace the traditional polling method, reducing performance loss. Basic rule verification, complex function verification, and asynchronous backend verification avoid unnecessary calculations and backend calls. Based on the WebExtensions API standard, it supports mainstream browsers such as Chrome and Firefox.

[0060] The specific implementation of this embodiment includes the following: Step 1: Environment Preparation and Project Initialization Create a user script file: Create a new text file and change its file extension to .user.js, for example, ticket-validator.user.js.

[0061] Write the script metadata header: The .user.js file must begin with a Tampermonkey-recognizable metadata block. This part is crucial, as it defines the script's runtime environment, permissions, and dependencies.

[0062] / / ==UserScript== / / @name Work Ticket / Operation Ticket Automatic Verification System / / @namespace http: / / www.your-company.com / / / @version 1.0.0 / / @description Automatically validates the standardization and logic of work orders and operation tickets, intercepts submissions, and prompts errors.

[0063] / / @author YourName / / @match https: / / your-ticket-system-domain.com / ticket-create.html / / @match https: / / your-ticket-system-domain.com / ticket-review.html / / @grant GM_notification / / @grant GM_setValue / / @grant GM_getValue / / @require https: / / cdnjs.cloudflare.com / ajax / libs / dayjs / 1.11.9 / dayjs.min.js / / == / UserScript==

[0064] Key points:

[0065] @match: This is the most crucial setting. It must exactly match the URL of your bureau's ticketing system. Wildcards (*) can be used, for example, https: / / your-ticket-system.com / *ticket*. The script will only run on matching pages.

[0066] @grant: Declare special APIs that the script needs to use, such as sending notifications (GM_notification) and storing data (GM_setValue / GM_getValue).

[0067] @require: Optional. If you need to handle complex date logic, you can use a third-party library such as day.js to simplify the process.

[0068] Step 2: Development of Core Functional Modules The logic of the entire script can be broken down into the following modules: 1. Page element listening and acquisition module Technical solution: Use the MutationObserver API or setInterval for polling to ensure that the input fields, drop-down menus, and date / time picker DOM elements of the work ticket form can be accurately located after the page is dynamically loaded.

[0069] Key technical points: Waiting for the page to load: The script must wait for the DOM element containing the ticket information to finish loading before executing. This can be done by wrapping the code in `window.addEventListener('DOMContentLoaded', function() { ...})` or by using `MutationObserver` to listen for changes to the parent node.

[0070] Element selection: Use the `document.querySelector` and `document.getElementById` methods to locate form fields. Careful analysis of the target page's HTML structure is required to find the unique selector corresponding to each field (such as ID, Class Name, Data Attribute).

[0071] Example code: function waitForElement(selector, callback) { if (document.querySelector(selector)) { callback(document.querySelector(selector)); } else { const observer = new MutationObserver(() => { if (document.querySelector(selector)) { observer.disconnect(); callback(document.querySelector(selector)); } }); observer.observe(document.body, { childList: true, subtree: true}); } } / / Waiting for and retrieving the "Work Supervisor" input box waitForElement('#work_principal', function(field) { / / Set an event listener for this field, such as onblur (to validate when focus is lost). field.addEventListener('blur', function() { validateField('work_principal', this.value); }); }).

[0072] 2. Validation rule engine module (core) Technical solution: Abstract the validation rules into independent JavaScript functions or configuration objects. Rules can be divided into two categories: Standardization checks: Check whether fields are required, whether the format is correct, and whether the date is reasonable.

[0073] Logical validation: Check the logical relationships between multiple fields (e.g., "Work start time" must be earlier than "Work end time", "Operator" cannot be "Work supervisor").

[0074] Key technical points: Rule definition: Use an object or array to centrally manage all rules, which facilitates maintenance and expansion.

[0075] Configurability: You can consider storing rules in Tampermonkey's storage (GM_setValue / GM_getValue), or even loading them from a remote server, to achieve hot updates of rules without modifying the script itself.

[0076] Example code (rule definition and execution): const validationRules = { 'work_principal': [ { type: 'required', Message: 'The person in charge of the task cannot be empty' validate: (value) => value && value.trim() !== '' }, ], 'start_time': [ { type: 'logic', Message: 'Start time must be earlier than end time' validate: (value) => { const endTime = document.querySelector('#end_time').value; return dayjs(value).isBefore(dayjs(endTime)); }, / / This rule relies on the end_time field, so validation needs to be triggered when it changes. dependencies: ['end_time'] } ] }; function validateField(fieldName, value) { const rules = validationRules[fieldName]; const errors = []; if (rules) { rules.forEach(rule => { if (!rule.validate(value)) { errors.push(rule.message); } }); } return errors; / / Returns an array of error messages for this field. }

[0077] 3. User Interaction and Prompt Module Technical solution: Dynamically insert error messages next to input fields or at the top of the page. Use Tampermonkey's GM_notification API for more prominent desktop notifications.

[0078] Key technical points: Non-intrusive hints: Insert near form fields Use the element to display the error and set the font style to red.

[0079] Real-time feedback: Trigger validation in the field's input or blur event to provide immediate feedback.

[0080] 4. Submit the interception module

[0081] Technical solution: Rewrite the click event listener of the submit button on the original page, or intercept the submit event of the form.

[0082] Key technical points:

[0083] Full validation: When the user clicks the "Submit" or "Report" button, all fields are traversed and a full validation is performed.

[0084] Prevent default behavior: If validation fails, call event.preventDefault() to prevent form submission and display all error messages in one place.

[0085] Example code: document.querySelector('#submit-btn').addEventListener('click',function(event) { event.preventDefault(); / / Prevent default commit first const allErrors = performFullValidation(); / / Perform full validation if (allErrors.length === 0) { / / If there are no errors, manually trigger the original commit logic. document.querySelector('form').submit(); } else { / / Otherwise, display all errors showSummaryErrors(allErrors); / / Send a desktop notification GM_notification({ text: `${allErrors.length} errors were found. Please correct them and submit again!`, title: 'Invoice verification failed' timeout: 5000 }); } });

[0086] Step 3: Testing and Deployment test:

[0087] Add the pre-created .user.js script directly to the Tampermonkey management panel.

[0088] Conduct comprehensive testing in the target work ticket system: fill in correct tickets and various incorrect tickets to ensure that the rules are triggered correctly, the prompts are accurate, and the submissions are effectively blocked.

[0089] The focus is on testing page compatibility to ensure that the script can still run stably after minor adjustments to the page structure.

[0090] deploy: Internal deployment: Place the final .user.js script file on an internal file server or shared directory. Notify users to access the file via a link, and Tampermonkey will automatically prompt for installation.

[0091] Centralized Management (Advanced): You can write a simple installation script to guide users through the installation process, or automatically update the script using Tampermonkey's @updateURL metadata.

[0092] The terminology used in this implementation includes: 1. Browser Extension:

[0093] These are browser extensions developed based on the WebExtensions API standard. They can extend browser functionality by injecting custom scripts when a user visits a specific webpage, enabling functions such as page content modification, data collection, and automated operations.

[0094] 2. Manifest V3: The third version of the browser plugin manifest file standard, compared to version V2, mainly includes the following improvements: using Service Workers to replace the backend page, enhancing security and performance; restricting remote code execution; and improving the permission model.

[0095] 3. Service Worker: JavaScript scripts that run in the browser background, independent of the webpage, can intercept and process network requests, cache resources, and receive push messages. In plugins, they are used to handle lifecycle events and message communication.

[0096] 4. Content Script: JavaScript injected into a target webpage shares the DOM with the page but runs in an independent execution environment. It can access and modify the page content, but cannot access the page's JavaScript variables and functions.

[0097] 5. DOM (Document Object Model): The Document Object Model (DOM) is a programming interface for HTML and XML documents. It represents a document as a tree of nodes, where each node represents a part of the document. JavaScript can be used to manipulate the DOM to change the document's structure, style, and content.

[0098] 6. Normative verification: Check the basic rules for field requirements, format correctness, and length limits, such as checking email and phone number formats.

[0099] 7. Logical verification: Verify the logical relationships between multiple fields, such as checking if the start time is earlier than the end time and ensuring that the operator is not the person in charge of the work.

[0100] 8. Asynchronous verification: Validation performed asynchronously (such as by calling a backend API) will not block page rendering while waiting for the validation result.

[0101] 9. Asynchronous execution: Non-blocking execution allows other tasks to continue while waiting for I / O operations (such as network requests) to complete, improving page response performance.

[0102] 10. Event-driven: A programming paradigm in which the execution flow of a program is determined by events (such as user actions or network responses) rather than by a predetermined order.

[0103] 11. Access Control: Browser plugins need to request specific permissions from users (such as accessing specific websites or storing data), and users can only use the corresponding functions after they agree.

[0104] 12. Data Encryption: Converting data into an unreadable format to prevent unauthorized access is a common encryption method, including Base64 encoding and AES encryption.

[0105] 13. Responsive Design: A web design method that enables web pages to automatically adjust their layout and style according to the device screen size, providing a good user experience.

[0106] 14. Offline support: The application can still run normally without a network connection, storing data locally and synchronizing it to the server once the network is restored.

[0107] 15. Regular Expressions: Expressions used to match string patterns are often used to validate string formats and extract specific content.

[0108] 16. JSON (JavaScript Object Notation): A lightweight data exchange format that is easy to read and write, and also easy for machines to parse and generate.

[0109] 17. Base64 encoding: An encoding method that converts binary data into ASCII strings, often used to transmit binary data in text environments.

[0110] The foregoing description illustrates and describes several preferred embodiments of this application. However, as previously stated, it should be understood that this application is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. It can be used in various other combinations, modifications, and environments, and can be altered within the scope of the inventive concept described herein through the foregoing teachings or techniques or knowledge in related fields. Any modifications and variations made by those skilled in the art that do not depart from the spirit and scope of this application should be within the protection scope of the appended claims.

Claims

1. An automatic verification method for work tickets and operation tickets based on browser plugins, characterized in that: Including browser plugin infrastructure; Based on a browser plugin infrastructure, the content of the two tickets is automatically verified. The browser plugin infrastructure includes manifest configuration files, service worker scripts, content scripts, and pop-up pages; The manifest configuration file is used as the entry file for the plugin, defining basic information such as plugin name, version, permissions, and script file path. The service worker script is a script that runs in the background of the browser. It is responsible for handling plugin lifecycle events, message communication, and data storage. It adopts an event-driven model, activating when needed and terminating when idle. The content script is a script injected into the target webpage. It is responsible for listening to changes in the page's document object model, locating form elements, and executing validation logic. It shares the document object model with the page but operates in an independent environment. The pop-up page is an interactive interface displayed when the user clicks the plugin icon. It displays the verification results and configuration options, and is loaded on demand without occupying resident memory.

2. The automatic verification method for work tickets and operation tickets based on browser plugins according to claim 1, characterized in that, The content script includes page monitoring and element location; the page monitoring and element location locates form elements after the page is dynamically loaded by monitoring changes in the document object model tree in real time.

3. The automatic verification method for work tickets and operation tickets based on browser plugins according to claim 2, characterized in that, The page monitoring and element location includes an element location strategy; the element location strategy obtains a unique selector by locating the input boxes, drop-down menus, date pickers, and document object model elements of the work order form and analyzing the hypertext markup language structure.

4. The automatic verification method for work tickets and operation tickets based on browser plugins according to claim 1, characterized in that, The browser plugin infrastructure also includes validation rule management; the validation rule management is used for standardization validation, checking basic rules for field mandatory fields, correct format, and reasonable date, and is implemented using configurable functions or configuration objects.

5. The automatic verification method for work tickets and operation tickets based on browser plugins according to claim 4, characterized in that, The verification rule management also includes logical verification and rule configuration; The logical validation is used to verify the logical relationship between multiple fields, and to implement complex business rules such as the start time of the work must be earlier than the end time and the operator cannot be the person in charge of the work. The rule configuration allows for dynamic loading and updating of validation rules, enabling adaptation to policy changes without code modification.

6. The automatic verification method for work tickets and operation tickets based on browser plugins according to claim 5, characterized in that, The verification rule management includes a verification execution engine; The validation execution engine is used for the event triggering mechanism to automatically trigger validation in the events of form fields and provide immediate feedback.

7. The automatic verification method for work tickets and operation tickets based on browser plugins according to claim 6, characterized in that, The verification execution engine also includes a hierarchical verification strategy and real-time verification features; The layered verification strategy adopts a layered mechanism of basic rule verification, complex function verification, and asynchronous backend verification to avoid unnecessary calculations and backend calls. The real-time verification feature is used to shorten user waiting time, and multi-dimensional verification of values ​​and formats ensures comprehensive verification.

8. The automatic verification method for work tickets and operation tickets based on browser plugins according to claim 1, characterized in that, The browser plugin infrastructure also includes user interaction and prompts; The user interaction and prompts are used for non-intrusive prompts, dynamically inserting error message information during the filling process, and adopting a friendly feedback mechanism to improve the user experience; as well as error location and display, accurately locating the error location and prompting the error content, supporting the categorized display of error information and manual refresh verification.

9. The automatic verification method for work tickets and operation tickets based on browser plugins according to claim 1, characterized in that, The browser plugin infrastructure also includes data storage and communication; the data storage and communication uses storage provided by the browser for data persistence.

10. A method for automatic verification of work tickets and operation tickets based on browser plugins, characterized in that: The browser plugin infrastructure works collaboratively with the work ticket page by injecting content scripts.