An AI agent-based power transaction market automatic transaction quotation method

CN122779944APending Publication Date: 2026-09-18HUANENG LANCANG RIVER HYDROPOWER CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610653909.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-13
Publication Date
2026-09-18

AI Technical Summary

Technical Problem

[0004]针对现有技术的不足,本发明提供了一种基于AI智能体电力交易市场自动交易报价方法,解决了现有技术中电力交易自动报价工具因数据核对与业务校验机制缺失导致错误数据被提交,以及异常处理能力不足导致系统运行中断的技术问题

Benefits of technology

1、本发明通过提取本地待上传模板文件的文件名特征及内部标识字段,结合底层页面元素与视觉呈现文本执行预校验计算。当所有的校验条件处于匹配状态时,触发文件上传操作。该机制在网络传输发生前对业务实体的身份标识与交易参数进行核对,减少因文件上传错误或参数不匹配产生的申报数据异常情况。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122779944A_ABST
    Figure CN122779944A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of power transaction, and discloses an AI agent-based power transaction market automatic transaction pricing method, which comprises the following steps: receiving a trigger signal, accessing a transaction platform to complete login and navigating to an electricity declaration interface; extracting target parameters and filling input components; extracting the file name features and internal identification fields of a template file to be uploaded, comparing the target parameters selected from the page, executing file uploading and triggering system temporary storage when matching; reading temporary storage data, extracting original data to establish a control benchmark, calculating data deviation, and verifying whether the captured data meets the boundary constraint of the business rule; calling a submission function to end declaration when the data deviation is within a threshold value and the boundary constraint is met; otherwise, terminating the process, capturing an abnormal page view to generate a difference log and transmitting the difference log; and entering a safe exit and resource recycling stage after the task is completed. Through data information pre-comparison and compliance checking, the application reduces the transaction blocking risk caused by parameter mismatch.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power trading technology, specifically to an automatic trading quotation method for power trading markets based on AI intelligent agents. Background Technology

[0002] With the implementation of electricity market trading mechanisms, power generation companies need to regularly submit electricity volume and price declarations on the electricity trading platform. Currently, the bidding process mainly involves business personnel manually logging into the platform, manually verifying power plant parameters and trading times, and then uploading locally prepared quotation template files to the system. This manual submission method is labor-intensive when processing report data from multiple time periods, and there is a risk of information entry errors in parameter selection or file upload. Once an incorrect file is uploaded or a non-compliant electricity price is submitted, it is usually not discovered until the end of the declaration process, leading to transaction disruptions or compliance review issues.

[0003] To reduce the burden of manual operations, some enterprises have introduced basic scripting tools to simulate web page clicks and form filling. However, in practical applications, traditional scripting tools rely on fixed page structures and coordinates, making them ill-suited to platform webpage front-end updates and network loading delays, and prone to interruptions due to node positioning failures. Simultaneously, these tools have shortcomings in data verification; they cannot cross-validate the identity identifiers within local files with the selection parameters of the current page before file upload, making it difficult to intercept upload errors before file transfer. During the platform's temporary data storage phase, existing tools cannot automatically extract the data displayed on the platform and establish a benchmark for comparison and calculation with the local original files. They also lack verification mechanisms that incorporate actual business rules such as unit assembly capacity and electricity price limits, posing a risk of submitting erroneous data to the trading center. Furthermore, when data deviations or page anomalies occur during operation, conventional tools may experience process suspension or blocking, lacking mechanisms for capturing abnormal views, tiered alerts, and mandatory process resource reclamation at the underlying level. This results in the automated program being unable to clean up its operating environment after a failure, affecting the execution of tasks in subsequent cycles and increasing the maintenance costs of manual troubleshooting. Summary of the Invention

[0004] To address the shortcomings of existing technologies, this invention provides an AI-based automatic trading quotation method for the power trading market. This method solves the technical problems in existing power trading automatic quotation tools, such as the lack of data verification and business validation mechanisms leading to the submission of erroneous data, and insufficient anomaly handling capabilities causing system operation interruptions.

[0005] To achieve the above objectives, the present invention provides the following technical solution:

[0006] This invention provides an automated trading quotation method for the power trading market based on AI intelligent agents, comprising the following steps: Upon receiving the trigger signal, access the power trading platform and complete system authentication login, then navigate the page to the power declaration function interface; Extract the target power plant name and target transaction date, and fill in the corresponding selection items in the input component of the electricity declaration function interface; Extract the filename features and internal identifier fields of the local template file to be uploaded, and compare the filename features and internal identifier fields with the currently selected target power plant name and target transaction date on the page; When the judgment result is a match, the file upload operation is executed, and the system's temporary storage function is triggered; Read the system's temporary data, extract the original file data to establish a benchmark, calculate the data deviation of the corresponding fields, and call the built-in business rules to verify whether the captured data meets the boundary constraints. When the data deviation is within the threshold range and the boundary constraints are met, the commit function is called to end the transaction declaration. When the data deviation exceeds the threshold range or violates the boundary constraints, the submission process is terminated, the current abnormal page view is captured, a data difference log is generated, and it is transmitted through the interface. After the task is completed, the system enters the safe exit and system resource reclamation phase.

[0007] In its implementation, this invention includes anti-interception and dynamic element location processes. When logging into the power trading platform, the system parses the document object model structure of the login interface and extracts the location path of the input box node. To counter fixed-frequency security interception, the system splits the plaintext identity credentials into single-character sequences and calculates and inserts random delay variables between the injection actions of adjacent characters, generating a text input delay.

[0008] In the page navigation phase, to address the technical problem of absolute coordinate positioning failure caused by different resolutions or viewport scaling ratios, this invention obtains the position attributes of candidate element nodes in the current viewport and calculates the center point coordinates. It then combines this with a partial screen image cropped from the node size for optical character recognition. The system subsequently performs string comparison between the extracted displayed text and the preset target menu text, converting the edit distance into a similarity score using a normalization algorithm. When the similarity score reaches a preset target matching threshold, the element is confirmed as the target navigation node, and the interaction command is executed, completing the dynamic page navigation.

[0009] During the transaction data preparation and form filling phases, the system performs character cleaning on the extracted target power plant names and target transaction dates, using regular expressions to remove invisible control characters and redundant whitespace. When processing dropdown selection components, the system uses the cleaned text as keywords to trigger a filtering mechanism, comparing and matching generated node state variables to lock onto the target option. For time controls with input restrictions, the system forcibly removes the read-only attribute identifier through underlying document object model operations, injects the converted standard time string, and dispatches value change and defocus events to the underlying layer to complete the assignment of values ​​to the form components.

[0010] This invention establishes a pre-verification mechanism before file upload to intercept incoming files with erroneous submissions. The first pre-verification parses entity information from the file path and compares it with target information in runtime memory; The second pre-verification verifies the file's inherent attributes by addressing the cells containing identity identifiers such as the unified social credit code within the file using a memory stream object. The third pre-validation step involves capturing a partial image of the form control area, extracting the text from the image, and cross-validating it with the text read from the underlying page's document object model node. Based on the results of these three calculations, a comprehensive release status variable is generated to control the injection of the underlying data stream for file upload, ensuring consistency between the declaration environment and the uploaded file.

[0011] In the data verification stage, this invention employs a data verification technique combining physical boundary reconstruction and fuzzy fault-tolerant comparison. The system extracts and maps local template files row-by-row into a source data dictionary set. Simultaneously, it calls a pre-configured optical character recognition model to perform table physical boundary reconstruction and text extraction on screenshot images, generating a target data dictionary set. The system extracts transaction date, power plant code, and transaction type to construct string combination keys, performs horizontal merging of feature records based on hash operations, and generates a physical alignment result set to calculate the data alignment rate. In deviation calculation, for numerical fields, the system calculates the absolute deviation value between the source data and the target data and compares it with a preset numerical tolerance threshold. For text fields, after performing half-width character conversion and removing invisible characters, the system calculates the Levenstein distance between the source and target text strings and compares it with a text error tolerance threshold. This error tolerance comparison principle filters out abnormal data caused by formatting differences or character conversions.

[0012] In addition to data consistency verification, the system invokes built-in business rules to perform compliance verification. Based on the extracted transaction electricity price field value, the system compares whether it falls within the upper and lower threshold range defined in the rule configuration tree. Simultaneously, based on the grouping and aggregation operations of structured query language, the system calculates the cumulative electricity declared by a single business entity for the day and compares this cumulative value with the product of the unit's rated installed capacity and the total number of trading hours throughout the day. The calculation result of the compliance status variable serves as the final boundary constraint condition for the submission process to proceed.

[0013] When data deviation or boundary constraint violation is detected, the system generates a decision output status value through logical combination judgment, suspends the active main thread, and renders a modal blocking dialog box to preserve the on-site view. The system quantifies the alarm level according to the number of abnormal records in the difference mapping table, and triggers local visual warnings, email pushes, or external network hook message transmissions based on the level.

[0014] Upon task completion, the system extracts the runtime data, serializes it into a log file, and applies a secure hash algorithm to generate a hexadecimal hash value, which is then appended to the header to form a digital fingerprint to prevent tampering. After clearing the cache and credentials, the system calculates the resource release rate and sends a forced termination signal to the resident process via the operating system kernel application programming interface, destroying memory pointers and handles to avoid excessive system resource consumption caused by long-term automated operation.

[0015] This invention provides an automated trading quotation method for the power trading market based on AI intelligent agents. It has the following beneficial effects: 1. This invention extracts the filename features and internal identifier fields of the template file to be uploaded from the local machine, and performs pre-verification calculations in conjunction with underlying page elements and visually presented text. When all verification conditions match, the file upload operation is triggered. This mechanism verifies the identity of the business entity and transaction parameters before network transmission, reducing anomalies in declared data caused by file upload errors or parameter mismatches.

[0016] 2. This invention constructs an alignment result set by integrating original file data with system-temporarily stored data. For different types of data fields, it uses absolute deviation values ​​and Lewinstein distances to compare and determine numerical and textual features, respectively. Based on the comparison, it utilizes built-in business rules such as the installed capacity of the generator set and the upper and lower limits of the transaction electricity price to verify boundary constraints. This ensures that the temporarily stored data on the platform undergoes data consistency and compliance checks before the submission command is executed, reducing the risk of transaction blocking caused by non-compliant parameters.

[0017] 3. This invention calculates the alarm level based on the number of abnormal records in the difference mapping table during the abnormal process, and executes the corresponding alarm policy through local pop-ups, email pushes, or network hook messages; during the task exit phase, it calculates the resource release rate, and uses the operating system's process management interface to destroy unresponsive processes and underlying resources when an anomaly is determined. The abnormal alarm mechanism and resource forced reclamation process reduce the probability of system suspension in abnormal states and maintain the operational stability of the automated agent program in subsequent execution cycles. Attached Figure Description

[0018] Figure 1 This is a schematic diagram of the system architecture of the present invention; Figure 2 This is a schematic diagram of the method flow of the present invention; Figure 3 This is a comparison chart of the anti-machine behavior interception and evasion effects of the present invention; Figure 4 This is a comparison chart of the accuracy of dynamic environment UI element recognition in this invention; Figure 5 This is a comparison chart of the data verification effect under the dirty data environment of the present invention. Detailed Implementation

[0019] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] Please see the appendix Figure 1 This invention provides an AI-based automatic trading quotation system for the power trading market, comprising: The perception operation module is used to identify page interface elements of the power trading market platform and perform input and click operations.

[0021] The data preparation module is used to read the power trading plan document, extract relevant fields, and perform component positioning and content filling on the page through the perception operation module.

[0022] The upload pre-verification module is used to compare the attributes of the local template file to be uploaded with the target entity information on the system page before the file is uploaded.

[0023] The data verification module is used to obtain the original source data and the target data in the system's temporary preview page, and perform a consistency matching calculation item by item.

[0024] The decision alarm module is used to control the system to trigger the transaction submission interface or generate a difference report based on the consistency result status variables output by the data verification module.

[0025] Please see the appendix Figure 2 This invention provides an automatic trading quotation method for the power trading market based on AI intelligent agents, comprising the following steps: S1, the sensing operation module receives the trigger signal, accesses the power trading platform and completes system authentication login, and navigates the page to the power declaration function interface; S2, the data preparation module parses the power trading plan file, extracts the target power plant name field and the transaction date field, and controls the perception operation module to fill in the corresponding selection items in the input component of the application function interface; S3, before performing the file upload action, the upload pre-verification module extracts the file name characteristics and internal identifier fields of the local template file to be uploaded, and compares them with the parameters of the target power plant currently selected on the page; S4, when the judgment result is a matching state, the upload pre-verification module performs the file upload operation and triggers the system temporary storage function after confirming successful reception; S5, the data verification module reads the system's temporary data, extracts the original file data to establish a comparison benchmark, calculates the data deviation of the corresponding fields, and calls the built-in business rules to verify whether the captured data meets the boundary constraints; S6, the decision alarm module receives the deviation calculation result and constraint verification result. When the data deviation is within the threshold range and the constraint conditions are met, the submit function is called to end the transaction declaration. S7, when the data deviation exceeds the threshold range or violates the constraints, the decision alarm module terminates the submission process, captures the current abnormal page view, generates a data difference log and transmits it through the interface; S8, after the task is completed, the perception operation module calls the logout interface to exit the current account's operating environment.

[0026] The specific execution logic of the sensing operation module of this invention when executing trigger control and adaptive login mechanism is as follows: The sensing operation module listens for operating system clock signals or system events at the target file storage path. Internally, the module has a time scheduler and an event listener. The time scheduler matches time thresholds based on preset Cron expressions, while the event listener monitors file write operations in a specified directory. Time thresholds are written to the system by business personnel using a configuration file based on the opening times of the electricity trading market. When the clock signal reaches the preset time threshold, or the event listener detects a new electricity trading plan file write event, the sensing operation module generates a system activation command. This command includes a trigger type identifier and target platform configuration parameters.

[0027] The perception and operation module receives the system activation command, calls the underlying browser automation control interface to initialize a browser instance, and loads the power trading platform address into that instance. The browser automation control interface acts as a communication bridge between the code and the browser, responsible for translating code-level commands into native browser behavior. The perception and operation module continuously monitors the network request status, and once it determines that the page document object model has been completed and key resources have been loaded, it proceeds to the subsequent authentication process.

[0028] The perception operation module sends a credential retrieval request to the local or remote security credential management component to extract the user authentication data in ciphertext state. For the encryption and decryption process of the ciphertext data, those skilled in the art can use standard symmetric or asymmetric encryption algorithms for key management and data decryption to obtain the plaintext username and password. The specific encryption and decryption mechanisms are well-known technologies in this field and will not be elaborated upon here.

[0029] The perception module parses the document object model structure of the login interface, extracting the node location paths of the username input field, password input field, and login confirmation button by traversing node attribute features. The node location paths are represented as XPath paths or CSS selector strings. The perception module then verifies the visibility and interactivity of the extracted nodes using the visual coordinate system mapping. This verification process determines whether the target element is being rendered in the current browser window and is not obscured by other overlays, thus preventing interactive actions from failing.

[0030] The perception operation module calls the input simulation interface to split the username and password in plaintext into single-character sequences, which are then injected sequentially into the corresponding input box nodes. When injecting character sequences into the input boxes, the perception operation module calculates and inserts random delay variables between the input actions of adjacent characters. Let the character sequence to be input be... ,in The total length of the characters. For the first character in the character sequence One character, For the first character in the character sequence One character. Adjacent characters and Input time interval The calculation method is as follows: ; in, The basic input delay constant is set between 50 milliseconds and 150 milliseconds based on the normal typing speed of humans. This is the delay fluctuation coefficient constant, with a value range of 10 milliseconds to 30 milliseconds; The input time interval is a random variable generated by a random number generator that follows a standard normal distribution. By superimposing random delays that follow a statistical distribution, the sensing operation module transforms the input time interval into a non-linear sequence, thereby simulating the rhythmic differences of human keyboard typing and circumventing the platform's security gateway's machine behavior interception mechanism based on fixed input frequency characteristics.

[0031] After the user authentication data is entered, the perception module extracts the screen coordinates of the center point of the login confirmation button, triggering a left-click event at the system level. The perception module then suspends its current execution thread, listening for platform network response messages and page route redirection events. Suspending the current execution thread ensures the backend server returns the authentication result and the frontend page is rendered asynchronously, preventing errors from occurring during subsequent node lookups before the page is ready. When the page's Uniform Resource Locator (URL) is detected to have changed to the platform's homepage address, the system's adaptive login operation is considered successful.

[0032] The specific execution logic of the perception operation module of this invention when performing UI element recognition and dynamic routing navigation based on machine vision is as follows: After the platform homepage loads, the perception module obtains the document object model (DOM) tree structure of the current page. It then extracts a set of candidate interactive elements from the DOM tree, including hyperlinks, buttons, and menu labels. Because the power trading platform may use a responsive layout, the layout of components within the page may reflow and redraw as the browser window size changes, causing absolute screen coordinates to become invalid. By parsing the underlying node code structure of the webpage to extract candidate targets, and combining this with machine vision technology for content confirmation, the underlying principle is to avoid click misalignment caused by simply relying on fixed absolute screen coordinates when dealing with different resolution devices or browser window scaling.

[0033] For any candidate element node in the set of candidate interactive elements, the perception module calls the browser's underlying bounding rectangle calculation interface to obtain the element's position attributes in the current viewport. These position attributes specifically include the top-left x-coordinate, top-left y-coordinate, width, and height of the candidate element node.

[0034] The perception module calculates the center coordinates of the candidate element node based on the acquired position attributes, which serve as the anchor point for subsequent visual sampling and mouse interaction. and the y-coordinate of the center point of the candidate element node The calculation formula is as follows: ; ; in, The x-coordinate of the center point of the candidate element node; The ordinate of the center point of the candidate element node; The x-coordinate of the top-left corner of the candidate element node; The top-left y-coordinate of the candidate element node; The width of the candidate element node; The height of the candidate element node.

[0035] The perception operation module uses the calculated x-coordinate of the center point of the candidate element node. and the y-coordinate of the center point of the candidate element node Based on the width of the candidate element node... and the height of candidate element nodes A partial screen image of the candidate element node is captured. The perception operation module inputs the partial screen image into the configured optical character recognition model to extract the displayed text contained in the partial screen image. For the image preprocessing and text feature extraction logic of the optical character recognition model, those skilled in the art can use convolutional neural networks to extract image features and combine them with recurrent neural networks for sequence decoding. Its image text recognition processing is a well-known technology in this field and will not be described in detail here.

[0036] The perception operation module performs a string comparison between the extracted display text and the target menu text defined in the business configuration file. The module calculates the edit distance between the display text and the target menu text and uses a normalization algorithm to convert the edit distance into a similarity score. (Similarity score) The calculation formula is as follows: ; in, A similarity score; To display the editing distance between the text and the target menu text; The maximum of the character length of the displayed text and the character length of the target menu text. Target matching threshold. The value range is set by system maintenance personnel between 0.85 and 1.0 based on the tolerance for text rendering truncation or blurring. When the similarity score... At that time, the perception operation module determines that the current candidate element node is the target navigation node.

[0037] After identifying the target navigation node, the perception and operation module generates a system-level mouse movement and click event sequence. The perception and operation module then moves the virtual mouse pointer to the x-coordinate of the center point of the candidate element node. and the y-coordinate of the center point of the candidate element node Location. For complex hierarchical structures containing multi-level submenus, the perception and operation module issues a mouse hover event command before triggering a click action. The mouse hover event triggers the loading and rendering of hidden document object model nodes in the page to the visible area. The perception and operation module waits for the rendering to complete before repeating the coordinate calculation and text matching operations on the expanded submenu nodes. When the bottom-level target navigation node is reached, the perception and operation module issues left mouse button press and release commands.

[0038] After the command is issued, the perception module listens for the browser's route state change event. The route state change event is used to indicate the navigation status of the page's Uniform Resource Locator (URL) or the mounting and replacement status of asynchronous components within the page without page refresh. When the perception module reads the route change completion status code returned by the browser, and the document title attribute of the new page matches the identifier of the target business page, the navigation process of the current level is completed. If the system has a multi-level nested menu structure, the perception module repeatedly executes the above element parsing, similarity calculation, and click steps until the page navigates to the final power consumption reporting function interface.

[0039] The data preparation module and the perception operation module of this invention perform the following specific logic when parsing the business plan document and simulating selection on the web page: The data preparation module retrieves the power trading plan file stored in a specified local directory or business storage path. The power trading plan file is typically in spreadsheet format. The data preparation module uses an underlying spreadsheet parsing library to load the binary data stream of this file and convert it into an in-memory object model structure. The data preparation module extracts configuration parameters, provided by the configuration file during system deployment, which specify the worksheet name or index number where the power trading plan file is located. The data preparation module then locates the target worksheet containing the transaction records based on the configuration parameters. For the underlying binary parsing logic of the spreadsheet, those skilled in the art can use existing open-source spreadsheet parsing libraries to implement the conversion of the data stream to an object model; the specific implementation methods are well-known in the field and will not be elaborated upon here.

[0040] The data preparation module iterates through the header row data of the target worksheet, locating the column indices containing the power plant name and transaction date through string matching. Based on the obtained column indices, the module then traverses down the data rows, extracting the content of the corresponding cells. To eliminate formatting inconsistencies caused by human input, the module performs character cleaning on the extracted content, using regular expressions to remove leading and trailing spaces, newlines, and invisible control characters. Humans often mistakenly input full-width spaces or invisible zero-width characters when entering business data. These characters are visually difficult to detect, but they have independent character encodings in memory storage; retaining these characters will cause subsequent accurate string matching to fail.

[0041] After character cleaning is complete, the data preparation module passes the cleaned power plant names to the perception and operation module. The perception and operation module locates the dropdown selection component responsible for receiving power plant names on the electricity declaration interface using the node positioning path. The perception and operation module then issues a simulated left-click command to this dropdown selection component. This command triggers a redraw of the document object model on the surface page, rendering the expanded dropdown option list layer in the viewport.

[0042] Considering that some business systems use virtual list technology or have pagination mechanisms in their dropdown option lists, when the number of options is large, the underlying document object model only renders nodes in the currently visible area. Before traversing the nodes, the perception operation module uses the cleaned power plant name as the search keyword and directly fills it into the filter input box built into the dropdown selection component. This triggers the platform's backend search interface, ensuring that only the option nodes that meet the requirements are displayed in the dropdown option list layer, thus avoiding query failures caused by the target node not being rendered.

[0043] The perception module iterates through each option node in the dropdown list layer and extracts the text attributes of each option node. Let the name of the cleaned power plant passed by the data preparation module be... The first option in the dropdown list layer The text content of each option node is The perception operation module calculates the matching state variables of the nodes. The calculation formula is as follows: ; in, Match state variables to nodes; The name of the power plant after cleaning; For the drop-down option list layer The text content of each option node. A node matches a state variable if and only if the node matches the state variable. When the value is 1, the perception operation module determines the current number of... Each option node is the target option node. The perception operation module calculates the center coordinates of the target option node in the screen window and triggers a click operation at the center coordinate position to complete the simulated selection process of the power plant name information.

[0044] After completing the simulated selection process for power plant name information, the data preparation module passes the cleaned transaction dates to the perception operation module. Addressing the common keyboard input interception and read-only attribute restrictions in web-based date pickers, the perception operation module calls the browser's native script execution interface to inject a pre-defined script into the current page environment. This script is used to locate the underlying input node of the target date picker in the document object model and forcibly remove the read-only attribute identifier from that underlying input node.

[0045] After removing the read-only attribute identifier from the underlying input node, the perception module converts the cleaned transaction date into the standard time string format required by the page system. The perception module then directly assigns this standard time string format to the internal numeric attribute of the underlying input node. After the assignment is complete, the perception module proactively dispatches a numeric change event and a focus loss event to the underlying input node. Modern front-end pages often adopt a data-driven view architecture. Components in this architecture do not respond to direct modifications to document object model attributes; change signals must be transmitted through the browser's native event channel. The numeric change event and focus loss event are captured by the page's underlying data-driven framework, triggering a two-way binding refresh of the front-end page state, ensuring that the transaction date parameter is correctly recorded by the system backend. This injection method based on modifying underlying document object model attributes avoids the complex page-turning and clicking logic of a calendar panel.

[0046] The upload pre-verification module of this invention performs the following logic when performing file naming rule verification based on regular expression parsing: Before the sensing and operation module dispatches a file upload command to the power trading platform's upload interface, the upload pre-verification module intercepts the execution thread and obtains the local storage absolute path of the power trading plan file to be uploaded. The upload pre-verification module calls the operating system's file system application interface, using the system's default path separator as a base, to extract the filename body and file extension from the absolute path. The upload pre-verification module discards directory hierarchy information and file extensions, retaining only the filename string to eliminate interference from path and format suffixes in subsequent string parsing.

[0047] The upload pre-validation module loads a pre-defined regular expression library to perform feature matching and information extraction on the acquired filename strings. Filenames generated by business personnel in daily operations often include redundant version numbers, timestamps, or remarks. The upload pre-validation module uses pre-compiled regular expression capture groups and prefix / suffix delimiters defined by the company's naming conventions to extract the entity information represented by the file from the filename string. The extracted entity information includes the file's power plant code and the file's transaction date. Considering the differences in date naming habits in actual business operations, the upload pre-validation module is internally configured with regular expression matching templates for various date formats, such as consecutive eight-digit combinations or date strings separated by hyphens. For the underlying matching algorithm and state machine transition logic of the regular expressions, those skilled in the art can use existing nondeterministic or deterministic finite automata models; the specific parsing and matching process is well-known in the field and will not be elaborated upon here.

[0048] The upload pre-verification module extracts the target power plant code and target transaction date obtained during the preliminary parsing preparation phase from the system's runtime memory context. The target power plant code and target transaction date represent the attributes of the actual business entities currently awaiting submission on the power trading platform. Since file names may contain mixed uppercase and lowercase letters during manual input, the upload pre-verification module performs a uniform uppercase conversion on the extracted coded character sequence before comparison to avoid misjudgments due to different letter cases. The upload pre-verification module compares the file's power plant code with the target power plant code, and simultaneously compares the file's transaction date with the target transaction date, performing the first layer of error prevention pre-verification calculation.

[0049] Suppose the file power plant code extracted by the upload pre-verification module through regular expression parsing is... The extracted file transaction date is Suppose the target power plant code stored in the runtime memory context is... The target transaction date to be saved is The upload pre-verification module calculates the first-level verification Boolean function. The calculation formula is as follows: ; in, This is the first-level check Boolean function; Power plant code for document The date of the document transaction; Code the target power plant; The target transaction date; For logical AND operator.

[0050] If and only if the first check Boolean function When the calculation result is 1, the upload pre-verification module determines that the local file naming characteristics are completely consistent with the current target declaration entity, allowing it to proceed to the next level of verification. When the first-level verification Boolean function... When the calculation result is 0, the upload pre-verification module determines that there is a risk of file mismatch. In this state, the upload pre-verification module directly triggers the upload blocking logic, refusing to pass the underlying data stream handle of the local file to the browser's upload component, preventing erroneous data from being uploaded to the power trading market platform, releasing the currently blocked execution thread, and terminating the current task process.

[0051] The upload pre-verification module of this invention performs file content pre-verification based on internal feature extraction, and the specific logic is as follows: After the first Boolean function calculation result is 1, the upload pre-verification module triggers the internal verification logic of the file content. To prevent mismatches where the file name meets the requirements but the internal data belongs to other entities—for example, business personnel often copy historical file templates when submitting applications, which can easily lead to modifying the file name but forgetting to update the internal entity number—the upload pre-verification module calls the underlying data processing library to load the binary stream of the file to be uploaded in the background. Since modern spreadsheets often use a compressed package structure based on Extensible Markup Language, the upload pre-verification module reads its internal structure file through unpacking technology, directly mapping the physical storage path of the file to be uploaded to a memory stream object. In this process, the graphical office software process of the operating system is not invoked. This method of directly processing the underlying memory stream avoids the resource consumption caused by graphical interface rendering and prevents interference from window focus contention when multiple tasks are running in parallel.

[0052] After constructing the memory stream object, the upload pre-verification module locates the cell containing the entity identity information within the file based on pre-configured coordinate addressing parameters. These coordinate addressing parameters include the worksheet name, row index, and column index, provided by the business configuration file during system deployment. The upload pre-verification module extracts the text data from the corresponding cell to obtain the file's internal credit code and internal identity identifier. The file's internal credit code is the unified social credit code, and the file's internal identity identifier is the enterprise's registration number in the power trading platform system. Regarding the addressing and reading mechanism of the underlying spreadsheet data, those skilled in the art can use existing data stream parsing interfaces to obtain cell data at specified row and column coordinates; the specific reading process is well-known in the field and will not be elaborated upon here.

[0053] After extracting the text data, the upload pre-verification module filters the text data, removing any full-width spaces and redundant hyphens, and converting it into a standardized continuous string. After conversion, the upload pre-verification module reads the target credit code and target identity identifier corresponding to the current business entity from the runtime memory context. The target credit code and target identity identifier are real platform data obtained by the perception operation module when entering the electricity application function interface by parsing the read-only form nodes of the page and caching them in the runtime memory context. The upload pre-verification module performs a string equality comparison between the internal credit code and the target credit code, and simultaneously compares the internal identity identifier with the target identity identifier, performing a second layer of error prevention pre-verification calculation.

[0054] Let the internal credit code of the file extracted by the upload pre-verification module be... The extracted file's internal identifier is Let the target credit code stored in the runtime memory context be... The saved target identity is The upload pre-verification module calculates the second-level verification Boolean function. The calculation formula is as follows: ; in, This is a second-level check Boolean function; This refers to the internal credit code of the document; For target credit code; This serves as an internal identifier for the file. For target identity identification; For logical AND operator.

[0055] If and only if the second check Boolean function When the calculation result is 1, the upload pre-verification module determines that the internal identifier of the local file is consistent with the current target declaration entity, completing the content-level identity verification. When the second verification boolean function... When the calculation result is 0, the upload pre-verification module determines that there is a file content mismatch. In this state, the upload pre-verification module triggers an interception action, destroys the currently established memory stream object, refuses to pass the file physical path to the browser environment, blocks subsequent file upload network requests, and outputs an exception status log of content mismatch.

[0056] The upload pre-verification module of this invention performs the following logic when conducting dual verification of the system interface based on OCR and UI capture: After the second Boolean function calculates a value of 1, the upload pre-validation module triggers the final verification logic for the page state. In the browser's underlying kernel architecture, the JavaScript execution thread and the graphical user interface rendering thread are mutually exclusive. When the page performs complex network requests or processes large amounts of data binding, the rendering thread is suspended, causing inconsistencies between the rendered page data and the underlying form data. To prevent asynchronous delays between the view layer and data layer during two-way data binding in this single-page application framework, the upload pre-validation module sends a node query command to the currently active tab via the browser's underlying debugging protocol. The upload pre-validation module extracts the underlying page's power plant name and transaction date from the form container. These two information represent the actual business parameters that will be packaged and sent to the system backend.

[0057] The upload pre-verification module calls the operating system's underlying graphics rendering interface to capture the global screen image of the current browser's visible area. To prevent other irrelevant text on the page from interfering with the recognition results, the upload pre-verification module reads the coordinate parameters of the boundary rectangle of the underlying form container node, and performs local slicing on the global screen image based on these coordinate parameters to obtain a local image containing only the form control area. Subsequently, the upload pre-verification module converts the local image into a grayscale image to eliminate interference from the page background color, and inputs the grayscale image into the configured optical character recognition engine. The optical character recognition engine performs text region detection and character decoding on the grayscale image, extracting the visually presented power plant name and visually presented transaction date. The visually presented power plant name and visually presented transaction date represent the rendering result actually seen by the business personnel on the monitor screen. For the text region detection and character decoding processing of the local image, those skilled in the art can use existing deep learning visual recognition frameworks, and the specific image text extraction algorithms are well-known technologies in the field, and will not be elaborated here.

[0058] The upload pre-verification module performs the same character cleaning operation on both the underlying page's power plant name and the visually rendered power plant name, removing invisible control characters and leading and trailing spaces, and converting them to a uniform uppercase format. Since the underlying stored time format may differ from the visually rendered format, the upload pre-verification module calls a time parsing library to convert both the underlying page's transaction date and the visually rendered transaction date into structured timestamp integers, eliminating formatting issues such as those caused by hyphens and Chinese characters. After processing, the upload pre-verification module compares the cleaned underlying page's power plant name with the visually rendered power plant name, and simultaneously compares the converted underlying page's transaction date with the visually rendered transaction date, performing a third layer of error-proofing pre-verification calculation.

[0059] Let the name of the power plant on the cleaned bottom page be... The visual appearance after cleaning shows the power plant's name. Let the transaction date of the converted underlying page be... The transformed visual representation of the transaction date is The upload pre-verification module calculates the third-level verification Boolean function. The calculation formula is as follows: ; in, This is a third-level check Boolean function; The name of the power plant on the bottom page; To visually represent the power plant's name; The transaction date on the underlying page; To visually represent the transaction date; For logical AND operator. A third check Boolean function is used if and only if... When the calculation result is 1, the upload pre-verification module determines that the front-end view rendering and the underlying form data are synchronized.

[0060] After completing the three pre-verification mechanisms, the pre-verification module summarizes the overall verification status. Let the first-level verification Boolean function be... The second check Boolean function is The third check Boolean function is The upload pre-verification module calculates the comprehensive release status variables. The calculation formula is as follows: ; in, To comprehensively release the state variables; This is the first-level check Boolean function; This is a second-level check Boolean function; ∧ is the third-level check Boolean function; ∧∧ is the logical AND operator.

[0061] When the overall release status variables When the value is 1, the upload pre-verification module determines that the local transaction file completely matches the current power trading platform's submission environment. At this time, the upload pre-verification module releases the interception and suspension of the browser's upload execution thread, injects the underlying data stream handle of the local power trading plan file into the page's file upload component, and triggers the actual network transmission request to complete the file upload operation.

[0062] When the overall release status variables When the value is 0, the upload pre-verification module determines that the system has a risk of data mismatch or abnormal view rendering. The upload pre-verification module completely terminates the current upload process, intercepts the transmission of the underlying data stream handle, and controls the perception operation module to call the browser interface to refresh the current page, thereby forcibly resetting the state of the front-end framework that may have asynchronous delays, ensuring that abnormal data is physically isolated.

[0063] The data verification module of this invention performs multimodal extraction and physical alignment of source and target data using the following logic: The data verification module loads the power trading plan source file located in the local environment. It calls the underlying table processing engine to traverse the worksheet nodes of the file row by row, extracting key business fields such as trading period, trading volume, and trading price from each row. The module then maps the extracted row-by-row data structure to a set of source data dictionaries in memory. The dictionary keys correspond to the normalized names of the business fields, and the dictionary values ​​correspond to specific business numerical values ​​or text strings. For the row and column traversal mechanism of the table file and the mapping of the dictionary structure, those skilled in the art can use standard data frame processing libraries to implement the conversion of data flow to memory objects. The specific mapping and conversion process is well-known in the field and will not be elaborated here.

[0064] After the front-end page of the power trading platform navigates to the temporary data verification interface, the data verification module locates the temporary data table node in the underlying page structure using a Document Object Model (DOM) query. The module then traverses the table's row and column nodes, extracting the text objects within each cell. Addressing the issue that some trading platforms use canvas rendering or virtual scrolling technologies, which prevent DOM nodes from directly reflecting the full volume of business data, the data verification module triggers a multimodal data extraction mechanism. It sends a page scrolling command to the browser and simultaneously calls a system interface to capture a screen image containing the temporary data. A pre-configured optical character recognition (OCR) model is used to reconstruct the table's physical boundaries and extract cell text from the screenshot. During physical boundary reconstruction, the module uses morphological image processing algorithms to extract horizontal and vertical line segments from the image. By calculating the coordinates of the intersections of these segments, it reconstructs the two-dimensional grid matrix structure of the underlying table, accurately mapping the scattered text blocks extracted by the OCR model to the corresponding row and column cell coordinates. After extraction, the module integrates the data obtained from the webpage into a target data dictionary set.

[0065] After acquiring the source and target data dictionary sets, the data verification module triggers the execution of data standardization processing logic. Because locally maintained files and data returned by the business system platform often have structural differences in format, the data verification module performs unit conversion and floating-point precision unification operations on numeric fields in the dictionary sets. Based on the conversion rate parameters set in the configuration file, the data verification module uniformly converts different levels of electricity units to megawatt-hours (MWh). For example, it divides values ​​containing kilowatt-hour units by one thousand to convert them to the standard MWh level and rounds them to the preset number of decimal places. For discrete date fields, the data verification module calls the date and time formatting interface and uses a parsing mask to uniformly convert them into a standard integer timestamp format.

[0066] After data standardization, the data verification module performs physical alignment calculations on the two datasets by constructing a composite primary key. The module extracts the transaction date, power plant code, and transaction type for each single record in both the source and target data dictionary sets, concatenating them into a globally unique string key. To prevent data concatenation and hash collisions when characters from different fields are joined end-to-end, the module forcibly inserts pre-defined delimiters as physical isolation between fields during concatenation. Since the order of data rows returned by the business system page may differ from the original order of the local source file due to asynchronous loading from the front-end network interface, the module uses the source data dictionary set as the main table structure and the target data dictionary set as the secondary table structure, performing hash matching operations based on the string key. The hash matching operation constructs a hash table in memory indexed by the key, achieving fast location and addressing unaffected by data order. Through hash comparison, the module horizontally merges source and target data records with the same key into a single comparison feature record, ultimately generating a physical alignment result set in memory.

[0067] After the physical alignment result set is generated, the data verification module performs a mathematical evaluation of data integrity. Let the total number of records in the source data dictionary set be... The total number of successfully merged physical alignment result comparison feature records is The data verification module calculates the data alignment rate. The calculation formula is as follows: ; in, For data alignment; The total number of comparison feature records that were successfully merged; This represents the total number of records contained in the source data dictionary set.

[0068] The data verification module determines the data alignment rate. The numerical state. The system's internal preset alignment is set to a constant 1.0 through a threshold, which represents the absolute conservation of the number of data rows. When the data alignment rate... When the value equals 1.0, the data verification module determines that the record entries in the platform's temporary storage list completely correspond to the line-level data in the local source file, with no redundant or missing lines. The system then proceeds to the subsequent numerical verification stage. When the data alignment rate... When the value is less than 1.0, the data review module determines that there is a data packet loss or platform interface parsing error during the network request phase. The data review module then blocks the current review process and outputs a system-level error log indicating data structure misalignment.

[0069] The data verification module of this invention performs a cell-by-cell fine-grained comparison with an introduced tolerance threshold as follows: After the data alignment rate assessment is passed, the data verification module performs a cell-by-cell fine-grained comparison operation on the data in the physical alignment result set. The data verification module sequentially traverses each comparison feature record contained in the physical alignment result set. For a single comparison feature record, the data verification module parses each business field that needs to be verified and, based on the system's pre-defined field type definition table, classifies the current business field into numeric fields and text fields, applying different verification logic. This field type definition table is loaded from the local configuration file during system initialization and internally constructs a mapping relationship between field name keywords and underlying data type enumerations to support the program's dynamic distribution of processing logic.

[0070] For numeric fields, considering that the underlying computer hardware follows the IEEE 754 standard when processing floating-point operations, different programming language frameworks and business databases may employ different rounding or precision truncation strategies at the data storage and presentation layers. This difference in underlying architecture can easily lead to discrepancies in the last decimal place between the original values ​​in local files and the values ​​returned by the web-based system. If the system uses an absolute equality comparison method, it can easily trigger false alarms that are valid in business logic but inconsistent in data representation.

[0071] To solve this problem, the data verification module extracts the source data value and the target data value corresponding to the current numeric field in the comparison feature record. Let the source data value be... The target data value is The data verification module calculates the absolute deviation value. The calculation formula is as follows: ; in, This is the absolute deviation value; The source data value; The target data value.

[0072] The data verification module obtains pre-configured random variables that follow a standard normal distribution, generated by a random number generator. Random variables generated by a random number generator that follow a standard normal distribution. Dynamically injected from the system's business configuration file, used to define the maximum acceptable reasonable error range for the system. Random variables generated by a random number generator that follow a standard normal distribution. The value range is typically set between 0.0001 and 0.01, with the specific value depending on the minimum billing accuracy and electricity measurement unit specified for the current electricity trading product. The data verification module calculates and compares the values ​​with the state variables. The calculation formula is as follows: ; in, For numerical comparison of state variables; This is the absolute deviation value; Let be a random variable generated by a random number generator that follows a standard normal distribution. When comparing numerical values ​​with state variables... When the value is 1, the data verification module determines that the current numeric field is within the allowable error range, and the comparison passes. When the numeric comparison status variable... When the value is 0, the data verification module determines that the comparison fails.

[0073] For text fields, considering that manual data entry by business personnel often results in non-essential formatting errors such as mixing Chinese and English brackets and switching between full-width and half-width characters, the data verification module calls a character mapping library to uniformly convert all characters within the text field to half-width format before performing string comparison. It then uses regular expressions to remove all invisible whitespace characters. In the underlying computer encoding architecture, full-width characters and their corresponding half-width characters have a fixed hexadecimal numerical offset within the Unicode space. The character mapping library performs arithmetic offset calculations in memory to achieve the physical conversion of character encoding. Let the processed source text string be... The processed target text string is .

[0074] The data verification module calls the edit distance algorithm to calculate the source text string. With the target text string Lewinstein distance between Levinstein is far from This represents the source text string. Convert to target text string The minimum number of single-character insertion, deletion, or replacement operations required. The solution process for the underlying state transition equation of the edit distance can be implemented using existing dynamic programming matrix algorithms, and its specific derivation is well-known in the field and will not be elaborated here.

[0075] The data verification module determines the distance to Lewinstein. Is it less than or equal to the preset text error tolerance threshold? The text error tolerance threshold is a non-negative integer, set by the system's business configuration file, and typically takes the value of 0 or 1, representing the maximum number of character modifications allowed. When Levinstein is far... If the conditions are met, the data verification module determines that the current text field comparison is successful; otherwise, it determines that the comparison is unsuccessful.

[0076] After completing the comparison of all business fields within a comparison feature record, the data verification module summarizes the status of that record. If any field in the record fails the comparison, the data verification module marks that record as an abnormal data row. The data verification module extracts the field name, source data value, target data value, and corresponding form row and column coordinates of the discrepancy, encapsulates them into an exception log object, and stores it in the difference mapping table in runtime memory. After traversing all comparison feature records in the physical alignment result set, the data verification module checks the capacity of the difference mapping table. When the difference mapping table is empty, the data verification module determines that the platform's temporary data deep verification is correct and triggers the next business flow network request; when the difference mapping table is not empty, the data verification module blocks the subsequent business submission process and controls the perception operation module to pop up a visual alarm panel, displaying the specific mismatch details in the difference mapping table for manual intervention and verification.

[0077] The data verification module of this invention performs the built-in business rule verification based on prior knowledge in the following specific logic: Assuming the difference mapping table is empty, the data verification module triggers a business logic verification based on prior knowledge. The data verification module calls the local file system application interface to load the business rule configuration file pre-stored on the local disk. This configuration file is regularly maintained and updated by market operators according to the latest rule notifications from the power market trading center to ensure the timeliness of the prior parameters. The business rule configuration file is written in Extensible Markup Language or JavaScript Object Notation format and internally encapsulates the prior constraint parameters for the current power market trading varieties. These prior constraint parameters include the market-stipulated upper and lower thresholds for trading electricity prices, as well as the rated installed capacity of each business entity. The data verification module parses the business rule configuration file into a rule configuration tree object in memory to support dynamic parameter reading during subsequent business logic operations.

[0078] The data verification module iterates through each record in the physical alignment result set, extracting the transaction electricity price field value. Based on the transaction variety identifier in the record, the module retrieves the corresponding upper and lower threshold values ​​for the transaction electricity price from the rule configuration tree object. The specific values ​​of the upper and lower threshold values ​​are determined by the current market clearing mechanism. For example, in the spot market of some provinces, the lower limit may be set at 0 yuan per megawatt-hour, and the upper limit at 1500 yuan per megawatt-hour. Let the extracted transaction electricity price be... The retrieved lower limit threshold for electricity trading price is The upper limit threshold for electricity trading price is The data verification module calculates the electricity price compliance status variable. The calculation formula is as follows: ; in, This is a variable representing the compliance status of electricity prices. For the electricity trading price; This is the lower limit threshold for the electricity trading price; This refers to the upper limit threshold for the electricity trading price. When the electricity price compliance status variable... When the value is 1, the data verification module determines that the transaction price is within a reasonable range; when the electricity price compliance status variable... When the value is 0, the data verification module determines that the electricity price is out of bounds.

[0079] In addition to electricity price range verification, the data verification module also performs logical verification of electricity volume for the physical alignment result set to prevent the risk of enterprises exceeding their quota declarations. The data verification module extracts transaction data from the physical alignment result set, performs grouping and aggregation operations in Structured Query Language according to the transaction date and power plant code, and calculates the cumulative declared electricity volume of a single business entity within the target trading day. The data verification module extracts the rated installed capacity of the unit corresponding to the current entity from the rule configuration tree object and calculates the theoretical maximum power generation by combining it with the total trading hours for the whole day. The total trading hours for the whole day is a value dynamically obtained by the system based on the time span of the trading variety mapped in the rule configuration tree object; its value range is usually 24 (representing a regular medium-to-long-term transaction that operates continuously throughout the day) or the actual number of trading periods allowed. Let the cumulative declared electricity volume within the target trading day be... The rated installed capacity of the unit is The total number of trading hours for the whole day is The data verification module calculates the electricity compliance status variable. The calculation formula is as follows: ; in, This is a variable indicating compliance with electricity consumption requirements. For the cumulative reported electricity volume; This refers to the rated installed capacity of the unit. This represents the total number of transaction hours for the entire day. (When the electricity consumption compliance status variable...) When the value is 1, the data verification module determines that the declared electricity consumption meets the output limit of the physical equipment; when the electricity consumption compliance status variable When the value is 0, the data verification module determines that there is an over-issuance anomaly in the declared electricity volume.

[0080] After completing the item-by-item verification, the data review module summarizes the judgment results. The data review module calculates the comprehensive variables based on the rule verification. The calculation formula is as follows: ; in, To validate the comprehensive variables for the rules; This is a variable representing the compliance status of electricity prices. This is a variable indicating compliance with electricity consumption requirements. For logical AND operator.

[0081] When the rule validation is combined with variables When the value is 1, the data verification module determines that the data in the current temporary list fully complies with the prior business rules of the electricity market and allows the final submission action. At this time, the data verification module sends a submission process release signal to the perception operation module, which then drives the underlying browser kernel interface to trigger the confirmation submission button node in the page object model, completing the formal data reporting.

[0082] When the rule validation is combined with variables When the value is 0, the data review module determines that the data has a business logic risk that violates market regulations. The data review module blocks the submission process by calling the browser's automated driver interface to forcibly modify the underlying properties of the "Confirm Submit" button node in the Document Object Model, adding a "disabled" tag to it, thereby physically blocking the page's submission request. It also calls the logging framework to output a business exception blocking log to the local disk. The exception blocking log records the power plant code where the rule conflict occurred, the name of the violating field, and the specific difference in the exceeded limit.

[0083] The decision alarm module of this invention, when executing deterministic decision-making logic and branch control, unfolds its logic as follows: After completing pre-verification and deep review of temporary data before upload, the decision-making and alerting module initiates a global status aggregation mechanism. The module reads the status variables output by each independent verification step from the runtime memory context. After each independent verification step completes, it stores the corresponding status variables as key-value pairs in a global singleton memory object to ensure data persistence and sharing across process nodes. The variables extracted by the decision-making and alerting module cover the comprehensive release status variables of the file upload stage, the data alignment rate of the data extraction stage, the difference mapping table generated during the cell comparison stage, and the comprehensive variable of rule verification during the business logic verification stage. The decision-making and alerting module calculates the number of cached log objects in the difference mapping table by querying the runtime memory context, thus obtaining the number of records in the difference mapping table.

[0084] To transform the various verification results into control instructions that the computer can directly execute, the decision-making alarm module constructs a deterministic state machine model at the underlying level. This model, based on the logical combination of various state variables, outputs discrete decision state values ​​to the outside world. Let the extracted comprehensive release state variable be... Data alignment rate The number of records in the difference mapping table is The rule validation comprehensive variable is The decision alarm module calculates the decision output status value. The calculation formula is as follows: ; in, Output state values ​​for decision-making; To comprehensively release the state variables; For data alignment; The number of records in the difference mapping table; To validate the comprehensive variables for the rules; For logical AND operator; This is a logical OR operator. Among them, the overall release status variable... Combined variables with rule validation The value can be 0 or 1; data alignment rate The value range is a floating-point number between 0 and 1; the number of records in the difference mapping table. The output state value is a non-negative integer. The value can be 0, 1, or 2.

[0085] The decision alarm module will output the decision status value. As routing addressing parameters, these parameters are mapped in memory to corresponding function pointers, thereby triggering different system control branches. During the initialization phase, the system pre-builds a state machine mapping table. The keys of this table are enumerated constants representing the decision output state values, and the values ​​are the memory function execution addresses of the corresponding control branches.

[0086] When the decision outputs a state value When the value is 1, the decision-making alarm module determines that the current end-to-end data interaction is in a safe and compliant state, triggering the automated release execution branch. Under this branch, the decision-making alarm module calls the browser's underlying automated application programming interface to locate the network request triggering node responsible for the final submission in the document object model tree. The decision-making alarm module sends a native mouse click event to this node, driving the browser to send a data submission communication packet with authentication credentials to the power trading platform's backend server, completing the closed loop of power trading plan reporting.

[0087] When the decision outputs a state value When the threshold is 2, the decision-making alarm module determines that the system is in a pending confirmation state where the physical environment is normal but the business data has logical deviations, triggering manual intervention to block the branch. Under this branch, the decision-making alarm module uses a thread suspension mechanism to put the currently active automated operation main thread into sleep mode, freezing the editable properties of all form controls in the browser interface. Simultaneously, the decision-making alarm module sends a wake-up command to the operating system's graphics rendering layer via inter-process communication protocol, rendering a full-screen modal blocking dialog box at the forefront of the display, awaiting secondary confirmation or modification by business personnel. For thread suspension and inter-process communication handling in multi-threaded concurrent states, those skilled in the art can use existing operating system underlying call libraries; the specific concurrency control mechanism is well-known in the field and will not be elaborated upon here.

[0088] When the decision outputs a state value When the value is 0, the decision-making alarm module determines that the system has encountered an underlying physical mismatch or data loss, triggering a fatal exception circuit breaker branch. Under this branch, the decision-making alarm module reclaims control of the browser from the perception operation module and directly destroys the session handle currently maintained in memory. The decision-making alarm module sends a forced termination signal to the browser process by calling the operating system's process management interface to destroy the network socket connection, preventing erroneous data from being accidentally sent to the platform due to the network retry mechanism, and hands over the system execution pointer to the global exception handling routine.

[0089] The decision-making alarm module of this invention performs the following specific logic when encapsulating abnormal alarm data and pushing it through multiple channels: After the decision-making alarm module triggers a manual intervention blocking branch or a fatal anomaly circuit breaker branch, the system enters the anomaly alarm handling process. The decision-making alarm module calls the system's underlying time function to obtain the timestamp of the current processing operation. Simultaneously, the decision-making alarm module extracts the specific anomaly data that triggered the blocking from the global object in runtime memory. The extracted data includes the decision output status value, the number of records in the difference mapping table, out-of-bounds business values, and the error stack information of the underlying system. To preserve the context of the anomaly, the decision-making alarm module calls the operating system's graphics device interface to capture the current display screen image and uses a standard encoding algorithm to convert the screen image into a Base64 format string. In computer network communication, binary image data containing control characters is prone to truncation or garbled characters when directly transmitted over the network. The decision-making alarm module uses the Base64 encoding algorithm to map the binary stream of the image into a plain text string composed of printable characters, allowing the image data to be directly embedded in structured message nodes. The decision-making alarm module merges and serializes the timestamp, anomaly data, and screen image string according to a predefined structure specification into an alarm data packet in Extensible Markup Language (Extensible Markup Language) or JavaScript Object Notation (JavaScript Object Notation) format. For the structured serialization of data, those skilled in the art can use existing data parsing libraries. The specific encoding and conversion mechanisms are well-known technologies in the field and will not be elaborated here.

[0090] After the alarm data packet is encapsulated, the decision-making alarm module quantifies the severity of the current anomaly to determine the subsequent network push channel to be used. The decision-making alarm module introduces a preset threshold for the number of differences. The preset threshold for the number of differences This value is set by the system administrator in the initialization configuration file, and is typically set to an integer between 5 and 10 to define the critical point for manual correction workload. The decision alarm module calculates the alarm level. The calculation formula is as follows: ; in, Alarm level; Output state values ​​for decision-making; The number of records in the difference mapping table; A preset threshold for the number of differences; For logical AND operator. Alert level. The value can be 0, 1, 2 or 3.

[0091] The decision-making alarm module bases its decisions on the calculated alarm levels. Implement multi-channel network push strategies at different levels. When the alarm level... When the value is 1, the decision alarm module determines that the current anomaly is a small-scale data logic deviation. It only calls the operating system's graphics rendering interface to pop up a visual warning dialog box containing the alarm data packet on the local computer desktop, prompting on-site business personnel to conduct targeted manual verification and correction.

[0092] When the alarm level When the value is 2, the decision-making alarm module determines that the number of data deviations is too large, exceeding the scope of rapid handling by a single person. In addition to triggering a local visual warning dialog box, the decision-making alarm module initiates an email push mechanism. The module establishes a network socket connection with the enterprise's internal email transmission proxy server via Transmission Control Protocol (TCP), uses the alarm data packet content as the email body and the screen image as an attachment, and sends the alarm email to the reserved email address configured by the business manager according to the underlying data packet specifications of Simple Mail Transfer Protocol (SMLP).

[0093] When the alarm level When the value is 3, the decision-making alarm module determines that the system has experienced an underlying network failure, element location failure, or data loss. While executing local pop-ups and email pushes, the decision-making alarm module also calls the application programming interface (API) of the enterprise instant messaging tool. The decision-making alarm module reconstructs the alarm data packet into a Hypertext Transfer Protocol (HTTP) request message and sends it to a pre-configured external network hook address via the HTTP security protocol. A network hook is an HTTP-based API callback mechanism that allows third-party applications to receive event pushes by listening to Uniform Resource Locator (URL) nodes. The decision-making alarm module directly pushes the abnormal physical status of the system to the mobile devices of the operations and maintenance team, completing the transmission of alarm information across network segments and terminals.

[0094] The decision-making alarm module of this invention performs the following specific logic when executing end-to-end audit log recording and secure exit control: After the current batch of automated power trading plan reporting process reaches the termination node, the decision-making alarm module initiates the encapsulation and solidification mechanism of the full-link audit log. The decision-making alarm module traverses the global status monitoring tree in runtime memory, extracting operational data from various key dimensions during this execution process. The extracted data includes the start and end timestamps of each submodule, the number of lines parsed in the file, the document object model path record for locating page elements, the response status codes of network requests, and the operation trajectory of manual intervention. The decision-making alarm module concatenates the collected discrete data according to the time series and serializes it into a log file in JavaScript object abbreviation format.

[0095] To prevent malicious tampering of audit logs while they are stored on the local disk, the decision-making alarm module performs a digest encryption operation on the log file before persistent storage. The module extracts the full string content from the log file, calls the secure hash algorithm in the underlying cryptographic interface, and calculates a hexadecimal hash value. This hexadecimal hash value is appended as a digital fingerprint to the beginning of the log file, and the final message is written to the audit log directory specified by the local operating system. During subsequent audit backtracking, the audit program recalculates the hash value by reading the log text content and compares it with the digital fingerprint appended to the beginning. If the two calculations match, the log content is determined to be tamper-proof. For the underlying bitwise operations of the hash digest algorithm, those skilled in the art can use existing cryptographic algorithm libraries; the specific bitwise operation mechanism is well-known in the field and will not be elaborated here.

[0096] After the audit logs are solidified, the decision-making and alerting module enters the secure exit and system resource reclamation phase. The module sends an exit command to the underlying browser automation driver, instructing the browser kernel to close all currently rendered tabs and clear locally cached data and session credentials generated during runtime. During the cleanup operation, the module calls the browser automation driver's underlying protocol interface to send control commands to the browser process to delete all cookie objects and clear the local storage space, thereby severing the login state between the system and the power trading platform. After cleanup, the module physically releases the memory space.

[0097] To verify whether underlying system resources have been completely reclaimed and to prevent memory leaks caused by zombie processes left behind by automated drivers in the background, the decision-making and alarm module performs a quantitative assessment of memory reclamation status. Let the initial memory usage at system startup be... The peak memory usage during system operation is The actual amount of memory released by the operating system during the exit phase is The decision-making and alarm module calculates the resource release rate. The calculation formula is as follows: ; in, For resource release rate; The actual amount of memory released as reported by the operating system during the exit phase; This represents the peak memory usage during system operation. This represents the initial memory usage at system startup. Peak memory usage And the actual amount of memory released as reported by the operating system during the exit phase. All are non-negative integers measured in megabytes; resource release rate It is a floating-point number with a value between 0.0 and 1.0.

[0098] The decision-making alarm module determines the resource release rate. The numerical state of the resource release rate. When the value equals 1.0, the decision-making alarm module determines that the dynamically allocated memory space during system operation has been completely reclaimed, and there are no suspended residual threads at the underlying level. At this time, the decision-making alarm module returns a normal exit code of 0 to the operating system main process, completing a safe exit across the entire process.

[0099] When resource release rate When the value is less than 1.0, the decision-making alarm module determines that there is an unresponsive suspended process or a memory leak at the underlying level. The decision-making alarm module calls the operating system's process management application interface to traverse the current background process tree, matching and extracting the process identifiers of browser processes and console processes related to the system. Based on the process identifiers, the decision-making alarm module sends a forced termination signal to the operating system kernel, such as the SIGKILL signal under the Linux kernel specification, forcibly destroying the relevant memory pointers and handle resources, thereby ensuring the purity of the computing node's operating environment before the next round of automated tasks is triggered.

[0100] Specific application examples: To verify the effectiveness, stability, and accuracy of the AI-based intelligent agent-based automated trading quotation system and method for the power trading market proposed in this invention, a 30-day comparative experiment was conducted in a simulated test environment of a provincial-level real power trading platform, with a total of 1000 automated submission tasks executed. The experiment mainly focused on three dimensions: anti-machine interception and evasion capabilities, accuracy of dynamic page element recognition, and intelligent fault-tolerant comparison mechanism. The specific verification results are as follows: Login behavior security verification (effectiveness against machine interception): Traditional automated trading scripts typically use fixed character input intervals, making them vulnerable to interception by the frequency detection mechanisms of platform security gateways. This experiment compares a "fixed input delay (100ms)" with the formula-based sensing operation module of this invention. The interception trigger rate of the generated "nonlinear random fluctuation delay" under continuous high-frequency login.

[0101] Experimental results: As the number of consecutive login tests increased, the interception rate using the traditional fixed-delay input method rose sharply, climbing from an initial 0% to as high as 85% after 100 consecutive tests. However, this invention incorporates a random delay variable that follows a standard normal distribution. It highly replicates the rhythmic differences of human keyboard typing, and the interception rate remained at an extremely low level of 0% to 2% in 100 consecutive tests, significantly improving the system's adaptive login success rate.

[0102] Verification of the accuracy of dynamic page element recognition: Electricity trading platforms often suffer from responsive layout and viewport scaling / redrawing issues. Experiments were conducted to compare the traditional method based on "absolute screen coordinate positioning" with the method based on "local image OCR and similarity scoring" at browser viewport scaling ratios of 80%, 100%, 125%, and 150%. The accuracy of element clicks using the "dynamic routing" method.

[0103] Experimental results: When the scaling factor deviates from 100%, the accuracy of traditional absolute coordinate mapping methods drops precipitously. At 80% and 125% scaling, the accuracy decreases sharply to 12.5% ​​and 4.2%, respectively, and at 150% scaling, the recognition accuracy drops to 0%. This invention, however, is based on OCR and... The similarity algorithm, by introducing visual center point coordinate calculation and edit distance similarity normalization, maintains a recognition and click accuracy of over 98.5% at various resolutions and scaling ratios (up to 99.5% at 100% scaling), proving its robustness in complex front-end redrawing environments.

[0104] Intelligent fault tolerance and data verification accuracy: Due to the truncation of underlying floating-point precision (IEEE 754 standard) and the mixing of full-width and half-width characters in manual documents, strict matching often leads to a high false alarm rate. The experiment injected data with precision deviations in the last decimal place and dirty data containing a mixture of half-width and full-width characters into the test dataset. The traditional "absolute perfect equality comparison algorithm" and the data verification module of this invention, based on absolute deviation values, were compared. Combined with tolerance random variables and based on data alignment The intelligent and refined comparison strategy.

[0105] Experimental results: Faced with dirty data environments, the correct matching rate of traditional absolute equality comparison is only 65.8%, and the false alarm interception rate reaches 34.2%, greatly increasing the workload of manual verification. This invention, Intelligent Fault-Tolerant Verification (… By setting reasonable tolerance thresholds and multimodal physical alignment verification, the correct matching rate reached 99.8%, while the false alarm interception rate was controlled at 0.5%, ensuring data integrity (data alignment rate). This effectively filters out non-substantive format differences under the premise of [missing information].

Claims

1. A method for automatic trading and pricing in an AI-based intelligent agent-based electricity trading market, characterized in that, Includes the following steps: Upon receiving the trigger signal, access the power trading platform and complete system authentication login, then navigate the page to the power declaration function interface; Extract the target power plant name and target transaction date, and fill in the corresponding selection items in the input component of the electricity declaration function interface; Extract the filename features and internal identifier fields of the local template file to be uploaded, and compare the filename features and internal identifier fields with the target power plant name and the target transaction date currently selected on the page; When the judgment result is a match, the file upload operation is executed, and the system's temporary storage function is triggered; Read the system's temporary data, extract the original file data to establish a benchmark, calculate the data deviation of the corresponding fields, and call the built-in business rules to verify whether the captured data meets the boundary constraints. When the data deviation is within the threshold range and the boundary constraints are met, the submit function is called to end the transaction declaration. When the data deviation exceeds the threshold range or violates the boundary constraints, the submission process is terminated, the current abnormal page view is captured, a data difference log is generated, and it is transmitted through the interface. After the task is completed, the system enters the safe exit and system resource reclamation phase.

2. The automatic trading quotation method for an AI-based intelligent agent power trading market according to claim 1, characterized in that, The specific execution process of accessing the power trading platform and completing system authentication login includes: The document object model structure of the login interface is parsed. By traversing the node attribute features, the node location paths of the username input box, password input box and login confirmation button are extracted. The input simulation interface is called to split the plaintext username and password into single character sequences and inject them into the corresponding input box nodes in sequence. When injecting the single character sequence into the input box node, a random delay variable is calculated and inserted between the input actions of adjacent characters; Once the user authentication data is entered, the screen coordinates of the center point of the login confirmation button are extracted, triggering the left mouse button click event at the system level. When the page's Uniform Resource Locator is detected to have changed to the platform's homepage address, the system determines that the adaptive login operation has been successfully executed.

3. The automatic trading quotation method for an AI-based intelligent agent power trading market according to claim 1, characterized in that, The specific execution process of navigating the page to the electricity reporting function interface includes: Get the document object model tree structure of the current page, extract the candidate interactive element set containing hyperlinks, buttons and menu labels in the document object model tree, call the browser's underlying boundary rectangle calculation interface, and get the position attribute of any candidate element node in the current viewport. Calculate the center point coordinates of the candidate element node based on the obtained position attributes; Based on the calculated x and y coordinates of the center point, and combined with the width and height of the candidate element node, a partial screen image of the candidate element node is cropped. The partial screen image is then input into the optical character recognition model to extract the displayed text contained in the partial screen image. The extracted display text is compared with the target menu text defined in the business configuration file. A normalization algorithm is introduced to convert the edit distance into a similarity score. When the similarity score is greater than or equal to the target matching threshold, the current candidate element node is determined to be the target navigation node and a left mouse button press and release command is issued. The comparison and command issuance operations are executed repeatedly until the page navigates to the final power reporting function interface.

4. The automatic trading quotation method for an AI-based intelligent agent power trading market according to claim 1, characterized in that, The specific execution process of filling in the corresponding selection items in the input component of the electricity declaration function interface includes: Perform character cleaning operation, using regular expressions to remove leading and trailing spaces, newline characters, and invisible control characters from the string, and obtain the cleaned target power plant name and the cleaned target transaction date; The cleaned target power plant name is used as a search keyword and entered into the filter input box of the drop-down selection component. The text attributes of each option node in the drop-down option list layer are extracted and compared with the cleaned target power plant name to generate a node matching status variable. When the value of the node matching status variable is 1, the current option node is determined to be the target option node. The center coordinates of the target option node in the screen window are calculated, and a click operation is triggered on the center coordinate position of the target option node. Locate the underlying input node of the target date selection control, forcibly remove the read-only attribute identifier of the underlying input node, convert the cleaned target transaction date into a standard time string format and assign it to the internal numerical attribute of the underlying input node, and dispatch a value change event and a defocus event to the underlying input node.

5. The method for automatic trading and pricing in an AI-based intelligent agent-based power trading market according to claim 1, characterized in that, The specific execution process of extracting the filename features and internal identifier fields of the local template file to be uploaded, and comparing the filename features and internal identifier fields with the currently selected target power plant name and target transaction date on the page includes: The filename body and file extension are extracted from the absolute path of the local template file to be uploaded. The filename string is retained. The entity information contained in the filename feature is extracted from the filename string. The entity information includes the file power plant code and the file transaction date. The target power plant code and the target transaction date are read from the running memory context. The file power plant code and the target power plant code are compared. At the same time, the file transaction date and the target transaction date are compared. The first layer of error prevention pre-check calculation is performed. Construct a memory stream object, locate the cell containing entity identity information inside the file according to coordinate addressing parameters, extract the text data in the corresponding cell as an internal identifier field, the internal identifier field is obtained as the internal credit code and the internal identity identifier of the file, read the target credit code and the target identity identifier corresponding to the current business entity from the running memory context, perform a string equality comparison between the internal credit code and the target credit code, and at the same time compare the internal identity identifier of the file with the target identity identifier, and perform the second layer of error prevention pre-check calculation; Extract the power plant name and transaction date from the underlying page within the form container. Capture a slice of the global screen image of the current browser's visible area to obtain a partial image containing the form control area. Convert this partial image to grayscale and extract the visually presented power plant name and transaction date. Perform character cleaning on the underlying page power plant name and the visually presented power plant name, removing invisible control characters and leading and trailing spaces, and converting them to a uniform uppercase format. Call a time parsing library to convert both the underlying page transaction date and the visually presented transaction date into structured timestamp integers. Compare the cleaned underlying page power plant name with the visually presented power plant name, and simultaneously compare the converted underlying page transaction date with the visually presented transaction date. Perform a third layer of error prevention pre-check calculation. Based on the results of the first, second, and third error prevention pre-verification calculations, a comprehensive release status variable is generated. When the value of the comprehensive release status variable is 1, it is determined that the local template file to be uploaded matches the current power trading platform's declaration environment. The underlying data stream handle of the local template file to be uploaded is then injected into the page's file upload component, triggering a network transmission request to complete the file upload operation.

6. The automatic trading quotation method for an AI-based intelligent agent power trading market according to claim 5, characterized in that, The specific execution process of reading system-stored data and extracting original file data to establish a reference standard includes: Iterate through the worksheet nodes of the local template file to be uploaded row by row, extract the transaction time period, transaction electricity volume and transaction electricity price contained in each row of data as the original file data, and map the extracted row-by-row data structure to the source data dictionary set in the running memory; The system uses a pre-configured optical character recognition model to reconstruct the physical boundaries of tables and extract cell text from the screenshots containing the system's temporary data, integrating them into a target data dictionary set. Extract the transaction date, power plant code, and transaction type corresponding to each single record in the source data dictionary set and the target data dictionary set. Concatenate the extracted transaction date, power plant code, and transaction type into a globally unique string combination key. Perform a hash matching operation based on the string combination key. Horizontally merge source data records and target data records with the same combination key into a single comparison feature record. Finally, generate a physical alignment result set in memory. The ratio of the total number of successfully merged comparison feature records to the total number of records contained in the source data dictionary set is used as the data alignment rate. When the data alignment rate is equal to 1.0, it is determined that the record entries in the platform's temporary storage list completely correspond to the line-level data of the local source file, and the system instruction flows to the numerical verification stage to establish the comparison benchmark.

7. The automatic trading quotation method for an AI-based intelligent agent power trading market according to claim 6, characterized in that, The specific execution process for calculating the data deviation of the corresponding field includes: Iterate through each comparison feature record contained in the physical alignment result set. For numerical fields, calculate the absolute deviation between the source data value and the target data value. When the absolute deviation is less than or equal to the preset numerical tolerance threshold, it is determined that the current numerical field comparison is successful. For text fields, the character mapping library is called to convert all characters inside the text field into half-width format. Regular expressions are used to remove all invisible whitespace characters inside the text field. The Levenstein distance between the source text string and the target text string is calculated. When the Levenstein distance is less than or equal to the text error tolerance threshold, the current text field is determined to pass the comparison. The record containing any field that fails the comparison is marked as an abnormal data row. The field name, source data value, target data value, and corresponding table row and column coordinates of the deviation are extracted. The field name, source data value, target data value, and corresponding table row and column coordinates are encapsulated into an abnormal log object and stored in the difference mapping table in the runtime memory.

8. The automatic trading quotation method for an AI-based intelligent agent power trading market according to claim 7, characterized in that, The specific execution process of calling built-in business rule conditions to verify whether the crawled data meets the boundary constraints includes: When the difference mapping table is empty, traverse each record in the physical alignment result set, extract the transaction electricity price field value in the physical alignment result set, retrieve the corresponding transaction electricity price upper limit threshold and transaction electricity price lower limit threshold from the rule configuration tree object, compare and determine whether the transaction electricity price field value is within the limit range of the transaction electricity price lower limit threshold and the transaction electricity price upper limit threshold, and calculate the electricity price compliance status variable. For the physical alignment result set in the running memory, grouping and aggregation operations in the structured query language are performed based on the transaction date and power plant code to calculate the cumulative declared electricity volume of a single business entity on the target transaction day, extract the rated installed capacity of the unit associated with the current business entity, calculate the theoretical maximum power generation in combination with the total number of transaction hours of the day, determine whether the cumulative declared electricity volume is less than or equal to the product of the rated installed capacity of the unit and the total number of transaction hours of the day, and calculate the electricity compliance status variable; Based on the electricity price compliance status variable and the electricity consumption compliance status variable, a rule verification comprehensive variable is calculated. When the value of the rule verification comprehensive variable is 1, it is determined that the data in the current temporary list fully meets the boundary constraints, and a submission process release signal is issued.

9. The automatic trading quotation method for an AI-based intelligent agent power trading market according to claim 8, characterized in that, The specific execution process of terminating the submission process, capturing the current abnormal page view, generating a data difference log, and transmitting it via the interface includes: Extract the comprehensive release status variable, the data alignment rate, the number of records in the difference mapping table, and the rule verification comprehensive variable. Based on the logical combination of the comprehensive release status variable, the data alignment rate, the number of records in the difference mapping table, and the rule verification comprehensive variable, obtain the decision output status value. When the value of the decision output status value is 2, put the currently active automated operation main thread into sleep mode and render a modal blocking dialog box covering the entire screen at the forefront of the display to capture the current abnormal page view. The alarm level is calculated based on the number of abnormal records in the difference mapping table. When the value of the alarm level is 1, a data difference log is generated to construct an alarm data packet, and a visual warning dialog box containing the contents of the alarm data packet pops up on the local computer desktop. When the alarm level value is 2, the email push mechanism is activated to send alarm emails to the configured email address; When the alarm level value is 3, the alarm data packet is reconstructed into a Hypertext Transfer Protocol Request message and sent to the external network hook address for transmission via the Hypertext Transfer Protocol Security Protocol.

10. The automatic trading quotation method for an AI-based intelligent agent power trading market according to claim 1, characterized in that, The specific execution process for entering the safe exit and system resource reclamation phase includes: Extract the operational data of each key dimension during the completion of this task, concatenate them according to the time sequence, and serialize them into a log file in JavaScript object abbreviation format. Call the secure hash algorithm in the underlying cryptographic interface to calculate and generate a hexadecimal hash value. Append the hexadecimal hash value as a digital fingerprint to the beginning of the log file and write it to the audit log directory specified by the local operating system. Send an exit command to the underlying browser automation driver to clear local cached data and session credentials generated during runtime; The ratio of released resources to total allocated resources is used as the resource release rate. When the resource release rate is less than 1.0, it is determined that there is an unresponsive suspended process or memory leak at the underlying level. The operating system's process management application interface is called to match and extract the process identifiers of the relevant browser process and driver console process, send a forced termination signal to the operating system kernel, and physically destroy the relevant memory pointers and handle resources.