Credit regulation method and device, equipment and storage medium
By obtaining closing price information for bond transactions, splitting and updating the quota in the cache database, continuous trading during non-business hours is achieved, solving the problem of low flexibility in bond transaction quota settlement, and improving the accuracy and time efficiency of transactions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- PING AN TECH (SHENZHEN) CO LTD
- Filing Date
- 2022-06-15
- Publication Date
- 2026-05-19
AI Technical Summary
The existing interbank bond trading settlement scheme has low flexibility in bond trading quota settlement, requires manual judgment and operation, and can only be carried out during normal business hours, resulting in low flexibility in trading quota.
By obtaining the closing price information of the target product, calculating the continuous trading information during the continuous trading period, and splitting the closing quota into the continuous trading quota and the unsold quota, the quota is updated and merged using the cache database to achieve continuous trading during non-business hours.
It improved the accuracy of quota control, extended the market-making time of products, solved the problems of high concurrency and high availability, and enabled continuous trading during non-business hours.
Smart Images

Figure CN115170303B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of big data technology, and in particular to a method, apparatus, device and storage medium for credit limit regulation. Background Technology
[0002] Bonds are securities issued by debtors such as governments, corporations, and banks to raise funds, promising to repay principal and interest to creditors on a specified date. Individual investors can entrust securities firms to buy, sell, and settle bonds. Traditional bond settlement relies on custodian systems and third-party settlement clients, but the data between these systems is often isolated.
[0003] The existing interbank bond transaction settlement scheme involves the asset custody system obtaining transaction data from the foreign exchange trading center and recording it in the interbank bond transaction management table. Business personnel then verify the transactions in the interbank bond transaction management table and generate interbank bond settlement contracts according to business rules. Next, business personnel log into a third-party settlement client, locate the corresponding settlement confirmation instruction by transaction number, and manually compare the various business elements of the interbank bond transaction management table with the settlement confirmation instruction. If they match, the settlement confirmation operation is performed on the third-party client. Business personnel check the settlement contract status in the third-party settlement client and manually synchronize it to the asset custody system. Once the contract status is successful, the asset custody system automatically registers it in the funds ledger and securities ledger. As can be seen, the existing interbank bond transaction settlement scheme requires manual judgment and operation for each transaction, and transactions must be conducted during normal business hours, such as 9:30-16:30, resulting in low flexibility in bond transaction settlement. Summary of the Invention
[0004] The main objective of this invention is to solve the problem of low flexibility in the settlement of existing bond transaction quotas.
[0005] The first aspect of the present invention provides a quota control method, comprising: obtaining closing price information corresponding to a target product, and calculating continuous trading information of the target product during continuous trading based on the closing price information; obtaining closing quota information of the target product, and splitting the closing quota information into continuous trading quota and unsold quota; loading the continuous trading quota into a preset cache database, and updating the cache quota in the cache database based on the continuous trading information; merging the updated cache quota with the unsold quota to obtain the control quota during continuous trading.
[0006] Optionally, in a first implementation of the first aspect of the present invention, updating the cache limit in the cache database based on the continuous transaction information includes: upon receiving a limit update instruction, matching the continuous transaction information corresponding to the limit update instruction, and determining the target dimension parameter corresponding to the target product based on the matching result; performing parallel processing on the cache limit in the cache database according to the limit update operation in the limit update instruction based on the target dimension parameter; determining whether the result of the parallel processing satisfies a preset limit deduction condition; if satisfied, updating the cache limit in the cache database; otherwise, not updating the cache limit in the cache database.
[0007] Optionally, in a second implementation of the first aspect of the present invention, determining whether the result of parallel processing satisfies the preset quota deduction condition includes: based on the result of the parallel processing, determining the product identifier, operation type, and update time corresponding to the quota update operation; determining whether the quota update operation satisfies the first quota deduction condition for repeated operations based on the product identifier, the operation type, and the update time; if satisfied, comparing the deduction quota corresponding to the quota update operation with the deductible quota corresponding to the target dimension parameter, and determining whether the quota update operation satisfies the second quota deduction condition based on the comparison result.
[0008] Optionally, in a third implementation of the first aspect of the present invention, the parallel processing of the cache quota in the cache database according to the target dimension parameter and the quota update operation in the quota update instruction includes: obtaining consumption data during continuous transactions according to the target dimension parameter and the quota update operation in the quota update instruction; writing the consumption data into a preset blocking queue, and when the blocking queue is full, sending the unwritten consumption data to a temporary file; cyclically consuming the consumption data in the blocking queue, and determining a first deduction quota to be written to the cache database according to the type of consumption data in the blocking queue; processing the consumption data in the temporary file using an asynchronous thread, and determining a second deduction quota to be written to the cache database according to the type of consumption data in the temporary file; determining the cache quota to be updated in the cache database based on the first deduction quota and the second deduction quota, and using this as the result of the parallel processing of the quota update operation.
[0009] Optionally, in the fourth implementation of the first aspect of the present invention, before merging the updated cache quota with the sales quota to obtain the control quota during continuous transactions, the method further includes: every preset first period, persisting the cache quota to a preset structure database to obtain a persistent quota; every preset second period, comparing the cache quota and the persistent quota, and based on the comparison result, issuing a control warning for the cache quota to obtain a control warning result.
[0010] Optionally, in a fifth implementation of the first aspect of the present invention, the step of calculating the continuous trading information of the target product during the continuous trading period based on the closing price information includes: calculating the accrued interest of the target product using a preset product trading model; and calculating the continuous trading information of the target product by combining the closing price information and the accrued interest.
[0011] A second aspect of the present invention provides a quota control device, comprising: a calculation module for acquiring closing price information corresponding to a target product, and calculating continuous trading information of the target product during continuous trading based on the closing price information; a splitting module for acquiring closing quota information of the target product, and splitting the closing quota information into continuous trading quota and unsold quota; an updating module for loading the continuous trading quota into a preset cache database, and updating the cache quota in the cache database based on the continuous trading information; and a merging module for merging the updated cache quota with the unsold quota to obtain the control quota during continuous trading.
[0012] Optionally, in a first implementation of the second aspect of the present invention, the update module includes: a matching unit, configured to match the continuous transaction information corresponding to the quota update instruction when a quota update instruction is obtained, and determine the target dimension parameter corresponding to the target product based on the matching result; a parallel processing unit, configured to perform parallel processing on the cached quota in the cache database according to the quota update operation in the quota update instruction based on the target dimension parameter; and an update unit, configured to determine whether the result of the parallel processing satisfies the preset quota deduction condition; if it does, the cached quota in the cache database is updated; otherwise, the cached quota in the cache database is not updated.
[0013] Optionally, in a second implementation of the second aspect of the present invention, the updating unit is further configured to: determine the product identifier, operation type, and update time corresponding to the quota update operation based on the result of the parallel processing; determine whether the quota update operation satisfies the first quota deduction condition for repeated operations based on the product identifier, the operation type, and the update time; if satisfied, compare the deduction amount corresponding to the quota update operation with the deductible amount corresponding to the target dimension parameter, and determine whether the quota update operation satisfies the second quota deduction condition based on the comparison result.
[0014] Optionally, in a third implementation of the second aspect of the present invention, the parallel processing unit is further configured to: obtain consumption data during continuous transactions according to the target dimension parameter and the quota update operation in the quota update instruction; write the consumption data into a preset blocking queue, and when the blocking queue is full, send the unwritten consumption data to a temporary file; perform cyclic consumption of the consumption data in the blocking queue, and determine a first deduction quota to be written to the cache database according to the type of consumption data in the blocking queue; process the consumption data in the temporary file using an asynchronous thread, and determine a second deduction quota to be written to the cache database according to the type of consumption data in the temporary file; and determine the cache quota to be updated in the cache database based on the first deduction quota and the second deduction quota, and use this as the result of the parallel processing of the quota update operation.
[0015] Optionally, in a fourth implementation of the second aspect of the present invention, the quota control device further includes an early warning module, configured to: persist the cache quota to a preset structure database every preset first period to obtain a persistent quota; and compare the cache quota and the persistent quota every preset second period, and adjust and warn the cache quota based on the comparison result to obtain an adjustment and warning result.
[0016] Optionally, in a fifth implementation of the second aspect of the present invention, the calculation module includes: a first calculation unit, used to calculate the accrued interest corresponding to the target product using a preset product transaction model; and a second calculation unit, used to calculate the continuous transaction information corresponding to the target product by combining the closing price information and the accrued interest.
[0017] A third aspect of the present invention provides a credit limit adjustment device, comprising: a memory and at least one processor, wherein the memory stores instructions; the at least one processor invokes the instructions in the memory to cause the credit limit adjustment device to perform the above-described credit limit adjustment method.
[0018] A fourth aspect of the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the above-described quota control method.
[0019] The technical solution provided by this invention calculates the continuous trading quotation during non-business hours using the product's closing price; simultaneously, a continuous trading quota is pre-configured to support continuous trading during non-business hours, with a pending quota as a safety net, and a cache quota, such as a Redis quota, is used instead of the continuous trading quota for transaction calculation. This solves the high concurrency and high availability problems that arise during actual product trading, enabling continuous trading during non-business hours, ensuring the accuracy of the continuous trading quota, and extending the product's market-making time. Attached Figure Description
[0020] Figure 1 This is a schematic diagram of the first embodiment of the quota adjustment method in this invention;
[0021] Figure 2 This is a schematic diagram of a second embodiment of the quota adjustment method in this invention;
[0022] Figure 3 This is a schematic diagram of the third embodiment of the quota adjustment method in this invention;
[0023] Figure 4 This is a schematic diagram of one embodiment of the quota control device in this invention;
[0024] Figure 5 This is a schematic diagram of another embodiment of the quota adjustment device in this invention;
[0025] Figure 6 This is a schematic diagram of one embodiment of the quota control device in this invention. Detailed Implementation
[0026] This invention provides a method, apparatus, device, and storage medium for quota control. The method involves acquiring closing price information for a target product and calculating continuous trading information for the target product during continuous trading based on the closing price information; acquiring the closing quota information for the target product and splitting it into continuous trading quota and pending sales quota; loading the continuous trading quota into a pre-set cache database and updating the cached quota in the cache database based on the continuous trading information; and merging the updated cached quota and pending sales quota to obtain the controlled quota during continuous trading. This invention improves the accuracy of quota control for products and extends the market-making time of products.
[0027] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” or “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0028] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 The first embodiment of the quota adjustment method in this invention includes:
[0029] 101. Obtain the closing price information corresponding to the target product, and calculate the continuous trading information of the target product during the continuous trading period based on the closing price information;
[0030] It is understood that the executing entity of this invention can be a quota control device, a terminal, or a server; no specific limitation is made here. This embodiment of the invention will be described using a server as an example.
[0031] In this embodiment, the target product can be bonds, securities, futures, funds, or stocks, etc., and its corresponding closing price information includes the closing price of the target product at the end of each day's trading day. Then, based on the closing price of the target product, a preset product model is added to calculate the accrued interest, and the continuous trading information of the target product during the continuous trading period is calculated. Specifically, this can be the closing price plus the accrued interest. The continuous trading period refers to the exchange's non-normal business hours, such as trading outside of the trading hours stipulated by the exchange, excluding 9:00-11:30 AM and 1:30-3:00 PM.
[0032] 102. Obtain the closing quota information of the target product, and split the closing quota information into continuous transaction quota and unsold quota;
[0033] In this embodiment, the closing quota information refers to the available quota for the target product when the exchange closes for the day. Here, the closing quota is divided into two parts: continuous trading quota and unsold quota. During the continuous trading period, the continuous trading quota is used for market making, while the unsold quota does not participate in trading. When the market opens, the unsold quota and the remaining continuous trading quota are combined to form the opening quota.
[0034] 103. Load the continuous transaction limit into the preset cache database, and update the cache limit in the cache database based on the continuous transaction information;
[0035] In this embodiment, when a continuous trading period begins, after obtaining the continuous trading limit, the corresponding limit data is loaded into a pre-set cache database. The continuous trading limit is represented by a count in the cache database. Subsequently, when a transaction occurs during the continuous trading period, pricing is performed based on the continuous trading information, and the continuous trading limit in the cache database is directly increased or decreased based on the transaction amount. This is specifically reflected in the increase or decrease of the count in the cache database.
[0036] In addition, considering that continuous transaction quotas are a hot resource, in order to cope with potential future business activities such as flash sales, a Redis in-memory database can be used as a cache database to solve the problem of high concurrency and high availability.
[0037] 104. The updated cache limit is merged with the pending sales limit to obtain the control limit during continuous transactions.
[0038] In this embodiment, when a transaction occurs, the quota data in the cache database is increased or decreased and updated, and then merged with the quota available for sale to obtain the control quota during the continuous trading period after the current transaction. It should be noted that the control quota obtained before the market opens is the opening quota of the target product, and normal product trading is carried out with this opening quota.
[0039] In this embodiment of the invention, the closing price of the product is used to calculate the continuous trading quotation during non-business hours; at the same time, a continuous trading quota is pre-configured to support continuous trading during non-business hours, with a pending quota as a backup, and a cache quota, such as a Redis quota, is used instead of the continuous trading quota for transaction calculation. This solves the high concurrency and high availability problems that arise during the actual trading process of the product, enabling continuous trading during non-business hours, ensuring the accuracy of the continuous trading quota, and extending the market-making time of the product.
[0040] Please see Figure 2 The second embodiment of the quota adjustment method in this invention includes:
[0041] 201. Obtain the closing price information corresponding to the target product, and use the preset product trading model to calculate the accrued interest corresponding to the target product;
[0042] 202. Based on the closing price information and the accrued interest of the product, calculate the continuous transaction information corresponding to the target product;
[0043] In this embodiment, a pre-set product trading model is used to calculate the accrued interest of the target product. Then, the closing price and the accrued interest are added together to obtain the continuous trading information of the target product, i.e., the trading price during the continuous trading period. Specifically, the calculation method for accrued interest can be determined according to the interest payment cycle, as shown below:
[0044] A. The interest payment cycle is 1 year.
[0045] B. For interest payment periods of less than one year, interest will be paid based on the actual number of days.
[0046] C. For interest payment periods of less than one year, interest is paid based on the average value.
[0047] Wherein, AI refers to the accrued interest per 100 yuan face value; C refers to the annual interest per 100 yuan face value, which, for floating interest rates, is determined based on the coupon rate for the current interest payment period; t refers to the actual number of days from the interest accrual date or the previous interest payment date to the valuation date; TY refers to the actual number of days in the interest-bearing year in which the current interest payment period falls; TS refers to the actual number of days in the current interest payment period; f refers to the number of interest payments within a year; and m refers to the current remaining principal value per 100 yuan face value.
[0048] 203. Obtain the closing quota information of the target product, and split the closing quota information into continuous transaction quota and unsold quota;
[0049] 204. Load the continuous transaction limit into the preset cache database. When the limit update instruction is obtained, match the continuous transaction information corresponding to the limit update instruction, and determine the target dimension parameters corresponding to the target product based on the matching result.
[0050] 205. Based on the target dimension parameters, perform parallel processing on the cache quota in the cache database according to the quota update operation in the quota update instruction;
[0051] 206. Determine whether the result of parallel processing meets the preset deduction conditions;
[0052] 207. If the conditions are met, the cache limit in the cache database is updated; otherwise, the cache limit in the cache database is not updated.
[0053] In this embodiment, upon receiving a transaction operation for the target product, the client initiates a quota update instruction. Based on the identifier in the quota update instruction, the corresponding continuous transaction information is matched, pointing to the account and continuous transaction price that need to be traded. The target dimension parameter that needs to be updated is determined from the matching results corresponding to the target product. The target dimension parameter may include one or more of the following: exchange-specific quota, channel-shared quota, or continuous quota.
[0054] In this embodiment, after determining the target dimension parameters, the data corresponding to the cache quota that needs to be updated is selected, and then the quota update operation is executed. The quota update operations are added to the cache database in the message queue respectively, and parallel processing is performed according to the parallel quota update operations in the cache database. Multiple cache quota updates can be processed simultaneously.
[0055] When processing the quota update operation in parallel, that is, before updating the cache quota of the target product, the increase / deduction quota corresponding to each quota update operation is compared with the deductible quota corresponding to the target dimension parameter of the target product to determine whether the quota deduction condition is met. If the updated quota is greater than the deductible quota, it is not met; otherwise, it is met.
[0056] 208. Every preset first cycle, the cache quota is persisted to a preset structure database to obtain a persistent quota;
[0057] 209. Every second preset period, compare the cache limit and the persistence limit, and based on the comparison result, adjust and warn about the cache limit to obtain the adjustment and warning result;
[0058] In this embodiment, the first period refers to the time period set during a continuous trading period, and the second period refers to the time period set when a continuous trading period is completed.
[0059] For example, for the first cycle, during a continuous transaction period, every 30 minutes, the cached amount is persisted to a structured database and stored long-term in the structured database for reconciliation, ensuring the security of the amount during the continuous transaction period. Specifically, the cached amount in the Redis database can be stored in an Oracle database to obtain the persistent amount.
[0060] For example, for the second cycle, at the end of a continuous trading period, i.e. the end of the continuous trading day, the cache limit in the cache database and the persistent limit in the structure database are reconciled. If the reconciliation is abnormal, the target product is automatically stopped from being sold to prevent short selling.
[0061] 210. The updated cache limit is merged with the pending sales limit to obtain the control limit during continuous transactions.
[0062] Please see Figure 3 The third embodiment of the quota adjustment method in this invention includes:
[0063] 301. Obtain the closing price information corresponding to the target product, and calculate the continuous trading information of the target product during the continuous trading period based on the closing price information;
[0064] 302. Obtain the closing quota information of the target product, and split the closing quota information into continuous transaction quota and unsold quota;
[0065] 303. Load the continuous transaction limit into the preset cache database, and when the limit update instruction is obtained, match the continuous transaction information corresponding to the limit update instruction, and determine the target dimension parameters corresponding to the target product based on the matching result;
[0066] 304. Based on the target dimension parameters, and following the quota update operation in the quota update instruction, obtain the consumption data during the continuous transaction period;
[0067] In this embodiment, for each target dimension parameter, it is necessary to construct a corresponding component interface for consuming data. Specifically, distributed message queues such as Kafka or RocketMQ can be used to obtain consuming data. For example, the simpleConsumer method can be used to obtain consuming data from Kafka, or the DefaultPushConsumer method can be used to obtain consuming data from RocketMQ.
[0068] 305. Write the consumption data into a preset blocking queue. When the blocking queue is full, send the unwritten consumption data to a temporary file.
[0069] 306. Consume the data in the blocking queue in a loop, and determine the first deduction amount to be written to the cache database based on the type of the data in the blocking queue;
[0070] 307. The consumption data in the temporary file is processed using an asynchronous thread, and the second deduction amount to be written to the cache database is determined according to the type of consumption data in the temporary file;
[0071] 308. Based on the first deduction amount and the second deduction amount, determine the cache amount to be updated in the cache database and use it as the result of parallel processing of the quota update operation;
[0072] In this embodiment, it is determined whether the blocking queue (such as LinkedBlockQueue) is full. If it is full, the remaining consumption data is written to a temporary file (such as overMsg.txt) and processed by other processing logic to speed up the processing of consumption data.
[0073] In this embodiment, based on the type of consumption data in the blocking queue, the consumption data is processed in a single-threaded loop using the blocking queue. The consumption data is pre-written into the cache database to obtain the first deduction amount, thereby realizing the counting function of consumption data in the blocking queue.
[0074] In this embodiment, a listener is needed to dynamically monitor the consumption rate of data in a temporary file to determine the amount of data to be consumed. A thread pool is started, initialized, and its core and maximum thread counts are set. Consumption threads are then started within the thread pool to process the data in the temporary file and remove it from overMsg.txt, ultimately obtaining the level of data consumption in the temporary file. The number of threads can be dynamically adjusted based on the processing level of the consumed data in the temporary file monitored by the listener.
[0075] In this embodiment, based on the type of consumed data in the temporary file, an asynchronous thread in the thread pool is used to process the consumed data and pre-write the consumed data into the cache database to obtain the second deduction amount, thereby realizing the counting function of consumed data in the temporary file.
[0076] 309. Based on the results of the parallel processing, determine the product identifier, operation type, and update time corresponding to the quota update operation;
[0077] 310. Based on the product identifier, the operation type, and the update time, determine whether the credit limit update operation meets the first credit limit deduction condition for repeated operations;
[0078] 311. If satisfied, compare the deductible amount corresponding to the credit limit update operation with the deductible amount corresponding to the target dimension parameter, and determine whether the credit limit update operation satisfies the second credit limit deduction condition based on the comparison result.
[0079] In this embodiment, in the cache database, such as the Redis database, the quota update operation and the corresponding parallel processing result can be recorded by operation identifier, such as operation serial number, operation letter or other identifier, to prevent users from sending the same quota update operation repeatedly. If there is a duplicate quota update operation, the duplicate quota update operation is deleted according to the operation identifier.
[0080] Specifically, based on the product identifier, operation type, and update time corresponding to the credit limit update operation, a pre-generated operation serial number is added to the credit limit update operation. If a duplicate operation serial number is detected among the credit limit update operations, i.e., a duplicate credit limit update operation exists, the duplicate credit limit update operation is removed based on the operation serial number. If no duplicate credit limit update operation exists, it is defined as the credit limit update operation meeting the first credit limit deduction condition.
[0081] In other embodiments, the credit limit deduction operation encapsulates a sub-operation for querying the real-time credit limit, which queries the deductible credit limit corresponding to the target dimension parameter; then, it determines whether the deductible credit limit of the target dimension parameter is sufficient. If it is insufficient, it determines that the credit limit update operation does not meet the second credit limit deduction condition and returns the information that the credit limit is insufficient; if it is sufficient, it determines that the credit limit update operation meets the second credit limit deduction condition and returns success and the remaining credit limit after deduction.
[0082] 312. If the condition is met, the cache limit in the cache database is updated; otherwise, the cache limit in the cache database is not updated.
[0083] 313. The updated cache limit is merged with the pending sales limit to obtain the control limit during continuous transactions.
[0084] The above describes the credit limit adjustment method in the embodiments of the present invention. The following describes the credit limit adjustment device in the embodiments of the present invention. Please refer to [link / reference]. Figure 4 One embodiment of the quota adjustment device in this invention includes:
[0085] The calculation module 401 is used to obtain the closing price information corresponding to the target product, and calculate the continuous trading information of the target product during the continuous trading period based on the closing price information.
[0086] The splitting module 402 is used to obtain the closing quota information of the target product and split the closing quota information into continuous transaction quota and unsold quota;
[0087] The update module 403 is used to load the continuous transaction limit into the preset cache database and update the cache limit in the cache database based on the continuous transaction information;
[0088] The merging module 404 is used to merge the updated cache quota with the quota to be sold to obtain the control quota during continuous transactions.
[0089] In this embodiment of the invention, the closing price of the product is used to calculate the continuous trading quotation during non-business hours; at the same time, a continuous trading quota is pre-configured to support continuous trading during non-business hours, with a pending quota as a backup, and a cache quota, such as a Redis quota, is used instead of the continuous trading quota for transaction calculation. This solves the high concurrency and high availability problems that arise during the actual trading process of the product, enabling continuous trading during non-business hours, ensuring the accuracy of the continuous trading quota, and extending the market-making time of the product.
[0090] Please see Figure 5 Another embodiment of the quota adjustment device in this invention includes:
[0091] The calculation module 401 is used to obtain the closing price information corresponding to the target product, and calculate the continuous trading information of the target product during the continuous trading period based on the closing price information.
[0092] The splitting module 402 is used to obtain the closing quota information of the target product and split the closing quota information into continuous transaction quota and unsold quota;
[0093] The update module 403 is used to load the continuous transaction limit into the preset cache database and update the cache limit in the cache database based on the continuous transaction information;
[0094] The merging module 404 is used to merge the updated cache quota with the quota to be sold to obtain the control quota during continuous transactions.
[0095] Specifically, the update module 403 includes:
[0096] The matching unit 4031 is used to match the continuous transaction information corresponding to the quota update instruction when the quota update instruction is obtained, and determine the target dimension parameters corresponding to the target product based on the matching result.
[0097] The parallel processing unit 4032 is used to perform parallel processing on the cache quota in the cache database according to the target dimension parameter and the quota update operation in the quota update instruction.
[0098] The update unit 4033 is used to determine whether the result of parallel processing meets the preset quota deduction condition; if it does, the cache quota in the cache database is updated; otherwise, the cache quota in the cache database is not updated.
[0099] Specifically, the update unit 4033 is also used for:
[0100] Based on the results of the parallel processing, the product identifier, operation type, and update time corresponding to the quota update operation are determined.
[0101] Based on the product identifier, the operation type, and the update time, determine whether the credit limit update operation meets the first credit limit deduction condition for repeated operations;
[0102] If satisfied, the deductible amount corresponding to the quota update operation is compared with the deductible amount corresponding to the target dimension parameter, and based on the comparison result, it is determined whether the quota update operation satisfies the second quota deduction condition.
[0103] Specifically, the parallel processing unit 4032 is also used for:
[0104] Based on the target dimension parameters, and following the quota update operation in the quota update instruction, the consumption data during the continuous transaction period is obtained;
[0105] The consumption data is written to a preset blocking queue. When the blocking queue is full, the unwritten consumption data is sent to a temporary file.
[0106] The data consumed in the blocking queue is consumed in a loop, and the first deduction amount to be written to the cache database is determined according to the type of data consumed in the blocking queue.
[0107] The consumption data in the temporary file is processed using an asynchronous thread, and the second deduction amount to be written to the cache database is determined based on the type of consumption data in the temporary file.
[0108] Based on the first deduction amount and the second deduction amount, the cache amount to be updated in the cache database is determined and used as the result of parallel processing of the quota update operation.
[0109] Specifically, the quota control device further includes an early warning module 405, used for:
[0110] Every preset first cycle, the cache quota is persisted to a preset structure database to obtain the persistent quota;
[0111] Every second preset period, the cache limit and the persistent limit are compared, and based on the comparison result, the cache limit is adjusted and an early warning is issued to obtain the adjustment and early warning result.
[0112] Specifically, the computing module 401 includes:
[0113] The first calculation unit 4011 is used to calculate the accrued interest corresponding to the target product using a preset product transaction model;
[0114] The second calculation unit 4012 is used to calculate the continuous transaction information corresponding to the target product by combining the closing price information and the accrued interest of the product.
[0115] above Figure 4 and Figure 5 The quota control device in the embodiments of the present invention will be described in detail from the perspective of modular functional entities. The quota control device in the embodiments of the present invention will be described in detail from the perspective of hardware processing.
[0116] Figure 6This is a schematic diagram of a credit limit adjustment device 600 provided in an embodiment of the present invention. The credit limit adjustment device 600 can vary significantly due to different configurations or performance characteristics. It may include one or more central processing units (CPUs) 610 (e.g., one or more processors) and a memory 620, and one or more storage media 630 (e.g., one or more mass storage devices) storing application programs 633 or data 632. The memory 620 and storage media 630 can be temporary or persistent storage. The program stored in the storage media 630 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the credit limit adjustment device 600. Furthermore, the processor 610 may be configured to communicate with the storage media 630 and execute the series of instruction operations in the storage media 630 on the credit limit adjustment device 600.
[0117] The credit limit control device 600 may also include one or more power supplies 640, one or more wired or wireless network interfaces 650, one or more input / output interfaces 660, and / or one or more operating systems 631, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 6 The illustrated structure of the credit limit control device does not constitute a limitation on the credit limit control device. It may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.
[0118] The present invention also provides a credit limit adjustment device, wherein the computer device includes a memory and a processor, the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor performs the steps of the credit limit adjustment method in the above embodiments.
[0119] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when the instructions are executed on a computer, cause the computer to perform the steps of the quota control method.
[0120] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0121] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0122] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for adjusting credit limits, characterized in that, The quota adjustment method includes: Obtain the closing price information corresponding to the target product, and calculate the continuous trading information of the target product during the continuous trading period based on the closing price information; wherein, the continuous trading period refers to the non-normal business hours of the exchange; the step of calculating the continuous trading information of the target product during the continuous trading period based on the closing price information includes: calculating the accrued interest of the target product using a preset product trading model; and calculating the continuous trading information of the target product by combining the closing price information and the accrued interest. Obtain the closing quota information of the target product, which refers to the available quota for the target product at the end of the trading day when the exchange closes for the day, and split the closing quota information into continuous trading quota and unsold quota; during the continuous trading period, the continuous trading quota is used for market making, while the unsold quota does not participate in trading; The continuous transaction limit is loaded into a preset cache database, and the cache limit in the cache database is updated based on the continuous transaction information; The updated cache limit is merged with the pending sales limit to obtain the control limit for continuous transactions. Before merging the updated cache limit with the pending sales limit to obtain the control limit for continuous transactions, the method further includes: persisting the cache limit to a preset structure database every preset first period to obtain a persisted limit; comparing the cache limit and the persisted limit every preset second period, and issuing a control warning for the cache limit based on the comparison result to obtain a control warning result; the first period refers to the time period set in a continuous transaction period, and the second period refers to the time period set when a continuous transaction period is completed.
2. The quota adjustment method according to claim 1, characterized in that, The step of updating the cache limit in the cache database based on the continuous transaction information includes: Upon receiving a quota update instruction, the system matches the continuous transaction information corresponding to the quota update instruction and determines the target dimension parameters corresponding to the target product based on the matching result. Based on the target dimension parameters, the cache quota in the cache database is processed in parallel according to the quota update operation in the quota update instruction; Determine whether the result of parallel processing meets the preset deduction conditions; If the conditions are met, the cache limit in the cache database is updated; otherwise, the cache limit in the cache database is not updated.
3. The quota adjustment method according to claim 2, characterized in that, The determination of whether the result of parallel processing meets the preset deduction conditions includes: Based on the results of the parallel processing, the product identifier, operation type, and update time corresponding to the quota update operation are determined. Based on the product identifier, the operation type, and the update time, determine whether the credit limit update operation meets the first credit limit deduction condition for repeated operations; If satisfied, the deductible amount corresponding to the quota update operation is compared with the deductible amount corresponding to the target dimension parameter, and based on the comparison result, it is determined whether the quota update operation satisfies the second quota deduction condition.
4. The quota adjustment method according to claim 2, characterized in that, The step of performing parallel processing on the cache quota in the cache database according to the target dimension parameter and the quota update operation in the quota update instruction includes: Based on the target dimension parameters, and following the quota update operation in the quota update instruction, the consumption data during the continuous transaction period is obtained; The consumption data is written to a preset blocking queue. When the blocking queue is full, the unwritten consumption data is sent to a temporary file. The data consumed in the blocking queue is consumed in a loop, and the first deduction amount to be written to the cache database is determined according to the type of data consumed in the blocking queue. The consumption data in the temporary file is processed using an asynchronous thread, and the second deduction amount to be written to the cache database is determined based on the type of consumption data in the temporary file. Based on the first deduction amount and the second deduction amount, the cache amount to be updated in the cache database is determined and used as the result of parallel processing of the quota update operation.
5. A quota adjustment device, characterized in that, The quota adjustment device includes: The calculation module is used to obtain the closing price information corresponding to the target product, and calculate the continuous trading information of the target product during the continuous trading period based on the closing price information; wherein, the continuous trading period refers to the non-normal business hours of the exchange; the calculation of the continuous trading information of the target product during the continuous trading period based on the closing price information includes: calculating the accrued interest of the target product using a preset product trading model; and calculating the continuous trading information of the target product by combining the closing price information and the accrued interest. The splitting module is used to obtain the closing quota information of the target product. The closing quota information refers to the available quota for the target product at the end of the trading day when the exchange closes for the day. The closing quota information is split into continuous trading quota and unsold quota. During the continuous trading period, the continuous trading quota is used for market making, while the unsold quota does not participate in trading. The update module is used to load the continuous transaction limit into the preset cache database and update the cache limit in the cache database based on the continuous transaction information. The merging module is used to merge the updated cache quota with the quota to be sold to obtain the control quota during continuous transactions; The quota control device also includes an early warning module for: Every preset first cycle, the cache quota is persisted to a preset structure database to obtain the persistent quota; Every second preset period, the cache limit and the persistence limit are compared, and the cache limit is adjusted and warned based on the comparison result to obtain the adjustment and warning result; the first period refers to the time period set in a continuous transaction period, and the second period refers to the time period set when a continuous transaction period is completed.
6. A quota adjustment device, characterized in that, The quota control device includes: a memory and at least one processor, wherein the memory stores instructions; The at least one processor invokes the instructions in the memory to cause the quota control device to perform the steps of the quota control method as described in any one of claims 1-4.
7. A computer-readable storage medium storing instructions thereon, characterized in that, When the instruction is executed by the processor, it implements the steps of the quota control method as described in any one of claims 1-4.