Asset business processing method, electronic device and storage medium

Through the pre-configured policy factory and processor chain construction mechanism, the code coupling problem of asset business processing system is solved, flexible expansion and orderly processing processes are achieved, and the flexibility and modularity of the system are improved.

CN120182011BActive Publication Date: 2025-08-29HANGZHOU QIUGUOJIHUA TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510660456.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-22
Publication Date
2025-08-29
Estimated Expiration
2045-05-22

AI Technical Summary

Technical Problem

When handling diversified asset business, the existing technology has problems such as serious code coupling and easy to accidentally touch other logic when modifying it, and it is impossible to flexibly expand and adjust the processing process.

Method used

Through the pre-configured policy factory, a target processor chain is built, and the reflection mechanism and dependency injection mechanism are used to achieve flexible processing of asset business requests, supporting dynamic adaptation of diversified asset types and orderly orchestration of business logic.

Benefits of technology

It realizes the flexibility and scalability of the asset business processing system, avoids the limitations of hard coding, supports flexible adjustment of processing processes, and improves the modularity and adaptability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120182011B_ABST
    Figure CN120182011B_ABST
Patent Text Reader

Abstract

The present application provides an asset business processing method, electronic device, and storage medium, belonging to the field of data processing technology. The method comprises: receiving an asset business request, the asset business request including a target asset type; obtaining a target policy object corresponding to the target asset type through a preconfigured policy factory; constructing a target processor chain based on a preconfigured processor chain configuration file and the target asset type, and injecting the target policy object into the first node of the target processor chain; and calling the target processor chain to execute the asset business request. The present application can achieve high flexibility and maintainability in asset business processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to an asset business processing method, electronic device and storage medium. Background Art

[0002] With the rapid development of financial services, asset processing systems need to support a wide range of asset types (such as stocks, bonds, funds, and derivatives) and their differentiated processing logic. Traditional technical solutions often use hard-coded conditional branches, such as if-else or switch-case statements, to statically determine different asset types. This results in the mixing of processing code for different asset types within the same module, making it easy to accidentally trigger other logic when modifying a particular rule. For example, adjusting the stock fee calculation logic could accidentally disrupt the interest accrual function for bonds.

[0003] To address this, existing technologies propose a chain-of-responsibility model to decouple processing logic. For example, by chaining together verification, billing, and settlement handlers, these handlers still require an if-else check to determine asset types, essentially failing to eliminate code coupling. For example, if a handler needs to support both "high-yield bonds" and "investment-grade bonds," it still needs to embed multiple conditional branches.

[0004] Therefore, how to solve the drawback of intrusive code modification when adding new asset types or adjusting processing logic is a technical problem that needs to be solved urgently. Summary of the Invention

[0005] The purpose of this application is to provide an asset business processing method, electronic device and storage medium to solve the above problems.

[0006] To achieve the above objectives, in a first aspect, the present application proposes an asset business processing method, the method comprising:

[0007] receiving an asset service request, wherein the asset service request includes a target asset type;

[0008] Obtain a target policy object corresponding to the target asset type through a preconfigured policy factory;

[0009] Building a target processor chain according to a preconfigured processor chain configuration file and the target asset type, and injecting the target policy object into the first node of the target processor chain;

[0010] The target processor chain is called to execute the asset service request.

[0011] In some implementations, obtaining a target policy object corresponding to the target asset type through a preconfigured policy factory includes:

[0012] In the pre-configured policy factory, the target policy implementation class corresponding to the target asset type is searched through the mapping table;

[0013] The target policy implementation class is instantiated into a target policy object through a reflection mechanism.

[0014] In some implementations, after searching a mapping table for a target policy implementation class corresponding to the target asset type within the preconfigured policy factory, the method further includes:

[0015] If the target policy implementation class corresponding to the target asset type is not found, the target policy implementation class corresponding to the target asset type is registered through dependency injection, and the mapping table is updated.

[0016] In some implementations, constructing a target processor chain according to a preconfigured processor chain configuration file and the target asset type includes:

[0017] Obtaining a target processor chain configuration corresponding to the target asset type through a preconfigured processor chain configuration file;

[0018] Parsing the target processor chain configuration into an ordered processor list;

[0019] Instantiate each processor class in the ordered processor list into a processor object through a class loader;

[0020] By traversing the ordered processor list, chain pointers between the processor objects are constructed to form a target processor chain.

[0021] In some implementations, after constructing a target processor chain according to the target asset type and the target policy object, the method further includes:

[0022] Creating a transaction context object, wherein the transaction context object is used to store processing data of the asset business request;

[0023] The calling the target processor chain to execute the asset service request includes:

[0024] determining one or more processor objects as target processor objects from a plurality of processor objects in the target processor chain based on a processing progress of the asset service request;

[0025] Calling the target processor object to process the corresponding part of the business logic in the asset business request based on the transaction context object, and generating corresponding processing data;

[0026] The transaction context object is updated according to the processing data to be passed to the next processor object of the target processor object.

[0027] In some implementations, the target processor chain includes a risk control processor, and calling the target processor chain to execute the asset service request includes:

[0028] Perform risk monitoring on the asset business request by calling the risk control processor;

[0029] If it is monitored that the risk of the asset service request exceeds a preset risk threshold, the execution of the target processor chain is terminated, and a rollback operation is performed on the executed processor object.

[0030] In some implementations, after calling the target processor chain to execute the asset service request, the method further includes:

[0031] monitoring at least one business indicator associated with the asset business request, the business indicator comprising asset volatility, transaction volume threshold, and market risk level;

[0032] When the at least one business indicator exceeds a preset threshold, dynamically adjusting a node execution path of the target processor chain;

[0033] Acquire a transaction context object of the asset service request, and execute the asset service request based on the transaction context object and the adjusted node execution path.

[0034] In some implementations, after calling the target processor chain to execute the asset service request, the method includes:

[0035] monitoring the execution status and performance indicators of the target processor chain in real time, and predicting system bottlenecks based on the execution status and the performance indicators;

[0036] When a system bottleneck is detected, marking a processor object corresponding to the system bottleneck as a node to be replaced;

[0037] Determining a standby node corresponding to the node to be replaced from a preset processor pool;

[0038] Based on the standby node, the target processor chain is updated, and the updated target processor chain is called to execute the asset service request.

[0039] In a second aspect, the present application provides an electronic device, comprising:

[0040] one or more processors;

[0041] a memory for storing one or more programs,

[0042] When the one or more programs are executed by the one or more processors, the one or more processors execute the asset business processing method as described above.

[0043] On the third aspect, the present application proposes a storage medium, which stores executable instructions. When the instructions are executed by a processor, the processor executes the asset business processing method as described above.

[0044] Compared with the prior art, the advantages of this application include:

[0045] On the one hand, the preconfigured policy factory enables the asset business processing system to dynamically select the corresponding policy object based on different asset types, decoupling the logic of different asset types, avoiding the limitations of hard coding, and improving the flexibility and scalability of the system. For example, when adding a new asset type, it is only necessary to add the corresponding policy class and update the configuration of the policy factory without modifying the existing code. On the other hand, by constructing the target processing chain based on the preconfigured processor chain configuration file and the target asset type, and injecting the target policy object into the first node of the processing chain, the orderly orchestration of the business processing process is achieved, ensuring that asset business requests can pass through each processor node in the predetermined order. The processor chain design not only improves the modularity of the system, but also supports flexible adjustment of the processing process to adapt to different business needs. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope of the present application.

[0047] Figure 1 A flowchart of an asset business processing method in one embodiment;

[0048] Figure 2 A schematic diagram of a process for obtaining a target policy object in one embodiment;

[0049] Figure 3 A schematic diagram of a process for constructing a target processor chain in one embodiment;

[0050] Figure 4 A schematic diagram of a process in which a target processor chain executes an asset business request based on a transaction context object in one embodiment;

[0051] Figure 5 A schematic diagram of a process for dynamically adjusting a node execution path by monitoring business indicators in one embodiment;

[0052] Figure 6 FIG. 1 is a flow chart illustrating a method for dynamically updating a target processor chain by predicting a system bottleneck in one embodiment;

[0053] Figure 7 This is a structural diagram of the electronic device involved in the asset business processing method in the embodiment of the present application. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solutions and advantages of this application more clearly understood, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0055] All terms (including technical and scientific terms) used in this application have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0056] For example, the terms "first," "second," etc. used in this application may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish a first element from another element.

[0057] For example, the terms "include", "comprising", etc. used in this application indicate the existence of features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0058] As mentioned above, with the rapid development of financial services, asset business processing systems need to support a variety of asset types (such as stocks, bonds, funds, derivatives, etc.) and their differentiated processing logic. Traditional technical solutions generally use hard-coded conditional branches, such as if-else or switch-case statements, to statically judge different asset types. This will lead to: (1) Violation of the Open / Closed Principle (OCP): Adding new asset types requires intrusive modification of the core code, forcing the system to frequently shut down and release, and easily causing version conflicts. (2) Highly coupled logic: The processing codes of different asset types are mixed in the same module, and it is easy to accidentally trigger other logic when modifying a certain rule. For example, when adjusting the stock fee calculation logic, the interest accrual function of the bond may be accidentally destroyed. (3) Lack of dynamic capabilities: It is impossible to adjust the processing process in real time according to market fluctuations or regulatory policies, and it is difficult to support complex business scenarios (such as complex asset types).

[0059] To this end, the existing technology proposes to provide a responsibility chain model to decouple processing logic, such as connecting verification, billing, settlement and other processors (Handler) in series into a chain structure. However, this single responsibility chain solution still has the following disadvantages: (1) Redundant conditional judgment: The asset type still needs to be judged by if-else within its processor (Handler), which does not essentially eliminate code coupling. For example, if a processor needs to support "high-yield bonds" and "investment-grade bonds", it still needs to embed multiple conditional branches. (2) Rigid chain structure: Adjustment of the processing flow requires reconstruction of the entire responsibility chain, and it is impossible to dynamically add or delete nodes according to business scenarios. For example, bond trading requires inserting an interest accrual node before billing, but it requires recoding and restarting the system. (3) High expansion cost: New asset types require the development of independent subclasses for each processor, resulting in class explosion. For example, when a system supports 10 asset types, it needs to maintain more than 50 processor classes, and the complexity of the code base increases exponentially. In order to solve the above problems, this application proposes an asset business processing method, electronic device and storage medium that can achieve high flexibility and maintainability in asset business processing.

[0060] In one embodiment, Figure 1 As shown, the embodiment of the present application proposes an asset business processing method, which includes the following steps:

[0061] Step S10: receiving an asset service request.

[0062] In this embodiment, an asset service request refers to an operation request for a specific asset, including the target asset type and other necessary service parameters (such as stock code, transaction amount, quantity, etc.). The asset service processing system receives and parses asset service requests in various data formats (such as JSON, XML, and Protocol Buffers) via a network interface or application programming interface (API). By identifying preset parameters in the parsed asset service request, such as stocks (STOCK), bonds (BOND), and funds (FUND), the system identifies the target asset type, thus providing a basis for subsequent differentiated processing.

[0063] For example, a user initiates an asset transaction request through a trading client. The request includes the target asset type "STOCK" and transaction parameters (such as stock symbol, quantity, price, etc.). The asset transaction processing system receives the request through the API and parses it to determine that the target asset type is "STOCK", which means stock trading.

[0064] Step S20: Obtain a target policy object corresponding to the target asset type through a pre-configured policy factory.

[0065] In this embodiment, the policy factory is a component that dynamically selects the corresponding processing policy based on the target asset type. It can employ the double-checked locking singleton pattern to ensure that a class has only one instance throughout the application lifecycle and provide a global access point to obtain this instance, ensuring thread safety. The target policy object is an instance of the policy implementation class corresponding to the target asset type, implementing specific business logic. Policy objects often contain complex business rules or algorithms specific to a particular asset type. For example, a stock policy object might include specific validation rules for stock trading, fee calculation methods, and so on.

[0066] In some embodiments, as Figure 2 As shown, step S20 includes:

[0067] Step S21 : In the pre-configured policy factory, a target policy implementation class corresponding to the target asset type is searched through a hash table.

[0068] Step S22: instantiate the target policy implementation class into a target policy object through a reflection mechanism.

[0069] Specifically, the policy factory maintains a mapping table (e.g., a hash table) between asset types and policy implementation classes. This mapping table supports concurrent access control. During policy factory initialization, the mapping relationship between asset types and corresponding policy implementation classes is stored in the mapping table. Based on the target asset type, the corresponding policy class is searched in the mapping table and instantiated through reflection. This allows for the dynamic creation of target policy objects at runtime, making the asset business processing system highly flexible and scalable.

[0070] For example, by calling the getStrategy(type) method of the strategy factory, the factory internally searches through a hash table: type → Strategy implementation class (such as STOCK mapping StockStrategy.class), and instantiates the StockStrategy strategy object through the reflection mechanism.

[0071] In some implementations, after step S21, the method further includes:

[0072] Step S23: If the target policy implementation class corresponding to the target asset type is not found, the target policy implementation class corresponding to the target asset type is registered through dependency injection, and the mapping table is updated.

[0073] In this embodiment, dependency injection is a design pattern defined in this application that delegates component creation and management to a framework or container, rather than requiring components to create dependencies internally. This ensures that the asset business processing system can dynamically adapt to new asset types or changes in business logic without requiring downtime for updates, improving system scalability and flexibility.

[0074] Specifically, if the target policy implementation class corresponding to the target asset type is not found, the target policy implementation class is registered with the policy factory through a dependency injection framework (such as Spring), and a new key-value pair is inserted into the mapping table (hash table) to map the target asset type to the target policy implementation class.

[0075] For example, if the target strategy implementation class "FundStrategy" corresponding to the target asset type "FUND" (fund) is not found, "FundStrategy" is registered in the strategy factory through the dependency injection framework, and the key-value pair "FUND→FundStrategy" is inserted into the mapping table.

[0076] Step S30: construct a target processor chain according to the preconfigured processor chain configuration file and the target asset type, and inject the target policy object into the first node of the target processor chain.

[0077] In this embodiment, the processor chain configuration file stores processor chain configuration files corresponding to different asset types. The file format can be XML, YAML, or properties. A target processor chain is a processor chain consisting of multiple processor objects in sequence, used to process asset business requests. The processor objects at each node can achieve request-level instance isolation through the prototype pattern. A processor object is a node in the processor chain, responsible for processing a specific portion of an asset business request. Each processor object contains a processing method (such as a handle method), which defines specific business logic such as verification, risk control, and settlement. Processor objects are typically dynamically instantiated by a class loader based on the configuration information in the processor chain configuration file. Each processor object can be injected with necessary dependencies during creation, such as a target policy object or other services, to ensure that the target processor chain can utilize the target policy object's business logic, achieving a close integration of policy and processing flow. Because each processor object focuses on specific business logic, the system is more modular, making it easier to understand and maintain. Furthermore, because each processor object is relatively independent, it can be independently developed, tested, and deployed, reducing system maintenance costs.

[0078] In some embodiments, as Figure 3 As shown, step S30 includes:

[0079] Step S31 : obtaining a target processor chain configuration corresponding to the target asset type through a pre-configured processor chain configuration file.

[0080] For example, according to the processor chain configuration file, the system obtains that the processor chain configuration corresponding to the stock transaction is "ValidationHandler→RiskControlHandler→SettlementHandler".

[0081] Step S32: Parse the target processor chain configuration into an ordered processor list.

[0082] In this embodiment, the ordered processor list refers to a list of processor class names arranged in the order in which the processors are executed.

[0083] Exemplarily, “ValidationHandler→RiskControlHandler→SettlementHandler” is parsed into [“ValidationHandler”, “RiskControlHandler”, “SettlementHandler”], and the parsed handler class names are stored in a list.

[0084] Step S33: instantiate each processor class in the ordered processor list into a processor object through a class loader.

[0085] In this embodiment, the class loader refers to the component in the Java virtual machine responsible for loading classes, which can load class files into memory and instantiate them into objects. The pseudo code is as follows:

[0086] "handlers.add(new ValidationHandler());

[0087] handlers.add(new RiskControlHandler());

[0088] handlers.add(new SettlementHandler());"

[0089] Step S34 , constructing chain pointers between the processor objects by traversing the ordered processor list to form a target processor chain, and injecting the target policy object into the first node of the target processor chain.

[0090] In this embodiment, the chain pointer refers to the reference relationship between processor objects, which is used to form a processor chain. By traversing the list of processor objects, the "nextHandler" attribute of each processor object is set to the next processor object, thereby forming a target processor chain. In addition, it is necessary to ensure that the first node of the target processor chain points to the first processor object and the "nextHandler" of the tail node is "null". For example, "ValidationHandler→RiskControlHandler→SettlementHandler→null", and expose the execution entry method: "handlerChain.execute(context)". Finally, the target strategy object "stockStrategy" is injected into the first node "ValidationHandler" of the target processor chain. Among them, the first node refers to the first processor object in the target processor chain, which is responsible for starting the entire processing flow. It is the entry point of the target processor chain and is used to receive asset business requests and start processing.

[0091] This embodiment can ensure that the asset service request can pass through each processor object in sequence according to the order of the target processor chain by constructing the target processor chain.

[0092] In some embodiments, injecting the target policy object into the first node of the target processor chain means setting the target policy object as an attribute or dependency of the first node processor object of the target processor chain, thereby ensuring that the processor chain can use the business logic of the target policy object and achieve a close integration of the policy and processing flow.

[0093] This embodiment utilizes a dynamic injection mechanism for target policy objects, enabling the system to flexibly adapt to diverse business needs and asset types. Furthermore, it supports dynamic replacement of the primary node's policy objects during system operation (a hot-swappable mechanism). It is also understood that, in application scenarios requiring the combined execution of multiple policies, the primary node can simultaneously inject multiple target policy objects to support this combined execution.

[0094] Step S40: calling the target processor chain to execute the asset service request.

[0095] In this embodiment, starting with the first node in the target processor chain, the processing method of each processor object is called sequentially. After each processor object completes its corresponding portion of the business logic, it passes the request and processing data to the next processor object. If a processor object fails to process, the system terminates the processing flow and performs appropriate error handling.

[0096] For example, the asset transaction processing system calls the "ValidationHandler," the first node in the target handler chain. This handler object uses the "StockStrategy" to validate the transaction parameters. Once validation is successful, the request is passed to the "RiskControlHandler" for risk control checks. If the risk is within acceptable limits, the request is passed to the "SettlementHandler" for settlement. If any handler fails, the system terminates the process and performs appropriate error handling.

[0097] In the asset business processing method proposed in the embodiment of the present application, on the one hand, through the pre-configured policy factory, the asset business processing system can dynamically select the corresponding policy object according to different asset types, decouple the logic of different asset types, avoid the limitations of hard coding, and improve the flexibility and scalability of the system. For example, when a new asset type is added, it is only necessary to add the corresponding policy class and update the configuration of the policy factory without modifying the existing code. On the other hand, by constructing the target processing chain according to the pre-configured processor chain configuration file and the target asset type, and injecting the target policy object into the first node of the processing chain, the orderly arrangement of the business processing flow is achieved, ensuring that the asset business request can pass through each processor node in a predetermined order. The design of the processor chain not only improves the modularity of the system, but also supports flexible adjustment of the processing flow to adapt to different business needs.

[0098] In one embodiment, after step S30, the process includes: creating a transaction context object, which is used to store the processing data of the asset business request, including request parameters, processing results, exception information, etc. Based on this, Figure 4 As shown, the step S40 includes:

[0099] Step S41 : determining one or more processor objects as target processor objects from a plurality of processor objects in the target processor chain based on the processing progress of the asset service request.

[0100] In this embodiment, the processing progress refers to the execution stage of the asset business request in the target processor chain, such as the verification stage, risk control stage, settlement stage, etc. The target processor object refers to the processor object that needs to execute the business logic based on the current processing progress.

[0101] Specifically, based on the current processing stage of the asset service request, one or more processor objects corresponding to the current processing progress are selected from the processor chain as the target processor objects. This ensures that asset service requests are processed in the correct order and logic, with each processing stage being executed by a corresponding processor object.

[0102] Step S42: calling the target processor object to process the corresponding part of the business logic in the asset business request based on the transaction context object, and generating corresponding processing data.

[0103] In this embodiment, the processing data includes request parameters, processing results, exception information, etc., wherein the processing results refer to the data generated by the processor object after executing the business logic, such as verification results, risk assessment results, etc.

[0104] Specifically, by calling the processing method of the target handler object, the target handler object executes the corresponding portion of the business logic in the asset business request based on the data in the transaction context object. After executing this portion of the business logic, the corresponding processing data is generated. For example, calling the "handle" method of the "ValidationHandler" verifies the transaction parameters and generates the verification results, which are then stored in the transaction context object.

[0105] Step S43: updating the transaction context object according to the processing data to pass it to the next processor object of the target processor object.

[0106] For example, the ValidationHandler stores the validation results in a transaction context object, then passes the transaction context object to the RiskControlHandler for risk control. The RiskControlHandler is a node in the handler chain that checks for risks in transactions, such as excessive amounts or unusual transaction frequencies.

[0107] In one embodiment, the risk control processor is invoked to monitor the risk of the asset business request. If the risk of the asset business request is detected to exceed a preset risk threshold, the execution of the target processor chain is terminated and a rollback operation is performed on the executed processor object. The preset risk threshold ("riskControlHandler.setThreshold") refers to the risk control rules predefined in the system configuration file, such as transaction amount thresholds, transaction frequency limits, etc. For example, in stock trading processing, if the risk control processor detects that the transaction amount exceeds a preset threshold of 1 million yuan, the execution of the processing chain is terminated and the rollback method of the "ValidationHandler" is called to undo the executed validation operation. If the rollback operation cannot be performed, the reverse operation is performed on the executed processor object, thereby ensuring that the system state returns to the consistency before the processing.

[0108] The asset business processing method proposed in this embodiment achieves high flexibility and maintainability in asset business processing through dynamic mapping of policy factories, configuration file-driven processor chain construction, and the updating and transfer of transaction context objects. The updating and transfer of transaction context objects ensures that processed data is correctly transferred and shared within the processor chain, supporting the business logic processing of subsequent processor objects.

[0109] Based on the above embodiment, in one embodiment, Figure 5 As shown, after step S43, the method further includes:

[0110] Step S44: monitor at least one business indicator associated with the asset business request.

[0111] In this embodiment, business indicators refer to quantitative indicators used to measure the business status related to asset business requests, including but not limited to asset volatility, trading volume threshold, and market risk level. Asset volatility is an indicator used to measure the degree of asset price fluctuation, usually expressed as standard deviation or variance. Trading volume threshold refers to a preset upper limit on trading volume, used to determine whether a transaction is abnormal. Market risk level refers to a risk level assessed based on market conditions, such as low risk, medium risk, and high risk.

[0112] Step S45 : When the at least one business indicator exceeds a preset threshold, dynamically adjust the node execution path of the target processor chain.

[0113] In this embodiment, dynamic adjustment refers to dynamically modifying the node execution path of the target processor chain, such as adding or skipping certain processor nodes, or adjusting the execution order of processor objects in the target processor chain.

[0114] For example, in stock trading processing, if the asset volatility exceeds a preset threshold (such as 5%), the system dynamically adjusts the processor chain and adds a "VolatilityHandler" processor to perform additional volatility processing.

[0115] Step S46: Acquire the transaction context object of the asset business request, and execute the asset business request based on the transaction context object and the adjusted node execution path.

[0116] In this embodiment, the target processor chain is rebuilt based on the adjusted node execution path, and the asset service request is continued using the data in the transaction context object. This ensures that asset service requests are correctly processed according to the adjusted execution path, improving the flexibility and adaptability of the asset service processing system and enabling the system to quickly respond to business changes and abnormal situations.

[0117] Based on the above embodiment, in one embodiment, Figure 6 As shown, after step S40, the method further includes:

[0118] Step S50: monitoring the execution status and performance index of the target processor chain in real time, and predicting the system bottleneck according to the execution status and the performance index.

[0119] In this embodiment, the execution state refers to the current execution status of each processor object in the target processor chain, including states such as completed, executing, and not executed. Performance indicators refer to quantitative indicators used to measure the execution efficiency of the target processor chain, such as execution time, resource utilization, and throughput.

[0120] Specifically, the execution status and performance indicators of each processor object in the target processor chain are input into a pre-trained machine learning model to obtain a prediction result of the machine learning model for the system bottleneck of the target processor chain.

[0121] Step S60: When a system bottleneck is detected, mark the processor object corresponding to the system bottleneck as a node to be replaced.

[0122] For example, when a system bottleneck is detected, if the predicted data source of the system bottleneck is determined to be the execution time of "RiskControlHandler" that exceeds a preset duration, the "RiskControlHandler" processor object is marked as a node to be replaced. It should be noted that the number of nodes to be replaced can be greater than one.

[0123] Step S70: Determine a backup node corresponding to the node to be replaced from a preset processor pool.

[0124] In this embodiment, the processor pool refers to a preconfigured and dynamically expandable collection of processor objects, including multiple different types of processor objects. Based on the function and performance requirements of the node to be replaced, a backup processor object corresponding to the node to be replaced is selected from the processor pool as the backup node.

[0125] Exemplarily, the "OptimizedRiskControlHandler" is selected from the processor pool as a backup node for the "RiskControlHandler".

[0126] Step S80: Based on the standby node, the target processor chain is updated, and the updated target processor chain is called to execute the asset service request.

[0127] In this embodiment, by utilizing the updated target processor chain of the standby node to execute the asset service request, the system can quickly adapt to performance changes and improve processing efficiency and response speed.

[0128] In some implementations, a transaction context object of the asset service request is obtained, and the asset service request is executed based on the transaction context object and the updated target processor chain.

[0129] In this embodiment, asset service requests are continued according to the updated target processor chain and using the data in the transaction context object. This ensures that asset service requests are correctly processed according to the adjusted execution path, improving the flexibility and adaptability of the asset service processing system and enabling the system to quickly respond to business changes and abnormal situations.

[0130] In one embodiment, a computer-readable storage medium is provided, on which executable instructions are stored. When the instructions are executed by a processor, the processor executes the steps in the above-mentioned method embodiments.

[0131] In one embodiment, an electronic device is also provided, comprising one or more processors; a memory, wherein one or more programs are stored in the memory, wherein when the one or more programs are executed by one or more processors, the one or more processors execute the steps in the above-mentioned method embodiments.

[0132] In one embodiment, Figure 7 , which shows a schematic diagram of the structure of an electronic device for implementing an embodiment of the present application. Electronic device 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to programs stored in read-only memory (ROM) 702 or programs loaded from storage unit 708 into random access memory (RAM) 703. RAM 703 also stores various programs and data required for the operation of electronic device 700. CPU 701, ROM 702, and RAM 703 are connected to each other via bus 704. Input / output (I / O) interface 705 is also connected to bus 704.

[0133] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, mouse, and the like; an output section 707 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and speakers; a storage section 708 including devices such as a hard disk; and a communication section 709 including a network interface card such as a LAN card or a modem. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. Removable media 711, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 710 as needed, so that computer programs read from the media can be installed in the storage section 708 as needed.

[0134] In particular, according to embodiments of the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer-readable medium carrying instructions. In such embodiments, the instructions can be downloaded and installed from a network via communication component 709 and / or installed from removable media 711. When the instructions are executed by central processing unit (CPU) 701, the various method steps described in this application are performed.

[0135] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some or all of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

[0136] Furthermore, those skilled in the art will appreciate that although some embodiments herein include certain features included in other embodiments but not others, combinations of features from different embodiments are intended to be within the scope of this application and to form different embodiments. For example, any of the above embodiments may be used in any combination. The information disclosed in this background section is intended solely to enhance understanding of the overall background of this application and should not be construed as an admission or any implication that such information constitutes prior art known to those skilled in the art.

Claims

1. A method for processing asset business, characterized in that: The method comprises: receiving an asset service request, wherein the asset service request includes a target asset type; Obtain a target policy object corresponding to the target asset type through a preconfigured policy factory; Obtaining a target processor chain configuration corresponding to the target asset type through a preconfigured processor chain configuration file; Parsing the target processor chain configuration into an ordered processor list; Instantiate each processor class in the ordered processor list into a processor object through a class loader; By traversing the ordered processor list, constructing chain pointers between the processor objects to form a target processor chain, and injecting the target policy object into the first node of the target processor chain; Creating a transaction context object, wherein the transaction context object is used to store processing data of the asset business request; Invoking the target processor chain to execute the asset service request; The calling of the target processor chain to execute the asset business request includes: determining one or more processor objects from multiple processor objects in the target processor chain as target processor objects based on the processing progress of the asset business request, calling the target processor objects to process the corresponding part of the business logic in the asset business request based on the transaction context object, generating corresponding processing data, and updating the transaction context object according to the processing data to pass it to the next processor object of the target processor object.

2. The asset business processing method according to claim 1, characterized in that: The step of obtaining a target policy object corresponding to the target asset type through a preconfigured policy factory includes: In the pre-configured policy factory, the target policy implementation class corresponding to the target asset type is searched through the mapping table; The target policy implementation class is instantiated into a target policy object through a reflection mechanism.

3. The asset business processing method according to claim 2, characterized in that: After searching the mapping table for the target policy implementation class corresponding to the target asset type within the preconfigured policy factory, the method further includes: If the target policy implementation class corresponding to the target asset type is not found, the target policy implementation class corresponding to the target asset type is registered through dependency injection, and the mapping table is updated.

4. The asset business processing method according to claim 1, characterized in that: The target processor chain includes a risk control processor, and calling the target processor chain to execute the asset business request includes: Perform risk monitoring on the asset business request by calling the risk control processor; If it is monitored that the risk of the asset service request exceeds a preset risk threshold, the execution of the target processor chain is terminated, and a rollback operation is performed on the executed processor object.

5. The asset business processing method according to claim 1, characterized in that: After calling the target processor chain to execute the asset service request, the method further includes: monitoring at least one business indicator associated with the asset business request, the business indicator comprising asset volatility, transaction volume threshold, and market risk level; When the at least one business indicator exceeds a preset threshold, dynamically adjusting a node execution path of the target processor chain; Acquire a transaction context object of the asset service request, and execute the asset service request based on the transaction context object and the adjusted node execution path.

6. The asset business processing method according to claim 1, characterized in that: After calling the target processor chain to execute the asset service request, the method further includes: monitoring the execution status and performance indicators of the target processor chain in real time, and predicting system bottlenecks based on the execution status and the performance indicators; When a system bottleneck is detected, marking a processor object corresponding to the system bottleneck as a node to be replaced; Determining a standby node corresponding to the node to be replaced from a preset processor pool; Based on the standby node, the target processor chain is updated, and the updated target processor chain is called to execute the asset service request.

7. An electronic device, characterized in that: include: one or more processors; a memory for storing one or more programs, Wherein, when the one or more programs are executed by the one or more processors, the one or more processors execute the asset business processing method according to any one of claims 1 to 6.

8. A storage medium, characterized in that: The storage medium stores executable instructions, and when the instructions are executed by the processor, the processor executes the asset business processing method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Asset management method and system

    CN111402061A

  • Network attack path discovery method and system based on knowledge graph

    CN119382987A