Data processing method and device
By automatically calculating and splitting bond quotas, combining sales system performance and user data, the subjective judgment error problem of savings bond quotas is solved, and more accurate and efficient sharding is achieved, reducing labor costs and system pressure.
Patent Information
- Application Number
- CN202411283293.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2025-01-03
AI Technical Summary
In the prior art, there are subjective judgment errors in the sharding of bond quotas of savings treasury bonds, which leads to unreasonable sharding, increasing labor costs, and requiring a large amount of manual analysis of sales data.
By receiving quota shard requests, obtain the performance data of the sales system and the maximum number of users in the historical period, calculate a reasonable number of shards based on preset rules, automatically split the bond quota, combine the performance and user information analysis of the sales system to avoid Human errors are made and the shard quota is monitored. If it is insufficient, the main film will be recycled to ensure the stability of the system.
It improves the accuracy and rationality of bond quota sharding, reduces labor costs, ensures the maximum utilization of system resources, and avoids transaction failures and reduced user experience.
Smart Images

Figure CN119250975A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data processing method and device. Background Art
[0002] Savings bonds are personal deposit products that have attracted much public attention. Savings bonds have many sales channels and are in great demand, which makes the control of their bond quotas more complicated. Usually, the bond quota and quantity are set manually based on the total bond quota, which may result in subjective judgment errors. In addition, manual analysis of a large amount of sales data is required, which places high demands on labor and has high labor costs.
[0003] In view of this, how to improve the rationality and accuracy of bond quota segmentation and reduce labor costs is an urgent problem to be solved. Summary of the invention
[0004] The present application provides a data processing method and device for improving the rationality and accuracy of bond quota segmentation and reducing labor costs.
[0005] In a first aspect, an embodiment of the present application provides a data processing method, which is applied to any electronic device with computing capability, and the method includes:
[0006] receiving a quota sharding request, the quota sharding request is used to instruct to split the sharded bond quota in the sales system into multiple shards; the quota sharding request includes the sharded bond quota;
[0007] In response to the quota sharding request, obtain the performance data of the sales system and the maximum number of users of the sales system in the historical period;
[0008] According to the performance data of the sales system, the maximum number of users and preset rules, the number of shards N of the shard bond quota is determined, where N is a positive integer;
[0009] The shard bond quota is split according to the number of shards N to obtain N shards.
[0010] In this solution, by obtaining the performance data of the sales system and the maximum number of users of the sales system in the historical period, the obtained data is calculated according to the preset rules to determine the number of shards of the sharded bond quota. The bond quota sharding obtained by combining the performance of the sales system and the user information is more reasonable, and there is no need to manually set the number of shards, which can avoid errors in human subjective judgment, further improve the accuracy of the bond quota sharding, and reduce labor costs.
[0011] Optionally, obtain performance data of the sales system, including: obtaining the time required for the sales system to process each transaction when the sales system reaches the maximum processing capacity and the maximum number of transactions that each shard can process per second.
[0012] In this method, the performance data of the sales system is obtained when the maximum processing capacity is reached, so that the shards determined subsequently can maximize the use of system resources while ensuring the normal operation of the sales system, reduce resource waste, and improve the rationality of determining the shards.
[0013] Optionally, the number of shards N for the shard bond quota is determined based on the performance data of the sales system, the maximum number of users and preset rules, including: calculating the number of transactions that the sales system can process per second based on the time required for the sales system to process each transaction; obtaining the peak concurrency of the sales system based on the number of transactions that the sales system can process per second multiplied by the maximum number of users; and obtaining the number of shards N for the shard bond quota based on the peak concurrency divided by the maximum number of transactions that each shard can process per second.
[0014] In this method, according to preset rules, the number of shards of the shard bond quota is calculated based on the performance data of the sales system and the maximum number of users. This takes into account both the performance of the sales system and the user purchase situation during the peak trading period, making the calculated number of shards more reasonable.
[0015] Optionally, the sales system also includes a main-shard bond quota and a shard quota record table, the shard quota record table is used to record the total quota, sold quota and available quota of each of the N shards, and the available quota is the difference between the total quota and the sold quota of each shard; after obtaining N shards, the method also includes: monitoring the available quota of each of the N shards in the shard quota record table; if the available quota of any shard among the N shards is not greater than the recovery threshold, then disabling any shard, and recovering the available quota of any shard into the main-shard bond quota.
[0016] In this method, after obtaining N shards, the total amount, sold amount and available amount of the N shards are recorded in the shard amount record table to facilitate the subsequent monitoring of the sales of the N shard amount; when it is detected that the available amount of any shard is not greater than the recovery threshold, the available amount of any shard is recovered to avoid user transaction failures due to insufficient amount, reduce user experience, and improve the reliability of this application.
[0017] Optionally, the available quota of any shard is recovered into the main shard bond quota, including: setting the total quota and sold quota of any shard to 0; adding the available quota of any shard to the main shard bond quota; setting the total quota, sold quota and available quota of any shard in the shard quota record table to 0.
[0018] In this method, the order of the recovery steps is consistent with the order of deducting the shard quota first when the user trades, and if the shard quota is insufficient, deducting the main shard quota. The shard quota is first deducted to 0, and then the available quota of the shard quota is added to the main shard, avoiding deadlock and improving the reliability of this application.
[0019] Optionally, before recovering the available quota of any shard to the main shard bond quota, the method further includes: determining that the sum of the absolute value of the total quota of any shard and the absolute value of the sold quota is greater than 0.
[0020] In this method, before reclaiming the available quota of any shard, it is necessary to ensure that the shard has not been reclaimed before, so as to avoid repeated reclaiming of the shard, which would cause resource waste or confusion.
[0021] Optionally, after the available credit limit of any shard is recovered to the main shard bond credit limit, the method further includes: stopping monitoring the available credit limit of each of the N shards recorded in the shard credit limit record table; and restarting the monitoring after a preset time interval.
[0022] In this method, after the recovery of any shard is completed, the program is allowed to sleep for a preset period of time, which can avoid the situation where multiple shards are recovered to the main shard at the same time, resulting in a large number of transactions competing for the main shard's quota.
[0023] In a second aspect, an embodiment of the present application provides a data processing device, including:
[0024] The receiving module is used to: receive a quota sharding request, where the quota sharding request is used to instruct to split the sharded bond quota in the sales system to obtain multiple shards; the quota sharding request includes the sharded bond quota;
[0025] An acquisition module, used to: in response to a quota sharding request, acquire performance data of the sales system and the maximum number of users of the sales system in a historical period;
[0026] The processing module is used to: determine the number of shards N of the shard bond quota according to the performance data of the sales system, the maximum number of users and preset rules, where N is a positive integer; split the shard bond quota according to the number of shards N to obtain N shards.
[0027] Optionally, when acquiring the performance data of the sales system, the acquisition module is specifically used to: obtain the time required for the sales system to process each transaction when the maximum processing capacity is reached and the maximum number of transactions that each shard can process per second.
[0028] Optionally, when the processing module determines the number of shards N of the shard bond quota based on the performance data of the sales system, the maximum number of users and preset rules, it is specifically used to: calculate the number of transactions that the sales system can process per second based on the time required for the sales system to process each transaction; obtain the peak concurrency of the sales system based on the number of transactions that the sales system can process per second multiplied by the maximum number of users; obtain the number of shards N of the shard bond quota based on the peak concurrency divided by the maximum number of transactions that each shard can process per second.
[0029] Optionally, the sales system also includes a main-shard bond quota and a shard quota record table, the shard quota record table is used to record the total quota, sold quota and available quota of each of the N shards, and the available quota is the difference between the total quota and the sold quota of each shard; after obtaining the N shards, the processing module is also used to: monitor the available quota of each of the N shards in the shard quota record table; if the available quota of any shard among the N shards is not greater than the recovery threshold, then disable any shard, and recover the available quota of any shard into the main-shard bond quota.
[0030] Optionally, when the processing module recovers the available quota of any shard into the main shard bond quota, it is used to: set the total quota and sold quota of any shard to 0; increase the available quota of any shard in the main shard bond quota; set the total quota, sold quota and available quota of any shard in the shard quota record table to 0.
[0031] Optionally, before the available quota of any shard is recovered into the main shard bond quota, the processing module is further used to: determine that the sum of the absolute value of the total quota of any shard and the absolute value of the sold quota is greater than 0.
[0032] Optionally, after the available quota of any shard is recovered into the main shard bond quota, the processing module is also used to: stop monitoring the available quota of each of the N shards recorded in the shard quota record table; and restart the monitoring after a preset time interval.
[0033] In a third aspect, an embodiment of the present application provides an electronic device, comprising at least one processor, wherein the at least one processor is used to execute a computer program stored in a memory so that a method as in the first aspect or any optional implementation of the first aspect is implemented.
[0034] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which is used to store instructions. When the instructions are executed, the method in the first aspect or any optional implementation of the first aspect is implemented.
[0035] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program code, which, when executed on a computer, enables the method in the first aspect or any optional implementation of the first aspect to be implemented.
[0036] The technical effects or advantages of one or more technical solutions provided in the second, third, fourth and fifth aspects of the embodiments of the present application can be correspondingly explained by the technical effects or advantages of one or more corresponding technical solutions provided in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A flow chart of a data processing method provided in an embodiment of the present application;
[0038] Figure 2 A flow chart of a method for recovering sharding quota provided in an embodiment of the present application;
[0039] Figure 3 A structural diagram of a data processing device provided in an embodiment of the present application;
[0040] Figure 4 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] In the technical solution of this application, the collection, dissemination, and use of data are in compliance with the requirements of relevant national laws and regulations.
[0042] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0043] The technical solution of the present application is described in detail below through the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present application and the specific features in the embodiments are detailed descriptions of the technical solution of the present application, rather than limitations on the technical solution of the present application. In the absence of conflict, the embodiments of the present application and the technical features in the embodiments can be combined with each other.
[0044] It should be understood that "multiple" in the description of the embodiment of the present application refers to two or more. "First", "second" etc. in the embodiment of the present application are used to distinguish different objects, rather than to describe a specific order. The term "and / or" in the embodiment of the present application is merely a kind of association relationship describing associated objects, indicating that three relationships may exist, for example, A and / or B, which may represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "includes" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. The module in the embodiment of the present application refers to a part with independent functions in a software system.
[0045] Savings bonds are currently a deposit product that has attracted much attention from the public. Its main subscription channels include bank counters, online banking, and mobile banking. According to statistics, young people are keen to buy savings bonds on mobile banking apps or online banking, and the sales quota of electronic channels accounts for about 40% of the total sales quota. The elderly are accustomed to buying savings bonds at offline bank counters, and the sales quota of counter channels accounts for about 60% of the total sales quota. Therefore, in view of the huge demand for bonds and complex quota control, it is necessary to shard the bond quota so that multiple shards can execute transaction processing in parallel on the system to reduce the pressure on the system. Usually, the sharding is set manually according to the total bond quota, and there may be errors caused by manual subjective judgment. If the number of shards is configured too large, more fragments will be generated, causing customers to see that there is a small amount of quota available for sale, but it is actually difficult to buy, which reduces the customer experience; if the sharding configuration is too small, the system processing pressure is greater, which may cause congestion, crash, etc.; and a large amount of sales data needs to be manually statistically analyzed, and the labor cost is high.
[0046] In view of this, an embodiment of the present application provides a data processing method, which calculates the number of shards of the sharded bond quota according to preset rules, based on the performance data of the sales system and the maximum user data of the sales system in a historical period, and shards the sharded bond quota according to the number of shards. This takes into account both the performance of the sales system and the user purchase situation during the peak transaction period, making the calculated number of shards more reasonable; and does not require manual participation in setting the number of shards, avoiding errors that may be caused by human subjective judgment, thereby improving the accuracy of bond quota sharding and reducing labor costs.
[0047] The data processing method provided in the embodiment of the present application can be applied to any quota sharding scenario, including but not limited to the bond quota sharding mentioned above.
[0048] See also Figure 1 , is a flow chart of a data processing method provided in an embodiment of the present application, which can be applied to any electronic device with computing capabilities, including but not limited to computers, tablets, mobile phones, etc. The method includes steps S101 to S104:
[0049] S101. Receive a quota sharding request.
[0050] The quota sharding request is used to instruct to split the sharded bond quota in the sales system into multiple shards; the quota sharding request includes the sharded bond quota.
[0051] For example, when the sharded bond quota needs to be sharded, the staff can input a quota sharding instruction, or set a scheduled task on the system or other terminals to trigger the quota sharding request at a scheduled time.
[0052] S102. In response to the quota sharding request, obtain the performance data of the sales system and the maximum number of users of the sales system in a historical period.
[0053] Exemplarily, the historical period can be set according to actual needs, such as the week or month before the current date, or the time interval between the last time a quota sharding request was received and the current time a quota sharding request was received can be set as the historical period, etc. The embodiments of the present application do not impose any restrictions on this.
[0054] In a possible example, obtaining performance data of a sales system includes:
[0055] Get the time required for the sales system to process each transaction at maximum processing capacity and the maximum number of transactions that each shard can process per second.
[0056] It can be understood that in order to ensure the subsequent shards to maximize the use of system resources while ensuring the normal operation of the system, it is necessary to obtain performance data of sales data when the maximum processing capacity is reached (that is, the sales system is in an extreme state).
[0057] Optionally, the method for obtaining performance data of sales data when the maximum processing capacity is reached may be through non-functional testing, such as gradually increasing the number of transactions and the number of shards of the sales system until the sales system reaches the limit state, and obtaining the time required for the sales system to process each transaction and the maximum number of transactions that each shard can process per second.
[0058] S103. Determine the number of shards N of the shard bond quota based on the performance data of the sales system, the maximum number of users, and preset rules.
[0059] Wherein, N is a positive integer.
[0060] Specifically, first, the number of transactions that the sales system can process per second is calculated based on the time required for the sales system to process each transaction;
[0061] For example, assuming that the time required for the sales system to process each transaction is y milliseconds, the number of transactions that the sales system can process per second is 1000 / y;
[0062] Then, based on the number of transactions that the sales system can process per second multiplied by the maximum number of users, the peak concurrency of the sales system is obtained;
[0063] Exemplarily, assuming that the maximum number of users is m and the peak concurrent number is k, then k=m*(1000 / y).
[0064] Finally, based on the peak concurrency divided by the maximum number of transactions that each shard can process per second, the number of shards N for the shard bond quota is obtained.
[0065] For example, assuming that the maximum number of transactions that each shard can process per second is x, the number of shards N = k / x, that is, N = m*(1000 / y) / x.
[0066] If N calculated according to the above formula is not a positive integer, it is rounded up, that is, one is added to the integer value of the calculated data and the decimal part is discarded, and the resulting positive integer is N.
[0067] S104. Split the shard bond quota according to the number of shards N to obtain N shards.
[0068] Exemplarily, the shard bond quota can be evenly split according to the number of shards N, and the bond quota of each shard in the obtained N shards is one-Nth of the shard bond quota. The shard bond quota can also be split into N unequal parts according to actual needs. Among them, each shard can support bond transactions in various channels, or according to the proportion of the transaction amount of different sales channels to the total transaction amount, the N shards can be allocated to different sales channels according to the proportion. The specific allocation situation can be set according to actual needs, and the embodiment of the present application does not limit this.
[0069] In this embodiment, by obtaining the performance data of the sales system and the maximum number of users of the sales system in a historical period, the obtained data is calculated according to preset rules to determine the number of shards of the sharded bond quota. The bond quota sharding obtained by combining the performance of the sales system and the user information for analysis is more reasonable, and there is no need to manually set the number of shards, which can avoid errors in human subjective judgment, further improve the accuracy of the bond quota sharding, and reduce labor costs.
[0070] In a possible design, the sales system further includes a main shard bond quota and a shard quota record table. The shard quota record table is used to record the total quota, sold quota, and available quota of each shard among the N shards. The available quota is the difference between the total quota and the sold quota of each shard.
[0071] In order to ensure normal transactions of subsequent shards, when the available quota of a shard is not greater than the recovery threshold, the embodiment of the present application further provides a method for recovering the quota of a shard, the method comprising:
[0072] Monitor the available quota of each of the N shards in the shard quota record table; if the available quota of any shard among the N shards is not greater than the recovery threshold, disable the shard and recover the available quota of the shard into the main shard bond quota.
[0073] It can be understood that the shard quota record table can not only record the N shards currently divided according to the quota sharding request, but also record the shards divided according to the historical quota sharding request before. The shard quota record table can record the total quota of each shard (i.e. the quota of each shard at the time of initial division), the sold quota and the available quota, and can also record the sales record of each shard, etc., for easy data verification.
[0074] When the shard quota is not greater than the recovery threshold, if multiple users simultaneously request the shard to conduct bond transactions, the transaction may fail due to the small shard quota, or even the system may crash, affecting the user experience. Therefore, when the quota of any shard is not greater than the recovery threshold, the available quota of any shard needs to be recovered.
[0075] Exemplarily, monitoring the available quota of each of the N shards in the shard quota record table can be real-time monitoring. If it is detected that the available quota of any shard is not greater than the recovery threshold, the quota of the shard is immediately recovered; or the available quota of each of the N shards in the quota record table can be periodically detected at preset time intervals, and all shards whose detected available quota is not greater than the recovery threshold are recorded in the recovery list, and the available quota of the shards in the recovery list is recovered one by one.
[0076] In a possible embodiment, the method of recovering the available quota of any shard to the bond quota of the main shard may specifically include:
[0077] Set the total amount and sold amount of any shard to 0; increase the available amount of any shard in the main shard bond amount; set the total amount, sold amount and available amount of any shard in the shard amount record table to 0.
[0078] It can be understood that the order of the recycling steps is consistent with the order in which the shard quota is deducted first when the user trades. If the shard quota is insufficient, the main shard quota is deducted. The shard quota is first deducted to 0, and then the available quota of the shard quota is added to the main shard to avoid deadlock.
[0079] In a possible embodiment, before the available quota of any shard is recovered to the bond quota of the main shard, the process further includes:
[0080] Determine that the sum of the absolute value of the total amount of any shard and the absolute value of the sold amount is greater than 0.
[0081] It can be understood that the total amount and the sold amount of any shard after recycling are both 0. In order to avoid repeated recycling of the same shard causing resource waste or resource confusion, it is necessary to first determine whether any shard is a shard that has not been recycled, that is, to determine whether the sum of the absolute value of the total amount of any shard and the absolute value of the sold amount is greater than 0.
[0082] Optionally, it is also possible to determine that any shard is an unrecovered shard simply by determining that the absolute value of the total amount of any shard is greater than 0 or the absolute value of the sold amount is greater than 0.
[0083] In a possible embodiment, after the available quota of any shard is recovered to the bond quota of the main shard, the process further includes:
[0084] Stop monitoring the available quota of each shard in the N shards recorded in the shard quota record table; restart the monitoring after a preset interval.
[0085] It is understandable that the preset duration can be set according to the actual situation. After the recovery of any shard is completed, the program is allowed to sleep for a preset period of time to avoid the situation where multiple shards are recovered to the main shard at the same time, resulting in a large number of transactions competing for the main shard's quota.
[0086] For one possible example, see Figure 2 , the specific implementation method of realizing shard quota recovery may include the following steps:
[0087] 1. Lock the shards that have reached the recycling threshold.
[0088] Exemplarily, the available amount of the shards is periodically detected, and for a shard whose available amount is not greater than the recycling threshold, the shard is disabled (ie, locked).
[0089] 2. Query the list of shards that are locked and have not been recycled.
[0090] Exemplarily, confirm that all shards whose available amount detected this time is not greater than the recovery threshold are in a locked state, and obtain the shards among all the shards that have not been recovered (that is, the sum of the absolute value of the total amount and the absolute value of the sold amount is greater than 0).
[0091] For shards that are locked and have not been recycled, perform the following steps one by one:
[0092] 3. Deduct the shard quota.
[0093] Set the total amount and sold amount of the shard to 0.
[0094] 4. Increase the main film quota.
[0095] Add the available quota of the shard to the bond quota of the main shard.
[0096] 5. Check whether the sum of the main shard quota and each shard quota is consistent with the total issuance quota.
[0097] Exemplarily, it is checked whether the total amount of all shard quotas plus the main shard quota is consistent with the total issuance amount, that is, whether the quota recovery is correct.
[0098] If they are consistent, the credit recovery program will sleep for a preset time (for example, 2 seconds).
[0099] If they are inconsistent, the system will report an error and exit, and send an alarm message to the staff.
[0100] In this embodiment, in order to ensure the normal transactions of the sales system, when the available quota of any shard is not greater than the recovery threshold, it is necessary to lock any shard first to avoid the situation where multiple users request transactions for any shard but the transaction fails due to insufficient available quota of any shard. Then, confirm that any shard is a shard that has not been recovered to avoid repeated recovery of the recovered shards, resulting in resource waste or resource confusion; then, the quota is recovered in the order of quota deduction during user transactions to avoid deadlock; finally, after the available quota of any shard is recovered, let the program sleep for a preset time to avoid the situation where multiple shards are recovered to the main shard at the same time, resulting in a large number of transactions competing for the main shard quota.
[0101] The method provided by the embodiment of the present application is introduced above, and the device provided by the embodiment of the present application is introduced below.
[0102] Based on the same technical concept, an embodiment of the present application provides a data processing device, which includes a module / unit / means for executing the method executed by the electronic device in the above method embodiment. The module / unit / means can be implemented by software, or by hardware, or the corresponding software can be implemented by hardware.
[0103] For example, Figure 3 As shown, the device 300 includes:
[0104] The receiving module 301 is used to: receive a quota sharding request, where the quota sharding request is used to instruct to split the sharded bond quota in the sales system into multiple shards; the quota sharding request includes the sharded bond quota;
[0105] The acquisition module 302 is used to: in response to the quota slicing request, acquire the performance data of the sales system and the maximum number of users of the sales system in the historical period;
[0106] Processing module 303 is used to: determine the number of shards N of the shard bond quota according to the performance data of the sales system, the maximum number of users and preset rules, where N is a positive integer; split the shard bond quota according to the number of shards N to obtain N shards.
[0107] Optionally, when acquiring the performance data of the sales system, the acquisition module 301 is specifically used to: acquire the time required for the sales system to process each transaction when the maximum processing capacity is reached and the maximum number of transactions that each shard can process per second.
[0108] Optionally, when the processing module 303 determines the number of shards N of the shard bond quota based on the performance data of the sales system, the maximum number of users and preset rules, it is specifically used to: calculate the number of transactions that the sales system can process per second based on the time required for the sales system to process each transaction; obtain the peak concurrency of the sales system based on the number of transactions that the sales system can process per second multiplied by the maximum number of users; obtain the number of shards N of the shard bond quota based on the peak concurrency divided by the maximum number of transactions that each shard can process per second.
[0109] Optionally, the sales system also includes a main-slice bond quota and a slice quota record table, the slice quota record table is used to record the total quota, sold quota and available quota of each slice in the N slices, and the available quota is the difference between the total quota and the sold quota of each slice; after obtaining N slices, the processing module 303 is also used to: monitor the available quota of each of the N slices in the slice quota record table; if the available quota of any slice in the N slices is not greater than the recovery threshold, then disable any slice, and recover the available quota of any slice into the main-slice bond quota.
[0110] Optionally, when the processing module 303 recovers the available quota of any shard into the main shard bond quota, it is used to: set the total quota and sold quota of any shard to 0; increase the available quota of any shard in the main shard bond quota; set the total quota, sold quota and available quota of any shard in the shard quota record table to 0.
[0111] Optionally, before the available quota of any shard is recovered into the main shard bond quota, the processing module 303 is further used to: determine whether the sum of the absolute value of the total quota of any shard and the absolute value of the sold quota is greater than 0.
[0112] Optionally, after the available credit limit of any shard is recovered to the main shard bond credit limit, the processing module 303 is also used to: stop monitoring the available credit limit of each of the N shards recorded in the shard credit limit record table; and restart the monitoring after a preset time interval.
[0113] It should be understood that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.
[0114] Based on the same technical concept, see Figure 4 The embodiment of the present application further provides an electronic device 400, including:
[0115] At least one processor 401; and a communication interface 403 that is communicatively connected to the at least one processor 401; the at least one processor 401 executes instructions stored in the memory 402, so that the electronic device 400 executes the method steps performed by the billboard in the above method embodiment through the communication interface 403.
[0116] Optionally, the memory 402 is located outside the electronic device 400 .
[0117] Optionally, the electronic device 400 includes the memory 402, the memory 402 is connected to the at least one processor 401, and the memory 402 has instructions that can be executed by the at least one processor 401. Figure 4 The dashed lines indicate that the memory 402 is optional for the electronic device 400 .
[0118] The at least one processor 401 and the memory 402 may be coupled via an interface circuit or may be integrated together, which is not limited here.
[0119] The specific connection medium between the at least one processor 401, the memory 402 and the communication interface 403 is not limited in the embodiment of the present application. Figure 4 In the embodiment, at least one processor 401, a memory 402 and a communication interface 403 are connected via a bus 404. Figure 4 The connection between other components is only for schematic illustration and is not intended to be limiting. The bus part may be an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 It is represented by only one thick line, but it does not mean that there is only one bus or one type of bus.
[0120] It should be understood that the processor mentioned in the embodiments of the present application can be implemented by hardware or by software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented by software, the processor can be a general-purpose processor implemented by reading software code stored in a memory.
[0121] Exemplarily, the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0122] It should be understood that the memory mentioned in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both a volatile memory and a non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which acts as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DirectRambus RAM, DR RAM).
[0123] It should be noted that when the processor is a general-purpose processor, DSP, ASIC, FPGA or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, the memory (storage module) can be integrated into the processor.
[0124] It should be noted that the memory described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0125] Based on the same technical concept, an embodiment of the present application also provides a computer-readable storage medium, which is used to store instructions. When the instructions are executed, the computer executes the method steps executed by any device in the above method embodiments.
[0126] Based on the same technical concept, an embodiment of the present application also provides a computer program product, including computer program code. When the computer program code is executed on a computer, the method steps executed by any device in the above method embodiment are implemented.
[0127] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0128] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0129] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1A function specified in one or more boxes.
[0130] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0131] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A data processing method, characterized in that: include: receiving a quota sharding request, wherein the quota sharding request is used to instruct to split a sharded bond quota in a sales system into a plurality of shards; The quota sharding request includes the sharding bond quota; In response to the quota slicing request, obtaining performance data of the sales system and a maximum number of users of the sales system in a historical period; Determine the number of shards N of the shard bond quota according to the performance data of the sales system, the maximum number of users and preset rules, where N is a positive integer; The shard bond quota is split according to the shard number N to obtain N shards.
2. The method according to claim 1, characterized in that The obtaining of the performance data of the sales system includes: Obtain the time required for the sales system to process each transaction when the sales system reaches the maximum processing capacity and the maximum number of transactions that each shard can process per second.
3. The method according to claim 2, characterized in that The determining, according to the performance data of the sales system, the maximum number of users and a preset rule, the number of shards N of the shard bond quota includes: Calculate the number of transactions that the sales system can process per second based on the time required for the sales system to process each transaction; The peak concurrency of the sales system is obtained based on the number of transactions that the sales system can process per second multiplied by the maximum number of users; Based on the peak concurrency divided by the maximum number of transactions that each shard can process per second, the number of shards N of the shard bond amount is obtained.
4. The method according to claim 1, characterized in that The sales system also includes a main-slice bond quota and a slice quota record table; the slice quota record table is used to record the total quota, sold quota and available quota of each slice in the N slices, and the available quota is the difference between the total quota and the sold quota of each slice; After obtaining N fragments, the method further includes: Monitoring the available quota of each of the N shards in the shard quota record table; If the available amount of any shard among the N shards is not greater than the recovery threshold, the shard is disabled and the available amount of the shard is recovered into the main shard bond amount.
5. The method according to claim 4, characterized in that The recovering the available quota of any shard into the bond quota of the main shard includes: Set the total amount and sold amount of any shard to 0; Adding the available amount of any shard to the main shard bond amount; The total amount, sold amount and available amount of any shard in the shard amount record table are all set to 0.
6. The method according to claim 4 or 5, characterized in that Before recovering the available quota of any shard to the main shard bond quota, the method further includes: Determine that the sum of the absolute value of the total amount of any shard and the absolute value of the sold amount is greater than 0.
7. The method according to claim 4 or 5, characterized in that After the available quota of any shard is recovered to the main shard bond quota, the method further includes: Stop monitoring the available quota of each shard in the N shards recorded in the shard quota record table; After a preset time interval, the monitoring behavior is started again.
8. A data processing device, characterized in that: include: A receiving module, used to: receive a quota sharding request, wherein the quota sharding request is used to instruct to split the sharded bond quota in the sales system to obtain multiple shards; The quota sharding request includes the sharding bond quota; An acquisition module, used to: in response to the quota slicing request, acquire the performance data of the sales system and the maximum number of users of the sales system in a historical period; A processing module is used to: determine the number of shards N of the sharded bond quota according to the performance data of the sales system, the maximum number of users and preset rules, where N is a positive integer; and split the sharded bond quota according to the number of shards N to obtain N shards.
9. An electronic device, characterized in that: include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the steps included in the method according to any one of claims 1 to 7 according to the obtained program instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to have a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the method according to any one of claims 1 to 7 is implemented.
11. A computer program product, characterized in that The computer program product comprises: a computer program code, and when the computer program code is run on a computer, the computer is enabled to execute the method according to any one of claims 1 to 7.
