A transaction delegation interceptor chain processing method, device, equipment and medium

By obtaining multi-dimensional context parameters in the transaction delegation, initializing and asynchronously scheduling the interceptor chain, the risk omission and state pollution problems of the traditional interceptor mechanism are solved, realizing complete risk verification and user prompts, and improving the security and efficiency of the transaction system.

CN122134463BActive Publication Date: 2026-07-03FOUNDER SECURITIES CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
FOUNDER SECURITIES CO LTD
Filing Date
2026-05-06
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Traditional interceptor mechanisms cannot fully verify multiple business dimensions, may miss key risk points, provide incomplete user prompts, and cause transaction risks and losses due to state pollution.

Method used

By obtaining multi-dimensional context parameters when a business delegation is triggered, the interceptor chain state is initialized, and the interceptors are asynchronously scheduled to perform conditional interception, state accumulation and transmission, and multi-stage preprocessing. The accumulated information is displayed and the operation process is driven by the results.

Benefits of technology

It achieves complete multi-dimensional risk verification, ensuring users receive accurate prompts, avoiding state contamination, and improving transaction efficiency and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122134463B_ABST
    Figure CN122134463B_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, device, and medium for processing transaction order interceptor chains, relating to the field of computer technology and applied to an interceptor manager. The method includes: when a business order is triggered, initializing the execution state of the interceptor chain after obtaining multi-dimensional context parameters from the business order base class; asynchronously scheduling interceptors in the interceptor chain according to a preset order, controlling the interceptors to perform conditional interception, state accumulation and propagation, multi-stage preprocessing, and data correction based on the multi-dimensional context parameters; when any interceptor returns a status code requiring confirmation, displaying relevant information accumulated during the interceptor's execution through a user interface callback; determining the direction of the operation flow based on the relevant information, and driving the business order base class to perform a commit or termination operation based on the execution result of the interceptor chain. This achieves intelligent, accurate, and efficient transaction order interception processing, improving user experience and transaction efficiency while avoiding state pollution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a transaction order interceptor chain processing method, apparatus, device, and medium. Background Technology

[0002] With the development of fintech, securities trading systems are becoming increasingly complex. Before a trading order is submitted, multi-layered verification involving multiple business dimensions is required, such as risk warnings, agreement confirmation, price verification, quantity verification, and account permission verification. However, traditional interceptor mechanisms have the following problems: interceptors typically only receive parameters from a single business object, resulting in incomplete verification logic and potential omission of key risk points. Users may trade without fully understanding the risks, increasing trading risk; warnings and error messages detected by the front-end interceptor cannot be passed to the back-end interceptor, resulting in incomplete information for users and affecting the accuracy of their decisions; the interceptor chain state persists, and switching trading targets may cause state pollution, leading to verification errors or trading losses. Summary of the Invention

[0003] The purpose of this invention is to provide a transaction order interceptor chain processing method, apparatus, device, and medium that can realize transaction order interception processing that supports multi-dimensional context, state accumulation and transmission, intelligent interception judgment, and complete lifecycle management, thereby improving interception accuracy, user experience, and transaction efficiency, and avoiding state pollution.

[0004] To address the aforementioned technical problems, this invention provides a transaction delegation interceptor chain processing method, applied to an interceptor manager, comprising:

[0005] When a business delegate is triggered, the execution state of the interceptor chain is initialized after obtaining multi-dimensional context parameters from the business delegate base class.

[0006] Interceptors in the interceptor chain are asynchronously scheduled in a preset order, and the interceptors are controlled to perform conditional interception, state accumulation and propagation, multi-stage preprocessing and data correction based on the multi-dimensional context parameters.

[0007] When any interceptor returns a status code that requires confirmation, the relevant information accumulated during the execution of the interceptor is displayed through the interface callback interface.

[0008] Based on the relevant information, the direction of the operation process is determined, and combined with the execution result of the interceptor chain, the business delegate base class is driven to perform a submission operation or a termination operation.

[0009] To address the aforementioned technical problems, the present invention also provides a transaction delegation interceptor chain processing device, comprising:

[0010] The state initialization module is used to initialize the execution state of the interceptor chain after obtaining multi-dimensional context parameters from the business delegate base class when the business delegate is triggered.

[0011] The interceptor management module is used to asynchronously schedule the interceptors in the interceptor chain according to a preset order, and control the interceptors to perform conditional interception, state accumulation and transmission, multi-stage preprocessing and data correction based on the multi-dimensional context parameters.

[0012] The information display module is used to display relevant information accumulated during the execution of any interceptor through a UI callback interface when any interceptor returns a status code that requires confirmation.

[0013] The driver module is used to determine the direction of the operation process based on the relevant information, and, in conjunction with the execution result of the interceptor chain, drive the business delegate base class to perform a submission operation or a termination operation.

[0014] To address the aforementioned technical problems, the present invention also provides an electronic device, comprising: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of the transaction delegation interceptor chain processing method described above.

[0015] To address the aforementioned technical problems, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the transaction delegation interceptor chain processing method described above.

[0016] The beneficial effects of this invention are as follows: The transaction delegation interceptor chain processing method provided by this invention, by initializing the interceptor chain execution state after the business delegation is triggered and the business delegation base class obtains multi-dimensional context parameters, can support the transmission and utilization of multi-dimensional business context, enabling the interceptor to consider multiple dimensions simultaneously, making the verification logic more complete and preventing the omission of key risk points; by asynchronously scheduling interceptors according to a preset order and performing conditional interception, state accumulation and transmission, multi-stage preprocessing and data correction based on multi-dimensional context parameters, the cumulative transmission of state in the interceptor chain is realized, ensuring that the verification results are transmitted sequentially and continuously accumulated during the interception execution process, while also realizing the conditional interception. Component-based interception and automatic data correction provide users with more accurate prompts, aiding in informed decision-making and improving user experience and transaction efficiency. When any interceptor returns a confirmation status code, accumulated information is displayed via a UI callback interface, providing accurate prompts and enabling users to receive complete and accurate risk warnings. This facilitates informed decision-making and prevents overlooking critical risks. The system determines the operational flow based on relevant information and drives the business delegation base class to commit or terminate operations based on the execution results, achieving complete lifecycle management of the interceptor chain, preventing state pollution, and making the verification logic more comprehensive and rigorous, thus improving the overall stability and security of business delegation processing.

[0017] In addition, the present invention also provides a corresponding transaction order interceptor chain processing device, electronic device and computer-readable storage medium for the transaction order interceptor chain processing method, which have the same or corresponding technical features as the transaction order interceptor chain processing method mentioned above, and have the same effect. Attached Figure Description

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

[0019] Figure 1 A flowchart of the transaction delegation interceptor chain processing method provided in this embodiment of the invention;

[0020] Figure 2 A signaling interaction diagram for receiving three-dimensional parameters and initializing the interceptor chain, provided for embodiments of the present invention;

[0021] Figure 3 This is a signaling interaction diagram of a risk interceptor performing conditional interception, provided in an embodiment of the present invention.

[0022] Figure 4This is a signaling interaction diagram for the cumulative transmission of the execution status of the control protocol interceptor provided in an embodiment of the present invention;

[0023] Figure 5 This is a signaling interaction diagram of the control confirmation interceptor performing multi-stage preprocessing and data correction according to an embodiment of the present invention;

[0024] Figure 6 A signaling interaction diagram for a transaction order submission or termination operation provided in an embodiment of the present invention;

[0025] Figure 7 This is a schematic diagram of the transaction delegation interceptor chain processing device provided in an embodiment of the present invention. Detailed Implementation

[0026] The technical solutions of 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 of ordinary skill in the art without creative effort are within the protection scope of the present invention.

[0027] It should be noted that, in the description of this invention, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., used in this invention are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0028] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0029] The specific application environment architecture or specific hardware architecture on which the execution of the transaction delegation interceptor chain processing method depends is described here.

[0030] The embodiments of the present invention provide a transaction delegation interceptor chain processing method, and the method is described in detail in conjunction with the execution flow of the transaction delegation interceptor chain processing method. Figure 1 The flowchart of the transaction delegation interceptor chain processing method provided in the embodiments of the present invention is as follows: Figure 1 As shown, this method is applied to the interceptor manager and includes:

[0031] S101. When a business delegate is triggered, after obtaining multi-dimensional context parameters from the business delegate base class, the execution state of the interceptor chain is initialized.

[0032] It should be noted that in this invention, the multi-dimensional context parameters can include business order information objects, stock basic information objects, and real-time market information objects. A business order information object refers to an object containing data related to a trading order, which may include attributes such as order price, quantity, direction, account, and confirmation flag. A stock basic information object refers to an object containing static stock information, which may include attributes such as stock code, market type, exchange type, and stock type. A real-time market information object refers to an object containing dynamic stock market data, which may include attributes such as current price, percentage change, and buy / sell orders.

[0033] A business delegation base class is an abstract foundation class that encapsulates delegation scheduling logic, allowing business delegation classes to inherit and reuse it, thus decoupling business request forwarding and processing. The business delegation base class can include an interceptor manager. The interceptor manager can maintain a list of interceptors.

[0034] When executing step S101, the business delegate base class collects context parameters from multiple dimensions, including the trading target, user account, and real-time market data, when the business delegate is triggered. After collecting the multi-dimensional context parameters, the interceptor manager can first initialize the execution state of the interceptor chain, receive the multi-dimensional context parameters through the interceptor interface, and then execute the interception logic. This allows the interceptor to make judgments based on the complete business context. The interceptor can simultaneously consider multiple dimensions such as stock type, price deviation, and price limits, making the verification logic more complete, ensuring no key risk points are missed, and providing users with more accurate prompts, thus helping to make correct decisions. This solves the problem that traditional methods cannot make intelligent judgments based on multi-dimensional context.

[0035] S102. Asynchronously schedule the interceptors in the interceptor chain according to the preset order, and control the interceptors to perform conditional interception, state accumulation and transmission, multi-stage preprocessing and data correction based on multi-dimensional context parameters.

[0036] It should be noted that conditional interception refers to a mechanism where the interceptor determines whether to actually execute the interception operation based on business conditions. State accumulation and propagation refers to the process where the state information set by the preceding interceptor is read and used by the following interceptors, and the state accumulates continuously in the interception chain. Multi-stage preprocessing refers to the interceptor performing multiple stages of preprocessing (such as setting warning messages and error messages) before executing the interception.

[0037] When executing step S102, this invention, when executing the interception chain, can uniformly pass the three-dimensional context parameters to each interceptor. Following the pre-configured interceptor execution order, each interceptor in the interceptor chain is scheduled to start running asynchronously and serially. Specifically, after the previous interceptor completes its execution and returns its result, the next interceptor is started, ensuring that the interceptors execute sequentially according to the pre-configured order without blocking the main thread or interrupting the user interface. The corresponding interceptors can perform conditional interception, state accumulation and propagation, multi-stage preprocessing, and data correction based on unified multi-dimensional context parameters. This achieves the ability to dynamically determine interception actions based on business scenarios, ensures the integrity and consistency of verification results through state accumulation and propagation, and completes data correction during the preprocessing stage, reducing the error rate in subsequent processes and improving the overall security and user experience of transaction delegation processing.

[0038] S103. When any interceptor returns a status code that requires confirmation, display the relevant information accumulated by the interceptor during execution through the interface callback interface.

[0039] Step S103 establishes an interaction channel between the interceptor chain and the user interface. Through the interface callback interface, multi-dimensional verification information accumulated during interceptor execution, such as risk warnings, data correction instructions, and rule verification results, is synchronously displayed to the user. When user confirmation is required, an interactive dialog box is displayed through the interface callback interface, and the corresponding execution status is returned based on the user's confirmation or cancellation operation. When any interceptor returns a status code requiring confirmation, this invention can present complete accumulated information through the interface callback interface, rather than fragmented single prompts, ensuring that the user fully understands all risks and status changes of the current entrustment. When user confirmation is not required, this invention can directly execute the interception action and return a successful execution status.

[0040] S104. Determine the direction of the operation process based on relevant information, and in conjunction with the execution results of the interceptor chain, drive the business delegate base class to perform a submission operation or a termination operation.

[0041] When executing step S104, based on the relevant information accumulated during the execution of the interceptor chain, the branching direction of the subsequent business process can be determined. At the same time, the business process is finally controlled by combining the overall execution result. The business delegate base class uniformly executes the delegate submission or process termination operation, which ensures the integrity and consistency of the delegate processing logic and avoids process branch confusion. At the same time, the final operation is closed to the business delegate base class, which effectively decouples the interception logic from the main business logic. This ensures that transaction risks are fully verified and the process flow is standardized, thereby improving the stability and reliability of the overall business processing.

[0042] In the transaction delegation interceptor chain processing method provided in this embodiment of the invention, after the business delegation is triggered and the business delegation base class obtains multi-dimensional context parameters, the interceptor manager initializes the execution state of the interceptor chain. This supports the transmission and utilization of multi-dimensional business context, allowing the interceptor to consider multiple dimensions simultaneously, making the verification logic more complete and preventing the omission of key risk points. The interceptors are asynchronously scheduled according to a preset order and perform conditional interception, state accumulation and transmission, multi-stage preprocessing, and data correction based on multi-dimensional context parameters. This achieves the accumulation and transmission of states in the interceptor chain, ensuring that verification results are transmitted sequentially and continuously accumulated during the interception execution process, while also realizing conditional interception. With automatic data correction, the prompts displayed to users are more accurate, helping them make correct decisions and thus improving user experience and transaction efficiency. When any interceptor returns a status code requiring confirmation, the accumulated relevant information is displayed through the interface callback interface, enabling the output of accurate prompts. This allows users to receive complete and accurate risk warnings, facilitating correct decision-making based on relevant information and avoiding the omission of key risk points. Based on relevant information, the operation process is determined, and the execution results drive the business delegation base class to perform submission or termination operations, realizing complete lifecycle management of the interceptor chain, avoiding state pollution, making the verification logic more comprehensive and rigorous, and improving the overall stability and security of business delegation processing.

[0043] It should be noted that the above-mentioned transaction order interceptor chain processing method provided by the present invention can be applied to the order processing process of a securities trading system, such as: multi-level verification before the submission of stock buy and sell orders, risk warning and user confirmation process, data format verification and automatic correction, and transaction rule compliance check.

[0044] Furthermore, in a specific implementation, in the transaction delegation interceptor chain processing method provided in the embodiments of the present invention, after obtaining the multi-dimensional context parameters in the business delegation base class, step S101 initializes the execution state of the interceptor chain, which may specifically include: identifying key business nodes and monitoring whether the business delegation base class has completed the acquisition of multi-dimensional context parameters; after confirming that the multi-dimensional context parameters have been acquired, performing a reset operation of the interceptor chain at the key business node; the reset operation includes: setting the length of the interceptor list corresponding to the interceptor chain to zero and clearing the references of each interceptor object so that the interceptor chain is reset to the initial empty state; and reconfiguring the interceptor chain according to the current business scenario to add the required interceptors.

[0045] In implementation, this invention identifies key business nodes such as switching transaction targets and transaction types, and simultaneously monitors whether the business delegation base class has completed the acquisition of multi-dimensional context parameters. After confirming that the parameters have been acquired, an interceptor chain reset operation is performed at the corresponding key node. For example, the length of the interceptor list is set to zero, so that the interceptor list is reset to an empty array, and all object references of the interceptors are cleared, so that the interceptor chain is restored to its initial empty state. Then, the required interceptors are reconfigured and loaded according to the current business scenario (building the interceptor chain). This achieves fine-grained lifecycle management of the interceptor chain, which can effectively avoid the pollution of the new context by the previous residual state when switching business scenarios, ensure that the verification process starts on a clean environment, improve the accuracy of verification results and the reliability of prompt information, and make the system process more standardized and the operation more stable.

[0046] Figure 2 This is a signaling interaction diagram provided for receiving three-dimensional parameters and initializing the interceptor chain in an embodiment of the present invention. For example... Figure 2 As shown, after a user submits a request for authorization, the business authorization base class first acquires and constructs context parameters for three dimensions: business authorization information object, stock basic information object, and real-time market information object. Then, it calls the interceptor manager to initialize the interceptor chain execution state and initiates an interceptor chain execution request with the complete context parameters. The interceptor manager then passes the multi-dimensional context to the risk interceptor, driving it to execute conditional interception logic based on the business object, stock information, and market information. This process achieves complete collection and transmission of multi-dimensional context, providing the interceptor with comprehensive decision-making basis and ensuring the integrity and accuracy of the risk interception logic.

[0047] Furthermore, this invention can also flexibly manage the interceptor chain using configuration files. The relevant configuration information of the interceptor chain is stored in the configuration file, which is automatically read and dynamically loaded when the system starts. Simultaneously, the appropriate configuration file can be selected as needed based on different business scenarios. This implementation allows for free adjustment of the combination and execution order of interceptors without modifying the code, significantly improving the flexibility and maintainability of the interceptor chain configuration and effectively reducing the cost of business expansion and rule updates.

[0048] Furthermore, in a specific implementation, in the transaction delegation interceptor chain processing method provided in the embodiments of the present invention, step S102, which controls the interceptor to perform conditional interception based on multi-dimensional context parameters, may specifically include: controlling the interceptor to perform condition judgment according to preset business rules based on multi-dimensional context parameters; determining whether the current business meets the preset interception conditions based on the condition judgment result; if it is determined that the preset interception conditions are not met, controlling the corresponding interceptor to return to the successful execution state and not to perform the interception action; if it is determined that the preset interception conditions are met, controlling the corresponding interceptor to perform the interception operation.

[0049] In implementation, this invention employs a conditional interception judgment mechanism to achieve flexible business interception control. The interceptor performs conditional judgments based on multi-dimensional context parameters and preset business rules, determining whether the current business meets the preset interception conditions based on the judgment results. If the preset interception conditions are not met, the corresponding interceptor returns to a successful execution state without performing any interception action. If the preset interception conditions are met, the corresponding interceptor performs the interception operation. The multi-dimensional conditional judgment can be completed by the interceptor based on context parameters from three dimensions: basic stock information, business order information, and real-time market information. Basic stock information includes stock type, market type, and exchange type; business order information includes order direction, order attribute, and account type; and real-time market information includes current price, price change, and price deviation. During execution, the interceptor prioritizes conditional judgments. If the conditions are not met, it directly returns to a successful state without performing any interception operation; if the conditions are met, it performs the corresponding interception operation. When an interceptor requires user confirmation, an interactive dialog box is displayed via a UI callback interface. This dialog box shows accumulated warnings, errors, and other status information accumulated during execution. Upon user confirmation, the interceptor sets a confirmation flag and returns a success status; if the user cancels, it returns a failure status and terminates the entire interception chain. This conditional interception mechanism achieves flow control through asynchronous success and failure callback mechanisms (such as the resolve / reject mechanism of Promise). The interceptor returns an asynchronous processing object (such as a Promise object). A success callback (resolve) is triggered when the condition is not met; a success callback (resolve) is triggered when the condition is met and the user confirms; and a failure callback (reject) is triggered when the user cancels. The interceptor manager receives the execution result of each interceptor synchronously via await. If a failure result is received, the entire process is immediately terminated. Through conditional judgment and asynchronous flow control, precise conditional interception is achieved, effectively skipping unnecessary interception operations, reducing user operation steps, and significantly improving user experience and transaction efficiency.

[0050] Figure 3 This is a signaling interaction diagram illustrating the conditional interception performed by the risk control interceptor according to an embodiment of the present invention. Figure 3As shown, the interceptor manager calls the risk interceptor with multi-dimensional context parameters. The risk interceptor then performs conditional judgments based on the business object, stock information, and market data. When a stock is determined to be at risk of delisting, the risk interceptor reads the status of the business order information object and displays a risk confirmation dialog box to the user through a callback interface. After the user clicks "confirm," the risk interceptor modifies the status of the business order information object and reports the updated result, ultimately returning a "passed" status to the interceptor manager. When a stock is determined not to be at risk of delisting, the risk interceptor directly returns a "directly passed" status to the interceptor manager without additional interaction. This process fully presents the branching logic, user interaction, and status update process of conditional interception. Through multi-dimensional context judgment, it achieves accurate conditional interception, providing necessary user confirmation for high-risk transactions and enabling rapid passage for risk-free scenarios, effectively improving transaction security and user experience.

[0051] Furthermore, this invention can also employ a chain-of-responsibility pattern to implement flow control for the interceptor chain, where each interceptor autonomously decides whether to pass the flow to the next node. Specifically, after an interceptor completes its execution, it returns a flag indicating whether to continue execution. If it returns to continue, the flow is passed to the next interceptor; if it returns to stop, the entire interceptor chain is terminated. This ensures stable chain execution of interceptors, provides independent error and process termination handling mechanisms, and enhances the flexibility and adaptability of interceptor execution control.

[0052] This invention can also employ a strategy-based design to achieve dynamic selection of interceptors. By defining interceptor strategy interfaces, different business scenarios can implement independent interceptor strategies. At runtime, the system automatically matches and selects the corresponding interceptor strategy based on actual business scenarios such as stock type and transaction type, and the strategy loads the interceptor combination required for the current scenario. This allows for dynamic adjustment of the interceptor combination without modifying the code, significantly improving the flexibility and scalability of interceptor configuration and giving the system stronger adaptability to business scenarios.

[0053] Furthermore, in a specific implementation, in the transaction delegation interceptor chain processing method provided in the embodiments of the present invention, step S102, which controls the interceptor to perform state accumulation and transmission based on multi-dimensional context parameters, may specifically include: controlling the interceptor to perform state read and write operations on the business delegation information object in the multi-dimensional context parameters according to the execution order of the interceptor chain; wherein the business delegation information object includes warning information attributes, pre-error information attributes, and confirmation flag attributes; controlling the currently executing interceptor to read the existing state information and write new state information on the read state information; and transmitting the updated state information to the next sequentially executed interceptor in the interceptor chain, so that the state information is transmitted sequentially and continuously accumulated during the interception execution process.

[0054] In implementation, this invention can control interceptors to perform state read and write operations on business delegation information objects in multi-dimensional context parameters according to the execution order of the interceptor chain. The business delegation information object contains modifiable state attributes, specifically warning information attributes, pre-error information attributes, and confirmation flag attributes. The warning information attribute stores various risk warning messages, the pre-error information attribute stores verification error messages, and the confirmation flag attribute marks whether the user has confirmed. During execution, the currently executing interceptor reads existing state information and writes new state information onto it. The updated state information is then passed to the next interceptor in the interceptor chain, allowing state information to be passed sequentially and continuously accumulated during interception execution. The first interceptor reads the initial state and sets new state information; the second interceptor reads the state information set by the preceding interceptor and updates it accordingly, and so on, accumulating state information in the interceptor chain to form a complete verification result. The status information set by the pre-interceptor can be read and used by the post-interceptor, which solves the problem that interceptors cannot share and accumulate verification results in the existing technology. It can completely pass the warning information and error messages found by the pre-interceptor to the post-interceptor, so that the prompt information finally displayed to the user includes all verification results. At the same time, it allows the post-interceptor to make further judgments based on the previous verification results, which significantly improves the completeness and accuracy of the interception process.

[0055] Figure 4 This is a signaling interaction diagram illustrating the cumulative transmission of the execution state of the control protocol interceptor provided in an embodiment of the present invention. (See diagram below.) Figure 4 As shown, the interceptor manager carries multi-dimensional context parameters such as business objects, stock information, and market data, and calls the protocol interceptor to perform interception operations. The protocol interceptor first reads the status of the business entrustment information object, obtains and receives the accumulated status information set by the preceding risk interceptor, and then displays a protocol confirmation dialog box to the user through a UI callback interface, presenting the protocol content and accumulated risk warning information to the user in its entirety. After the user clicks confirm, the UI callback interface returns a confirmation result to the protocol interceptor. After the protocol interceptor completes the status update, it returns a "passed" status to the interceptor manager, and the process continues. This process clearly demonstrates the collaboration process and status read / write logic among multiple roles, verifying the feasibility and effectiveness of the status accumulation and transmission mechanism.

[0056] In addition, the present invention can also use an event publish-subscribe mechanism to replace the object reference passing method to achieve state accumulation. Specifically, during the execution of the interceptor, the state information is published to the event bus. The subsequent interceptor receives the state information published by the preceding interceptor by subscribing to the corresponding event. The state information is passed through the event parameters. There is no need to directly modify the business delegate information object. The state accumulation and transmission function in the interceptor chain can also be realized.

[0057] This invention can also employ a state machine pattern to achieve standardized management of interceptor states. By defining a state machine corresponding to the interceptor, multiple operating states and state transition rules are set. During interceptor execution, based on the current state and multi-dimensional context input parameters, the interceptor automatically transitions to the next state according to the rules, and executes the corresponding interception logic during the state transition. This approach makes the interceptor's state management more standardized and orderly, and the state transition logic clearer and more explicit, providing a more standardized and controllable state management method for the interceptor chain.

[0058] Furthermore, in a specific implementation, in the above-mentioned transaction order interceptor chain processing method provided in the embodiments of the present invention, step S102 controls the interceptor to perform multi-stage preprocessing based on multi-dimensional context parameters. Specifically, it may include: controlling the interceptor to complete multi-stage preprocessing operations sequentially based on multi-dimensional context parameters before performing the interception operation; in the warning information setting stage, risk judgment is performed based on multi-dimensional context parameters, and the judgment results of delisting risk, bond risk, and price deviation risk are written into the warning information attribute of the business order information object; in the error information setting stage, account verification, price verification, and quantity verification are performed based on multi-dimensional context parameters, and the verification results are written into the pre-error information attribute of the business order information object.

[0059] In practice, this invention can control the interceptor to complete multi-stage preprocessing operations based on multi-dimensional context parameters before performing interception operations, thus decomposing complex business rule judgments into multiple stages:

[0060] During the warning information setting phase, the interceptor judges various risks based on context parameters from three dimensions: basic stock information, business order information, and real-time market information. This includes judging delisting risk based on the sector status in the basic stock information, judging bond risk based on stock type and convertible bond type, and judging price deviation risk based on the deviation calculated from the order price and yesterday's valuation. The judgment results of each risk are then written into the warning information attribute of the business order information object.

[0061] During the error message setting phase, the interceptor also performs comprehensive business rule verification based on multi-dimensional context parameters, including account verification (whether the account exists and whether it supports the current transaction type), price verification (whether the price exceeds the daily limit and whether the price accuracy meets the rules), and quantity verification (whether the quantity exceeds the operable range and whether it meets the minimum transaction unit). The results of each verification are written into the pre-error message attribute of the business entrustment information object.

[0062] After the preprocessing results are written into the business delegation information object, they can be directly displayed and used by the user interface, or read by subsequent interceptors to carry out further judgment and processing based on the preprocessing results.

[0063] Furthermore, in a specific implementation, in the transaction order interceptor chain processing method provided in the embodiments of the present invention, step S102, which controls the interceptor to perform data correction based on multi-dimensional context parameters, may specifically include: controlling the interceptor to detect the data format of the business order information object in the multi-dimensional context parameters; if the detected data format does not meet the preset requirements, then calculating the allowed data range according to the preset transaction rules; if the data of the business order information object exceeds the allowed data range, then correcting the data by truncation or rounding; writing the corrected data back to the business order information object, and recording the corresponding correction description in the error information attribute of the business order information object.

[0064] In implementation, this invention can control the interceptor to detect the data format of the business entrustment information object in multi-dimensional context parameters. If the detected data format does not meet the preset requirements, the allowed data range is calculated according to the preset trading rules. If the data of the business entrustment information object exceeds the allowed data range, the data is corrected by truncation or rounding through an automatic data correction mechanism. The corrected data is written back to the business entrustment information object, and the corresponding correction description is recorded in the error information attribute of the business entrustment information object. Specifically, the automatic data correction mechanism can include: during the verification process, the interceptor detects the data format in the business entrustment information object. The detection items include whether the price precision meets the trading rules (such as the price precision limit for convertible bonds in a specific trading sector) and whether the quantity meets the trading unit requirements (such as whether it is an integer multiple of the minimum trading unit). If a data format error is detected, the interceptor will automatically correct it: when the price precision exceeds the limit, the maximum allowed precision is calculated, and the price is truncated to that precision; when the quantity does not meet the requirements, it is adjusted to the closest compliant quantity. The corrected data is written back to the business entrustment information object, and the correction description is recorded in the error information attribute. The user can see a prompt that the data has been corrected in the confirmation dialog box. The automatic data correction mechanism's process steps may include: reading price or quantity data from the business order information object; calculating the allowed data range based on trading rules (such as price precision and minimum trading unit) in the stock's basic information; determining whether the current data exceeds the allowed range; if so, calculating the corrected data value (such as price truncation and quantity rounding); writing the corrected data back to the business order information object; and recording the correction description in the error message attribute. Through this automatic data correction mechanism, data errors can be automatically corrected during the interception process, reducing the order failure rate caused by data format issues, while ensuring that users can clearly understand the data correction status, thus improving the success rate of transaction processing and user experience.

[0065] Figure 5 This is a signaling interaction diagram illustrating the multi-stage preprocessing and data correction performed by the control confirmation interceptor provided in an embodiment of the present invention. Figure 5As shown, the interceptor manager carries multi-dimensional context parameters such as business objects, stock information, and market information, and calls the confirmation interceptor to execute the interception operation. The confirmation interceptor first completes multi-stage preprocessing (such as setting warning messages and error messages) and data correction, then reads the accumulated status information of the business order information object, and writes new warning messages and error messages on this basis. After completing the status update, it displays a comprehensive confirmation dialog box containing all accumulated statuses to the user through the interface callback interface, integrating warning messages, error messages, and order details to present to the user. User interaction is divided into two branches: when the user clicks confirm, the interface callback interface returns the confirmation result, the confirmation interceptor modifies the confirmation flag attribute of the business order information object and updates the status, and then returns the "passed" status to the interceptor manager; when the user clicks cancel, the interface callback interface returns the cancellation result, the confirmation interceptor returns the "aborted" status to the interceptor manager, and the process terminates. This process intuitively reflects the integrated implementation of multi-stage preprocessing, automatic data correction, status accumulation and transmission, and user interaction, ensuring that users can obtain complete risk and verification information, providing a comprehensive basis for subsequent trading decisions, while clearly defining the process flow corresponding to different user operations, ensuring the integrity and controllability of the interception logic.

[0066] Furthermore, in a specific implementation, in the transaction entrustment interceptor chain processing method provided in the embodiments of the present invention, step S104 determines the direction of the operation process based on relevant information, and drives the business entrustment base class to perform a submission operation or a termination operation in combination with the execution result of the interceptor chain. Specifically, it may include: determining the process control direction based on the target operation corresponding to the relevant information, and making a comprehensive judgment on the process control direction in combination with the execution result of the interceptor chain; if the comprehensive judgment result meets the business entrustment submission conditions, then the business entrustment base class is driven to perform a submission operation; if the comprehensive judgment result does not meet the business entrustment submission conditions, then the business entrustment base class is driven to perform a termination operation.

[0067] In implementation, this invention uses information generated from user interaction and multi-stage interception to determine the flow control direction and makes a comprehensive judgment based on the overall execution result of the interceptor chain. If the comprehensive judgment result indicates that the business entrustment has met all submission conditions, the business entrustment base class is driven to execute the entrustment submission operation; if the comprehensive judgment result indicates that the submission conditions are not met, the business entrustment base class is driven to execute the process termination operation. This ensures the integrity of all risk verification and user confirmation stages and ensures that the final execution logic of the business process is highly consistent with the interception result, effectively realizing risk control and standardized execution throughout the entire transaction process.

[0068] Figure 6 This is a signaling interaction diagram for a transaction order submission or termination operation provided in an embodiment of the present invention. (See diagram below.) Figure 6As shown, when all interceptors pass verification, the interceptor manager returns a success status to the business delegation base class. The business delegation base class then sends a complete delegation request package containing the accumulated status to the transaction system and informs the user that the delegation submission was successful. When any interceptor rejects the request, the interceptor manager returns a failure status to the business delegation base class, which terminates the delegation process and informs the user that the delegation has been cancelled. This process ensures that the submission operation is only executed after all risk checks pass, and it can quickly terminate the process if any interception fails, effectively avoiding invalid delegation submissions. At the same time, by including the accumulated status information in the request package, it provides a complete verification basis for subsequent transaction processing, thus improving the standardization, security, and traceability of the transaction process as a whole.

[0069] From the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by software plus necessary general-purpose hardware platforms, and of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0070] Embodiments of the present invention also provide a transaction delegation interceptor chain processing device. Figure 7 This is a schematic diagram of the transaction delegation interceptor chain processing device provided in an embodiment of the present invention. This embodiment is based on functional modules, such as… Figure 7 As shown, the device includes:

[0071] The state initialization module 10 is used to initialize the execution state of the interceptor chain after obtaining multi-dimensional context parameters from the business delegate base class when the business delegate is triggered.

[0072] Interceptor management module 11 is used to asynchronously schedule interceptors in the interceptor chain according to a preset order, and control the interceptors to perform conditional interception, state accumulation and transmission, multi-stage preprocessing and data correction based on multi-dimensional context parameters.

[0073] Information display module 12 is used to display relevant information accumulated by the interceptor during execution through the interface callback interface when any interceptor returns a status code that requires confirmation.

[0074] The operation driver module 13 is used to determine the direction of the operation process based on relevant information, and, in conjunction with the execution results of the interceptor chain, drive the business delegate base class to perform a submission operation or a termination operation.

[0075] In the transaction delegation interceptor chain processing device provided in this embodiment of the invention, through the interaction of the above four modules, after the business delegation is triggered and the business delegation base class obtains multi-dimensional context parameters, the interceptor manager initializes the execution state of the interceptor chain, which can support the transmission and utilization of multi-dimensional business context. This allows the interceptor to consider multiple dimensions simultaneously, making the verification logic more complete and preventing the omission of key risk points. The interceptors are asynchronously scheduled according to a preset order and perform conditional interception, state accumulation and transmission, multi-stage preprocessing, and data correction based on multi-dimensional context parameters. This achieves the accumulation and transmission of states in the interceptor chain, ensuring that the verification results are transmitted sequentially and continuously accumulated during the interception execution process. This system implements conditional interception and automatic data correction, resulting in more accurate prompts for users, which helps them make correct decisions and improves user experience and transaction efficiency. When any interceptor returns a status code requiring confirmation, the system displays accumulated relevant information through a callback interface, providing accurate prompts and enabling users to receive complete and accurate risk warnings. This allows users to make correct decisions based on the relevant information and avoid overlooking key risk points. Based on the relevant information, the system determines the operation flow and drives the business delegation base class to perform submission or termination operations, achieving complete lifecycle management of the interceptor chain, avoiding state pollution, making the verification logic more comprehensive and rigorous, and improving the overall stability and security of business delegation processing.

[0076] Since the embodiments of the transaction order interceptor chain processing device and the transaction order interceptor chain processing method correspond to each other, the descriptions of the features in the embodiments corresponding to the transaction order interceptor chain processing device can be found in the relevant descriptions of the embodiments corresponding to the transaction order interceptor chain processing method, and will not be repeated here. Furthermore, it has the same beneficial effects as the transaction order interceptor chain processing method mentioned above.

[0077] Furthermore, in a specific implementation, in the transaction delegation interceptor chain processing device provided in the embodiments of the present invention, the state initialization module 10 can be specifically used to identify key business nodes and monitor whether the business delegation base class has completed the acquisition of multi-dimensional context parameters; after confirming that the multi-dimensional context parameters have been acquired, the interceptor chain is reset at the key business node; the reset operation includes: setting the length of the interceptor list corresponding to the interceptor chain to zero and clearing the references of each interceptor object so that the interceptor chain is reset to the initial empty state; and reconfiguring the interceptor chain according to the current business scenario to add the required interceptors.

[0078] Furthermore, in a specific implementation, in the transaction delegation interceptor chain processing device provided in the embodiments of the present invention, the interceptor management module 11 may specifically include:

[0079] The conditional interception unit is used to control the interceptor to perform condition judgments based on multi-dimensional context parameters and preset business rules; based on the condition judgment results, it determines whether the current business meets the preset interception conditions; if it is determined that the preset interception conditions are not met, it controls the corresponding interceptor to return a successful execution status and does not perform an interception action; if it is determined that the preset interception conditions are met, it controls the corresponding interceptor to perform an interception operation.

[0080] Furthermore, in a specific implementation, the interceptor management module 11 in the transaction delegation interceptor chain processing device provided in the embodiments of the present invention may further include:

[0081] The state accumulation and transmission unit is used to control the interceptors to perform state read and write operations on the business delegation information object in the multi-dimensional context parameters according to the execution order of the interceptor chain. The business delegation information object includes warning information attributes, pre-error information attributes, and confirmation flag attributes. It controls the currently executing interceptor to read the existing state information and write the new state information on the read state information. The updated state information is then passed to the next interceptor to be executed in the interceptor chain, so that the state information is passed sequentially and continuously accumulated during the interception execution process.

[0082] Furthermore, in a specific implementation, the interceptor management module 11 in the transaction delegation interceptor chain processing device provided in the embodiments of the present invention may further include:

[0083] The multi-stage preprocessing unit is used to control the interceptor to complete multi-stage preprocessing operations sequentially based on multi-dimensional context parameters before executing the interception operation. In the warning information setting stage, risk judgment is performed based on multi-dimensional context parameters, and the judgment results of delisting risk, bond risk and price deviation risk are written into the warning information attribute of the business entrustment information object. In the error information setting stage, account verification, price verification and quantity verification are performed based on multi-dimensional context parameters, and the verification results are written into the pre-error information attribute of the business entrustment information object.

[0084] Furthermore, in a specific implementation, the interceptor management module 11 in the transaction delegation interceptor chain processing device provided in the embodiments of the present invention may further include:

[0085] The data correction unit controls the interceptor to detect the data format of the business entrustment information object in the multi-dimensional context parameters; if the detected data format does not meet the preset requirements, the allowed data range is calculated according to the preset transaction rules; if the data of the business entrustment information object exceeds the allowed data range, the data is corrected by truncation or rounding; the corrected data is written back to the business entrustment information object, and the corresponding correction description is recorded in the error information attribute of the business entrustment information object.

[0086] Furthermore, in a specific implementation, in the transaction entrustment interceptor chain processing device provided in the embodiments of the present invention, the operation driving module 13 can be specifically used to determine the process control direction based on the target operation corresponding to the relevant information, and to make a comprehensive judgment by combining the process control direction with the execution result of the interceptor chain; if the comprehensive judgment result meets the business entrustment submission conditions, the business entrustment base class is driven to perform the submission operation; if the comprehensive judgment result does not meet the business entrustment submission conditions, the business entrustment base class is driven to perform the termination operation.

[0087] Embodiments of the present invention also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above embodiments of the transaction delegation interceptor chain processing method.

[0088] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described embodiments of the transaction delegation interceptor chain processing method when running.

[0089] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0090] Embodiments of the present invention also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above embodiments of the transaction delegation interceptor chain processing method.

[0091] Embodiments of the present invention also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described embodiments of the transaction delegation interceptor chain processing method.

[0092] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0093] The foregoing has provided a detailed description of the transaction delegation interceptor chain processing method, apparatus, device, and medium provided by this invention. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the above embodiments are only intended to help understand the method and core ideas of this invention. It should be noted that those skilled in the art can make various improvements and modifications to this invention without departing from its principles, and these improvements and modifications also fall within the protection scope of this invention.

Claims

1. A method for processing a transaction delegation interceptor chain, characterized in that, Applied to the interceptor manager, including: When a business delegate is triggered, the execution state of the interceptor chain is initialized after obtaining multi-dimensional context parameters from the business delegate base class. Interceptors in the interceptor chain are asynchronously scheduled according to a preset order. The interceptors are controlled to perform conditional interception, state accumulation and propagation, multi-stage preprocessing, and data correction based on the multi-dimensional context parameters. Specifically, controlling the interceptors to perform state accumulation and propagation based on the multi-dimensional context parameters includes: controlling the interceptors to perform state read / write operations on the business delegation information object in the multi-dimensional context parameters according to the execution order of the interceptor chain; wherein the business delegation information object includes warning information attributes, pre-error information attributes, and confirmation flag attributes; controlling the currently executing interceptor to read existing state information and write new state information onto the read state information; and propagating the updated state information to the next interceptor in the interceptor chain, so that the state information is propagated sequentially and continuously accumulated during the interception execution process. When any interceptor returns a status code that requires confirmation, the relevant information accumulated during the execution of the interceptor is displayed through the interface callback interface. Based on the relevant information, the direction of the operation process is determined, and combined with the execution result of the interceptor chain, the business delegate base class is driven to perform a submission operation or a termination operation.

2. The transaction delegation interceptor chain processing method according to claim 1, characterized in that, After obtaining multi-dimensional context parameters from the business delegation base class, the execution state of the interceptor chain is initialized, including: Identify key business nodes and monitor whether the business delegate base class has completed the acquisition of multi-dimensional context parameters; After confirming that the multi-dimensional context parameters have been obtained, a reset operation of the interceptor chain is performed at the business-critical node. The reset operation includes: setting the length of the interceptor list corresponding to the interceptor chain to zero and clearing the references of each interceptor object, so that the interceptor chain is reset to the initial empty state. Based on the current business scenario, reconfigure the interceptor chain to add the required interceptors.

3. The transaction delegation interceptor chain processing method according to claim 1, characterized in that, The control interceptor performs conditional interception based on the multi-dimensional context parameters, including: The control interceptor performs conditional judgments based on multi-dimensional context parameters and preset business rules. Based on the condition judgment results, determine whether the current service meets the preset interception conditions; If the preset interception conditions are not met, the corresponding interceptor will return to a successful execution status and no interception action will be performed. If the preset interception conditions are met, the corresponding interceptor will be controlled to perform the interception operation.

4. The transaction delegation interceptor chain processing method according to claim 1, characterized in that, The control interceptor performs multi-stage preprocessing based on the multi-dimensional context parameters, including: Before executing the interception operation, the control interceptor sequentially completes a multi-stage preprocessing operation based on the multi-dimensional context parameters. During the warning information setting phase, risk assessment is performed based on the multi-dimensional context parameters, and the assessment results of delisting risk, bond risk, and price deviation risk are written into the warning information attribute of the business entrustment information object. During the error message setting phase, account verification, price verification, and quantity verification are performed based on the multi-dimensional context parameters, and the verification results are written into the pre-error message attribute of the business entrustment information object.

5. The transaction delegation interceptor chain processing method according to claim 1, characterized in that, The control interceptor performs data correction based on the multi-dimensional context parameters, including: The control interceptor detects the data format of the business delegation information object in the multi-dimensional context parameters; If the data format is detected to be inconsistent with the preset requirements, the allowed data range will be calculated according to the preset transaction rules. If the data of the business entrustment information object exceeds the allowed data range, the data will be corrected by truncating or rounding. Write the corrected data back to the business delegation information object, and record the corresponding correction description in the error information attribute of the business delegation information object.

6. The transaction delegation interceptor chain processing method according to claim 1, characterized in that, Based on the aforementioned relevant information, the flow of the operation is determined, and combined with the execution results of the interceptor chain, the business delegate base class is driven to perform a submission or termination operation, including: Based on the target operation corresponding to the relevant information, determine the process control direction, and combine the process control direction with the execution result of the interceptor chain for comprehensive judgment; If the comprehensive judgment result meets the conditions for submitting the business delegate, then the base class of the business delegate will be driven to perform the submission operation; If the overall judgment result does not meet the conditions for submitting the business entrustment, then the business entrustment base class will be driven to perform a termination operation.

7. A transaction order interceptor chain processing device, characterized in that, include: The state initialization module is used to initialize the execution state of the interceptor chain after obtaining multi-dimensional context parameters from the business delegate base class when the business delegate is triggered. The interceptor management module is used to asynchronously schedule the interceptors in the interceptor chain according to a preset order, and control the interceptors to perform conditional interception, state accumulation and transmission, multi-stage preprocessing and data correction based on the multi-dimensional context parameters. The interceptor management module includes: a status accumulation and transmission unit, used to control the interceptors to perform status read and write operations on the business delegation information object in the multi-dimensional context parameters according to the execution order of the interceptor chain; wherein the business delegation information object includes warning information attributes, pre-error information attributes, and confirmation flag attributes; controls the currently executing interceptor to read the existing status information and write new status information on the read status information; and transmits the updated status information to the next interceptor to be executed in the interceptor chain, so that the status information is transmitted sequentially and continuously accumulated during the interception execution process; The information display module is used to display relevant information accumulated during the execution of any interceptor through a UI callback interface when any interceptor returns a status code that requires confirmation. The operation driving module is used to determine the direction of the operation process based on the relevant information, and, in conjunction with the execution result of the interceptor chain, drive the business delegation base class to perform a submission operation or a termination operation.

8. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the transaction delegation interceptor chain processing method as described in any one of claims 1 to 6 when executing the computer program.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the transaction delegation interceptor chain processing method as described in any one of claims 1 to 6.