Index parallel processing method and device for risk control and electronic equipment

By integrating Seata coordination services and designing a parallel computing architecture, the problems of low computational efficiency and consistency of risk control indicators in the financial risk control system are solved, and efficient risk control and system scalability are achieved.

CN119718555APending Publication Date: 2025-03-28HANGZHOU BANK WEALTH MANAGEMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411917291.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

The calculation efficiency of risk control indicators in the existing financial risk control system is low, unable to meet business timeliness needs, and cannot maintain distributed consistency with other systems.

Method used

Through the distributed transaction processing framework integrating Seata coordination services, a parallel processing method for metrics for risk control is designed, the risk assessment results are calculated in parallel using the computing unit, and the risk control management service is updated through an asynchronous message queue.

Benefits of technology

It improves the processing efficiency of risk control indicators, ensures distributed consistency with other systems, and enhances the scalability and response speed of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718555A_ABST
    Figure CN119718555A_ABST
Patent Text Reader

Abstract

The invention provides an index parallel processing method and device for risk control and electronic equipment, and is applied to a server. The method comprises the steps that if an instruction signal of an investment transaction system is received, the instruction signal is sent to risk control prepositive service through seata coordination service, the instruction signal is processed to obtain an instruction command, the instruction command is sent to a saga coordinator, the instruction command is converted into a calculation unit instruction, and the calculation unit instruction is sent to a calculation unit; determining instruction position information based on the computing unit instruction; combining the instruction position information into a preset data set to obtain a newest asset position set, and inputting the context of task execution of the calculation unit; determining a target clause rule from a plurality of clause rules according to the context; and based on the target clause rule, calculating a calculation result corresponding to the calculation unit instruction in parallel. According to the method, an efficient risk control index parallel processing mechanism is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a method, device and electronic equipment for parallel processing of indicators for risk control. Background Art

[0002] Risk control is a core component of the financial industry, which involves the assessment and management of multiple risk factors such as market risk, credit risk, liquidity risk, etc. As the complexity and dynamism of the financial market continue to increase, the number of relevant risk control indicators is also increasing, which puts higher requirements on the existing risk assessment and management methods.

[0003] When conducting financial transactions, investment managers issue instructions in the investment system. The instructions are checked by the risk control end and the position end. After all of them pass, they are distributed to traders and reported to the exchange. Among them, the control of instructions by the position end and the risk control end must be consistent. If they pass, they will be passed. If any prohibition is lifted, it will be revoked.

[0004] In the current financial risk control system, the calculation of risk control indicators is generally based on the current instruction, traversing all clauses, bringing in the current instruction data, and performing serialized SQL operations based on the database to calculate the inspection results of all clauses. Its efficiency is low. From the issuance of an instruction to the calculation of risk control indicators, all clauses need to be calculated, which takes several seconds. After an instruction is completed, the data needs to be fully implemented before the calculation and implementation of the next instruction can be carried out. It cannot meet the business's needs for timeliness and cannot maintain distributed consistency with other systems. Summary of the invention

[0005] The purpose of the present invention is to provide a method, device and electronic device for parallel processing of risk control indicators, so as to alleviate the technical problems of low data processing efficiency and inability to maintain distributed consistency with other systems in the prior art, so as to improve data processing efficiency and ensure that the indicator data used for risk control maintains distributed consistency with other systems.

[0006] In a first aspect, an embodiment of the present invention provides a method for parallel processing of indicators for risk control, which is applied to a server; the server is pre-installed with a seata coordination service; the server is connected to an investment trading system; the method comprises: if an instruction signal of the investment trading system is received, the instruction signal is sent to a risk control front-end service through the seata coordination service; the instruction signal is processed by the risk control front-end service to obtain an instruction command, and the instruction command is sent to a saga coordinator; the instruction command is converted into a calculation unit instruction corresponding to the calculation unit according to a preset classification parameter through the saga coordinator; and the calculation unit instruction is sent to the calculation unit corresponding to the calculation unit instruction; the calculation unit is used for risk assessment of different financial services; the instruction position information corresponding to the calculation unit instruction is determined by the calculation unit based on the calculation unit instruction; and the instruction position information is combined into a preset data set of the calculation unit to obtain the latest asset position set; and the latest asset position set is input into the environment and status information of the task execution of the calculation unit; according to the environment and status information, the target clause rule corresponding to the calculation unit instruction is determined from a plurality of preset clause rules; and the calculation result corresponding to the calculation unit instruction is calculated in parallel based on the target clause rule.

[0007] In a preferred embodiment of the present invention, after the step of determining the target clause rule corresponding to the above-mentioned computing unit instruction from a plurality of preset clause rules based on the above-mentioned environment and status information, the above-mentioned method includes: obtaining a rule engine without processing tasks from a rule engine pool; placing the target clause rule corresponding to the above-mentioned computing unit instruction into the above-mentioned rule engine; and based on the above-mentioned target clause rule, the step of calculating the calculation results corresponding to the above-mentioned computing unit instruction in parallel includes: calculating the calculation results corresponding to the above-mentioned computing unit instruction in parallel based on the above-mentioned target clause rule based on the above-mentioned rule engine.

[0008] In a preferred embodiment of the present invention, the step of calculating the calculation results corresponding to the above-mentioned calculation unit instructions in parallel based on the above-mentioned rule engine according to the above-mentioned target clause rules includes: extracting the clause list of the above-mentioned target clause rules based on the above-mentioned rule engine, and inputting the above-mentioned clause list into the thread pool; and calculating the calculation results corresponding to the above-mentioned calculation unit instructions in parallel through the above-mentioned thread pool.

[0009] In a preferred embodiment of the present invention, the step of calculating the calculation results corresponding to the above-mentioned calculation unit instructions in parallel based on the above-mentioned rule engine according to the above-mentioned target clause rule includes: parsing the calculation factors from the clause expression of the above-mentioned target clause rule based on the above-mentioned rule engine; calculating the factor trend of the above-mentioned calculation factors according to the above-mentioned calculation factors; and calculating the calculation results corresponding to the above-mentioned calculation unit instructions in parallel according to the above-mentioned factor trend.

[0010] In a preferred embodiment of the present invention, the step of calculating the calculation results corresponding to the above-mentioned calculation unit instructions in parallel according to the above-mentioned factor trend includes: based on a preset trend-to-bad parameter, according to the above-mentioned factor trend, filtering the instructions with a trend to bad from the above-mentioned calculation unit instructions to obtain the instructions with a trend to bad; according to the above-mentioned instructions with a trend to bad and the above-mentioned target clause rules, calculating the calculation results corresponding to the above-mentioned calculation unit instructions in parallel.

[0011] In a preferred embodiment of the present invention, after the step of calculating the calculation results corresponding to the calculation unit instructions in parallel according to the above-mentioned bad trend instructions and the above-mentioned target clause rules, the above-mentioned method includes: returning the above-mentioned calculation results to the above-mentioned saga coordinator through the above-mentioned rule engine; obtaining the above-mentioned calculation results through the above-mentioned saga coordinator; sorting the above-mentioned calculation results in order of high and low corresponding risks to obtain the sorted calculation results; sending the above-mentioned sorted calculation results to the risk control management service by asynchronously sending a message queue; returning the above-mentioned message queue to the above-mentioned risk control front-end service through the above-mentioned risk control management service; updating the current status of the above-mentioned instruction signal according to the above-mentioned message queue through the above-mentioned risk control front-end service; and returning the above-mentioned calculation results to the above-mentioned seata coordination service; after assembling the above-mentioned calculation results through the above-mentioned seata coordination service, the assembled results are fed back to the above-mentioned investment trading system.

[0012] In a preferred embodiment of the present invention, after assembling the above-mentioned calculation results through the above-mentioned seata coordination service and feeding back the assembled results to the above-mentioned investment trading system, the above-mentioned method includes: if the above-mentioned server fails or does not pass, the above-mentioned seata coordination service sends a cancellation instruction to the downstream service.

[0013] In a preferred embodiment of the present invention, the above-mentioned calculation units include: a securities joint calculation unit, a securities calculation unit, a subject calculation unit, a product calculation unit, an SPV calculation unit and a full product calculation unit; the above-mentioned securities joint calculation unit is used to process the risk assessment of multiple securities; the above-mentioned securities calculation unit is used to process the risk assessment related to securities; the above-mentioned subject calculation unit is used to assess the risks related to the transaction subject; the above-mentioned product calculation unit is used to assess the risks of preset financial products; the above-mentioned SPV calculation unit is used to process the risks related to the asset management plan; the above-mentioned full product calculation unit is used to conduct a comprehensive assessment of the risks in the entire company dimension.

[0014] In the second aspect, an embodiment of the present invention further provides an indicator parallel processing device for risk control, which is applied to a server; the server is pre-installed with a seata coordination service; the server is connected to an investment trading system; the device includes: an instruction sending module, which is used to send the instruction signal of the investment trading system to the risk control front-end service through the seata coordination service if the instruction signal is received; an instruction command sending module, which is used to process the instruction signal through the risk control front-end service to obtain an instruction command, and send the instruction command to the saga coordinator; a computing unit instruction sending module, which is used to convert the instruction command into a computing unit instruction corresponding to the computing unit according to preset classification parameters through the saga coordinator; and send the computing unit instruction to the saga coordinator. A computing unit corresponding to the computing unit instruction is sent to the computing unit; the computing unit is used to indicate a risk assessment unit for different financial services; an instruction position information determination module is used to determine the instruction position information corresponding to the computing unit instruction based on the computing unit instruction through the computing unit; and combine the instruction position information into the preset data set of the computing unit to obtain the latest asset position set; and input the latest asset position set into the environment and status information of the task execution of the computing unit; a target clause rule determination module is used to determine the target clause rule corresponding to the computing unit instruction from the preset multiple clause rules according to the environment and status information; a parallel computing module is used to parallelly calculate the calculation results corresponding to the computing unit instruction based on the target clause rule.

[0015] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the above-mentioned parallel processing method of indicators for risk control.

[0016] The embodiments of the present invention have the following beneficial technical effects:

[0017] The embodiment of the present invention provides a method, device and electronic device for parallel processing of indicators for risk control, which are applied to a server; the server is pre-installed with a seata coordination service; the server is connected to an investment trading system; the method comprises: if a command signal of the investment trading system is received, the command signal is sent to a risk control front-end service through the seata coordination service; the command signal is processed by the risk control front-end service to obtain a command command, and the command command is sent to a saga coordinator; the command command is converted into a calculation unit instruction corresponding to the calculation unit according to a preset classification parameter through the saga coordinator; and the calculation unit instruction is sent to the calculation unit corresponding to the calculation unit instruction; the calculation unit is used for risk assessment of different financial services; the command position information corresponding to the calculation unit instruction is determined by the calculation unit based on the calculation unit instruction; and the command position information is combined into a preset data set of the calculation unit to obtain the latest asset position set; and the latest asset position set is input into the environment and status information of the task execution of the calculation unit; according to the environment and status information, the target clause rule corresponding to the calculation unit instruction is determined from a plurality of preset clause rules; and the calculation result corresponding to the calculation unit instruction is calculated in parallel based on the target clause rule. This method realizes an efficient parallel processing mechanism of risk control indicators by integrating the distributed transaction processing framework of seata coordination service. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 A schematic diagram of a flow chart of a method for parallel processing of indicators for risk control provided by an embodiment of the present invention;

[0020] Figure 2 A flowchart of another method for parallel processing of indicators for risk control provided by an embodiment of the present invention;

[0021] Figure 3 A schematic diagram of the structure of a device for parallel processing of indicators for risk control provided by an embodiment of the present invention;

[0022] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention.

[0023] Icons: 31-instruction sending module; 32-instruction command sending module; 33-computing unit instruction sending module; 34-instruction position information determination module; 35-target clause rule determination module; 36-parallel computing module; 41-processor; 42-memory; 43-bus; 44-communication interface. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0025] At present, the calculation of risk control indicators in financial risk control systems is generally based on the current instruction, traversing all clauses, bringing in the current instruction data, and performing serialized SQL operations based on the database to calculate the inspection results of all clauses. Its efficiency is low. From the issuance of an instruction to the calculation of risk control indicators, all clauses need to be calculated, which takes several seconds. After an instruction is completed, the data needs to be fully implemented before the calculation and implementation of the next instruction can be carried out. It cannot meet the business's needs for timeliness and cannot maintain distributed consistency with other systems.

[0026] Based on this, the embodiment of the present invention provides a method, device and electronic device for parallel processing of indicators for risk control, which realizes an efficient parallel processing mechanism of risk control indicators by integrating the distributed transaction processing framework of seata coordination service. In order to facilitate the understanding of the present invention, a method for parallel processing of indicators for risk control is first introduced in detail.

[0027] Example 1

[0028] In this embodiment, Figure 1 A schematic flow chart of a method for parallel processing of indicators for risk control provided by an embodiment of the present invention.

[0029] The method is applied to a server; the server is pre-installed with a seata coordination service; and the server is connected to an investment trading system.

[0030] Depend on Figure 1 As can be seen, the method includes:

[0031] Step S101: If a command signal from the investment trading system is received, the command signal is sent to the risk control front-end service through the seata coordination service.

[0032] In this embodiment, the investment trading system sends the instruction to the seata coordination service, which then sends it to the risk control front-end service and other services to uniformly manage whether the instruction is successfully passed. If not, it needs to be uniformly revoked to ensure data consistency.

[0033] Step S102: The command signal is processed by the risk control front-end service to obtain a command, and the command is sent to the saga coordinator.

[0034] In this embodiment, after the instruction reaches the risk control front-end service, the risk control front-end service cleans, verifies, and converts the data to form an instruction command and sends it to the saga coordinator.

[0035] Step S103: through the saga coordinator, convert the instruction command into a computing unit instruction corresponding to the computing unit according to the preset classification parameters; and send the computing unit instruction to the computing unit corresponding to the computing unit instruction; the computing unit is used for risk assessment of different financial services.

[0036] In this embodiment, in the saga coordination service, different receivers receive the instruction commands according to different instruction commands, and then convert the instruction commands into corresponding computing unit instructions according to several saga internal converters defined inside the receivers.

[0037] Step S104: Determine the instruction position information corresponding to the above-mentioned computing unit instruction based on the above-mentioned computing unit instruction through the above-mentioned computing unit; and combine the above-mentioned instruction position information into the preset data set of the above-mentioned computing unit to obtain the latest asset position set; and input the above-mentioned latest asset position set into the environment and status information of the task execution of the above-mentioned computing unit.

[0038] In actual operation, the saga coordinator sends the computing unit instructions to the corresponding computing unit in the form of internal messages.

[0039] Furthermore, after the computing unit receives the corresponding computing unit instruction, it first extracts the current instruction information from the computing unit instruction, then converts it into specific instruction position information, and then adds it to the computing unit's own position data set to form the computing unit's latest asset position set, which is placed in the context of the computing unit, wherein the above context is the above environment and status information.

[0040] Step S105: According to the above environment and status information, determine the target clause rule corresponding to the above computing unit instruction from the preset multiple clause rules.

[0041] Here, see the latest asset position collection in the table. After it is placed in the context of the calculation unit, it is ready to check the terms. First, the terms that need to be calculated in the calculation unit are obtained according to the terms setting. In this step, the terms acquisition depends on the rules of the terms setting, including the following four aspects: transaction type, control direction, control method, and control object; after obtaining the information of the current instruction from the context, the corresponding target terms rules are obtained according to the asset transaction type of the instruction, the buy and sell direction of the instruction, the calculation unit type, and the product range involved in the instruction.

[0042] Step S106: Based on the above target clause rules, the calculation results corresponding to the above calculation unit instructions are calculated in parallel.

[0043] In this embodiment, the currently idle rule engine is obtained from the rule engine pool, and the clause list of the target clause rule is added to the rule engine as a data base. When the rule engine is calculating, the clause list is taken out and put into the thread pool, and the clause results are started to be calculated in parallel. When calculating the clause, the factors involved in the configuration are first parsed from the clause expression. After all the involved factors are obtained, the pre-calculation (trend calculation) of the clause is started first.

[0044] Among them, pre-calculation is a pre-calculation method for executing all clauses involving factor configuration. On the one hand, the method will obtain the asset position set from the context. For asset positions, not all need to participate in the calculation of the current clause, so in the pre-calculation, the asset positions involved in the current factor calculation are filtered and collected and added to the memory set; on the other hand, it is necessary to calculate whether the current instruction does not need to be checked.

[0045] Among them, the trend of the instructions needs to be calculated for collecting the instructions involved and calculating whether the current instructions do not need to be checked. What is involved here is the trend algorithm. On the one hand, for asset positions, the instructions are the undetermined part of the day, so when the terms are strictly calculated, it is necessary to find instructions that meet the terms and trigger the warning direction to calculate the terms. Otherwise, if some instructions are not executed, it may eventually cause the terms to actually exceed the standard; on the other hand, if the trend of the current instruction is good, it should be checked and passed in the current terms. The trend algorithm is an algorithm that determines whether the instruction is going in the direction of driving the terms to prohibit or pass. The implementation is as follows:

[0046] When the clause is pre-calculated, the instruction trend value is calculated for all instructions that occurred on the day (including the current instruction) in the factor pre-calculation method involved in the clause. When further calculating the trend value of a single factor and a single instruction, first obtain the current instruction trend value from the rule engine trend key-value pair cache. If there is no such value, it is initially recognized as 0; if the current instruction affects the factor value to decrease, the trend value is -1, and if the impact factor value increases, the trend value is +1. After the calculation of the single factor trend is completed, the trend value is updated to the rule engine trend key-value pair cache. The primary key is the unique primary key of the instruction, and the value is the instruction information after the trend is updated.

[0047] Furthermore, the trend value of the instruction is compared with the clause control direction to obtain the trend of the instruction. If the current instruction has more impact factors in the direction of the clause trigger prohibition, the trend of the instruction is bad. If the current instruction has more impact factors in the opposite direction of the clause trigger prohibition, the trend of the instruction is good. Actual implementation: If the clause control direction is prohibited to be less than the threshold, if the trend value is greater than 0, the trend is bad, if the trend value is less than 0, the trend is good; if the clause control direction is prohibited to be greater than the threshold, if the trend value is greater than 0, the trend is good, if the trend value is less than 0, the trend is bad;

[0048] Furthermore, the preliminary calculation is completed and the formal calculation of the terms begins.

[0049] Among them, when obtaining asset holdings, for the case of strict calculation of terms, the factors filter out the orders with a bad trend to participate in the calculation based on the pre-calculated order trends.

[0050] Furthermore, the calculation of a single factor is as follows: the factor function obtains the required data resources from the cache, context, and asset holdings involved in the pre-calculation, and calculates the result of the single factor according to the calculation logic of the factor itself. The unique name of the factor is used as the key, and the factor result is stored as the value in the rule engine factor key-value pair cache.

[0051] Furthermore, after the result of a single factor is calculated, the rule engine obtains the factor result from the key-value pair cache, brings it into the clause expression, and calculates the actual value of the clause.

[0052] Furthermore, it is necessary to obtain the inspection status of the clause. If the pre-calculated result shows a positive trend, the inspection result is no need to check, otherwise it is compared according to the actual value; the actual value of the clause needs to be compared with the threshold set for the clause, and the multiple sets of thresholds set for the clause are compared from high to low, and the restriction level corresponding to the highest threshold triggered is found as the inspection result; if none of the thresholds are triggered, the default result is that the inspection passed. After a single clause is calculated, the unique primary key of the clause is used as the key, and the clause inspection information is stored as the value in the rule engine clause key-value pair cache.

[0053] Furthermore, the rule engine collects the clause inspection results from the clause key-value pair cache, summarizes them into an inspection result list, and then assembles them into a command completion event and returns them to the saga coordinator.

[0054] Furthermore, in the saga coordinator, the inspection results of all computing units are obtained, sorted from high to low according to the severity of the inspection results, and the inspection results are asynchronously sent to the risk control management service through the message queue, and then the inspection results are returned to the risk control front-end service. Furthermore, after the risk control management service receives the message queue, an asynchronous thread is started for data landing. The instruction inspection information can also be queried on the system page. In the risk control front-end service, the returned inspection results are obtained, the current instruction status is updated to success, and then the results are returned to the seata coordinator. The seata coordinator waits for all downstream services to respond normally and then assembles all results and returns them to the investment trading system. If a service response fails or fails, the seata coordinator sends a revocation instruction to all downstream services to ensure the consistency of distributed transactions in each system.

[0055] The embodiment of the present invention provides a method for parallel processing of indicators for risk control, which is applied to a server; the server is pre-installed with a seata coordination service; the server is connected to an investment trading system; the method comprises: if an instruction signal of the investment trading system is received, the instruction signal is sent to a risk control front-end service through the seata coordination service; the instruction signal is processed by the risk control front-end service to obtain an instruction command, and the instruction command is sent to a saga coordinator; the instruction command is converted into a calculation unit instruction corresponding to the calculation unit according to a preset classification parameter through the saga coordinator; and the calculation unit instruction is sent to the calculation unit corresponding to the calculation unit instruction; the calculation unit is used for risk assessment of different financial services; the instruction position information corresponding to the calculation unit instruction is determined by the calculation unit based on the calculation unit instruction; and the instruction position information is combined into a preset data set of the calculation unit to obtain the latest asset position set; and the latest asset position set is input into the environment and status information of the task execution of the calculation unit; according to the environment and status information, the target clause rule corresponding to the calculation unit instruction is determined from a plurality of preset clause rules; and the calculation result corresponding to the calculation unit instruction is calculated in parallel based on the target clause rule. This method realizes an efficient parallel processing mechanism of risk control indicators by integrating the distributed transaction processing framework of seata coordination service.

[0056] Example 2

[0057] Based on the above embodiments, Figure 2 A flowchart of another method for parallel processing of indicators for risk control provided by an embodiment of the present invention.

[0058] The method is applied to a server; the server is pre-installed with a seata coordination service; and the server is connected to an investment trading system.

[0059] Depend on Figure 2 As can be seen, the method includes:

[0060] Step S201: If a command signal from the investment trading system is received, the command signal is sent to the risk control front-end service through the seata coordination service.

[0061] Here, the above-mentioned Seata coordination service can be replaced with other distributed transaction managers, such as the transaction management function of Apache Kafka, the distributed transaction function of Atomikos, or other similar middleware.

[0062] Step S202: The command signal is processed by the risk control front-end service to obtain a command, and the command is sent to the saga coordinator.

[0063] Step S203: through the saga coordinator, convert the instruction command into a computing unit instruction corresponding to the computing unit according to the preset classification parameters; and send the computing unit instruction to the computing unit corresponding to the computing unit instruction; the computing unit is used for risk assessment of different financial services.

[0064] Here, the above-mentioned calculation units include: a securities joint calculation unit, a securities calculation unit, a subject calculation unit, a product calculation unit, an SPV calculation unit and a full product calculation unit; the above-mentioned securities joint calculation unit is used to process the risk assessment of multiple securities; the above-mentioned securities calculation unit is used to process the risk assessment related to securities; the above-mentioned subject calculation unit is used to assess the risks related to the transaction subject; the above-mentioned product calculation unit is used to assess the risks of preset financial products; the above-mentioned SPV calculation unit is used to process the risks related to the asset management plan; the above-mentioned full product calculation unit is used to conduct a comprehensive assessment of the risks in the entire company dimension.

[0065] Step S204: Determine the instruction position information corresponding to the above-mentioned computing unit instruction based on the above-mentioned computing unit instruction through the above-mentioned computing unit; and combine the above-mentioned instruction position information into the preset data set of the above-mentioned computing unit to obtain the latest asset position set; and input the above-mentioned latest asset position set into the environment and status information of the task execution of the above-mentioned computing unit.

[0066] Step S205: According to the above environment and status information, determine the target clause rule corresponding to the above computing unit instruction from the preset multiple clause rules.

[0067] Step S206: Obtain a rule engine without processing tasks from the rule engine pool.

[0068] Here, the above rule engine can be replaced by other business rule management systems, such as Drools, Easy Rules or similar rule engines.

[0069] Step S207: putting the target clause rules corresponding to the above computing unit instructions into the above rule engine.

[0070] Step S208: Based on the rule engine and according to the target clause rule, the calculation results corresponding to the calculation unit instructions are calculated in parallel.

[0071] In one embodiment, the step of calculating the calculation results corresponding to the above-mentioned computing unit instructions in parallel based on the above-mentioned rule engine according to the above-mentioned target clause rules includes: extracting the clause list of the above-mentioned target clause rules based on the above-mentioned rule engine, and inputting the above-mentioned clause list into the thread pool; and calculating the calculation results corresponding to the above-mentioned computing unit instructions in parallel through the above-mentioned thread pool.

[0072] Furthermore, based on the above-mentioned rule engine, according to the above-mentioned target clause rule, the step of calculating the calculation results corresponding to the above-mentioned calculation unit instructions in parallel includes: based on the above-mentioned rule engine, parsing the calculation factors from the clause expression of the above-mentioned target clause rule; according to the above-mentioned calculation factors, calculating the factor trend of the above-mentioned calculation factors; according to the above-mentioned factor trend, calculating the calculation results corresponding to the above-mentioned calculation unit instructions in parallel.

[0073] Here, according to the above-mentioned factor trend, the step of calculating the calculation results corresponding to the above-mentioned calculation unit instructions in parallel includes: based on a preset trend-to-bad parameter, according to the above-mentioned factor trend, filtering the instructions with a trend toward bad from the above-mentioned calculation unit instructions to obtain the instructions with a trend toward bad; according to the above-mentioned instructions with a trend toward bad and the above-mentioned target clause rules, calculating the calculation results corresponding to the above-mentioned calculation unit instructions in parallel.

[0074] In actual operation, after the step of calculating the calculation results corresponding to the calculation unit instructions in parallel according to the above-mentioned bad trend instructions and the above-mentioned target clause rules, the above-mentioned method includes: returning the above-mentioned calculation results to the above-mentioned saga coordinator through the above-mentioned rule engine; obtaining the above-mentioned calculation results through the above-mentioned saga coordinator; sorting the above-mentioned calculation results in the order of high and low corresponding risks to obtain the sorted calculation results; sending the above-mentioned sorted calculation results to the risk control management service by asynchronously sending a message queue; returning the above-mentioned message queue to the above-mentioned risk control front-end service through the above-mentioned risk control management service; updating the current state of the above-mentioned instruction signal according to the above-mentioned message queue through the above-mentioned risk control front-end service; and returning the above-mentioned calculation results to the above-mentioned seata coordination service; after assembling the above-mentioned calculation results through the above-mentioned seata coordination service, the assembled results are fed back to the above-mentioned investment trading system.

[0075] Here, the message queue includes: a Kafka message queue or a RabbitMQ message queue.

[0076] Furthermore, after assembling the calculation results through the seata coordination service and feeding back the assembled results to the investment trading system, the method includes: if the server fails or does not pass, the seata coordination service sends a cancellation instruction to the downstream service.

[0077] The present invention has the following beneficial technical effects:

[0078] First, by introducing the Seata coordination service, the challenge of maintaining data consistency in distributed systems is solved, ensuring data synchronization and consistency between the risk control system and other systems, and improving the reliability of transaction processing.

[0079] Secondly, after the Seata coordination service, the risk control pre-service was introduced to pre-process financial instructions, which improved the efficiency of verification and formatting of financial instructions before entering the risk assessment process, ensured the accuracy and consistency of subsequent risk assessments, and reduced the need for error and exception handling.

[0080] Third, design multiple specialized computing units, such as securities computing units, principal computing units, etc., each unit processes a specific type of clause in parallel; modular design of computing units: each computing unit is designed as an independent and functionally specific module that can handle the calculation of a specific type of clause; the system can dynamically allocate computing resources, including CPU, memory, and storage, as needed; introduce load balancing technology to ensure that computing tasks are evenly distributed among all computing units, solving the problem of inefficiency of traditional serial processing methods when processing a large number of financial instructions; traditional systems are often difficult to expand quickly to meet higher processing requirements when facing the growth of data volume and transaction volume; computing resource bottleneck: under high load conditions, a single or a small number of computing units may become a performance bottleneck; significantly improve the speed of risk assessment and the overall throughput of the system; improve system processing capabilities; by adding more computing units, the system can handle more parallel tasks, thereby improving overall processing capabilities. Enhance the scalability of the system; the system can flexibly add computing units according to business needs and resource conditions without making large-scale changes to the existing architecture.

[0081] Fourth, within the computing unit, multiple clauses are processed in parallel, and multiple factors involved in each clause are calculated in parallel, which optimizes the use of computing resources, reduces the waiting time of a single computing task, improves the processing capacity of a single computing unit, and speeds up the overall risk assessment process.

[0082] Fifth, after the parallel calculation of the computing engine, a factor trend pre-calculation step is added to prevent omissions in clause checks due to the final failure of the order, ensuring that the clauses can be strictly controlled. It also avoids unnecessary checks on all clauses and reduces the waste of computing resources; the trend algorithm more accurately determines whether the order meets the inspection criteria of the clauses, reducing misjudgments and omissions. The intelligent level of risk assessment is improved, allowing the system to allocate computing resources more efficiently.

[0083] Sixth, it dynamically decides whether to conduct clause checks based on the results of factor trend pre-calculation, which solves the inefficiency of unified checks on all clauses in traditional methods; it optimizes the risk assessment process so that the system can concentrate resources on processing clauses that really need attention.

[0084] Seventh, the risk assessment results are written to the database asynchronously, which reduces the obstruction of the calculation process during the result storage process and improves the system's response speed and the overall efficiency of data processing.

[0085] Here, different types of database systems can be used, such as relational databases (such as MySQL, PostgreSQL), NoSQL databases (such as MongoDB, Cassandra), or time series databases (such as InfluxDB).

[0086] The embodiment of the present invention provides a method for parallel processing of indicators for risk control, which is applied to a server; the server is pre-installed with a seata coordination service; the server is connected to an investment trading system; the method comprises: if a command signal of the investment trading system is received, the command signal is sent to a risk control front-end service through the seata coordination service; the command signal is processed by the risk control front-end service to obtain a command command, and the command command is sent to a saga coordinator; the command command is converted into a calculation unit instruction corresponding to a calculation unit according to a preset classification parameter through the saga coordinator; and the calculation unit instruction is sent to a calculation unit corresponding to the calculation unit instruction; the calculation unit is used for Risk assessment of financial services; determine the instruction position information corresponding to the above-mentioned calculation unit instruction based on the above-mentioned calculation unit instruction through the above-mentioned calculation unit; and combine the above-mentioned instruction position information into the preset data set of the above-mentioned calculation unit to obtain the latest asset position set; and input the above-mentioned latest asset position set into the environment and status information of the task execution of the above-mentioned calculation unit; according to the above-mentioned environment and status information, determine the target clause rule corresponding to the above-mentioned calculation unit instruction from the preset multiple clause rules; obtain the rule engine without processing tasks from the rule engine pool; put the target clause rule corresponding to the above-mentioned calculation unit instruction into the above-mentioned rule engine; based on the above-mentioned rule engine and according to the above-mentioned target clause rule, parallelly calculate the calculation result corresponding to the above-mentioned calculation unit instruction. This method aims to improve the efficiency of risk control, enhance the scalability and accuracy of the system through a parallel computing architecture and a parallel processing method of splitting multiple computing units, so as to adapt to the rapid development and complexity of the financial market.

[0087] Example 3

[0088] Based on the above embodiments, Figure 3 A schematic diagram of the structure of a device for parallel processing of indicators for risk control provided by an embodiment of the present invention.

[0089] The server is pre-installed with a seata coordination service; the server is connected to an investment trading system; the device includes:

[0090] The instruction sending module 31 is used to send the instruction signal to the risk control front-end service through the seata coordination service if the instruction signal of the investment trading system is received.

[0091] The instruction command sending module 32 is used to process the instruction signal through the risk control front-end service to obtain the instruction command, and send the instruction command to the saga coordinator.

[0092] The computing unit instruction sending module 33 is used to convert the above instruction command into a computing unit instruction corresponding to the computing unit according to the preset classification parameters through the above saga coordinator; and send the above computing unit instruction to the computing unit corresponding to the above computing unit instruction; the above computing unit is used to instruct the risk assessment unit of different financial services.

[0093] The instruction position information determination module 34 is used to determine the instruction position information corresponding to the above-mentioned computing unit instruction based on the above-mentioned computing unit instruction through the above-mentioned computing unit; and combine the above-mentioned instruction position information into the preset data set of the above-mentioned computing unit to obtain the latest asset position set; and input the above-mentioned latest asset position set into the environment and status information of the task execution of the above-mentioned computing unit.

[0094] The target clause rule determination module 35 is used to determine the target clause rule corresponding to the above-mentioned computing unit instruction from a plurality of preset clause rules according to the above-mentioned environment and status information.

[0095] The parallel computing module 36 is used to parallelly compute the computing results corresponding to the computing unit instructions based on the target clause rules.

[0096] Among them, the instruction sending module 31, the instruction command sending module 32, the computing unit instruction sending module 33, the instruction position information determination module 34, the target clause rule determination module 35 and the parallel computing module 36 are connected in sequence.

[0097] The implementation principle and technical effects of the indicator parallel processing device for risk control provided in the embodiment of the present invention are the same as those of the aforementioned indicator parallel processing method embodiment for risk control. For the sake of brief description, for parts not mentioned in the embodiment of the above-mentioned indicator parallel processing device for risk control, reference may be made to the corresponding contents in the aforementioned method embodiment.

[0098] The embodiment of the present invention further provides an electronic device, such as Figure 4 As shown, it is a schematic diagram of the structure of the electronic device, wherein the electronic device includes a processor 41 and a memory 42, the memory 42 stores machine executable instructions that can be executed by the processor 41, and the processor 41 executes the machine executable instructions to implement the above-mentioned parallel processing method of indicators for risk control.

[0099] exist Figure 4 In the illustrated embodiment, the electronic device further includes a bus 43 and a communication interface 44 , wherein the processor 41 , the communication interface 44 and the memory 42 are connected via the bus.

[0100] The memory 42 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 44 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus may be an ISA bus, a PCI bus, or an EISA bus, etc. The above-mentioned bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0101] The processor 41 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 41. The above processor 41 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as a hardware decoding processor to be executed, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor 41 reads the information in the memory 42 and completes the steps of the indicator parallel processing method for risk control in the aforementioned embodiment in combination with its hardware.

[0102] An embodiment of the present invention also provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned parallel processing method of indicators for risk control. The specific implementation can be found in the aforementioned method embodiment, which will not be repeated here.

[0103] The computer program product of the indicator parallel processing method for risk control, the indicator parallel processing device for risk control and the electronic device provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the above program code can be used to execute the above-mentioned indicator parallel processing method for risk control in the previous method embodiment. The specific implementation can be referred to the method embodiment, which will not be repeated here.

[0104] Unless otherwise specifically stated, the relative steps, numerical expressions and values ​​of the components and steps set forth in these embodiments do not limit the scope of the present invention.

[0105] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that can be executed by a processor. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the above methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0106] Finally, it should be noted that the above-mentioned embodiments are only specific implementation methods of the present invention, which are used to illustrate the technical solutions of the present invention rather than to limit it. The protection scope of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the above-mentioned embodiments, ordinary technicians in this field should understand that any technician familiar with this technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed by the present invention, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the protection scope of the present invention.

Claims

1. A method for parallel processing of indicators for risk control, characterized in that: The method is applied to a server; the server is pre-installed with a seata coordination service; the server is connected to an investment trading system; and the method comprises: If a command signal from the investment trading system is received, the command signal is sent to the risk control front-end service through the seata coordination service; Processing the instruction signal through the risk control front-end service to obtain an instruction command, and sending the instruction command to the saga coordinator; Through the saga coordinator, the instruction command is converted into a computing unit instruction corresponding to the computing unit according to the preset classification parameters; and the computing unit instruction is sent to the computing unit corresponding to the computing unit instruction; the computing unit is used for risk assessment of different financial services; Determine, by the computing unit, the instruction position information corresponding to the computing unit instruction based on the computing unit instruction; combine the instruction position information into a preset data set of the computing unit to obtain the latest asset position set; and input the latest asset position set into the environment and state information of the task execution of the computing unit; Determine, according to the environment and state information, a target clause rule corresponding to the computing unit instruction from a plurality of preset clause rules; Based on the target clause rule, the calculation results corresponding to the calculation unit instructions are calculated in parallel.

2. The method for parallel processing of indicators for risk control according to claim 1, characterized in that: After the step of determining the target clause rule corresponding to the computing unit instruction from a plurality of preset clause rules according to the environment and state information, the method comprises: Get the rule engine without processing tasks from the rule engine pool; Putting the target clause rule corresponding to the computing unit instruction into the rule engine; The step of calculating the calculation results corresponding to the calculation unit instructions in parallel based on the target clause rule includes: Based on the rule engine and according to the target clause rule, the calculation results corresponding to the calculation unit instructions are calculated in parallel.

3. The method for parallel processing of indicators for risk control according to claim 2, characterized in that: The step of calculating the calculation results corresponding to the calculation unit instructions in parallel based on the rule engine according to the target clause rule includes: Extracting a clause list of the target clause rule based on the rule engine, and inputting the clause list into a thread pool; The calculation results corresponding to the calculation unit instructions are calculated in parallel through the thread pool.

4. The method for parallel processing of indicators for risk control according to claim 3, characterized in that: The step of calculating the calculation results corresponding to the calculation unit instructions in parallel based on the rule engine according to the target clause rule includes: A calculation factor parsed from a clause expression of the target clause rule by the rule engine; According to the calculation factor, calculating the factor trend of the calculation factor; According to the factor trend, calculation results corresponding to the calculation unit instructions are calculated in parallel.

5. The method for parallel processing of indicators for risk control according to claim 4, characterized in that: The step of calculating the calculation results corresponding to the calculation unit instructions in parallel according to the factor trend includes: Based on a preset bad trend parameter and according to the factor trend, filtering instructions with a bad trend from the computing unit instructions to obtain instructions with a bad trend; According to the bad trend instruction and the target clause rule, the calculation results corresponding to the calculation unit instructions are calculated in parallel.

6. The method for parallel processing of indicators for risk control according to claim 5, characterized in that: After the step of calculating the calculation results corresponding to the calculation unit instructions in parallel according to the bad trend instruction and the target clause rule, the method includes: Returning the calculation result to the saga coordinator through the rule engine; Obtaining the calculation result through the saga coordinator; Sorting the calculation results in order of corresponding risks to obtain sorted calculation results; Send the sorted calculation results to the risk control management service by asynchronously sending a message queue; Returning the message queue to the risk control front-end service through the risk control management service; By means of the risk control front-end service, the current state of the command signal is updated according to the message queue; and the calculation result is returned to the seata coordination service; After the calculation results are assembled through the seata coordination service, the assembled results are fed back to the investment trading system.

7. The method for parallel processing of indicators for risk control according to claim 6, characterized in that: After assembling the calculation results through the seata coordination service and feeding back the assembled results to the investment trading system, the method includes: If the server fails or does not pass, the seata coordination service sends a revocation instruction to the downstream service.

8. The method for parallel processing of indicators for risk control according to claim 1, characterized in that: The calculation units include: a securities joint calculation unit, a securities calculation unit, a subject calculation unit, a product calculation unit, an SPV calculation unit and a full product calculation unit; the securities joint calculation unit is used to process the risk assessment of multiple securities; the securities calculation unit is used to process the risk assessment related to securities; the subject calculation unit is used to assess the risks related to the transaction subject; the product calculation unit is used to assess the risks of preset financial products; the SPV calculation unit is used to process the risks related to the asset management plan; the full product calculation unit is used to conduct a comprehensive assessment of the risks in the entire company dimension.

9. A device for parallel processing of indicators for risk control, characterized in that: Applied to a server; the server is pre-installed with a seata coordination service; the server is connected to an investment trading system; the device includes: An instruction sending module, configured to send the instruction signal to the risk control front-end service through the seata coordination service if an instruction signal from the investment trading system is received; An instruction command sending module, used to process the instruction signal through the risk control front-end service to obtain an instruction command, and send the instruction command to the saga coordinator; A computing unit instruction sending module, used to convert the instruction command into a computing unit instruction corresponding to the computing unit according to the preset classification parameters through the saga coordinator; and send the computing unit instruction to the computing unit corresponding to the computing unit instruction; the computing unit is used to instruct the risk assessment unit of different financial services; An instruction position information determination module is used to determine the instruction position information corresponding to the computing unit instruction based on the computing unit instruction through the computing unit; and combine the instruction position information into a preset data set of the computing unit to obtain the latest asset position set; and input the latest asset position set into the environment and state information of the task execution of the computing unit; A target clause rule determination module, used to determine the target clause rule corresponding to the computing unit instruction from a plurality of preset clause rules according to the environment and state information; A parallel computing module is used to parallelly compute the computing results corresponding to the computing unit instructions based on the target clause rules.

10. An electronic device, characterized in that: The electronic device includes a processor and a memory, the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the indicator parallel processing method for risk control as described in any one of claims 1 to 8.