WO2016019803A1 - 基于分布式内存和数据库的数据处理方法、装置和系统 - Google Patents
基于分布式内存和数据库的数据处理方法、装置和系统 Download PDFInfo
- Publication number
- WO2016019803A1 WO2016019803A1 PCT/CN2015/084883 CN2015084883W WO2016019803A1 WO 2016019803 A1 WO2016019803 A1 WO 2016019803A1 CN 2015084883 W CN2015084883 W CN 2015084883W WO 2016019803 A1 WO2016019803 A1 WO 2016019803A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- budget
- memory
- quota
- current
- database
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
Definitions
- the present application relates to the field of the Internet, and in particular, to a data processing method, apparatus, and system based on a distributed memory and a database DB.
- the database uses the database DB (Database) to store and process the budget data
- the first method is: storing a budget data through a record of a DB, each When deducting the budget data, it can be performed in the same transaction through the DB SQL statement. This method is called single DB mode.
- the second way is to split the budget data into different DBs of different servers, and load deduction requests can be balanced to different DBs each time the budget data needs to be deducted.
- a budget of 1000 is stored by 10 records distributed in 10 DBs, each of which records 100; and a deduction of 3 is routed to one of 10 DBs (for example, the second).
- the budget balance of the second DB becomes 97, and the budget balance of the nine records of the remaining nine DBs is still 100.
- the inventors have found that the prior art has the following problems: For the data processing method of the first single DB: since the read and write needs to access the DB, the performance of the DB is high, especially the disk which uses the disk as the storage medium. Disk read and write performance is relatively low, so this approach can not meet the needs of high concurrent data processing requests.
- multi-DB distributed data processing method multi-DB distributed data processing method is solved by increasing the number of DBs. The problem of too low DB performance can meet high concurrency requirements, but the need to use a large number of DBs leads to excessive cost.
- the present application provides a data processing method based on distributed memory and a database, which is used to solve the problem that the data processing in a prior art is performed by using a single DB for data processing.
- the problem of high concurrent requests also solves the problem of excessive cost caused by using a large number of DBs, thereby reducing the cost and meeting the actual demand of high concurrent requests. Further, data consistency can be ensured even in the event of a server downtime.
- the present application also provides a data processing apparatus and system based on distributed memory and database to ensure the implementation and application of the above method in practice.
- the present application discloses a data processing method based on distributed memory and a database, the method comprising:
- the data processing request includes: a budget identifier of the current budget data and a budget quota;
- the present application provides a data compensation method based on distributed memory and a database, the method comprising: a data processing process and a data compensation process;
- the data processing process includes:
- the data processing request includes: current Budget identification and budget quota for budget data;
- the data compensation process includes:
- a record storing the difference is updated in the target database.
- the application also provides a data processing device based on a distributed memory and a database, the device comprising:
- a receiving request unit configured to receive a user-triggered data processing request, where the data processing request includes: a budget identifier of the current budget data and a budget quota;
- a first determining unit configured to determine, according to the budget identifier, whether a memory quota in a current memory segment storing the current budget data is greater than the budget quota
- a first deducting unit configured to deduct the memory quota directly in the current memory segment if the result of the first determining unit is YES;
- a second determining unit configured to determine, according to the budget identifier, whether a sum of a current database remaining amount and the memory amount stored in the current memory segment is greater than The budget amount
- a second deduction unit configured to: when the result of the second judging module is yes, The current database remaining amount and the memory quota are deducted from the budget amount;
- the storage deduction recording unit is configured to store the deduction record of the deduction of the budget quota into the current database, where the current database and the current memory segment correspond to budget data of the same budget identifier.
- the present application also provides a data processing system, the system comprising: a data processing device and a data compensation device, wherein the data processing device comprises:
- a receiving request unit configured to receive a user-triggered data processing request, where the data processing request includes: a budget identifier of the current budget data and a budget quota;
- a first determining unit configured to determine, according to the budget identifier, whether a memory quota in a current memory segment storing the current budget data is greater than the budget quota
- a first deducting unit configured to deduct the memory quota directly in the current memory segment if the result of the first determining unit is YES;
- a second determining unit configured to determine, according to the budget identifier, whether a sum of a current database remaining amount and the memory amount stored in the current memory segment is greater than The budget amount
- a second deducting unit configured to deduct the budget quota according to the current database remaining amount and the memory quota if the result of the second judging module is YES;
- a storage deduction record unit configured to store the deduction record deducting the budget amount into the current database, where the current database and the current memory segment correspond to budget data of the same budget identifier;
- the data compensation device includes:
- a determining unit configured to determine a target database to be processed according to the budget identifier to be synchronized
- Obtaining a record unit configured to obtain, from the target database, all the deduction records and transfer records corresponding to the budget identifier, where the transfer record indicates that the quota is transferred from the database to the record with the memory segment;
- a sixth determining unit configured to determine whether the transfer total value represented by the all transfer records is greater than a deduction total value represented by the deduction record
- a storage compensation amount unit configured to store, as a database compensation amount, a difference between the transfer total value and the deducted total value in a case where the result of the sixth determining unit is YES Stored in the target database;
- an update unit configured to update the record storing the difference in the target database.
- the present application includes the following advantages:
- the number of accesses to the DB can be greatly reduced, and because the performance of the memory is relatively high relative to the DB, on the one hand, the access to the memory can be utilized to improve the data processing performance, and on the other hand, the number of accesses of the DB can be reduced. This reduces the impact of the DB on data processing requests. Therefore, the distributed memory and the distributed DB adopted by the embodiments of the present application can improve data processing performance, meet high concurrent requests, and save the number of DBs, thereby saving costs.
- the beneficial effect of the application is that: in the case that the operation of deducting the budget quota is successful, the user may be notified that the budget amount deduction is successful, and otherwise the user budget credit deduction is failed. Therefore, the deduction result is fed back to the user in real time, so that the user can understand the deduction of the budget amount.
- the beneficial effects of the present application are also that it is convenient to directly inform the user that the quota is insufficient when the total amount of the memory balance and the DB quota is insufficient, so that the access to the DB can be reduced.
- the utility model also has the beneficial effects of: greatly improving the speed of recovering data in the memory segment after the server is down.
- FIG. 1 is a flow chart of an embodiment of a distributed memory and database based data processing method of the present application
- FIG. 2 is a schematic structural diagram of an application scenario of an embodiment of the present application.
- FIG. 3 is a flow chart of loading a balance from a DB into a memory slice in the embodiment of the present application
- FIG. 5 is a flow chart of an embodiment of a data compensation method based on distributed memory and database of the present application
- FIG. 6 is a structural block diagram of an embodiment of a distributed memory and database based data processing apparatus of the present application.
- FIG. 7 is a schematic diagram of a frame of each unit in the implementation DB of the application for loading a balance to a memory slice;
- FIG. 8 is a schematic diagram of a frame of each unit for performing split storage of a budget identifier according to an implementation of the present application.
- FIG. 9 is a schematic diagram of a framework of a distributed memory and database based data processing system of the present application.
- Distributed memory is a data storage space that stores data on separate memory slices. Each memory slice can be distributed on one server, and the distributed memory data storage mode formed by multiple memory slices on multiple servers can expand the storage space and improve the data storage performance.
- the budget data is represented by the budget identifier and the budget quota, where the budget identifier is used to uniquely represent a budget data, for example, The only number indicates the quantity of a product being sold, or is used to uniquely indicate an amount specifically for a certain deduction.
- the budget amount indicates the quantity or amount. For example, the budget with a budget identifier of A001 is 100w.
- the storage form of the budget data in the first memory fragment can be as shown in Table 1:
- Table 1 shows that the budget data with the budget identifier A001-A100 is saved in the first memory segment, wherein each budget data corresponds to the DB balance and the memory balance, and the sum of the two is the current budget data. Total amount.
- the version number can be used to indicate the update of the current budget data. According to the way that each memory segment saves 100 budget data, then 5 memory segments can save the budget data of A001-A500.
- the distributed DB there are 5 DBs corresponding to each other, and the first DB corresponding to the first memory fragment also corresponds to the budget data of A001-A100.
- the deduction details of the budget data are also stored in the DB.
- FIG. 1 a flowchart of an embodiment of a data processing method based on a distributed memory and a database is shown in the present application.
- the embodiment may include the following steps:
- Step 101 Receive a user-triggered data processing request, where the data processing request includes: a budget identifier of the current budget data and a budget quota.
- FIG. 2 is a schematic structural diagram of an application scenario according to an embodiment of the present application.
- the application is applied to the memory storage system 202.
- the data processing request includes a budget identifier and a budget quota of the current budget data
- the budget routing control system may locate a memory segment that saves the budget data of the budget identifier according to the budget identifier, thereby The budget amount requested by the user is deducted in the memory slice.
- Step 102 Determine, according to the budget identifier, a current memory that stores the current budget data. Whether the amount of memory in the slice is greater than the budget amount, if yes, proceed to step 103, and if no, proceed to step 104.
- the memory quota is stored in the memory segment, it is determined whether the memory amount in the current memory segment storing the current budget data is greater than the budget amount. For example, if the budget identifier is A002 and the budget quota is 9w, the corresponding budget data is stored in the first memory fragment, and it is determined whether the budget amount 9w requested by the user is less than or equal to the memory quota of 10w.
- Step 103 Deduct the memory quota from the current quota in the current memory segment, and proceed to step 106.
- the memory quota is greater than the budget quota
- the budget data stored in the memory segment is sufficient to respond to the current data processing request. In this case, the memory quota is directly deducted in the current memory segment. You can reduce the budget amount by 9w.
- Step 104 Determine, according to the budget identifier, whether the sum of the current DB quota and the memory quota stored in the current memory fragment is greater than the budget quota, and if yes, proceed to step 105.
- the sum of the current DB quota and the memory credit of the budget data stored in the current memory fragment needs to be used.
- the sum of the current DB quota and the memory credit is greater than the budget quota, the sum of the memory fragment and the DB amount is sufficient to respond to the current data processing request.
- Step 105 Deduct the budget quota according to the current DB remaining credit and the memory credit.
- the current DB amount and the memory quota are simultaneously referred to to deduct the budget amount.
- the memory quota is 10w
- the budget quota is 11w
- the DB balance has 20w
- the budget quota can be deducted according to the current DB quota and memory quota.
- step 105 may specifically include:
- Step A1 Obtain a difference between the budget amount and the memory quota.
- Step A2 Deduct the credit difference from the current DB quota, and store the deducted credit difference into the current memory fragment.
- the deducted 1w is stored in the current memory slice.
- 11w of the memory quota is stored in the memory slice.
- Step A3 Deduct the memory quota after storing the credit difference in the current memory segment.
- the 11w budget amount can be deducted from the current memory segment.
- Step 106 Store the deduction record of the deduction of the budget quota into the current DB, where the current DB and the current memory segment correspond to budget data of the same budget identifier.
- the record of the deduction budget amount is stored in the current DB, so that it is convenient to use the deduction record saved in the DB in the case of data loss in the memory. Restore balance data.
- the first is to determine whether the memory balance is sufficient from the memory fragment, and if the memory balance is sufficient, the DB does not need to be accessed directly. Deduct the memory balance from the memory slice, even if the memory balance in the memory slice is not enough, you only need to deduct the part of the DB that is not enough. Therefore, compared with the prior art, the number of accesses to the DB can be greatly reduced, and because the performance of the memory is relatively high relative to the DB, on the one hand, the access to the memory can be utilized to improve the data processing performance, and on the other hand, the DB is reduced. The number of visits thus reduces the impact of the DB on data processing requests. Therefore, the distributed memory and the distributed DB adopted by the embodiments of the present application can improve data processing performance, meet high concurrent requests, and save the number of DBs, thereby saving costs.
- the method may further include:
- Step 108 Determine whether the operation of deducting the budget quota is successful. If yes, notify the user that the budget credit deduction is successful, and if not, notify the user that the budget credit deduction fails.
- the user may be notified that the budget amount deduction is successful, and otherwise the user budget quota deduction is stopped. Therefore, the deduction result is fed back to the user in real time, so that the user can understand the deduction of the budget amount.
- the process of loading a balance from a DB to a memory slice in the embodiment of the present application may specifically include:
- Step 301 Obtain a partial quota of a preset proportion of the budget total amount corresponding to the budget identifier as the memory quota.
- a ratio may be set in advance, and a part of the total budget corresponding to the ratio may be loaded from the DB into the memory each time. For example, for the budget data with the budget identifier A002, the preset ratio is one tenth. If the total amount of the budget data is 100w, then the partial quota corresponding to the preset ratio is 10w.
- Step 302 Transfer the memory quota from the current DB to the current memory segment corresponding to the budget identifier, where the current memory segment corresponds to a plurality of memory quotas that have preset multiple budget identifiers.
- the current DB stores a plurality of DB quotas in addition to the memory quota in the budget totality of the plurality of budget identifiers.
- one memory segment may have multiple budget data identified by multiple budgets and multiple memory quotas of the plurality of budget data, and one DB may also store correspondences of budget totals of multiple budget identifiers except memory quotas. Multiple DB quotas.
- Step 303 Store the transfer record of transferring the memory quota to the current DB.
- the above 10w transfer record is stored in the current DB.
- the DB balance is also stored in the memory segment, so that it is convenient to directly inform the user that the quota is insufficient when the total amount of the memory balance and the DB quota is insufficient, thereby reducing access to the DB.
- the embodiment of the present application may further include:
- Step B Determine whether the current quota of the DB corresponding to the memory segment is zero. If not, store a partial quota of the preset proportion of the current quota of the DB to the memory segment.
- the DB layer balance is not zero, it is assumed to be 100w.
- the amount of the part to be loaded into the memory fragment needs to be determined according to the preset ratio.
- the part of the amount that needs to be preloaded into the memory slice is 10w.
- the total budget balance of the DB is 0, and the status of the budget data for the budget is incomplete (the budget data of each budget identifier can be set correspondingly, after the budget data is completely processed) If you can change its status to complete, it means that the budget data has been processed completely, and all the deduction records and transfer records in the DB will be scanned. However, since the probability of this happening is very low, it can increase the efficiency by at least 1000% compared to the full load mode. For example, in the case of loading 10% of the balance into memory each time, for a budgeted budget data, only 10% of the probability is that the DB balance is zero.
- the embodiment adopts the method of loading only a partial balance of the preset proportion into the memory segment at a time, which can greatly improve the speed of recovering data in the memory segment after the server is down.
- the embodiment of the present application stores the budget data in the memory fragment according to the budget identifier, which can solve the problem of insufficient memory of the single machine.
- the process of splitting and storing the budget identifier in the case that the single-machine memory fragmentation is insufficient may include:
- Step 401 Determine whether the machine where the memory fragment is located satisfies the response of the data processing request initiated by the plurality of budget identifiers saved by the memory fragment, and if no, proceed to step 402.
- the current memory fragment may not be enough to withstand this large amount. Data processing request. If the result of the judgment is yes, no processing is performed.
- Step 402 Divide the plurality of budget identifiers into multiple copies according to the preset splitting rules, and save one of the split budget identifiers to the current memory segment, and save the other budget identifiers correspondingly. To multiple other memory slices.
- A001-A100 into A001-A050 and A051-A100 respectively, store the budget data with budget as A001-A050 to the first memory segment, and add a memory slice to store A051-A100. Budget data.
- Step 403 Divide the plurality of budget identifiers in the current DB corresponding to the current memory fragment into multiple shares in the same manner, and retain one of the split multiple budget identifiers in the current DB, and other budget identifiers. Then save to multiple other DBs.
- the current DB also stores the DB quota in addition to the memory quota in the budget data of the A001-A100, it is also necessary to store the budget data of the A001-A050 to the first DB and add a DB according to the method of step 402. Used to store budget data for the A051-A100.
- the problem of insufficient memory of the single machine can be solved, and the memory layer and the DB layer can be continuously expanded by increasing the memory and the DB as the amount of access increases.
- FIG. 5 there is shown a flowchart of an embodiment of a data compensation method based on distributed memory and database, which may include: a data processing process and a data compensation process, wherein the data processing
- the process can be referred to FIG. 1, and the data compensation process can include the following steps:
- Step 501 Determine a target DB to be processed according to the budget identifier to be synchronized.
- the DB storing the budget data of A005 is the target DB to be processed.
- Step 502 Obtain all deduction records and transfer records corresponding to the budget identifier from the target DB, where the transfer record indicates that the quota is transferred from the DB to the record with the memory segment.
- All deduction records and transfer records corresponding to A005 are obtained from the target DB, wherein the deduction record indicates a deduction of the budget data, and the transfer record indicates that the quota is transferred from the DB to the details of the memory fragment.
- Step 503 Determine whether the transfer total value represented by the all transfer records is greater than the deduction total value indicated by the deduction record, and if yes, proceed to step 504.
- the transfer record it is possible to calculate how much the total amount of transfer from the target DB to the memory slice, and according to the deduction record, it is also possible to calculate how much the deduction is in the memory segment, and determine whether the transfer total value is greater than the deduction total. value.
- Step 504 Store the difference between the transfer total value and the deducted total value as a DB compensation amount into the target DB.
- the transfer total value is greater than the deducted total value, indicating that there is still remaining balance, the budget data corresponding to the budget identifier is still valid, and the state of the budget data is also incomplete, then the total value of the transfer and the total amount of the deduction are transferred.
- the difference of the degree values is stored as a DB compensation amount in the target DB.
- Step 505 Update the record storing the difference value in the target DB.
- the record storing the difference is stored in the target DB.
- the consistency can be achieved through the above-described process of balance compensation, thereby avoiding the situation in which the calculation of the balance of the budget data is incorrect.
- the memory balance in the memory segment is sufficient in the actual application, it will be deducted from the memory segment and stored in the DB storage debit record, and the DB layer is needed if the memory segment of the memory segment is insufficient.
- Loading the DB balance to the memory slice and also deducting the record in the DB store so even if the balance data saved in the memory slice is inconsistent with the DB, the memory is deducted, then the balance compensation can be performed through the asynchronous task described above, thereby Ultimately achieve consistency.
- the process shown in FIG. 5 can be performed by a background asynchronous thread without being triggered by other services or users, thereby exerting less pressure on the DB.
- the method may further include:
- Step 506 Read the DB compensation amount from the record of the stored difference value.
- Step 507 Send the DB compensation quota to the target memory fragment corresponding to the target DB, so that the target memory fragment updates the storage DB remaining credit according to the DB compensation quota.
- the DB compensation amount is notified to the corresponding memory segment by idempotent, and the target memory segment updates the DB remaining quota stored by itself according to the DB compensation amount.
- the compensation amount is notified to the memory by asynchronous + and idempotent, and can further reduce the access to the DB, and at the same time, the final consistency of the balance data in the memory and the DB can be achieved.
- the present application further provides an embodiment of a data processing device based on a distributed memory and a database.
- the device can include:
- the receiving request unit 601 is configured to receive a data processing request triggered by the user, where the data processing request includes: a budget identifier of the current budget data and a budget quota.
- the first determining unit 602 is configured to determine, according to the budget identifier, whether a memory quota in a current memory segment storing the current budget data is greater than the budget quota.
- the first deduction unit 603 is configured to deduct the memory quota directly from the current memory segment in the current memory segment if the result of the first determining unit is YES.
- the second determining unit 604 is configured to determine, according to the budget identifier, whether the sum of the current DB remaining amount and the memory quota stored in the current memory segment is determined according to the budget identifier. Greater than the budget amount.
- the second deduction unit 605 is configured to deduct the budget quota according to the current DB remaining credit and the memory quota if the result of the second judging module is YES.
- the second deduction unit 605 may include: an obtaining module, configured to acquire a quota difference between the budget quota and the memory quota; and a first deduction module, configured to deduct from the current DB remaining credit a storage module for storing the deducted credit difference into the current memory segment; and a second deduction module for storing the credit in the current memory segment The difference in memory credit deducts the budget amount.
- the store deduction record unit 606 is configured to store the deduction record of the deduction of the budget amount into the current DB, where the current DB and the current memory segment correspond to budget data of the same budget identifier.
- the embodiment of the present application can greatly reduce the number of accesses to the DB, and because the performance of the memory is relatively high relative to the DB, on the one hand, the access to the memory can be utilized to improve the data processing performance, and on the other hand, the number of accesses of the DB can be reduced. Reduce the impact of DB on data processing requests. Therefore, the distributed memory and the distributed DB adopted by the embodiments of the present application can improve data processing performance, meet high concurrent requests, and save the number of DBs, thereby saving costs.
- a schematic diagram of a framework for implementing a unit for loading a balance into a memory slice in a DB may include:
- the obtaining quota unit 701 is configured to obtain a partial quota of a preset proportion of the budget total amount corresponding to the budget identifier as the memory quota.
- the transferring unit 702 is configured to transfer the memory quota from the current DB to the current memory fragment corresponding to the budget identifier, where the current memory fragment corresponds to multiple presets that store a plurality of preset budget identifiers. a memory quota, where the current DB stores a plurality of DB quotas in addition to the memory quota in the budget totality of the plurality of budget identifiers.
- the storage transfer recording unit 703 is configured to store the transfer record that transfers the memory quota to the current DB.
- the DB balance is also stored in the memory segment, so that it is convenient to directly inform the user that the quota is insufficient when the total amount of the memory balance and the DB quota is insufficient, thereby reducing the DB access.
- a schematic diagram of a frame of each unit for performing split storage on a budget identifier may include:
- the third determining unit 801 is configured to determine whether the machine where the memory fragment is located satisfies a response to a data processing request initiated by the plurality of budget identifiers saved by the memory fragment.
- the memory splitting unit 802 is configured to divide the plurality of budget identifiers into multiple copies according to a preset splitting rule if the result of the third determining unit is negative.
- the memory saving unit 803 is configured to save one copy of the split budget identifiers to the current memory fragment, and save the other budget identifiers to the plurality of other memory fragments.
- the DB splitting unit 804 divides the plurality of budget identifiers in the current DB corresponding to the current memory slice into a plurality of shares in the same manner.
- the DB saving unit 805 is configured to reserve one of the split budget identifiers in the current DB, and save the other budget identifiers in multiple other DBs.
- the problem of insufficient memory of the single machine can be solved, and the memory layer and the DB layer can be continuously expanded by increasing the memory and the DB as the number of accesses increases.
- the system may include: a data processing device 90 and a data compensation device 91, wherein the data processing device 90 may specifically include: receiving a requesting unit, configured to receive a user-triggered data processing request, where the data processing request includes: a budget identifier of the current budget data and a budget quota; the first determining unit is configured to determine, according to the budget identifier, the current budget Whether the memory quota in the current memory segment of the data is greater than the budget quota; the first deduction unit is configured to directly in the current memory segment if the result of the first determining unit is YES The second amount determining unit is configured to determine, according to the budget identifier, a current DB stored in the current memory segment, if the result of the first determining unit is negative Whether the sum of the remaining credit and the memory credit is greater than the budget quota; the second deducting unit is used in the second judging module Fruit is And deduct
- the data compensation device 91 may specifically include:
- the determining unit 911 is configured to determine a target DB to be processed according to the budget identifier to be synchronized.
- the obtaining record unit 912 is configured to obtain, from the target DB, all the deduction records and the transfer records corresponding to the budget identifier, wherein the transfer records indicate that the quota is transferred from the DB to the record with the memory segment.
- the sixth determining unit 913 is configured to determine whether the transfer total value represented by the all transfer records is greater than the deduction total value indicated by the deduction record.
- a storage compensation amount unit 914 configured to store, when the result of the sixth determining unit is YES, a difference between the transfer totality value and the deducted total value as a DB compensation amount to the target DB.
- the updating unit 915 is configured to update the record storing the difference value in the target DB.
- the consistency of the above balance compensation process can be used to achieve consistency, thereby avoiding the calculation of the balance of the budget data. Since the actual application first deducts from the memory fragment, the memory layer is not enough to deduct the DB layer balance, so even if the balance data stored in the memory fragment is inconsistent with the DB, it is more memory. If the deduction is made, the balance compensation can be performed through the asynchronous task described above, thereby achieving consistency.
- the data compensation device may further include:
- the read credit unit 916 is configured to read the DB compensation amount from the record of the stored difference value.
- the sending unit 917 is configured to send the DB compensation quota to the target memory fragment corresponding to the target DB, so that the target memory fragment updates the storage DB remaining credit according to the DB compensation quota.
- This embodiment can further reduce the access to the DB, and at the same time, the final consistency of the balance data in the memory and the DB can be achieved.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本申请提供了一种基于分布式内存和数据库的数据处理方法、装置和系统,所述方法包括:接收用户触发的数据处理请求,依据预算标识判断存储当前预算数据的当前内存分片中的内存额度是否大于所述预算额度,如果是,则直接在当前内存分片中将所述内存额度扣减所述预算额度;如果否,则依据预算标识判断当前内存分片中存储的当前数据库DB剩余额度和内存额度之和是否大于所述预算额度,如果是,则依据当前DB剩余额度和内存额度扣减所述预算额度;将扣减所述预算额度的扣减记录存储至当前DB中。采用本申请的实施例,既能提升数据处理性能,满足高并发请求,并且也能节省DB的数量,从而节省成本。
Description
本申请涉及互联网领域,特别涉及一种基于分布式内存和数据库DB的数据处理方法、装置和系统。
在互联网越来越发达的现在,越来越多的用户借助于互联网处理数据,例如,企业报表或者word文档等。再例如,也有很多用户通过服务器来对一些数据进行存储、管理或者更新等。如果数据量大,可以将数据存储到多个服务器的数据库中。例如,在电子商务中,假设对于在售产品的数量,其总量为100,那么如果每次对总量扣减1的话,在扣减100次之后,总量为零,将不再允许对该在售产品的数量的扣减。其中,在售产品的总量叫做“预算”。
在现有技术中,服务器在采用数据库DB(Database)来存储预算数据并对其进行处理时,一般分为两种方式,第一种方式为:通过一个DB的一条记录来存放预算数据,每次对该预算数据进行扣减时可以通过DB的SQL语句在同一个事务中进行,这种方式称为单DB方式。第二种方式为:将预算数据拆分到不同服务器的不同的DB中,每次对预算数据需要扣减时可以将扣减请求负载均衡到不同的DB上。例如,数量为1000的预算数据由分布在10个DB的10条记录存放,每条记录100;而一次数量为3的扣减操作会被路由到10个DB的其中一个(例如第二个)上,扣减后,第二个DB的预算余额变为97,剩余的9个DB中的9条记录的预算余额仍为100。
但是发明人发现现有技术存在以下问题:对于第一种单个DB的数据处理方式来说:由于读写都需要访问DB,所以对DB性能要求较高,特别是以磁盘作为存储介质的DB,而磁盘的读写性能相对较低,因此这种方式不能满足高并发的数据处理请求的需求。对于第二种多DB的分布式数据处理方式来说:多DB的分布式数据处理方式通过增加DB的数量解决了
单DB性能过低的问题,可以满足高并发需求,但是需要使用大量的DB,就造成成本过高的现象。
发明内容
基于发明人发现的目前数据处理中存在的问题,本申请提供一种基于分布式内存和数据库的数据处理方法,用以解决现有技术中进行数据处理时采用单个DB进行数据处理导致的不能满足高并发请求的问题,同时也解决了采用大量的DB导致的成本过高的问题,从而在降低成本的同时,满足高并发请求的实际需求。进一步的,还能在服务器发生宕机的情况下,也能保证数据的一致性。
本申请还提供了基于分布式内存和数据库的数据处理装置及系统,用以保证上述方法在实际中的实现及应用。
为了解决上述问题,本申请公开了一种基于分布式内存和数据库的数据处理方法,该方法包括:
接收用户触发的数据处理请求,其中,所述数据处理请求包括:当前预算数据的预算标识和预算额度;
依据所述预算标识判断存储所述当前预算数据的当前内存分片中的内存额度是否大于所述预算额度,如果是,则直接在所述当前内存分片中将所述内存额度扣减所述预算额度;
如果否,则依据所述预算标识判断所述当前内存分片中存储的当前数据库剩余额度和所述内存额度之和是否大于所述预算额度,如果是,则依据所述当前数据库剩余额度和内存额度扣减所述预算额度;
将所述扣减所述预算额度的扣减记录存储至所述当前数据库中,所述当前数据库与所述当前内存分片对应保存相同预算标识的预算数据。
本申请提供一种基于分布式内存和数据库的数据补偿方法,该方法包括:数据处理过程和数据补偿过程;
其中,所述数据处理过程包括:
接收用户触发的数据处理请求,其中,所述数据处理请求包括:当前
预算数据的预算标识和预算额度;
依据所述预算标识判断存储所述当前预算数据的当前内存分片中的内存额度是否大于所述预算额度,如果是,则直接在所述当前内存分片中将所述内存额度扣减所述预算额度;
如果否,则依据所述预算标识判断存储所述当前内存分片中存储的当前数据库剩余额度和所述内存额度之和是否大于所述预算额度,如果是,则从所述当前数据库剩余额度和内存额度中扣减所述预算额度;
将所述扣减所述预算额度的记录存储至所述当前数据库中,所述当前数据库与所述当前内存分片对应保存相同预算标识的预算数据;
其中,所述数据补偿过程包括:
依据待同步的预算标识确定待处理的目标数据库;
从所述目标数据库中获取该预算标识对应的所有扣减记录和转移记录,其中,所述转移记录表示将额度从数据库转移至与内存分片的记录;
判断所述所有转移记录所表示的转移总额度值是否大于所述扣减记录所表示的扣减总额度值,如果是,则将所述转移总额度值与所述扣减总额度值的差值作为数据库补偿额度存储至所述目标数据库中;
将存储所述差值的记录更新在所述目标数据库中。
本申请还提供一种基于分布式内存和数据库的数据处理装置,所述装置包括:
接收请求单元,用于接收用户触发的数据处理请求,其中,所述数据处理请求包括:当前预算数据的预算标识和预算额度;
第一判断单元,用于依据所述预算标识判断存储所述当前预算数据的当前内存分片中的内存额度是否大于所述预算额度;
第一扣减单元,用于在所述第一判断单元的结果为是的情况下,直接在所述当前内存分片中将所述内存额度扣减所述预算额度;
第二判断单元,用于在所述第一判断单元的结果为否的情况下,依据所述预算标识判断所述当前内存分片中存储的当前数据库剩余额度和所述内存额度之和是否大于所述预算额度;
第二扣减单元,用于在所述第二判断模块的结果为是的情况下,依据
所述当前数据库剩余额度和内存额度扣减所述预算额度;
存储扣减记录单元,用于将所述扣减所述预算额度的扣减记录存储至所述当前数据库中,所述当前数据库与所述当前内存分片对应保存相同预算标识的预算数据。
本申请还提供了一种数据处理系统,该系统包括:数据处理装置和数据补偿装置,其中,所述数据处理装置包括:
接收请求单元,用于接收用户触发的数据处理请求,其中,所述数据处理请求包括:当前预算数据的预算标识和预算额度;
第一判断单元,用于依据所述预算标识判断存储所述当前预算数据的当前内存分片中的内存额度是否大于所述预算额度;
第一扣减单元,用于在所述第一判断单元的结果为是的情况下,直接在所述当前内存分片中将所述内存额度扣减所述预算额度;
第二判断单元,用于在所述第一判断单元的结果为否的情况下,依据所述预算标识判断所述当前内存分片中存储的当前数据库剩余额度和所述内存额度之和是否大于所述预算额度;
第二扣减单元,用于在所述第二判断模块的结果为是的情况下,依据所述当前数据库剩余额度和内存额度扣减所述预算额度;
存储扣减记录单元,用于将所述扣减所述预算额度的扣减记录存储至所述当前数据库中,所述当前数据库与所述当前内存分片对应保存相同预算标识的预算数据;
所述数据补偿装置包括:
确定单元,用于依据待同步的预算标识确定待处理的目标数据库;
获取记录单元,用于从所述目标数据库中获取该预算标识对应的所有扣减记录和转移记录,其中,所述转移记录表示将额度从数据库转移至与内存分片的记录;
第六判断单元,用于判断所述所有转移记录所表示的转移总额度值是否大于所述扣减记录所表示的扣减总额度值;
存储补偿额度单元,用于在所述第六判断单元的结果为是的情况下,将所述转移总额度值与所述扣减总额度值的差值作为数据库补偿额度存
储至所述目标数据库中;
更新单元,用于将存储所述差值的记录更新在所述目标数据库中。
与现有技术相比,本申请包括以下优点:
采用本申请实施例,可以大大减少对DB的访问次数,而因为内存相对于DB的性能较高,一方面可以利用对内存的访问提升数据处理性能,一方面也会因为减少了DB的访问次数从而降低DB对于数据处理请求的影响。因此,本申请实施例采用的分布式内存和分布式DB的方式,既能提升数据处理性能,满足高并发请求,并且也能节省DB的数量,从而节省成本。
本申请的有益效果还在于:在扣减预算额度的操作成功的情况下,可以通知用户预算额度扣减成功,反之则用户预算额度扣减失败。从而将扣减结果实时反馈给用户,方便用户了解预算额度的扣减情况。
本申请的有益效果还在于:方便在内存余额和DB额度的总额度不足时直接告知用户额度不足,从而可以减少对DB的访问。
本申请的有益效果还在于:大幅提升服务器宕机后在内存分片中恢复数据的速度。
当然,实施本申请的任一产品并不一定需要同时达到以上所述的所有优点。
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请的基于分布式内存和数据库的数据处理方法实施例的流程图;
图2是本申请实施例的一个应用场景的架构示意图;
图3是本申请实施例中从DB中加载余额到内存分片的流程图;
图4是本申请的单机内存分片不足的情况下对预算标识进行拆分存储的流程图;
图5是本申请的基于分布式内存和数据库的数据补偿方法实施例的流程图;
图6是本申请的基于分布式内存和数据库的数据处理装置实施例的结构框图;
图7是本申请的实现DB中加载余额到内存分片的各单元的框架示意图;
图8是本申请的实现对预算标识进行拆分存储的各单元的框架示意图;
图9是本申请的基于分布式内存和数据库的数据处理系统的框架示意图。
这里描述的附图仅仅是一些例子。在不脱离本申请精神的情况下,这里所述的图可以有不同的变化。所有上述变化被认为是要求保护的本申请的一部分。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
在介绍本申请实施例之前,为了方便本领域技术人员更好的理解本申请,首先对本申请中的预算数据在分布式内存和分布式DB中的存储方式进行介绍。
分布式内存是将数据分别存储在不同的内存分片上的数据存储空间。每个内存分片可以分布在一个服务器上,多个服务器上的多个内存分片形成的分布式内存的数据存储方式可以扩充存储空间,也能提升数据存储性能。假设在实际应用中有10个内存分片,而预算数据由预算标识和预算额度来表示,其中预算标识用于唯一表示一条预算数据,例如,
唯一表示一个在售产品的数量,或者用于唯一标示一个专门进行某种扣费的金额。预算额度则表示数量大小或者金额多少。例如,预算标识为A001的预算额度为100w。
在分布式内存中,假设有5个内存分片,第1个内存分片中预算数据的存放形式可以如表1所示:
表1
| 预算ID | DB余额 | 版本号 | 内存余额 |
| A001 | 90w | 1 | 10w |
| …… | …… | …… | …… |
| A100 | 10w | 2 | 1w |
表1表示在第1个内存分片中保存了预算标识为A001-A100的预算数据,其中,每一个预算数据都对应保存有DB余额和内存余额,两者的和则是该预算数据当前的总量。其中版本号可以用于表示当前预算数据的更新情况。按照每个内存分片都保存100个预算数据的方式,那么5个内存分片分别可以保存A001-A500的预算数据。
相应的,在分布式DB中,对应存在5个DB,与第一个内存分片对应的第一个DB也对应保存有A001-A100的预算数据。此外,在DB中还保存有预算数据的扣减明细。
参考图1,示出了本申请一种基于分布式内存和数据库的数据处理方法实施例的流程图,本实施例可以包括以下步骤:
步骤101:接收用户触发的数据处理请求,其中,所述数据处理请求包括:当前预算数据的预算标识和预算额度。
参考图2所示,为本申请实施例的一个应用场景的架构示意图。其中,本申请是应用于内存存储系统202中的。当有用户触发数据处理请求的时候,数据处理请求中包括了当前预算数据的预算标识和预算额度,预算路由控制系统可以根据预算标识来定位到保存该预算标识的预算数据的内存分片,从而在该内存分片中将用户请求的预算额度进行扣减。
步骤102:依据所述预算标识判断存储所述当前预算数据的当前内存
分片中的内存额度是否大于所述预算额度,如果是,则进入步骤103,如果否,则进入步骤104。
因为内存分片中保存有内存额度,所以判断保存当前预算数据的当前内存分片中的内存额度是否大于该预算额度。例如,如果预算标识为A002,预算额度为9w,那么对应的预算数据就保存在第一个内存分片中,判断用户请求的预算额度9w是否小于或等于内存额度10w。
步骤103:直接在所述当前内存分片中将所述内存额度扣减所述预算额度,进入步骤106。
如果判断结果为肯定的,即内存额度大于预算额度,说明内存分片中存储的预算数据就足以响应当前的数据处理请求,在这种情况下,直接在当前内存分片中将内存额度10w扣减掉预算额度9w即可。
步骤104:依据所述预算标识判断所述当前内存分片中存储的当前DB额度和所述内存额度之和是否大于所述预算额度,如果是,则进入步骤105。
而如果判断结果为否定的,即内存额度小于预算额度,说明内存额度不足以响应当前的数据处理请求,因此,需要将当前内存分片中存储的该预算数据的当前DB额度和内存额度之和与预算额度进行比较,如果当前DB额度和内存额度之和大于预算额度,则说明内存分片和DB的额度之和足以响应当前的数据处理请求。
步骤105:依据所述当前DB剩余额度和内存额度扣减所述预算额度。
在内存分片和DB的额度之和足够扣减预算额度的情况下,同时参考当前DB额度和内存额度来扣减预算额度。例如,内存额度为10w,而预算额度为11w,但是DB余额有20w,就可以依据当前DB额度和内存额度来扣减预算额度。
在具体实现时,步骤105具体可以包括:
步骤A1:获取所述预算额度和内存额度的额度差。
接着前面的例子克制,预算额度11w和内存额度10w的额度差为1w。
步骤A2:从所述当前DB额度中扣减所述额度差,并将所述扣减的额度差存储至所述当前内存分片中。
在从DB的额度中扣减1w之后,将该扣减的1w存储至当前内存分片中,在这种情况下,内存分片中就存储有11w的内存额度。
步骤A3:在所述当前内存分片中将存储所述额度差后的内存额度扣减所述预算额度。
在从当前内存分片中将11w的预算额度进行扣减即可。
步骤106:将所述扣减所述预算额度的扣减记录存储至所述当前DB中,所述当前DB与所述当前内存分片对应保存相同预算标识的预算数据。
在当前内存分片中对预算额度进行扣减之后,要将本次扣减预算额度的记录存储在当前DB中,这样就方便在内存丢失数据的情况下可以根据DB中保存的扣减记录来恢复余额数据。
在本申请实施例中,需要响应用户的数据处理请求从而对预算数据进行余额扣减时,首先是从内存分片中判断内存余额是否足够,在内存余额足够的情况下,无需访问DB,直接从内存分片中扣减内存余额即可,即便内存分片中的内存余额不够,也只需从DB中扣减内存余额不够的那一部分。因此,与现有技术相比,可以大大减少对DB的访问次数,而因为内存相对于DB的性能较高,一方面可以利用对内存的访问提升数据处理性能,一方面也会因为减少了DB的访问次数从而降低DB对于数据处理请求的影响。因此,本申请实施例采用的分布式内存和分布式DB的方式,既能提升数据处理性能,满足高并发请求,并且也能节省DB的数量,从而节省成本。
可以理解的是,在步骤107之后,还可以包括:
步骤108:判断所述扣减预算额度的操作是否成功,如果是,则通知用户所述预算额度扣减成功,如果否,则通知用户所述预算额度扣减失败。
在扣减预算额度的操作成功的情况下,可以通知用户预算额度扣减成功,反之则停止用户预算额度扣减失败。从而将扣减结果实时反馈给用户,方便用户了解预算额度的扣减情况。
此外,在本申请实施例中,每一个内存分片中只保存预算数据中的一小部分余额,预算数据的剩余大部分余额还是保存在对应的DB中,在需要的时候分别从DB中获取即可。参考图3所示,为本申请实施例中从DB中加载余额到内存分片的流程,具体可以包括:
步骤301:获取所述预算标识对应的预算总额度的预设比例的部分额度作为所述内存额度。
在本实施例中,可以预先设置一个比例,每次将该比例对应的预算总额的一部分从DB加载到内存即可。例如,对于预算标识为A002的预算数据来说,预设比例为十分之一,那么假设该预算数据的总额度为100w,那么该预设比例对应的部分额度即为10w。
步骤302:将所述内存额度从当前DB转移至与所述预算标识对应的当前内存分片,其中,所述当前内存分片对应保存有预先设定的多个预算标识的多个内存额度,所述当前DB保存有所述多个预算标识的预算总额度中除了所述内存额度之外的多个DB额度。
再将确定的10w的内存额度从当前DB转移至保存A002的预算数据的那个内存分片中,而当前DB中则又90w的DB余额。其中,一个内存分片可以多个预算标识的多个预算数据以及该多个预算数据的多个内存额度,而一个DB也可以保存多个预算标识的预算总额度中除了内存额度之外的对应的多个DB额度。
步骤303:将转移所述内存额度的转移记录存储至所述当前DB。
在将上述10w的转移记录存储至当前DB中。
因为在本实施例中,内存分片中还会存放DB余额,这样就方便在内存余额和DB额度的总额度不足时直接告知用户额度不足,从而可以减少对DB的访问。
还可以理解的是,因为内存分片在服务器宕机并重新启动的情况下,其中,保存的预算数据的相关信息会全部丢失,所以在这种情况下,如果全量加载余额到内存分片,就需要针对该内存分片对应的DB进行全表扫描,读取该DB中所有的扣减明细来计算出内存余额的值。
因此,本申请实施例还可以包括:
步骤B:判断所述内存分片对应的DB当前额度是否为零,如果否,则将所述DB当前额度的预设比例的部分额度存储至所述内存分片。
在服务器宕机恢复时,在DB层余额不为零的情况下,假设为100w,这时需要按照预设比例的大小,确定将要加载到内存分片中的部分额度,假设预设比例仍为十分之一,则需要预加载到内存分片中的部分额度就为10w。在这种情况下,将DB中的当前额度中扣减10w到内存分片中即可。此外,还需要在DB中将该转移记录进行保存。
可以理解的是,如果DB的总预算余额为0,并且针对该预算标识的预算数据的状态为非完成态(每一条预算标识的预算数据可以对应设置其状态,在该预算数据全部处理完之后可以将其状态修改为完成,则表示该预算数据已经全部处理完毕),才会扫描DB中所有的扣减记录和转移记录。但由于这种情况发生的概率很低,所以可以比全量加载方式提升最少1000%的效率。例如,按照每次加载10%的余额到内存为例,针对一个预算标识的预算数据,只有10%的概率是DB余额为零的情况。
可见本实施例采用每次只将预设比例的部分余额加载到内存分片中的方式,可以大幅提升服务器宕机后在内存分片中恢复数据的速度。
此外,本申请实施例按照预算标识来将预算数据存放在内存分片中,可以解决单机内存不足的问题。具体的,参考图4所示,为单机内存分片不足的情况下对预算标识进行拆分存储的流程,可以包括:
步骤401:判断所述内存分片所在的机器是否满足针对其保存的多个预算标识而发起的数据处理请求的响应,如果否,则进入步骤402。
首先,假设第一个内存分片存在预算标识为A001-A100的预算数据,而针对这100个预算标识的预算数据产生了大量的数据处理请求,那么当前内存分片可能不足以顶住这大量的数据处理请求。如果判断结果为是的话,则不作任何处理。
步骤402:将多个预算标识按预设拆分规则分成多份,并将拆分后的多份预算标识中一份保存至当前内存分片,其他份预算标识则对应保存
至多个其他内存分片中。
则将A001-A100分别拆分为A001-A050,以及A051-A100,将预算标识为A001-A050的预算数据存储至第一个内存分片,再增加一个内存分片用来存储A051-A100的预算数据。
步骤403:将与当前内存分片对应的当前DB中的多个预算标识按照同样的方式分成多份,并将拆分后的多份预算标识中的一份保留在当前DB,其他份预算标识则对应保存至多个其他DB中。
并且,由于当前DB也存储A001-A100的预算数据中除了内存额度之外的DB额度,因此,也需要按照步骤402的方式,将A001-A050的预算数据存储至第一个DB,增加一个DB用来存储A051-A100的预算数据。
可见,在本申请实施例中,由于采用的分布式内存的方式,可以解决单机内存不足问题,并且随着访问量的增大可以通过增加内存和DB的方式,不断扩容内存层和DB层。
在本申请实施例中,有可能会出现内存分片中保存的DB余额与DB中实际的余额不匹配的情况,因此DB中实际的余额可以通过异步的方式来同步到内存分配中,因此,可能出现内存分片中的DB余额与实际DB余额暂时不一致的情况,但最终通过同步会一致。
因此,参考图5,示出了本申请一种基于分布式内存和数据库的数据补偿方法实施例的流程图,该数据补偿方法可以包括:数据处理过程和数据补偿过程,其中,所述数据处理流程可以参考图1所示,而数据补偿过程则可以包括以下步骤:
步骤501:依据待同步的预算标识确定待处理的目标DB。
首先,假设当前触发了对A005的预算标识对应的预算数据的数据补偿任务,那么存储A005的预算数据的DB即是待处理的目标DB。
步骤502:从所述目标DB中获取该预算标识对应的所有扣减记录和转移记录,其中,所述转移记录表示将额度从DB转移至与内存分片的记录。
从目标DB中获取到A005下对应的所有的扣减记录和转移记录,其中扣减记录表示对预算数据进行扣减的明细,而转移记录表示将额度从DB转移至与内存分片的明细。
步骤503:判断所述所有转移记录所表示的转移总额度值是否大于所述扣减记录所表示的扣减总额度值,如果是,则进入步骤504。
依据转移记录可以计算出从目标DB向内存分片一共转移了多少额度,依据扣减记录也可以计算出一共在内存分片中扣减了多少额度,判断转移总额度值是否大于扣减总额度值。
步骤504:将所述转移总额度值与所述扣减总额度值的差值作为DB补偿额度存储至所述目标DB中。
如果转移总额度值大于扣减总额度值,说明当前还有余额剩余,该预算标识对应的预算数据还有效,预算数据的状态也是非完成态,则将转移总额度值与所述扣减总额度值的差值作为DB补偿额度存储至目标DB中。
步骤505:将存储所述差值的记录更新在所述目标DB中。
再将存储该差值的记录存储在目标DB中。
在本实施例中,如果出现余额不一致的情况,可以通过上述余额补偿的流程来实现一致性,从而避免了预算数据的余额计算错误的情况。由于实际应用中内存分片中的内存余额如果足够,将会先从内存分片中进行扣减同时在DB存储扣费记录,而在内存分片的内存余额不够的情况下才需要从DB层的加载DB余额到内存分片同时也在DB存储扣减记录,所以就算内存分片中保存的余额数据与DB不一致也是内存多扣减了,那么可以通过上述的异步任务来进行余额补偿,从而最终实现一致性。在实际应用中,图5所示的流程可以由后台异步线程来做,而无需靠其他业务或者用户触发,从而对DB压力较小。
可选的,在实际应用中,进行了余额补偿之后,如果当前触发了异步任务,那么还可以包括:
步骤506:从所述存储差值的记录读取DB补偿额度。
再从DB中存储差值的记录中读取到DB的补偿额度是多少。
步骤507:将DB补偿额度发送至与所述目标DB对应的目标内存分片,以便所述目标内存分片依据所述DB补偿额度更新存储DB剩余额度。
再将DB补偿额度通过幂等通知给对应的内存分片,目标内存分片再依据DB补偿额度更新自身存储的DB剩余额度。
此外,每次向内存分片发送的余额变更幂等通知消息都有一个唯一自增版本号,如果同一个余额变更幂等通知消息收到两次或者旧的消息比新的消息先到,则内存分片都会以最新的版本号对应的消息为准。
可见,补偿额度是通过异步+和幂等通知到内存分配的,也能进一步降低对DB的访问,同时可以使内存和DB中的余额数据达到最终一致性。
对于前述的方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。
与上述本申请一种基于分布式内存和数据库的数据处理方法实施例所提供的方法相对应,参见图6,本申请还提供了一种基于分布式内存和数据库的数据处理装置实施例,该装置可以包括:
接收请求单元601,用于接收用户触发的数据处理请求,其中,所述数据处理请求包括:当前预算数据的预算标识和预算额度。
第一判断单元602,用于依据所述预算标识判断存储所述当前预算数据的当前内存分片中的内存额度是否大于所述预算额度。
第一扣减单元603,用于在所述第一判断单元的结果为是的情况下,直接在所述当前内存分片中将所述内存额度扣减所述预算额度。
第二判断单元604,用于在所述第一判断单元的结果为否的情况下,依据所述预算标识判断所述当前内存分片中存储的当前DB剩余额度和所述内存额度之和是否大于所述预算额度。
第二扣减单元605,用于在所述第二判断模块的结果为是的情况下,依据所述当前DB剩余额度和内存额度扣减所述预算额度。
其中,所述第二扣减单元605具体可以包括:获取模块,用于获取所述预算额度和内存额度的额度差;第一扣减模块,用于从所述当前DB剩余额度中扣减所述额度差;存储模块,用于将所述扣减的额度差存储至所述当前内存分片中;和,第二扣减模块,用于在所述当前内存分片中将存储所述额度差后的内存额度扣减所述预算额度。
存储扣减记录单元606,用于将所述扣减所述预算额度的扣减记录存储至所述当前DB中,所述当前DB与所述当前内存分片对应保存相同预算标识的预算数据。
采用本申请实施例可以大大减少对DB的访问次数,而因为内存相对于DB的性能较高,一方面可以利用对内存的访问提升数据处理性能,一方面也会因为减少了DB的访问次数从而降低DB对于数据处理请求的影响。因此,本申请实施例采用的分布式内存和分布式DB的方式,既能提升数据处理性能,满足高并发请求,并且也能节省DB的数量,从而节省成本。
参考图7所示,为实现DB中加载余额到内存分片的各单元的框架示意图,具体可以包括:
获取额度单元701,用于获取所述预算标识对应的预算总额度的预设比例的部分额度作为所述内存额度。
转移单元702,用于将所述内存额度从当前DB转移至与所述预算标识对应的当前内存分片,其中,所述当前内存分片对应保存有预先设定的多个预算标识的多个内存额度,所述当前DB保存有所述多个预算标识的预算总额度中除了所述内存额度之外的多个DB额度。
存储转移记录单元703,用于将转移所述内存额度的转移记录存储至所述当前DB。
在本实施例中,内存分片中还会存放DB余额,这样就方便在内存余额和DB额度的总额度不足时直接告知用户额度不足,从而可以减少对
DB的访问。
参考图8所示,为实现对预算标识进行拆分存储的各单元的框架示意图,具体可以包括:
第三判断单元801,用于判断所述内存分片所在的机器是否满足针对其保存的多个预算标识而发起的数据处理请求的响应。
内存拆分单元802,用于在所述第三判断单元的结果为否的情况下,将多个预算标识按预设拆分规则分成多份。
内存保存单元803,用于并将拆分后的多份预算标识中一份保存至当前内存分片,其他份预算标识则对应保存至多个其他内存分片中。
DB拆分单元804,将与当前内存分片对应的当前DB中的多个预算标识按照同样的方式分成多份。
DB保存单元805,用于将拆分后的多份预算标识中的一份保留在当前DB,其他份预算标识则对应保存至多个其他DB中。
在本实施例中,由于采用的分布式内存的方式,可以解决单机内存不足问题,并且随着访问量的增大可以通过增加内存和DB的方式,不断扩容内存层和DB层。
本申请还提供了一种基于分布式内存和数据库的数据处理系统,参考图9,该系统可以包括:数据处理装置90和数据补偿装置91,其中,所述数据处理装置90具体可以包括:接收请求单元,用于接收用户触发的数据处理请求,其中,所述数据处理请求包括:当前预算数据的预算标识和预算额度;第一判断单元,用于依据所述预算标识判断存储所述当前预算数据的当前内存分片中的内存额度是否大于所述预算额度;第一扣减单元,用于在所述第一判断单元的结果为是的情况下,直接在所述当前内存分片中将所述内存额度扣减所述预算额度;第二判断单元,用于在所述第一判断单元的结果为否的情况下,依据所述预算标识判断所述当前内存分片中存储的当前DB剩余额度和所述内存额度之和是否大于所述预算额度;第二扣减单元,用于在所述第二判断模块的结果为是
的情况下,依据所述当前DB剩余额度和内存额度扣减所述预算额度;存储扣减记录单元,用于将所述扣减所述预算额度的扣减记录存储至所述当前DB中,所述当前DB与所述当前内存分片对应保存相同预算标识的预算数据。
其中,所述数据补偿装置91具体可以包括:
确定单元911,用于依据待同步的预算标识确定待处理的目标DB。
获取记录单元912,用于从所述目标DB中获取该预算标识对应的所有扣减记录和转移记录,其中,所述转移记录表示将额度从DB转移至与内存分片的记录。
第六判断单元913,用于判断所述所有转移记录所表示的转移总额度值是否大于所述扣减记录所表示的扣减总额度值。
存储补偿额度单元914,用于在所述第六判断单元的结果为是的情况下,将所述转移总额度值与所述扣减总额度值的差值作为DB补偿额度存储至所述目标DB中。
更新单元915,用于将存储所述差值的记录更新在所述目标DB中。
如果出现余额不一致的情况,可以通过上述余额补偿的流程来实现一致性,从而避免了预算数据的余额计算错误的情况。由于实际应用中每次都是先从内存分片中进行扣减,内存分片不够的情况下才会扣减DB层的余额,所以就算内存分片中保存的余额数据与DB不一致也是内存多扣减了,那么可以通过上述的异步任务来进行余额补偿,从而最终实现一致性。
其中,所述数据补偿装置还可以包括:
读取额度单元916,用于从所述存储差值的记录读取DB补偿额度。
发送单元917,用于将DB补偿额度发送至与所述目标DB对应的目标内存分片,以便所述目标内存分片依据所述DB补偿额度更新存储DB剩余额度。
本实施例可以进一步降低对DB的访问,同时可以使内存和DB中的余额数据达到最终一致性。
需要说明的是,本说明书中的各个实施例均采用递进的方式描述,
每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。对于系统类实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
尽管本申请中描述的各个部件均为计算机程序,本申请中的任何部分均可以在软件、固件、硬件或者其结合中实现。
尽管这里详细描述了优选的实施例,但是对于本领域熟练的技术人员来说,很显然在不脱离本申请精神的情况下可以作出不同的改变、增加、替换或者类似操作,并且这些均被认为是在权力要求中所定义的本申请的保护范围之内。
以上对本申请所提供的一种基于分布式内存和数据库的数据处理方法、装置及系统进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。
Claims (16)
- 一种基于分布式内存和数据库的数据处理方法,其特征在于,该方法包括:接收用户触发的数据处理请求,其中,所述数据处理请求包括:当前预算数据的预算标识和预算额度;依据所述预算标识判断存储所述当前预算数据的当前内存分片中的内存额度是否大于所述预算额度,如果是,则直接在所述当前内存分片中将所述内存额度扣减所述预算额度;如果否,则依据所述预算标识判断所述当前内存分片中存储的当前数据库剩余额度和所述内存额度之和是否大于所述预算额度,如果是,则依据所述当前数据库剩余额度和内存额度扣减所述预算额度;将所述扣减所述预算额度的扣减记录存储至所述当前数据库中,所述当前数据库与所述当前内存分片对应保存相同预算标识的预算数据。
- 根据权利要求1所述的方法,其特征在于,所述依据所述当前数据库剩余额度和内存额度扣减所述预算额度,具体包括:获取所述预算额度和内存额度的额度差;从所述当前数据库剩余额度中扣减所述额度差,并将所述扣减的额度差存储至所述当前内存分片中;在所述当前内存分片中将存储所述额度差后的内存额度扣减所述预算额度。
- 根据权利要求1所述的方法,其特征在于,还包括:获取所述预算标识对应的预算总额度的预设比例的部分额度作为所述内存额度;将所述内存额度从当前数据库转移至与所述预算标识对应的当前内存分片,其中,所述当前内存分片对应保存有预先设定的多个预算标识的多个内存额度,所述当前数据库保存有所述多个预算标识的预算总额度中除了所述内存额度之外的多个数据库额度;将转移所述内存额度的转移记录存储至所述当前数据库。
- 根据权利要求1所述的方法,其特征在于,还包括:判断所述内存分片所在的机器是否满足针对其保存的多个预算标识而发起的数据处理请求的响应,如果否,则将多个预算标识按预设拆分规则分成多份,并将拆分后的多份预算标识中一份保存至当前内存分片,其他份预算标识则对应保存至多个其他内存分片中;将与当前内存分片对应的当前数据库中的多个预算标识按照同样的方式分成多份,并将拆分后的多份预算标识中的一份保留在当前DB,其他份预算标识则对应保存至多个其他数据库中。
- 根据权利要求1所述的方法,其特征在于,在所述内存分片宕机并重新启动的情况下,还包括:判断所述内存分片对应的数据库当前额度是否为零,如果否,则将所述数据库当前额度的预设比例的部分额度存储至所述内存分片。
- 根据权利要求1所述的方法,其特征在于,还包括:判断所述扣减预算额度的操作是否成功,如果是,则通知用户所述预算额度扣减成功;如果否,则通知用户所述预算额度扣减失败。
- 一种基于分布式内存和数据库的数据补偿方法,其特征在于,该方法包括:数据处理过程和数据补偿过程;其中,所述数据处理过程包括:接收用户触发的数据处理请求,其中,所述数据处理请求包括:当前预算数据的预算标识和预算额度;依据所述预算标识判断存储所述当前预算数据的当前内存分片中的内存额度是否大于所述预算额度,如果是,则直接在所述当前内存分片中将所述内存额度扣减所述预算额度;如果否,则依据所述预算标识判断存储所述当前内存分片中存储的当前数据库剩余额度和所述内存额度之和是否大于所述预算额度,如果是,则从所述当前数据库剩余额度和内存额度中扣减所述预算额度;将所述扣减所述预算额度的记录存储至所述当前数据库中,所述当前数据库与所述当前内存分片对应保存相同预算标识的预算数据;其中,所述数据补偿过程包括:依据待同步的预算标识确定待处理的目标数据库;从所述目标数据库中获取该预算标识对应的所有扣减记录和转移记录,其中,所述转移记录表示将额度从数据库转移至与内存分片的记录;判断所述所有转移记录所表示的转移总额度值是否大于所述扣减记录所表示的扣减总额度值,如果是,则将所述转移总额度值与所述扣减总额度值的差值作为数据库补偿额度存储至所述目标数据库中;将存储所述差值的记录更新在所述目标数据库中。
- 根据权利要求7所述的方法,其特征在于,还包括:从所述存储差值的记录读取数据库补偿额度;将数据库补偿额度发送至与所述目标数据库对应的目标内存分片,以便所述目标内存分片依据所述数据库补偿额度更新存储数据库剩余额度。
- 一种基于分布式内存和数据库的数据处理装置,其特征在于,所述装置包括:接收请求单元,用于接收用户触发的数据处理请求,其中,所述数据处理请求包括:当前预算数据的预算标识和预算额度;第一判断单元,用于依据所述预算标识判断存储所述当前预算数据的当前内存分片中的内存额度是否大于所述预算额度;第一扣减单元,用于在所述第一判断单元的结果为是的情况下,直接在所述当前内存分片中将所述内存额度扣减所述预算额度;第二判断单元,用于在所述第一判断单元的结果为否的情况下,依据所述预算标识判断所述当前内存分片中存储的当前数据库剩余额度和所述内存额度之和是否大于所述预算额度;第二扣减单元,用于在所述第二判断模块的结果为是的情况下,依据所述当前数据库剩余额度和内存额度扣减所述预算额度;存储扣减记录单元,用于将所述扣减所述预算额度的扣减记录存储至所述当前数据库中,所述当前数据库与所述当前内存分片对应保存相同预算标识的预算数据。
- 根据权利要求9所述的装置,其特征在于,所述第二扣减单元具体包括:获取模块,用于获取所述预算额度和内存额度的额度差;第一扣减模块,用于从所述当前数据库剩余额度中扣减所述额度差;存储模块,用于将所述扣减的额度差存储至所述当前内存分片中;第二扣减模块,用于在所述当前内存分片中将存储所述额度差后的内存额度扣减所述预算额度。
- 根据权利要求9所述的装置,其特征在于,还包括:获取额度单元,用于获取所述预算标识对应的预算总额度的预设比例的部分额度作为所述内存额度;转移单元,用于将所述内存额度从当前数据库转移至与所述预算标识对应的当前内存分片,其中,所述当前内存分片对应保存有预先设定的多个预算标识的多个内存额度,所述当前数据库保存有所述多个预算标识的预算总额度中除了所述内存额度之外的多个数据库额度;存储转移记录单元,用于将转移所述内存额度的转移记录存储至所述当前数据库。
- 根据权利要求9所述的装置,其特征在于,还包括:第三判断单元,用于判断所述内存分片所在的机器是否满足针对其保存的多个预算标识而发起的数据处理请求的响应;内存拆分单元,用于在所述第三判断单元的结果为否的情况下,将多个预算标识按预设拆分规则分成多份;内存保存单元,用于并将拆分后的多份预算标识中一份保存至当前内存分片,其他份预算标识则对应保存至多个其他内存分片中;数据库拆分单元,将与当前内存分片对应的当前数据库中的多个预算标识按照同样的方式分成多份;数据库保存单元,用于将拆分后的多份预算标识中的一份保留在当前数据库,其他份预算标识则对应保存至多个其他数据库中。
- 根据权利要求9所述的装置,其特征在于,在所述内存分片宕机并重新启动的情况下,还包括:第四判断单元,用于判断所述内存分片对应的数据库当前额度是否为零;加载单元,用于在所述第四判断单元的结果为否的情况下,将所述数据库当前额度的预设比例的部分额度存储至所述内存分片。
- 根据权利要求9所述的装置,其特征在于,还包括:第五判断单元,用于判断所述扣减预算额度的操作是否成功;第一通知单元,用于在所述第五判断单元的结果为是的情况下,通知用户所述预算额度扣减成功;第二通知单元,用于在所述第五判断单元的结果为否的情况下,通知用户所述预算额度扣减失败。
- 一种数据处理系统,其特征在于,该系统包括:数据处理装置和数据补偿装置,其中,所述数据处理装置包括:接收请求单元,用于接收用户触发的数据处理请求,其中,所述数据处理请求包括:当前预算数据的预算标识和预算额度;第一判断单元,用于依据所述预算标识判断存储所述当前预算数据的当前内存分片中的内存额度是否大于所述预算额度;第一扣减单元,用于在所述第一判断单元的结果为是的情况下,直接在所述当前内存分片中将所述内存额度扣减所述预算额度;第二判断单元,用于在所述第一判断单元的结果为否的情况下,依据所述预算标识判断所述当前内存分片中存储的当前数据库剩余额度和所述内存额度之和是否大于所述预算额度;第二扣减单元,用于在所述第二判断模块的结果为是的情况下,依据所述当前数据库剩余额度和内存额度扣减所述预算额度;存储扣减记录单元,用于将所述扣减所述预算额度的扣减记录存储至所述当前数据库中,所述当前数据库与所述当前内存分片对应保存相同预算标识的预算数据;所述数据补偿装置包括:确定单元,用于依据待同步的预算标识确定待处理的目标数据库;获取记录单元,用于从所述目标数据库中获取该预算标识对应的所有扣减记录和转移记录,其中,所述转移记录表示将额度从数据库转移至与内存分片的记录;第六判断单元,用于判断所述所有转移记录所表示的转移总额度值是否大于所述扣减记录所表示的扣减总额度值;存储补偿额度单元,用于在所述第六判断单元的结果为是的情况下,将所述转移总额度值与所述扣减总额度值的差值作为数据库补偿额度存储至所述目标数据库中;更新单元,用于将存储所述差值的记录更新在所述目标数据库中。
- 根据权利要求15所述的系统,其特征在于,所述数据补偿装置还包括:读取额度单元,用于从所述存储差值的记录读取数据库补偿额度;发送单元,用于将数据库补偿额度发送至与所述目标数据库对应的目标内存分片,以便所述目标内存分片依据所述数据库补偿额度更新存储数据库剩余额度。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201410384269.4A CN105335297B (zh) | 2014-08-06 | 2014-08-06 | 基于分布式内存和数据库的数据处理方法、装置和系统 |
| CN201410384269.4 | 2014-08-06 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2016019803A1 true WO2016019803A1 (zh) | 2016-02-11 |
Family
ID=55263129
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2015/084883 Ceased WO2016019803A1 (zh) | 2014-08-06 | 2015-07-23 | 基于分布式内存和数据库的数据处理方法、装置和系统 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN105335297B (zh) |
| WO (1) | WO2016019803A1 (zh) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109614388A (zh) * | 2018-11-14 | 2019-04-12 | 阿里巴巴集团控股有限公司 | 一种预算扣减方法和装置 |
| CN109697209A (zh) * | 2018-12-25 | 2019-04-30 | 广东亿迅科技有限公司 | 一种面向分布式数据库的报表处理方法及装置 |
| CN114598649A (zh) * | 2022-03-17 | 2022-06-07 | 苏州浪潮智能科技有限公司 | 内核带宽管理方法、装置、存储设备及存储介质 |
Families Citing this family (12)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106302702B (zh) * | 2016-08-10 | 2020-03-20 | 华为技术有限公司 | 数据的分片存储方法、装置及系统 |
| CN107463593A (zh) * | 2016-12-13 | 2017-12-12 | 阿里巴巴集团控股有限公司 | 库存扣减方法及其设备 |
| CN106850849A (zh) * | 2017-03-15 | 2017-06-13 | 联想(北京)有限公司 | 一种数据处理方法、装置和服务器 |
| CN108874809A (zh) * | 2017-05-10 | 2018-11-23 | 北京京东尚科信息技术有限公司 | 数据处理方法及装置、电子设备、存储介质 |
| CN109118361B (zh) * | 2018-07-20 | 2022-01-28 | 创新先进技术有限公司 | 额度管理方法、装置及系统 |
| CN110310060B (zh) * | 2019-05-27 | 2023-10-24 | 创新先进技术有限公司 | 基于分片的库存管理方法以及装置 |
| CN110648232A (zh) * | 2019-08-20 | 2020-01-03 | 上海数据交易中心有限公司 | 处理节点的额度控制方法及装置、存储介质、终端 |
| CN111143386A (zh) * | 2019-12-25 | 2020-05-12 | 中国建设银行股份有限公司 | 债券额度数据的处理方法及装置 |
| CN111221912A (zh) * | 2020-01-06 | 2020-06-02 | 中科驭数(北京)科技有限公司 | 数据库和硬件之间的数据同步方法及装置 |
| CN111899088B (zh) * | 2020-06-23 | 2023-04-18 | 四川新网银行股份有限公司 | 高并发数据流场景下的精准资产额度计算方法 |
| CN112069253A (zh) * | 2020-08-20 | 2020-12-11 | 上海钧正网络科技有限公司 | 适用于多场景的库存项管理方法、系统、终端及存储介质 |
| CN113139004B (zh) * | 2021-04-25 | 2024-03-01 | 中国工商银行股份有限公司 | 额度控制方法及装置、计算机设备及计算机可读存储介质 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20070143248A1 (en) * | 2005-12-19 | 2007-06-21 | Yahoo! Inc. | Method using query processing servers for query processing of column chunks in a distributed column chunk data store |
| CN101122885A (zh) * | 2007-09-11 | 2008-02-13 | 腾讯科技(深圳)有限公司 | 一种数据缓存处理方法、系统及数据缓存装置 |
| CN102222107A (zh) * | 2011-06-28 | 2011-10-19 | 中国联合网络通信集团有限公司 | 数据存取系统及其数据存取方法 |
| CN103544153A (zh) * | 2012-07-10 | 2014-01-29 | 阿里巴巴集团控股有限公司 | 一种基于数据库的数据更新方法和系统 |
-
2014
- 2014-08-06 CN CN201410384269.4A patent/CN105335297B/zh active Active
-
2015
- 2015-07-23 WO PCT/CN2015/084883 patent/WO2016019803A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20070143248A1 (en) * | 2005-12-19 | 2007-06-21 | Yahoo! Inc. | Method using query processing servers for query processing of column chunks in a distributed column chunk data store |
| CN101122885A (zh) * | 2007-09-11 | 2008-02-13 | 腾讯科技(深圳)有限公司 | 一种数据缓存处理方法、系统及数据缓存装置 |
| CN102222107A (zh) * | 2011-06-28 | 2011-10-19 | 中国联合网络通信集团有限公司 | 数据存取系统及其数据存取方法 |
| CN103544153A (zh) * | 2012-07-10 | 2014-01-29 | 阿里巴巴集团控股有限公司 | 一种基于数据库的数据更新方法和系统 |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109614388A (zh) * | 2018-11-14 | 2019-04-12 | 阿里巴巴集团控股有限公司 | 一种预算扣减方法和装置 |
| CN116932514A (zh) * | 2018-11-14 | 2023-10-24 | 创新先进技术有限公司 | 一种预算扣减方法和装置 |
| CN109697209A (zh) * | 2018-12-25 | 2019-04-30 | 广东亿迅科技有限公司 | 一种面向分布式数据库的报表处理方法及装置 |
| CN114598649A (zh) * | 2022-03-17 | 2022-06-07 | 苏州浪潮智能科技有限公司 | 内核带宽管理方法、装置、存储设备及存储介质 |
| CN114598649B (zh) * | 2022-03-17 | 2023-08-04 | 苏州浪潮智能科技有限公司 | 内核带宽管理方法、装置、存储设备及存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN105335297A (zh) | 2016-02-17 |
| CN105335297B (zh) | 2018-05-08 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2016019803A1 (zh) | 基于分布式内存和数据库的数据处理方法、装置和系统 | |
| US10437795B2 (en) | Upgrading systems with changing constraints | |
| CN102629268B (zh) | 数据同步方法、系统及数据访问装置 | |
| US20230259528A1 (en) | Synchronization cache seeding | |
| CN105183394B (zh) | 一种数据存储处理方法和装置 | |
| US10872066B2 (en) | Systems and methods of database tenant migration | |
| CN106802932B (zh) | 一种数据库的路由方法、装置及数据库系统 | |
| CN103336792B (zh) | 数据分区方法和装置 | |
| CN110276614B (zh) | 分户账的更新方法和装置 | |
| US20160212206A1 (en) | Deterministic database system and data transferring method thereof | |
| US10489378B2 (en) | Detection and resolution of conflicts in data synchronization | |
| CN107590207B (zh) | 数据同步方法及装置、电子设备 | |
| CN107977396B (zh) | 一种KeyValue数据库的数据表的更新方法与表数据更新装置 | |
| CN106815218A (zh) | 数据库访问方法、装置和数据库系统 | |
| WO2022111188A1 (zh) | 事务处理方法、系统、装置、设备、存储介质及程序产品 | |
| WO2017113962A1 (zh) | 访问分布式数据库的方法和分布式数据服务的装置 | |
| WO2022095366A1 (zh) | 基于Redis的数据读取方法、装置、设备及可读存储介质 | |
| CN102299904A (zh) | 一种实现业务数据备份的系统及方法 | |
| CN114661738B (zh) | 一种添加索引的方法、装置、设备以及存储介质 | |
| CN104462497A (zh) | 基于关系型数据库的跨库事务处理方法和系统 | |
| CN105550306A (zh) | 多副本数据的读写方法及系统 | |
| CN113836238A (zh) | 数据命令的批量处理方法及装置 | |
| WO2025189868A1 (zh) | 一种支持多副本一致性读的分布式数据库查询系统、方法、设备及介质 | |
| WO2018006723A1 (zh) | 一种针对数据库的数据修改请求处理方法及装置 | |
| CN103365987A (zh) | 一种基于共享磁盘架构的集群数据库系统及数据处理方法 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 15829241 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 15829241 Country of ref document: EP Kind code of ref document: A1 |