Asset business processing method, electronic equipment and storage medium
Through pre-configured policy factory and processor chain configuration files, the processor chain of the asset business processing system is dynamically built, solving the problem that existing systems need to invasively modify code when adding new asset types or adjusting processing logic, and achieving system flexibility and scalability.
Patent Information
- Application Number
- CN202510660456.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2045-05-22
AI Technical Summary
The existing asset business processing system needs to invasively modify the code when adding new asset types or adjusting processing logic, resulting in code coupling, maintenance difficulties and high expansion costs.
The target policy object is dynamically obtained through the preconfigured policy factory, and the target processor chain is built based on the preconfigured processor chain configuration file, and the target policy object is injected into the first node of the processing chain to realize the orderly orchestration of the business processing process.
It realizes the flexibility and scalability of the asset business processing system, avoids the limitations of hard coding, supports dynamic adjustment of processing processes, and reduces system maintenance costs.
Smart Images

Figure CN120182011A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data processing, and particularly to an asset business processing method, an electronic device, and a storage medium. Background Art
[0002] With the rapid development of financial business, asset business processing systems need to support diverse asset types (such as stocks, bonds, funds, derivatives, etc.) and their differentiated processing logics. Traditional technical solutions generally use hard-coded conditional branches, such as if-else or switch-case statements, to make static judgments on different asset types. This can lead to the mixing of processing codes for different asset types in the same module, and it is easy to accidentally touch other logics when modifying a certain rule. For example, when adjusting the calculation logic of stock handling fees, the interest accrual function of bonds may be accidentally damaged.
[0003] To this end, the prior art proposes to provide a responsibility chain pattern to decouple the processing logic. For example, processors such as verification, billing, and settlement (Handlers) are connected in series as a chain structure. However, the asset type still needs to be judged through if-else inside the Handler, and the code coupling is not essentially eliminated. For example, if a certain Handler needs to support "high-yield bonds" and "investment-grade bonds", multiple conditional branches still need to be embedded.
[0004] Therefore, how to solve the drawback of invasive code modification when adding new asset types or adjusting processing logics is a technical problem that urgently needs to be solved at present. Summary of the Invention
[0005] The purpose of this application is to provide an asset business processing method, an electronic device, and a storage medium to solve the above problems.
[0006] To achieve the above purpose, in a first aspect, this application proposes an asset business processing method, and the method includes: Receiving an asset business request, where the asset business request includes a target asset type; Obtaining a target policy object corresponding to the target asset type through a pre-configured policy factory; Constructing a target processor chain according to a pre-configured processor chain configuration file and the target asset type, and injecting the target policy object into the first node of the target processor chain; Invoking the target processor chain to execute the asset business request.
[0007] In some embodiments, the obtaining a target policy object corresponding to the target asset type through a pre-configured policy factory includes: Inside the pre-configured policy factory, querying a target policy implementation class corresponding to the target asset type through a mapping table; Instantiate the target policy implementation class into a target policy object through the reflection mechanism.
[0008] In some embodiments, inside the preconfigured policy factory, after querying the target policy implementation class corresponding to the target asset type through a mapping table, it further includes: If the target policy implementation class corresponding to the target asset type is not queried, register the target policy implementation class corresponding to the target asset type through dependency injection and update the mapping table.
[0009] In some embodiments, constructing a target processor chain according to the preconfigured processor chain configuration file and the target asset type includes: Obtain the target processor chain configuration corresponding to the target asset type through the preconfigured processor chain configuration file; Parse 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; Build a chained pointer between the processor objects by traversing the ordered processor list to form a target processor chain.
[0010] In some embodiments, after constructing the target processor chain according to the target asset type and the target policy object, it further includes: Create a transaction context object, which is used to store the processing data of the asset service request; The invoking the target processor chain to execute the asset service request includes: Determine one or more processor objects as target processor objects from multiple processor objects in the target processor chain based on the processing progress of the asset service request; Invoke the target processor object to process the corresponding part of the business logic in the asset service request based on the transaction context object and generate corresponding processing data; Update the transaction context object according to the processing data to be passed to the next processor object of the target processor object.
[0011] In some embodiments, the target processor chain includes a risk control processor, and the invoking the target processor chain to execute the asset service request includes: Monitor the risk of the asset service request by invoking the risk control processor; If the risk of the asset service request is monitored to exceed the preset risk threshold, the execution of the target processor chain is terminated, and a rollback operation is performed on the executed processor objects.
[0012] In some embodiments, after invoking the target processor chain to execute the asset service request, it further includes: Monitoring at least one service metric associated with the asset service request, where the service metric includes asset volatility, trading volume threshold, and market risk level; When the at least one service metric exceeds the preset threshold, dynamically adjusting the node execution path of the target processor chain; Obtaining the transaction context object of the asset service request, and executing the asset service request based on the transaction context object and the adjusted node execution path.
[0013] In some embodiments, after invoking the target processor chain to execute the asset service request, it includes: Real-time monitoring the execution status and performance metrics of the target processor chain, and predicting system bottlenecks based on the execution status and the performance metrics; When a system bottleneck is detected, marking the 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, updating the target processor chain, and invoking the updated target processor chain to execute the asset service request.
[0014] In a second aspect, the present application proposes an electronic device, including: 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 are caused to execute the asset service processing method as described above.
[0015] In a third aspect, the present application proposes a storage medium, where the storage medium stores executable instructions, and when the instructions are executed by a processor, the processor is caused to execute the asset service processing method as described above.
[0016] Compared with the prior art, the beneficial effects of the present application include: 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 logics 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, only the corresponding policy class needs to be added and the configuration of the policy factory needs to be updated, 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 orchestration of the business processing flow is realized, ensuring that the asset business requests can pass through each processor node in the 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 meet different business requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] To more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present application and should not be regarded as limiting the scope of the present application.
[0018] Figure 1 It is a schematic flow chart of the asset business processing method in an embodiment; Figure 2 It is a schematic flow chart of obtaining the target policy object in an embodiment; Figure 3 It is a schematic flow chart of constructing the target processor chain in an embodiment; Figure 4 It is a schematic flow chart of the target processor chain executing the asset business request based on the transaction context object in an embodiment; Figure 5 It is a schematic flow chart of dynamically adjusting the node execution path by monitoring business metrics in an embodiment; Figure 6 It is a schematic flow chart of dynamically updating the target processor chain by predicting system bottlenecks in an embodiment; Figure 7 It is a schematic structural diagram of the electronic device involved in the asset business processing method in the embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0019] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0020] All terms used in this application (including technical and scientific terms) 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.
[0021] For example, terms such as "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 the first element from another element.
[0022] For another example, terms such as "include", "comprise", etc. used in this application indicate the presence of features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0023] As mentioned above, with the rapid development of financial business, the asset business processing system needs to support diverse asset types (such as stocks, bonds, funds, derivatives, etc.) and their differentiated processing logics. Traditional technical solutions generally use hard-coded conditional branches, such as if-else or switch-case statements, to make static judgments on different asset types, which will lead to: (1) Violation of the Open-Closed Principle (OCP): Adding a new asset type requires invasive modification of the core code, forcing the system to be frequently shut down for release, and it is easy to cause version conflicts. (2) High logical coupling: The processing codes for different asset types are mixed in the same module, and it is easy to accidentally touch other logics when modifying a certain rule. For example, when adjusting the stock commission calculation logic, the interest accrual function of bonds may be accidentally damaged. (3) Lack of dynamic capabilities: It is impossible to adjust the processing flow in real time according to market fluctuations or regulatory policies, and it is also difficult to support complex business scenarios (such as composite asset types).
[0024] To this end, the prior art proposes to provide a chain of responsibility model to decouple processing logic, such as connecting verification, billing, settlement and other processors (Handler) in series into a chain structure, but the single chain of responsibility solution still has the following disadvantages: (1) Redundant conditional judgment: The processor (Handler) still needs to use if-else to judge the asset type, which does not eliminate code coupling in essence. 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: The adjustment of the processing flow requires the reconstruction of the entire chain of responsibility, and it is impossible to dynamically add or delete nodes according to business scenarios. For example, bond trading needs to insert an interest accrual node before billing, but it needs to be recoded and the system restarted. (3) High expansion cost: Adding new asset types requires developing 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, the present application proposes an asset business processing method, electronic device and storage medium, which can achieve high flexibility and maintainability of asset business processing.
[0025] In one embodiment, Figure 1 As shown, the embodiment of the present application proposes an asset business processing method, which includes the following steps: Step S10: receiving an asset service request.
[0026] In this embodiment, an asset business request refers to an operation request for a specific asset, including the target asset type and other necessary business parameters (such as stock code, transaction amount, quantity, etc.). The asset business processing system receives and parses asset business requests in multiple data formats (such as JSON, XML, Protocol Buffers) through a network interface or application program interface (API), and identifies the target asset type by identifying preset parameters in the parsed asset business request, such as stocks (STOCK), bonds (BOND), funds (FUND), etc., thereby providing a basis for subsequent differentiated processing.
[0027] For example, a user initiates an asset business request through a trading client, and the request includes the target asset type "STOCK" and trading parameters (such as stock code, quantity, price, etc.). The asset business processing system receives the request through the API and parses the target asset type as "STOCK", i.e., stock trading.
[0028] Step S20: obtaining a target policy object corresponding to the target asset type through a preconfigured policy factory.
[0029] In this embodiment, the policy factory is a component used to dynamically select the corresponding processing policy according to the target asset type. The double-checked locking singleton pattern can be adopted to ensure that a class has only one instance throughout the application life cycle and provide a global access point to obtain this instance, thereby ensuring thread safety. The target policy object is an instance of the policy implementation class that corresponds to the target asset type and implements specific business logic. Policy objects usually contain complex business rules or algorithms related to specific asset types. For example, a stock policy object can contain specific verification rules for stock trading, fee calculation methods, etc.
[0030] In some embodiments, as Figure 2 shown, step S20 includes: Step S21, inside the pre-configured policy factory, query the target policy implementation class corresponding to the target asset type through a hash table.
[0031] Step S22, instantiate the target policy implementation class into a target policy object through the reflection mechanism.
[0032] Specifically, inside the policy factory, a mapping table (such as a hash table) of asset types and policy implementation classes is maintained, and this mapping table supports concurrent access control. When the policy factory is initialized, the mapping relationship between the asset type and the corresponding policy implementation class is stored in the mapping table. According to the target asset type, find the corresponding policy class in the mapping table and instantiate this policy implementation class through the reflection mechanism, which can dynamically create the target policy object at runtime, making the asset business processing system highly flexible and extensible.
[0033] Exemplarily, by calling the getStrategy(type) method of the policy factory, inside the factory, query through the hash table: type → Strategy implementation class (such as STOCK maps to StockStrategy.class), and instantiate the StockStrategy policy object through the reflection mechanism.
[0034] In some embodiments, after step S21, it further includes: Step S23, if the target policy implementation class corresponding to the target asset type is not queried, register the target policy implementation class corresponding to the target asset type through dependency injection and update the mapping table.
[0035] In this embodiment, dependency injection is a design pattern defined in this application, which is used to hand over the creation and management of components to a framework or container, rather than creating dependencies internally within the components. This can ensure that the asset business processing system can dynamically adapt to new asset types or changes in business logic without downtime for updates, improving the scalability and flexibility of the system.
[0036] Specifically, if the target policy implementation class corresponding to the target asset type is not found, the target policy implementation class is registered into 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 this target policy implementation class.
[0037] Exemplarily, if the target policy implementation class "FundStrategy" corresponding to the target asset type "FUND" (fund) is not found, then through the dependency injection framework, "FundStrategy" is registered into the policy factory, and the key-value pair "FUND → FundStrategy" is inserted into the mapping table.
[0038] Step S30: Construct a target processor chain according to the pre-configured processor chain configuration file and the target asset type, and inject the target policy object into the head node of the target processor chain.
[0039] In this embodiment, the processor chain configuration file stores files with processor chain configurations corresponding to different asset types, and the file format can be XML, YAML, properties, etc. The target processor chain refers to a processor link composed of multiple processor objects in sequence and is used to process asset business requests. Among them, the processor objects of each node can achieve request-level instance isolation through the prototype pattern. A processor object is a node in the processor chain and is used to process a specific part of an asset business request. Each processor object contains a processing method (such as the handle method), which defines specific business logics such as verification, risk control, settlement, etc. The processor objects are usually dynamically instantiated by the class loader according to the configuration information in the processor chain configuration file. Some necessary dependencies, such as the target policy object or other services, can be injected into each processor object when it is created to ensure that the target processor chain can use the business logic of the target policy object and achieve a tight combination of the policy and the processing flow. Since each processor object only focuses on specific business logics, the system becomes more modular, facilitating understanding and maintenance. At the same time, since each processor object is relatively independent, it can be developed, tested, and deployed separately, reducing the system's maintenance cost.
[0040] In some embodiments, as Figure 3 shown, step S30 includes: Step S31: Obtain the target processor chain configuration corresponding to the target asset type through a pre-configured processor chain configuration file.
[0041] Exemplarily, according to the processor chain configuration file, the system obtains that the processor chain configuration corresponding to stock trading is "ValidationHandler→RiskControlHandler→SettlementHandler".
[0042] Step S32: Parse the target processor chain configuration into an ordered processor list.
[0043] In this embodiment, the ordered processor list refers to a list of processor class names arranged in the order of processor execution.
[0044] Exemplarily, parse "ValidationHandler→RiskControlHandler→SettlementHandler" into ["ValidationHandler", "RiskControlHandler", "SettlementHandler"], and store the parsed processor class names in a list.
[0045] Step S33: Instantiate each processor class in the ordered processor list into a processor object through a class loader.
[0046] In this embodiment, the class loader refers to a 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: “handlers.add(new ValidationHandler()); handlers.add(new RiskControlHandler()); handlers.add(new SettlementHandler());” Step S34: By traversing the ordered processor list, construct a chained pointer between the processor objects to form a target processor chain, and inject the target policy object into the head node of the target processor chain.
[0047] In this embodiment, the chained pointer refers to the reference relationship between processor objects and 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 the target processor chain. In addition, it is necessary to ensure that the head 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 the execution entry method is exposed: "handlerChain.execute(context)". Finally, the target policy object "stockStrategy" is injected into the head node "ValidationHandler" of the target processor chain. The head 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.
[0048] In this embodiment, by constructing the target processor chain, it can be ensured that the asset business requests pass through each processor object in sequence according to the order of the target processor chain.
[0049] In some embodiments, injecting the target policy object into the head node of the target processor chain means setting the target policy object as the attribute or dependency of the processor object of the head node of the target processor chain, thereby ensuring that the processor chain can use the business logic of the target policy object and realizing the close combination of the policy and the processing flow.
[0050] In this embodiment, through the dynamic injection mechanism of the target policy object, the system can flexibly adapt to different business requirements and asset types. Moreover, it supports dynamically replacing the policy object of the head node during system operation (hot plug mechanism). At the same time, it can be understood that when facing application scenarios that require multi-policy combined execution, it is allowed to inject multiple target policy objects into the head node simultaneously to support multi-policy combined execution.
[0051] Step S40, call the target processor chain to execute the asset business request.
[0052] In this embodiment, starting from the head node of the target processor chain, the processing methods of each processor object are called in sequence. After each processor object processes its corresponding part of the business logic, the request and processing data are passed to the next processor object. If a certain processor object fails to process, the system will terminate the processing flow and perform corresponding error handling.
[0053] Exemplarily, the asset business processing system calls the head node "ValidationHandler" of the target processor chain, and this processor object uses "StockStrategy" to verify the transaction parameters. After the verification passes, the request is passed to "RiskControlHandler" for risk control check. If the risk is within the acceptable range, the request continues to be passed to "SettlementHandler" to complete the settlement. If any one of the processors fails to handle, the system will terminate the processing flow and perform corresponding error handling.
[0054] In the asset business processing method proposed in the embodiments 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 logics of different asset types, avoid the limitations of hard coding, and at the same time improve the flexibility and scalability of the system. For example, when a new asset type is added, only the corresponding policy class needs to be added and the configuration of the policy factory needs to be updated, 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 head node of the processing chain, the orderly orchestration of the business processing flow is realized, ensuring that the asset business requests 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 requirements.
[0055] In one embodiment, after step S30, it 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, as Figure 4 shown, step S40 includes: Step S41, determining one or more processor objects from the multiple processor objects in the target processor chain as target processor objects based on the processing progress of the asset business request.
[0056] 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, the risk control stage, the settlement stage, etc. The target processor object refers to the processor object that needs to execute the business logic according to the current processing progress.
[0057] Specifically, according to the current processing stage of the asset business request, one or more processor objects corresponding to the current processing progress are selected from the processor chain as target processor objects. Thus, it is ensured that the asset business requests can be processed in the correct order and logic, and each processing stage has a corresponding processor object responsible for execution.
[0058] Step S42: Invoke 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 generate corresponding processing data.
[0059] In this embodiment, the processing data includes request parameters, processing results, exception information, etc. Among them, the processing result refers to the data generated by the processor object after executing the business logic, such as verification results, risk assessment results, etc.
[0060] Specifically, by invoking the processing method of the target processor object, the target processor object executes the corresponding part of the business logic in the asset business request according to the data in the transaction context object, and generates corresponding processing data after executing this part of the business logic. For example, invoke the "handle" method of "ValidationHandler" to verify the transaction parameters and generate a verification result, and store the verification result in the transaction context object.
[0061] Step S43: Update the transaction context object according to the processing data, so as to pass it to the next processor object of the target processor object.
[0062] Exemplarily, "ValidationHandler" stores the verification result in the transaction context object, and then passes the transaction context object to the risk control processor ("RiskControlHandler") for risk control processing. Among them, the risk control processor is a node in the processor chain, which is used to check whether there is a risk in the transaction, such as whether the transaction amount is too large, whether the transaction frequency is abnormal, etc.
[0063] In one embodiment, by invoking the risk control processor, risk monitoring is performed on the asset business request. If it is detected that the risk of the asset business request exceeds the preset risk threshold, the execution of the target processor chain is terminated, and a rollback operation is performed on the executed processor objects. Among them, the preset risk threshold ("riskControlHandler.setThreshold") refers to the risk control rules predefined by the system in the 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 the preset threshold of 1 million yuan, the execution of the processing chain is terminated, and the rollback method of "ValidationHandler" is called to revoke the executed verification operation. If the rollback operation cannot be performed, a reverse operation is performed on the executed processor objects to ensure that the system state returns to the consistency before processing.
[0064] In the asset business processing method proposed by the embodiments of the present application, through the dynamic mapping of the policy factory, the construction of the processor chain driven by the configuration file, and the update and transmission of the transaction context object, the high flexibility and maintainability of asset business processing are achieved. Among them, for the update and transmission of the transaction context object, it can ensure that the processed data can be correctly transmitted and shared in the processor chain, and support the business logic processing of subsequent processor objects.
[0065] Based on the above embodiments, in one implementation, as Figure 5 shown, after the step S43, it further includes: Step S44, monitoring at least one business metric associated with the asset business request.
[0066] In this embodiment, the business metric refers to a quantitative metric used to measure the business status related to the asset business request, including but not limited to asset volatility, trading volume threshold, and market risk level. Among them, the asset volatility is a metric used to measure the degree of asset price fluctuation, usually expressed by the standard deviation or variance. The trading volume threshold refers to the preset upper limit of the trading volume, which is used to determine whether a transaction is abnormal. The market risk level refers to the risk level evaluated according to market conditions, such as low risk, medium risk, and high risk.
[0067] Step S45, when at least one of the business metrics exceeds the preset threshold, dynamically adjusting the node execution path of the target processor chain.
[0068] In this embodiment, the 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 the processor objects in the target processor chain.
[0069] Exemplarily, in stock trading processing, if the asset volatility exceeds the preset threshold (such as 5%), the system dynamically adjusts the processor chain and adds a "VolatilityHandler" processor for additional volatility processing.
[0070] Step S46, obtaining the transaction context object of the asset business request, and executing the asset business request based on the transaction context object and the adjusted node execution path.
[0071] In this embodiment, according to the adjusted node execution path, the target processor chain is reconstructed, and the data in the transaction context object is used to continue executing the asset business request. It can ensure that the asset business request can be correctly processed according to the adjusted execution path, improving the flexibility and adaptability of the asset business processing system, and enabling the system to quickly respond to business changes and abnormal situations.
[0072] Based on the above embodiments, in one implementation, as Figure 6As shown, after the step S40, the following steps are further included: Step S50, real-time monitor the execution status and performance metrics of the target processor chain, and predict system bottlenecks according to the execution status and the performance metrics.
[0073] In this embodiment, the execution status refers to the current execution situation of each processor object in the target processor chain, including states such as completed, executing, and not executed. The performance metrics refer to the quantitative metrics used to measure the execution efficiency of the target processor chain, such as execution time, resource utilization rate, throughput, etc.
[0074] Specifically, input the execution status and performance metrics of each processor object in the target processor chain into a pre-trained machine learning model to obtain the prediction result of the system bottleneck of the target processor chain by the machine learning model.
[0075] Step S60, when a system bottleneck is detected, mark the processor object corresponding to the system bottleneck as a node to be replaced.
[0076] Exemplarily, when a system bottleneck is detected, if it is determined that the prediction data source of the system bottleneck is that the execution time of "RiskControlHandler" exceeds a preset duration, then mark the "RiskControlHandler" processor object as a node to be replaced. It should be noted that the number of nodes to be replaced can be greater than 1.
[0077] Step S70, determine a spare node corresponding to the node to be replaced from a preset processor pool.
[0078] In this embodiment, the processor pool refers to a pre-configured and dynamically expandable set of processor objects, which contains various different types of processor objects. According to the function and performance requirements of the node to be replaced, select a corresponding spare processor object from the processor pool as the spare node.
[0079] Exemplarily, select "OptimizedRiskControlHandler" from the processor pool as the spare node of "RiskControlHandler".
[0080] Step S80, update the target processor chain based on the spare node, and call the updated target processor chain to execute the asset service request.
[0081] In this embodiment, by using the target processor chain updated with the spare node to execute the asset service request, the system can quickly adapt to performance changes and improve processing efficiency and response speed.
[0082] In some embodiments, 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.
[0083] In this embodiment, according to the updated target processor chain, the asset service request is continuously executed using the data in the transaction context object. It can ensure that the asset service request can be 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.
[0084] 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 method embodiments.
[0085] In one embodiment, an electronic device is further provided, including one or more processors; a memory, in which one or more programs are stored. Wherein, when the one or more programs are executed by the one or more processors, the one or more processors execute the steps in the above method embodiments.
[0086] In one embodiment, as Figure 7 shown, it shows a schematic structural diagram of an electronic device for implementing the embodiments of the present application. The electronic device 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 702 or the program loaded from the storage section 708 into the random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 are also stored. The CPU 701, ROM 702, and RAM 703 are connected to each other through a bus 704. The input / output (I / O) interface 705 is also connected to the bus 704.
[0087] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. 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. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that the computer program read from it can be installed into the storage section 708 as needed.
[0088] In particular, according to an embodiment of the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, an embodiment of the present application includes a computer program product comprising a computer-readable medium carrying instructions. In such an embodiment, the instructions can be downloaded and installed from a network through a communication section 709, and / or installed from a removable medium 711. When the instructions are executed by a central processing unit (CPU) 701, the various method steps described in the present application are performed.
[0089] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and are not intended to limit them. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0090] In addition, those skilled in the art can understand that although some of the embodiments herein include certain features included in other embodiments but not other features, the combination of the features of different embodiments means that it is within the scope of the present application and forms different embodiments. For example, any one of the above embodiments can be used in any combination. The information disclosed in this background section is only intended to deepen the understanding of the overall background technology of the present application and should not be regarded as an admission or any form of suggestion that this information constitutes prior art known to those skilled in the art.
Claims
1. An asset business processing method, characterized in that, The method includes: Receiving an asset business request, where the asset business request includes a target asset type; Obtaining a target policy object corresponding to the target asset type through a pre-configured policy factory; Constructing a target processor chain according to a pre-configured processor chain configuration file and the target asset type, and injecting the target policy object into the first node of the target processor chain; Invoking the target processor chain to execute the asset business request.
2. The asset business processing method according to claim 1, characterized in that, The obtaining a target policy object corresponding to the target asset type through a pre-configured policy factory includes: Inside the pre-configured policy factory, querying a target policy implementation class corresponding to the target asset type through a mapping table; Instantiating the target policy implementation class into a target policy object through a reflection mechanism.
3. The asset business processing method according to claim 2, characterized in that, After querying a target policy implementation class corresponding to the target asset type through a mapping table inside the pre-configured policy factory, it further includes: If no target policy implementation class corresponding to the target asset type is queried, registering a target policy implementation class corresponding to the target asset type through dependency injection and updating the mapping table.
4. The asset business processing method according to claim 1, characterized in that, The constructing a target processor chain according to a pre-configured processor chain configuration file and the target asset type includes: Obtaining a target processor chain configuration corresponding to the target asset type through a pre-configured processor chain configuration file; Parsing the target processor chain configuration into an ordered processor list; Instantiating each processor class in the ordered processor list into a processor object through a class loader; By traversing the ordered processor list, constructing a chained pointer between the processor objects to form a target processor chain.
5. The asset business processing method according to claim 1, characterized in that, After constructing a target processor chain according to the target asset type and the target policy object, it further includes: Creating a transaction context object, where the transaction context object is used to store the processing data of the asset business request; The invoking the target processor chain to execute the asset business request includes: Determining one or more processor objects as target processor objects from multiple processor objects in the target processor chain based on the processing progress of the asset business request; Invoking the target processor object to process the corresponding part of the business logic in the asset business request based on the transaction context object to generate corresponding processing data; Updating the transaction context object according to the processing data for passing to the next processor object of the target processor object.
6. The asset business processing method according to claim 5, characterized in that, The target processor chain includes a risk control processor, and the invoking the target processor chain to execute the asset business request includes: Monitoring the risk of the asset business request by invoking the risk control processor; If it is monitored that the risk of the asset business request exceeds a preset risk threshold, terminating the execution of the target processor chain and performing a rollback operation on the executed processor objects.
7. The asset business processing method according to claim 5, characterized in that, After invoking the target processor chain to execute the asset business request, it further includes: Monitoring at least one business metric associated with the asset business request, where the business metric includes asset volatility, trading volume threshold, and market risk level; When the at least one service metric exceeds a preset threshold, dynamically adjust the node execution path of the target processor chain; Obtain the 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.
8. The asset business processing method according to claim 1, characterized in that, After invoking the target processor chain to execute the asset service request, it includes: Real-time monitor the execution status and performance metrics of the target processor chain, and predict system bottlenecks according to the execution status and the performance metrics; When a system bottleneck is detected, mark the processor object corresponding to the system bottleneck as a node to be replaced; Determine a standby node corresponding to the node to be replaced from a preset processor pool; Based on the standby node, update the target processor chain, and invoke the updated target processor chain to execute the asset service request.
9. An electronic device, characterized in that, It includes: 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 service processing method according to any one of claims 1 to 8.
10. A storage medium, characterized in that, The storage medium stores executable instructions, and when the instructions are executed by a processor, the processor executes the asset service processing method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Asset management method and system
CN111402061A
Implementation method for constructing heterogeneous data warehouse
CN118885523A
Network attack path discovery method and system based on knowledge graph
CN119382987A
Customizable asset governance for a distributed reusable software library
US20060265688A1
Cited By
Data auditing monitoring method and related device
CN120973588A