Resource processing method and apparatus, server, and storage medium

CN114387093BActive Publication Date: 2026-09-18TENPAY PAID TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011108238.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-16
Publication Date
2026-09-18
Estimated Expiration
2040-10-16

AI Technical Summary

Technical Problem

若对黄金资源买入或卖出的请求数量不断增大,达到库存管理数据库所能处理的上限,库存管理数据库将不能应对更多的请求,甚至可能发生故障,影响用户的正常交易

Benefits of technology

[0045] In this embodiment, if the number of resource transfer requests for the target resource per unit time exceeds the sum of the maximum number of requests that the existing sub-warehouse databases can handle (i.e., the processing capacity of the existing sub-warehouse databases cannot cope with the large number of received resource transfer requests), a sub-warehouse database is created based on the comprehensive inventory record in the target resource's main warehouse database. A portion of the inventory in the comprehensive inventory record is transferred to the sub-warehouse database for storage. Then, based on the resource transfer requests corresponding to each sub-warehouse database, the sub-warehouse inventory record in the sub-warehouse database is updated, thereby distributing the pressure of handling resource transfer requests across multiple sub-warehouse databases. This technical solution, as the number of requests continuously increases, can flexibly create sub-warehouse databases to achieve parallel expansion. The expanded multiple sub-warehouse databases can handle a large number of resource transfer requests, thus supporting real-time transactions for a large number of users, reducing failures caused by the mismatch between the number of corresponding resource transfer requests and processing capacity of the sub-warehouse databases, and improving database stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114387093B_ABST
    Figure CN114387093B_ABST
Patent Text Reader

Abstract

The application provides a resource processing method and device, a server and a storage medium, and belongs to the technical field of computers. The method comprises the following steps: acquiring a request quantity parameter of a target resource, the request quantity parameter being used to indicate the number of resource transfer requests received per unit time; in response to the request quantity parameter being greater than a request processing threshold, creating a sub-warehouse database based on a comprehensive inventory record in a total-warehouse database of the target resource, the comprehensive inventory record being used to record total inventory in the total-warehouse database, and the sub-warehouse database being used to store part of the inventory in the comprehensive inventory record; and updating a sub-warehouse inventory record in the sub-warehouse database based on a received resource transfer request. The application expands the sub-warehouse database to cope with a large number of resource transfer requests, thereby supporting real-time transactions of a large number of users, reducing failures of the sub-warehouse database due to a mismatch between the number of corresponding resource transfer requests and the processing capacity, and improving the stability of the database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a resource processing method, apparatus, server, and storage medium. Background Technology

[0002] Currently, some wealth management platforms provide online wealth management services to users via the internet. For example, gold trading platforms offer gold trading services, allowing users to view gold prices displayed on the platform and buy and sell gold resources.

[0003] In related technologies, gold trading platforms maintain an inventory management database. For each user's buy or sell order for gold resources, the inventory recorded in the database is adjusted accordingly. If the number of buy or sell requests for gold resources continues to increase, reaching the capacity of the inventory management database, the database will be unable to handle the increased requests and may even malfunction, affecting users' normal transactions. The above technical solutions cannot support real-time trading by a large number of users and suffer from poor stability. Summary of the Invention

[0004] This application provides a resource processing method, apparatus, server, and storage medium that can support real-time transactions from a large number of users and improve database stability. The technical solution is as follows:

[0005] On the one hand, a resource processing method is provided, the method comprising:

[0006] Obtain the request quantity parameter for the target resource, which represents the number of resource transfer requests received per unit time.

[0007] In response to the request quantity parameter being greater than the request processing threshold, a sub-warehouse database is created based on the comprehensive inventory record in the total warehouse database of the target resource. The request processing threshold is the sum of the maximum number of requests that the existing sub-warehouse database can process per unit time. The comprehensive inventory record is used to record the total inventory in the total warehouse database, and the sub-warehouse database is used to store a portion of the inventory in the comprehensive inventory record.

[0008] Based on the received resource transfer request, update the sub-warehouse inventory records in the sub-warehouse database.

[0009] On one hand, a resource processing apparatus is provided, the apparatus comprising:

[0010] The parameter acquisition module is used to acquire the request quantity parameter of the target resource, which represents the number of resource transfer requests received per unit time.

[0011] The sub-warehouse database creation module is used to create a sub-warehouse database based on the comprehensive inventory record in the total warehouse database of the target resource when the request quantity parameter is greater than the request processing threshold. The request processing threshold is the sum of the maximum number of requests that the existing sub-warehouse database can process per unit time. The comprehensive inventory record is used to record the total inventory in the total warehouse database, and the sub-warehouse database is used to store a portion of the inventory in the comprehensive inventory record.

[0012] The sub-warehouse inventory record update module is used to update the sub-warehouse inventory records in the sub-warehouse database based on the received resource transfer request.

[0013] In one optional implementation, the partitioned database creation module includes:

[0014] The comprehensive inventory record update unit is used to respond to the request quantity parameter being greater than the request processing threshold by deducting the warehouse inventory value from the inventory data in the comprehensive inventory record in order to update the comprehensive inventory record.

[0015] The warehouse inventory record generation unit is used to generate the warehouse inventory record based on the warehouse inventory value and the price data in the comprehensive inventory record, wherein the price data in the comprehensive inventory record is the latest unit price of the target resource.

[0016] The sub-warehouse database creation unit is used to store the sub-warehouse storage records in the sub-warehouse database.

[0017] In another alternative implementation, the warehouse inventory record generation unit is used for:

[0018] The sub-warehouse inventory value is used as the inventory data in the sub-warehouse inventory record;

[0019] The price data in the comprehensive inventory record is used as the price data in the sub-warehouse inventory record.

[0020] In another optional implementation, the sub-warehouse inventory record generation unit is further configured to use the price version identifier in the comprehensive inventory record as the price version identifier in the sub-warehouse inventory record, wherein the price version identifier in the comprehensive inventory record is used to identify the latest unit price of the target resource.

[0021] In another alternative implementation, the warehouse inventory record update module includes any of the following:

[0022] An inventory data deduction unit is used to respond to the resource transfer request for indicating the target resource to obtain the first value, and to deduct the first value from the inventory data in the sub-warehouse inventory record to update the sub-warehouse inventory record.

[0023] The inventory data increment unit is used to, in response to the resource transfer request indicating the target resource to be transferred out, increment the inventory data in the sub-warehouse inventory record by the second value to update the sub-warehouse inventory record.

[0024] In another alternative implementation, the inventory data deduction unit is used for:

[0025] In response to the resource transfer request indicating the target resource to obtain the first value, and the inventory data in the sub-warehouse inventory record is insufficient to deduct the first value, based on the comprehensive inventory record in the main warehouse database, the inventory data in the sub-warehouse inventory record is increased by a supplementary inventory value to update the sub-warehouse inventory record.

[0026] The first value is subtracted from the inventory data in the updated sub-warehouse inventory record to update the sub-warehouse inventory record.

[0027] In another alternative implementation, the apparatus further includes:

[0028] The warehouse database failure module is used to disable the warehouse database in response to a discrepancy between the price data in the warehouse inventory record and the price data in the comprehensive inventory record.

[0029] The sub-warehouse database creation module is also used to create a new sub-warehouse database based on the comprehensive inventory record;

[0030] The sub-warehouse inventory record update module is also used to update the sub-warehouse inventory records in the new sub-warehouse database based on the received resource transfer request.

[0031] In another alternative implementation, the apparatus further includes:

[0032] The data acquisition module is used to acquire the inventory data of the new batch of the target resource and the price data of the new batch from the unintegrated batch inventory records in the total warehouse database;

[0033] The price data integration module is used to determine the integrated price data of the new batch based on the inventory data of the new batch, the price data of the new batch, the inventory data in the comprehensive inventory record, and the price data in the comprehensive inventory record.

[0034] The comprehensive inventory record update module is used to integrate the price data of the newly added batches as the price data in the comprehensive inventory record, and to use the sum of the inventory data of the newly added batches and the inventory data in the comprehensive inventory record as the inventory data in the comprehensive inventory record, so as to update the comprehensive inventory record.

[0035] In another alternative implementation, the price data integration module is used to:

[0036] The price data of the newly added batch is used as the weight of the price data of the newly added batch, and the inventory data in the comprehensive inventory record is used as the weight of the price data in the comprehensive inventory record. A weighted average is then performed on the price data of the newly added batch and the price data in the comprehensive inventory record to obtain the price data after integrating the newly added batch.

[0037] In another alternative implementation, the apparatus further includes:

[0038] The first batch inventory record determination module is used to determine the inventory records in the temporary storage database as unintegrated batch inventory records in response to the total amount of temporary inventory stored in the temporary storage database of the target resource being greater than the temporary storage threshold. The temporary storage database is used to record the new inventory of the target resource.

[0039] In another alternative implementation, the apparatus further includes:

[0040] The second batch inventory record determination module is used to determine the unintegrated batch inventory record in the temporary storage database of the target resource as an unintegrated batch inventory record in response to the inventory data in the comprehensive inventory record being less than the total warehouse inventory threshold.

[0041] In another alternative implementation, the temporary inventory record is a warehouse inventory record in an expired warehouse database; or, the temporary inventory record is generated from the newly entered inventory data and price data of the target resource.

[0042] On one hand, a server is provided, the server including a processor and a memory, the memory storing at least one piece of program code, the at least one piece of program code being loaded and executed by the processor to implement the resource processing method described in any of the optional implementations above.

[0043] On one hand, a computer-readable storage medium is provided, wherein at least one piece of program code is stored in the computer-readable storage medium, the at least one piece of program code being loaded and executed by a processor to implement the resource processing method described in any of the above optional implementations.

[0044] On one hand, a computer program product or computer program is provided, which includes computer program code stored in a computer-readable storage medium. A processor of a server reads the computer program code from the computer-readable storage medium and executes the computer program code, causing the server to perform the resource processing method described in any of the above optional implementations.

[0045] In this embodiment, if the number of resource transfer requests for the target resource per unit time exceeds the sum of the maximum number of requests that the existing sub-warehouse databases can handle (i.e., the processing capacity of the existing sub-warehouse databases cannot cope with the large number of received resource transfer requests), a sub-warehouse database is created based on the comprehensive inventory record in the target resource's main warehouse database. A portion of the inventory in the comprehensive inventory record is transferred to the sub-warehouse database for storage. Then, based on the resource transfer requests corresponding to each sub-warehouse database, the sub-warehouse inventory record in the sub-warehouse database is updated, thereby distributing the pressure of handling resource transfer requests across multiple sub-warehouse databases. This technical solution, as the number of requests continuously increases, can flexibly create sub-warehouse databases to achieve parallel expansion. The expanded multiple sub-warehouse databases can handle a large number of resource transfer requests, thus supporting real-time transactions for a large number of users, reducing failures caused by the mismatch between the number of corresponding resource transfer requests and processing capacity of the sub-warehouse databases, and improving database stability. Attached Figure Description

[0046] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0047] Figure 1 This is a schematic diagram of an implementation environment provided in an embodiment of this application;

[0048] Figure 2 This is a flowchart of a resource processing method provided in an embodiment of this application;

[0049] Figure 3 This is a flowchart of a resource processing method provided in an embodiment of this application;

[0050] Figure 4 This is a flowchart illustrating an update of a comprehensive inventory record, as provided in an embodiment of this application.

[0051] Figure 5 This is a schematic diagram illustrating inventory management based on a central warehouse database, a temporary storage database, and a sub-warehouse database, provided in an embodiment of this application.

[0052] Figure 6 This is a schematic diagram of a target resource trading system provided in an embodiment of this application;

[0053] Figure 7 This is a block diagram of a resource processing apparatus provided in an embodiment of this application;

[0054] Figure 8 This is a block diagram of a server provided in an embodiment of this application. Detailed Implementation

[0055] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0056] The terms "first," "second," "third," and "fourth," etc., used in the specification, claims, and drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.

[0057] Figure 1 This is a schematic diagram of an implementation environment provided in an embodiment of this application. See also... Figure 1 The implementation environment includes: a first terminal 110, a server 120, and a second terminal 130.

[0058] The first terminal 110 and the second terminal 130 can be smartphones, tablets, laptops, desktop computers, smart speakers, smartwatches, etc., but are not limited to these. The server 120 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0059] Server 120 maintains a database of target resources, including inventory records for these resources, recording attribute information such as quantity and unit price. First terminal 110 connects directly or indirectly to server 120 via wired or wireless communication, without limitation in this application. First terminal 110 supports inventory management for resource managers on the financial management platform. Resource managers input attribute information for newly added target resources through first terminal 110, including, for example, the quantity and unit price. First terminal 110 sends this attribute information to server 120, enabling server 120 to update the inventory records based on this information, thus achieving inventory management of the target resources.

[0060] The second terminal 130 is directly or indirectly connected to the server 120 via wired or wireless communication, which is not limited in this application. The second terminal 130 has the function of supporting users to trade target resources. Users using the second terminal 130 can buy or sell target resources through the second terminal 130. In response to a user's buy or sell transaction, the second terminal 130 sends a corresponding resource transfer request to the server 120, so that the server 120 updates the inventory record of the target resource based on the resource transfer request, thereby realizing inventory management of the target resource. Optionally, the second terminal 130 is equipped with a client, which supports users to trade target resources. For example, the client can be a financial management client, a browser client, a payment service client, or an instant messaging client, etc.

[0061] Figure 2 This is a flowchart illustrating a resource processing method provided in an embodiment of this application. See also... Figure 2 This embodiment includes:

[0062] 201. The number of requests the server receives to obtain the target resource is a parameter that indicates the number of resource transfer requests received per unit of time.

[0063] The target resource is a resource used for financial management, and is a type of financial product. Optionally, the target resource is a resource based on precious metals. Precious metals include, for example, gold and silver. In this embodiment, the example of a target resource based on gold is used for illustration, and the type of target resource is not limited. If the target resource is based on gold, it may be physical gold; or it may be a virtual gold resource, such as a gold fund or gold futures.

[0064] A resource transfer request is used to request the transfer of a target resource. It is a request sent by the second terminal to the server in response to a transaction operation involving the target resource. If the transaction operation indicates the purchase of a first value of the target resource, the resource transfer request indicates the acquisition of the first value of the target resource. If the transaction operation indicates the sale of a second value of the target resource, the resource transfer request indicates the transfer of the second value of the target resource.

[0065] Within a given time period, at least one second terminal sends a resource transfer request to the server, and correspondingly, the server receives at least one resource transfer request. The unit time is a preset period of time, the duration of which can be flexibly configured; this embodiment does not limit the duration of the unit time. For example, if the unit time is 1 second, and 500 second terminals send resource transfer requests to the server within 1 second, then the server receives 500 resource transfer requests within 1 second, with the request quantity parameter being 500.

[0066] 202. When the server responds to a request quantity parameter that exceeds the request processing threshold, it creates a sub-warehouse database based on the comprehensive inventory record in the total warehouse database of the target resource. The comprehensive inventory record is used to record the total inventory in the total warehouse database, and the sub-warehouse database is used to store a portion of the inventory in the comprehensive inventory record.

[0067] It should be noted that the server updates the shard database records based on the received resource transfer requests, enabling the shard database to handle the resource transfer requests. Since the number of requests a single shard database can handle per unit of time is limited, the server flexibly creates new shard databases based on the number of received resource transfer requests, so that multiple created shard databases can handle more resource transfer requests.

[0068] The request processing threshold is the sum of the maximum number of requests that the existing sharded databases can process per unit of time. For example, if there are 3 sharded databases, and each sharded database has a maximum processing capacity of 500 requests per second, then the request processing threshold is 1500.

[0069] The central warehouse database includes a comprehensive inventory record, which records the total inventory in the central warehouse database. This comprehensive inventory record includes inventory data and price data; the inventory data represents the quantity of the total inventory in the central warehouse database, and the price data represents the unit price of the target resource in the total inventory. Optionally, the central warehouse database also includes at least one integrated batch inventory record, which represents the inventory data and price data of a single batch of inventory. The comprehensive inventory record is obtained by integrating the integrated batch inventory records in the central warehouse database.

[0070] The warehouse inventory records in the warehouse database are used to record a portion of the inventory in the overall inventory record. The warehouse inventory records include inventory data and price data. The inventory data represents a portion of the target resource currently for sale, and the price data represents the unit price of the target resource currently for sale.

[0071] The warehouse inventory records are generated based on the comprehensive inventory records. The sum of the inventory data in the warehouse inventory records across multiple created warehouse databases and the inventory data in the comprehensive inventory record represents the total amount of the target resources currently for sale. The price data in the warehouse inventory records is consistent with the price data in the comprehensive inventory records. The server deducts a portion of the inventory from the comprehensive inventory records, using this deducted quantity as the increment in the inventory stored in the warehouse database. It also uses the price data from the comprehensive inventory records as the price data in the warehouse inventory records to create the warehouse database. For example, if the server deducts 500 grams of inventory from the comprehensive inventory records and uses this 500 grams as the increment in the inventory stored in the warehouse database, the inventory data in the warehouse inventory records will increase by 500 grams accordingly. If the price data in the comprehensive inventory records is 300 yuan per gram, the server will set the price data in the warehouse inventory records to 300 yuan per gram.

[0072] 203. Based on the received resource transfer request, the server updates the sub-warehouse storage records in the sub-warehouse database.

[0073] The server distributes multiple received resource transfer requests to multiple sub-databases, so that each sub-database updates its sub-database records based on the resource transfer requests assigned to it. For example, if the server receives 1600 resource transfer requests for a target resource within 1 second, it will assign 500 of these requests to the first sub-database, another 500 to the second, another 500 to the third, and the remaining 100 to the fourth. Alternatively, the server may assign 400 resource transfer requests to each of the four sub-databases. This application does not limit the method by which the server distributes multiple resource transfer requests to multiple sub-databases.

[0074] It should be noted that, optionally, the server first allocates 1500 resource transfer requests to the three existing sub-databases, then creates one sub-database, and allocates the remaining 100 resource transfer requests to the newly created sub-database; or, the server first creates one sub-database, and then allocates 1600 resource transfer requests to the four existing sub-databases. This application does not limit the execution order of the server creating sub-databases and allocating resource transfer requests to them.

[0075] Specifically, if the resource transfer request is used to indicate the target resource to be acquired with a first value, the inventory data in the sub-warehouse inventory record is reduced by the first value to update the sub-warehouse inventory record; if the resource transfer request is used to indicate the target resource to be transferred out with a second value, the inventory data in the sub-warehouse inventory record is increased by the second value to update the sub-warehouse inventory record.

[0076] In this embodiment, if the number of resource transfer requests for the target resource per unit time exceeds the sum of the maximum number of requests that the existing sub-warehouse databases can handle (i.e., the processing capacity of the existing sub-warehouse databases cannot cope with the large number of received resource transfer requests), a sub-warehouse database is created based on the comprehensive inventory record in the target resource's main warehouse database. A portion of the inventory in the comprehensive inventory record is transferred to the sub-warehouse database for storage. Then, based on the resource transfer requests corresponding to each sub-warehouse database, the sub-warehouse inventory record in the sub-warehouse database is updated, thereby distributing the pressure of handling resource transfer requests across multiple sub-warehouse databases. This technical solution, as the number of requests continuously increases, can flexibly create sub-warehouse databases to achieve parallel expansion. The expanded multiple sub-warehouse databases can handle a large number of resource transfer requests, thus supporting real-time transactions for a large number of users, reducing failures caused by the mismatch between the number of corresponding resource transfer requests and processing capacity of the sub-warehouse databases, and improving database stability.

[0077] Figure 3 This is a flowchart illustrating a resource processing method provided in an embodiment of this application. See also... Figure 3 In this embodiment, the example given is that the price data in the sub-warehouse inventory record is consistent with the price data in the total warehouse inventory record. This embodiment includes:

[0078] 301. The number of requests the server receives to obtain the target resource is a parameter that indicates the number of resource transfer requests received per unit of time.

[0079] Step 301 is the same as step 201, and will not be repeated here.

[0080] 302. If the request quantity parameter exceeds the request processing threshold, the server will deduct the warehouse inventory value from the inventory data in the comprehensive inventory record to update the comprehensive inventory record.

[0081] The request processing threshold is the sum of the maximum number of requests that the existing sub-warehouse databases can handle per unit of time. The inventory data in the comprehensive inventory record represents the total inventory of currently available target resources stored in the main warehouse database. The sub-warehouse inventory value represents the quantity of target resources allocated by the server to the sub-warehouse database. The sub-warehouse inventory value can be flexibly configured; for example, it can be 500 grams or 1 kilogram.

[0082] If the number of resource transfer requests received by the server per unit time exceeds the request processing threshold, it indicates that the existing sub-warehouse database's processing capacity cannot handle this number of resource transfer requests. The server needs to create a new sub-warehouse database to handle resource transfer requests exceeding the processing capacity of the existing sub-warehouse database. The newly created sub-warehouse database is used to store a portion of the inventory in the overall inventory record. The server deducts the sub-warehouse inventory value from the inventory data in the overall inventory record to transfer the target resource represented by the sub-warehouse inventory value to the sub-warehouse database for storage. For example, if the original inventory data in the overall inventory record is 10 kg and the sub-warehouse inventory value is 500 g, the server deducts the sub-warehouse inventory value from the inventory data to obtain the new inventory data of 9500 g, and updates the overall inventory record with this new inventory data of 9500 g.

[0083] 303. The server generates warehouse inventory records based on the warehouse inventory value and price data in the comprehensive inventory records, and stores the warehouse inventory records in the warehouse database.

[0084] The price data in the comprehensive inventory record will be updated based on the inventory quantity and unit price of the target resource in the newly added batch. The price data in the comprehensive inventory record is the latest unit price of the target resource.

[0085] Optionally, the warehouse inventory record includes inventory data and price data. Step 303 above includes: the server using the warehouse inventory value as the inventory data in the warehouse inventory record; and the server using the price data in the comprehensive inventory record as the price data in the warehouse inventory record.

[0086] The technical solution provided in this application, while using the sub-warehouse inventory value as inventory data in the sub-warehouse inventory record to generate the sub-warehouse inventory record, simultaneously deducts corresponding amounts from the inventory data in the comprehensive inventory record. This ensures that the sum of the total inventory of currently available target resources stored in the main warehouse database and the inventory quantity stored in the sub-warehouse database remains consistent with the actual physical inventory, thereby ensuring the accuracy of the inventory records in the database and improving the reliability of database-based inventory management. Furthermore, during the creation of the sub-warehouse database, the price data in the sub-warehouse inventory record is made consistent with the price data in the comprehensive inventory record. Based on the price data in the sub-warehouse inventory record, resource transfer requests are processed, ensuring the reliability of resource transactions.

[0087] It should be noted that, optionally, the sub-warehouse inventory record also includes a price version identifier. The step of the server generating the sub-warehouse inventory record further includes: the server using the price version identifier in the comprehensive inventory record as the price version identifier in the sub-warehouse inventory record, wherein the price version identifier in the comprehensive inventory record is used to uniquely identify the latest unit price of the target resource. The price version identifier in the comprehensive inventory record is updated as the price data of the target resource is updated, and each update of the price data of the target resource is identified by a unique price version identifier. Optionally, the price version identifier is a unique identifier generated based on the price data; or, the price version identifier is a unique identifier generated based on the update time of the price data; or, the price version identifier is represented by the update time of the price data. The embodiments of this application do not limit the form of the price version identifier or the generation process.

[0088] The above technical solution uses a unique price version identifier to identify the price data of the target resource for each update. Each price update is represented by a new price version. Based on the price version identifier, the target resources corresponding to different price versions can be managed, which can improve the availability of database-based resource management.

[0089] Another point to note is that, optionally, the warehouse inventory records may include, in addition to inventory data, price data and price version identifier, with the price data or price version identifier representing the unit price of the inventory stored in the warehouse database. This application does not limit this.

[0090] Another point to note is that, optionally, the sharded database records also include a sharded database identifier. The server generates a unique sharded database identifier during the sharded database creation process to identify the sharded database.

[0091] Another point to note is that the above embodiment uses the example of a central warehouse database including comprehensive inventory records, where price data is updated based on the inventory quantity and unit price of newly added batches of target resources, and the server creating a sub-warehouse database based on the comprehensive inventory records. Optionally, inventory data in a single inventory record in the central warehouse database may represent the inventory quantity of target resources with the same unit price; or, inventory data in a single inventory record in the central warehouse database may represent the inventory quantity of a batch of target resources. The server can create a sub-warehouse database based on a single inventory record in the central warehouse database. The process of the server creating a sub-warehouse database based on a single inventory record in the central warehouse database is the same as the process of the server creating a sub-warehouse database based on comprehensive inventory records, and will not be described again here.

[0092] 304. Based on the received resource transfer request, the server updates the sub-warehouse inventory records in the sub-warehouse database.

[0093] Optionally, the resource transfer request is used to indicate the target resource for acquiring the first value; or, the resource transfer request is used to indicate the target resource for transferring out the second value. Based on the indication of the resource transfer request, the server increases or decreases the inventory data in the sub-warehouse inventory record accordingly to update the sub-warehouse inventory record. Accordingly, step 304 above includes: in response to the resource transfer request indicating the target resource for acquiring the first value, the server decreases the inventory data in the sub-warehouse inventory record by the first value to update the sub-warehouse inventory record. Alternatively, step 304 above includes: in response to the resource transfer request indicating the target resource for transferring out the second value, the server increases the inventory data in the sub-warehouse inventory record by the second value to update the sub-warehouse inventory record.

[0094] For example, if the inventory data in the warehouse inventory record is 500 grams, and the resource transfer request is used to indicate the acquisition of 10 grams of target resource, then the server will deduct 10 grams from the inventory data in the warehouse inventory record to obtain a new inventory data of 490 grams, and update the warehouse inventory record with the new inventory data of 490 grams.

[0095] In this embodiment, if the number of resource transfer requests for the target resource per unit time exceeds the sum of the maximum number of requests that the existing sub-warehouse databases can handle (i.e., the processing capacity of the existing sub-warehouse databases cannot cope with the large number of received resource transfer requests), a sub-warehouse database is created based on the comprehensive inventory record in the target resource's main warehouse database. A portion of the inventory in the comprehensive inventory record is transferred to the sub-warehouse database for storage. Then, based on the resource transfer requests corresponding to each sub-warehouse database, the sub-warehouse inventory record in the sub-warehouse database is updated, thereby distributing the pressure of handling resource transfer requests across multiple sub-warehouse databases. This technical solution, as the number of requests continuously increases, can flexibly create sub-warehouse databases to achieve parallel expansion. The expanded multiple sub-warehouse databases can handle a large number of resource transfer requests, thus supporting real-time transactions for a large number of users, reducing failures caused by the mismatch between the processing capacity of the sub-warehouse databases and the corresponding number of resource transfer requests, and improving database stability.

[0096] It should be noted that if the request quantity parameter is greater than the request processing threshold, the server creates a sub-warehouse database through steps 302 to 303 above, and updates the sub-warehouse storage records in the existing sub-warehouse database based on the resource transfer requests corresponding to the created sub-warehouse database. If the request quantity parameter is less than or equal to the request processing threshold, the server does not perform the step of creating a sub-warehouse database, but directly updates the sub-warehouse storage records in the existing sub-warehouse database based on the resource transfer requests corresponding to the existing sub-warehouse database.

[0097] Another point to note is that if the resource transfer request indicates the target resource for obtaining the first value, and the inventory data in the sub-warehouse inventory record is greater than or equal to the first value (i.e., the inventory data in the sub-warehouse inventory record is sufficient to deduct the first value), then the server directly updates the sub-warehouse inventory record by deducting the first value from the inventory data in the sub-warehouse inventory record. If the inventory data in the sub-warehouse inventory record is less than the first value (i.e., the inventory data in the sub-warehouse inventory record is insufficient to deduct the first value), then the server replenishes the inventory stored in the sub-warehouse database before deducting the first value. Accordingly, the steps of the server responding to the resource transfer request indicating the target resource for obtaining the first value and deducting the first value from the inventory data in the sub-warehouse inventory record to update the sub-warehouse inventory record include: the server responding to the resource transfer request indicating the target resource for obtaining the first value, and the inventory data in the sub-warehouse inventory record is insufficient to deduct the first value, based on the comprehensive inventory record in the main warehouse database, adding a supplementary inventory value to the inventory data in the sub-warehouse inventory record to update the sub-warehouse inventory record; the server then deducts the first value from the updated inventory data in the sub-warehouse inventory record to update the sub-warehouse inventory record.

[0098] The replenishment inventory value indicates the amount of inventory the server replenishes for a sub-warehouse database when its inventory is insufficient. The replenishment inventory value is flexibly configurable; for example, it can be 400 grams or 600 grams. For instance, if the inventory data in a sub-warehouse inventory record is 5 grams, and a resource transfer request indicates the acquisition of a target resource of 10 grams, and the inventory data in the sub-warehouse inventory record is insufficient to deduct the 10 grams of target resource, then if the replenishment inventory value is 500 grams, the server will deduct 500 grams from the inventory data in the overall inventory record to update the overall inventory record; increase the inventory data in the sub-warehouse inventory record by 500 grams, resulting in a new inventory data of 505 grams, and update the sub-warehouse inventory record with the new inventory data of 505 grams; then deduct 10 grams from the inventory data of 505 grams in the sub-warehouse inventory record, resulting in a new inventory data of 495 grams, and update the sub-warehouse inventory record with the new inventory data of 495 grams.

[0099] Another point to note is that the resource transfer request is initiated by the user through the execution of a transaction on the second terminal. In addition to adding or deducting inventory data in the sub-warehouse inventory record according to the instructions of the resource transfer request to update the sub-warehouse inventory record, the server also updates the resource quantity and funds corresponding to the user account corresponding to the resource transfer request.

[0100] For example, if a resource transfer request indicates the acquisition of a target resource of a first value, then the resource quantity corresponding to the user account is increased by the first value; and the funds corresponding to the user account are deducted based on the price data in the sub-warehouse inventory records. If a resource transfer request indicates the transfer of a target resource of a second value, then the resource quantity corresponding to the user account is deducted by the second value; and the funds corresponding to the user account are increased based on the price data in the sub-warehouse inventory records.

[0101] The server uses the product of the price data in the inventory records and the quantity of the target resource indicated in the resource transfer request as the total value of that quantity of target resources. Optionally, the server may add or subtract this total value from the funds corresponding to the user's account; or, the server may add or subtract the corresponding transaction fee in addition to adding or subtracting the total value from the funds corresponding to the user's account, which is not limited in this application.

[0102] Optionally, the server may also generate and store transaction records based on updates to the resource quantity and funds corresponding to the user account. Optionally, the server may also generate transaction orders based on updates to the resource quantity and funds corresponding to the user account, and send the transaction orders to the second terminal corresponding to the user account, so that the second terminal can display the transaction orders to the user.

[0103] Figure 4 This is a flowchart illustrating an update of a comprehensive inventory record, as provided in an embodiment of this application. See also... Figure 4 The process includes:

[0104] 401. The server uses the temporary inventory records in the temporary storage database as unintegrated batch inventory records in the main warehouse database.

[0105] The temporary storage database is used to record new inventory of the target resource. The temporary storage database includes at least one temporary storage inventory record. Each temporary storage inventory record includes inventory data for a new batch and price data, whereby the inventory data represents the quantity of the new batch and the price data represents the unit price of the target resource in that new batch.

[0106] Optionally, the newly added batch refers to the batch newly entered by resource management personnel through the first terminal. Resource management personnel enter the attribute information of the newly added target resource through the first terminal. This attribute information includes the quantity and unit price of the newly added target resource. The first terminal sends this attribute information to the server. The server uses the quantity of the newly added target resource in the attribute information as the inventory data of the newly entered target resource, and uses the unit price of the newly added target resource in the attribute information as the price data of the newly entered target resource. Based on this inventory data and price data, a temporary inventory record is generated.

[0107] The technical solution provided in this application generates a temporary inventory record based on the attribute information of newly entered target resources uploaded by the first terminal. Then, based on this temporary inventory record, the comprehensive inventory record in the main warehouse database is updated. This achieves logical warehousing by inserting inventory records into the temporary database and updating them in the main warehouse database. Furthermore, by performing inventory checks based on the inventory records in the sub-warehouse database and the main warehouse database, and by handling resource transfer requests based on the sub-warehouse database, the databases upon which inventory management and resource transfer request handling are separated. Compared to a system where logical warehousing, inventory checks, and resource transfer request handling are all implemented using the same database, this approach is more conducive to inventory management and database maintenance. It also supports concurrent resource transactions and inventory management, improving database availability and stability.

[0108] Optionally, if the price data in the sub-warehouse inventory record is inconsistent with the price data in the overall inventory record, the sub-warehouse database to which the sub-warehouse inventory record belongs is set to invalid. The server uses the sub-warehouse inventory record in the invalid sub-warehouse database as a temporary inventory record.

[0109] It should be noted that, optionally, the server will only treat the temporary inventory records in the temporary storage database as unintegrated batch inventory records when the total temporary inventory in the database reaches a certain amount. That is, the server will treat the temporary inventory records in the temporary storage database as unintegrated batch inventory records when the total temporary inventory in the target resource's temporary storage database exceeds a temporary storage threshold. The temporary storage threshold is a flexibly configurable value, for example, 500 grams or 800 grams. Optionally, the server can periodically compare the total temporary inventory in the temporary storage database with the temporary storage threshold. When the total temporary inventory in the target resource's temporary storage database exceeds the temporary storage threshold, the server will treat the temporary inventory records in the temporary storage database as unintegrated batch inventory records. The period for the server to compare the total temporary inventory in the temporary storage database with the temporary storage threshold is flexibly configurable, for example, every 10 minutes or every hour.

[0110] The above technical solution only treats the temporary inventory records as unintegrated batch inventory records when the total amount of the target resource in a new batch reaches a certain quantity. Then, based on the unintegrated batch inventory records, the price data in the comprehensive inventory record is updated. Compared with updating the price data in the comprehensive inventory record based on the inventory records of each new batch of target resources, this can reduce price fluctuations caused by frequent price data updates, improve the price stability of target resources, improve the stability of target resource transactions, and thus enhance the user's trading experience.

[0111] Another point to note is that, optionally, when the inventory stored in the main warehouse database is less than a certain amount, the server will treat the temporary inventory record as an unintegrated batch inventory record. That is, in response to the inventory data in the integrated inventory record being less than the main warehouse inventory threshold, the server will treat the temporary inventory record as an unintegrated batch inventory record. The main warehouse inventory threshold is a flexibly configurable value, for example, a main warehouse inventory threshold of 500 grams or 600 grams.

[0112] The above technical solution replenishes the inventory stored in the central warehouse database in a timely manner when the inventory is less than a certain amount. This allows the central warehouse database to support timely replenishment of inventory when users make large purchases of target resources and the inventory in the central warehouse database needs to be transferred to the sub-warehouse databases, thereby improving the availability and stability of the database.

[0113] 402. The server retrieves the inventory data and price data of the new batch of the target resource from the unintegrated batch inventory records in the central warehouse database.

[0114] The central warehouse database includes at least one unintegrated batch inventory record. Each unintegrated batch inventory record includes inventory data and price data for a newly added batch of the target resource. For example, the central warehouse database includes two unintegrated batch inventory records. One batch inventory record includes inventory data pa and price data sa for a newly added batch, and the other batch inventory record includes inventory data pb and price data sb for another newly added batch.

[0115] 403. The server determines the price data after integrating the newly added batch based on the inventory data of the newly added batch, the price data of the newly added batch, the inventory data in the comprehensive inventory record, and the price data in the comprehensive inventory record.

[0116] Optionally, the server performs a weighted average of the price data of the newly added batch and the price data in the comprehensive inventory record to obtain the price data after integrating the newly added batch. Accordingly, step 403 above includes: the server using the inventory data of the newly added batch as the weight of the price data of the newly added batch, and using the inventory data in the comprehensive inventory record as the weight of the price data in the comprehensive inventory record, to perform a weighted average of the price data of the newly added batch and the price data in the comprehensive inventory record to obtain the price data after integrating the newly added batch.

[0117] For example, if the inventory data of a new batch is pa and the price data is sa; and the inventory data of another new batch is pb and the price data is sb; and the inventory data and price data in the integrated inventory record are pc, then the price data after integrating the new batches can be expressed as (pa×sa+pb×sb+pc×sc)÷(pa+pb+pc).

[0118] 404. The server will integrate the price data of the newly added batches as the price data in the comprehensive inventory record, and will use the sum of the inventory data of the newly added batches and the inventory data in the comprehensive inventory record as the inventory data in the comprehensive inventory record to update the comprehensive inventory record.

[0119] For example, the original inventory data in the consolidated inventory record is pc, and the original price data is sc; the inventory data of a newly added batch is pa, and the price data is sa; the inventory data of another newly added batch is pb, and the price data is sb. Accordingly, the sum of the inventory data of the newly added batches and the inventory data in the consolidated inventory record is pa + pb + pc; the price data after integrating the newly added batches is expressed as (pa × sa + pb × sb + pc × sc) ÷ (pa + pb + pc), the inventory data in the consolidated inventory record is updated to pa + pb + pc, and the price data in the consolidated inventory record is updated to (pa × sa + pb × sb + pc × sc) ÷ (pa + pb + pc).

[0120] It should be noted that in related technologies, to avoid user transactions failing when a batch of target resources is about to sell out, a new batch is switched in advance for subsequent transactions. For example, if batch 1 has 10 grams of remaining inventory, and the server may receive 100 resource transfer requests indicating the acquisition of 1 gram of target resources, the server needs to switch to a new batch 2 in advance for subsequent transactions. Thus, batch 1 will have 10 grams of unsold stock left over. Similarly, batches 2, 3, and subsequent batches will also have unsold stock left over. Since the prices of each batch differ, handling unsold stock from multiple batches presents challenges. The technical solution provided in this application integrates the inventory of newly added batches and the inventory stored in expired sub-warehouse databases into a comprehensive inventory record, reducing the unsold stock left over from multiple batches and saving the cost of handling unsold stock. Furthermore, by updating the price data in the comprehensive inventory record through weighted average processing, multiple batches can be sold together without additional cost, ensuring that the interests of the financial platform are not harmed.

[0121] It should be noted that after the price data in the consolidated inventory record is updated, the price data in the sub-warehouse database created based on the price data in the original consolidated inventory record will be inconsistent with the price data in the updated consolidated inventory record. Optionally, in response to the inconsistency between the price data in the sub-warehouse inventory record and the price data in the consolidated inventory record, the server invalidates the sub-warehouse database; creates a new sub-warehouse database based on the consolidated inventory record; and updates the sub-warehouse inventory records in the new sub-warehouse database based on the received resource transfer request. If the sub-warehouse inventory record includes a price version identifier, optionally, in response to the inconsistency between the price version identifier in the sub-warehouse inventory record and the price version identifier in the consolidated inventory record, the server executes the step of invalidating the sub-warehouse database.

[0122] The above technical solution, after the price data in the comprehensive inventory record is updated, promptly invalidates the sub-warehouse database created based on the price data in the original comprehensive inventory record, and creates a new sub-warehouse database based on the updated price data, so as to conduct transactions of target resources based on the new price data, thereby improving the update efficiency of the transaction price of target resources.

[0123] Another point to note is that the above embodiment uses the example of a temporary inventory record in the temporary storage database including inventory data and price data for a newly added batch, and treats the temporary inventory record as an unintegrated batch inventory record in the main warehouse database. Optionally, the server integrates multiple temporary inventory records in the temporary storage database to obtain a temporary comprehensive inventory record; this temporary inventory record is then used as an unintegrated batch inventory record in the main warehouse database to update the comprehensive storage record. The process of the server integrating multiple temporary inventory records in the temporary storage database is the same as steps 403 to 404, and the process of the server updating the comprehensive storage record using this temporary inventory record as an unintegrated batch inventory record in the main warehouse database is also the same as steps 403 to 404, and will not be repeated here.

[0124] Another point to note is that the above embodiment uses the example of using the inventory records of the failed sub-warehouse database as temporary inventory records in the temporary storage database, and the inventory records generated from the newly entered target resource inventory data and price data as temporary inventory records; then, the temporary inventory records are used as unintegrated batch inventory records in the main warehouse database for illustration. Optionally, the server directly uses the inventory records of the failed sub-warehouse database as unintegrated batch inventory records in the main warehouse database; and uses the inventory records generated from the newly entered target resource inventory data and price data as unintegrated batch inventory records. Optionally, in response to the sum of inventory data in the unintegrated batch inventory records being greater than the temporary storage threshold, the server executes the step of obtaining the new batch inventory data and price data of the target resource from the unintegrated batch inventory records in the main warehouse database; or, in response to the inventory data in the comprehensive inventory records being less than the main warehouse inventory threshold, the server executes the step of obtaining the new batch inventory data and price data of the target resource from the unintegrated batch inventory records in the main warehouse database.

[0125] To make the update process of inventory records in the temporary storage database, the central warehouse database, and the branch warehouse databases clearer, the following section combines... Figure 5 Please provide an explanation. See also... Figure 5 Resource management personnel purchase target resources from resource suppliers; they input the quantity and unit price of newly added target resources through a first terminal; the first terminal sends the quantity and unit price of the newly added target resources to the server; the server uses the quantity of the newly added target resources as the inventory data of the newly entered target resources, and the unit price of the newly added target resources as the price data of the newly entered target resources; based on the inventory data and price data, a temporary inventory record is generated; this temporary inventory record is stored in the temporary storage database 501, realizing the collection of target resource purchases. Through the above steps 401 to 404, the server merges the temporary inventory records in the temporary storage database 501 into the total warehouse inventory records in the main warehouse database 502, realizing the merging of the inventory stored in the main warehouse database 502 and the inventory stored in the temporary storage database 501.

[0126] The server creates the sub-warehouse database 503 based on a process similar to steps 302 to 303 described above. The main warehouse database 502 and the temporary storage database 501 together constitute the central warehouse. The sum of the inventory stored in the central warehouse and the inventory stored in the sub-warehouse database 503 is consistent with the actual physical inventory, representing a mapping of the physical inventory.

[0127] If the received resource transfer request indicates the acquisition of a target resource, the inventory data in the warehouse inventory record of the warehouse database 503 is deducted, and a corresponding transaction order is generated based on the price data in the warehouse inventory record, which is equivalent to placing an order for outbound delivery. If the received resource transfer request indicates the transfer of a target resource, the inventory data in the warehouse inventory record of the warehouse database 503 is increased, and a corresponding transaction order is generated based on the price data in the warehouse inventory record, which is equivalent to releasing the resource into the warehouse.

[0128] If the remaining inventory in the sub-warehouse database 503 is insufficient, some inventory is obtained from the main warehouse database 502 to replenish the sub-warehouse database 503. If the price data in the sub-warehouse inventory records in the sub-warehouse database 503 is inconsistent with the price data in the comprehensive inventory records in the main warehouse database 502, then the sub-warehouse database 503 is declared invalid, and a new sub-warehouse database 503 is created. The sub-warehouse inventory records in the invalid sub-warehouse database 503 are stored in the temporary storage database 501, which is to say, the invalid sub-warehouse database is released and aggregated.

[0129] The technical solution provided in this application embodiment manages the inventory of target resources based on a temporary storage database, a central warehouse database, and sub-warehouse databases. Specifically, it provides an implementation of a central warehouse for sale + a central warehouse for sale + sub-warehouses for sale. The sub-warehouse database supports parallel expansion. By expanding the sub-warehouse database, multiple expanded sub-warehouse databases can handle a large number of resource transfer requests, effectively managing a large volume of user transactions. Furthermore, by using the sub-warehouse database to handle resource transfer requests and the central warehouse database and temporary storage database for inventory management, the transaction process and inventory management process are separated. This effectively handles a large number of user transactions while supporting concurrent inventory procurement and management operations, which is more conducive to inventory management and database maintenance, improving database availability and stability. Moreover, by merging multiple batches of inventory, the amount of leftover stock from multiple batches is reduced, saving the cost of handling leftover stock. Additionally, by averaging the price data of target resources from multiple batches, the price data of target resources is kept stable, improving the user's trading experience and protecting the interests of the financial platform.

[0130] To make the process of users trading target resources through a second terminal clearer, the following will combine... Figure 6 Please provide an explanation. See also... Figure 6The second terminal provides users with functions 601 for updating and displaying the price of target resources, 602 for buying target resources, 603 for selling target resources, and 604 for displaying transaction records. The server includes an access layer 605 and a storage layer 606. The access layer 605 receives requests from the second terminal and communicates with it. The storage layer 606 stores price data of the target resources, transaction records corresponding to the user's account, and inventory records of the target resources. In response to a price display operation, the second terminal sends a price acquisition request for the target resource to the server. The price acquisition interface in the server's access layer 605 receives the request; retrieves the stored price data from the storage layer 606; and returns the price data to the second terminal. In response to a transaction operation indicating a buy or sell of the target resource, the second terminal sends a resource transfer request for the target resource to the server. The transaction interface in the server's access layer 605 receives the request; updates the inventory records in the storage layer 606; and generates corresponding transaction records, which are then stored in the storage layer 606. In response to the transaction record retrieval operation, the second terminal sends a transaction record retrieval request to the server. The transaction record interface in the server's access layer 605 receives the request; it retrieves the requested transaction record from the transaction records already stored in the storage layer 606; and returns the transaction record to the second terminal. Optionally, the price retrieval interface, transaction interface, and transaction record interface are CGI (Common Gateway Interface). It should be noted that when resource managers purchase target resources from resource suppliers, they input the quantity and unit price of the newly added target resources through the first terminal; the first terminal sends the quantity and unit price of the newly added target resources to the server; the server updates the inventory records in the storage layer 606 based on the quantity and unit price of the newly added target resources.

[0131] All of the above-mentioned optional technical solutions can be combined in any way to form the optional embodiments of this application, and will not be described in detail here.

[0132] Figure 7 This is a block diagram of a resource processing apparatus provided in an embodiment of this application. See also... Figure 7 The device includes:

[0133] The parameter acquisition module 701 is used to acquire the request quantity parameter of the target resource. The request quantity parameter is used to represent the number of resource transfer requests received per unit time.

[0134] The sub-warehouse database creation module 702 is used to create a sub-warehouse database based on the comprehensive inventory record in the total warehouse database of the target resource when the request quantity parameter exceeds the request processing threshold. The request processing threshold is the sum of the maximum number of requests that the existing sub-warehouse database can process per unit time. The comprehensive inventory record is used to record the total inventory in the total warehouse database, and the sub-warehouse database is used to store a portion of the inventory in the comprehensive inventory record.

[0135] The sub-warehouse inventory record update module 703 is used to update the sub-warehouse inventory records in the sub-warehouse database based on the received resource transfer request.

[0136] In this embodiment, if the number of resource transfer requests for the target resource per unit time exceeds the sum of the maximum number of requests that the existing sub-warehouse databases can handle (i.e., the processing capacity of the existing sub-warehouse databases cannot cope with the large number of received resource transfer requests), a sub-warehouse database is created based on the comprehensive inventory record in the target resource's main warehouse database. A portion of the inventory in the comprehensive inventory record is transferred to the sub-warehouse database for storage. Then, based on the resource transfer requests corresponding to each sub-warehouse database, the sub-warehouse inventory record in the sub-warehouse database is updated, thereby distributing the pressure of handling resource transfer requests across multiple sub-warehouse databases. This technical solution, as the number of requests continuously increases, can flexibly create sub-warehouse databases to achieve parallel expansion. The expanded multiple sub-warehouse databases can handle a large number of resource transfer requests, thus supporting real-time transactions for a large number of users, reducing failures caused by the mismatch between the number of corresponding resource transfer requests and processing capacity of the sub-warehouse databases, and improving database stability.

[0137] In one alternative implementation, the partitioned database creation module 702 includes:

[0138] The comprehensive inventory record update unit is used to update the comprehensive inventory record by deducting the warehouse inventory value from the inventory data in the comprehensive inventory record in response to the request quantity parameter being greater than the request processing threshold.

[0139] The warehouse inventory record generation unit is used to generate warehouse inventory records based on warehouse inventory values ​​and price data in the comprehensive inventory record. The price data in the comprehensive inventory record is the latest unit price of the target resource.

[0140] The partitioned database creation unit is used to store partitioned storage records in the partitioned database.

[0141] In another alternative implementation, the warehouse-based inventory record generation unit is used for:

[0142] Use the warehouse inventory value as the inventory data in the warehouse inventory record;

[0143] Use the price data in the overall inventory record as the price data in the sub-warehouse inventory record.

[0144] In another alternative implementation, the sub-warehouse inventory record generation unit is also used to use the price version identifier in the comprehensive inventory record as the price version identifier in the sub-warehouse inventory record, and the price version identifier in the comprehensive inventory record is used to identify the latest unit price of the target resource.

[0145] In another alternative implementation, the warehouse inventory record update module 703 includes any of the following:

[0146] The inventory data deduction unit is used to respond to a resource transfer request that indicates the target resource for obtaining the first value, and to deduct the first value from the inventory data in the sub-warehouse inventory record to update the sub-warehouse inventory record.

[0147] The inventory data increment unit is used to respond to a resource transfer request that indicates the target resource to be transferred out with a second value, and to increment the inventory data in the sub-warehouse inventory record by a second value to update the sub-warehouse inventory record.

[0148] In another alternative implementation, the inventory data deduction unit is used for:

[0149] In response to a resource transfer request indicating the target resource for obtaining the first value, and if the inventory data in the sub-warehouse inventory record is insufficient to deduct the first value, the inventory data in the sub-warehouse inventory record is increased by a supplementary inventory value based on the comprehensive inventory record in the main warehouse database to update the sub-warehouse inventory record.

[0150] The first value is subtracted from the inventory data in the updated sub-warehouse inventory record to update the sub-warehouse inventory record.

[0151] In another alternative implementation, the device further includes:

[0152] The warehouse database failure module is used to disable the warehouse database in response to inconsistencies between the price data in the warehouse inventory records and the price data in the overall inventory records.

[0153] The warehouse database creation module 702 is also used to create new warehouse databases based on comprehensive inventory records;

[0154] The sub-warehouse inventory record update module 703 is also used to update the sub-warehouse inventory records in the new sub-warehouse database based on the received resource transfer request.

[0155] In another alternative implementation, the device further includes:

[0156] The data acquisition module is used to obtain the inventory data and price data of the new batch of the target resource from the unintegrated batch inventory records in the central warehouse database.

[0157] The price data integration module is used to determine the price data after integrating the new batch based on the inventory data of the new batch, the price data of the new batch, the inventory data in the comprehensive inventory record, and the price data in the comprehensive inventory record.

[0158] The integrated inventory record update module is used to use the price data after integrating the new batches as the price data in the integrated inventory record, and to use the sum of the inventory data of the new batches and the inventory data in the integrated inventory record as the inventory data in the integrated inventory record, so as to update the integrated inventory record.

[0159] In another alternative implementation, the price data integration module is used for:

[0160] The price data of the newly added batch is weighted by using the inventory data of the newly added batch as the weight, and the inventory data in the comprehensive inventory record is weighted by using the inventory data in the comprehensive inventory record as the weight. A weighted average is then applied to the price data of the newly added batch and the price data in the comprehensive inventory record to obtain the price data after integrating the newly added batch.

[0161] In another alternative implementation, the device further includes:

[0162] The first batch inventory record determination module is used to determine the inventory records in the temporary storage database as unintegrated batch inventory records when the total amount of temporary inventory stored in the temporary storage database of the target resource exceeds the temporary storage threshold. The temporary storage database is used to record the new inventory of the target resource.

[0163] In another alternative implementation, the device further includes:

[0164] The second batch inventory record determination module is used to determine the unintegrated batch inventory record in the temporary storage database of the target resource when the inventory data in the comprehensive inventory record is less than the total warehouse inventory threshold.

[0165] In another alternative implementation, the temporary inventory record is the warehouse inventory record in the invalid warehouse database; or, the temporary inventory record is generated from the inventory data and price data of the newly entered target resource.

[0166] It should be noted that the resource processing device provided in the above embodiments is only illustrated by the division of the above functional modules when performing resource processing. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the server can be divided into different functional modules to complete all or part of the functions described above. In addition, the resource processing device and the resource processing method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0167] Figure 8 This is a block diagram of a server provided in an embodiment of this application. The server 800 can vary significantly due to different configurations or performance. It may include one or more Central Processing Units (CPUs) 801 and one or more memories 802. The memory 802 stores at least one line of program code, which is loaded and executed by the processor 801 to implement the resource processing methods provided in the above-described method embodiments. Of course, the server may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server may also include other components for implementing device functions, which will not be elaborated here.

[0168] In an exemplary embodiment, a computer-readable storage medium is also provided, which stores at least one line of program code that can be executed by a processor in a server to perform the resource processing method in the above embodiments. For example, the computer-readable storage medium may be ROM (Read-Only Memory), RAM (Random Access Memory), CD-ROM (Compact Disc Read-Only Memory), magnetic tape, floppy disk, and optical data storage device, etc.

[0169] This application also provides a computer program product or computer program that includes computer program code stored in a computer-readable storage medium. The server's processor reads the computer program code from the computer-readable storage medium and executes the computer program code, causing the server to perform the resource processing methods in the above-described method embodiments.

[0170] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0171] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A resource processing method, characterized in that, The method includes: The system retrieves the inventory data and price data of the new batch of the target resource from the unintegrated batch inventory records in the central warehouse database; based on the inventory data, the price data, the inventory data and price data in the comprehensive inventory record, it determines the price data after integrating the new batch; it uses the price data after integrating the new batch as the price data in the comprehensive inventory record, and it uses the sum of the inventory data of the new batch and the inventory data in the comprehensive inventory record as the inventory data in the comprehensive inventory record to update the comprehensive inventory record; the unintegrated batch inventory records include the warehouse inventory records in the invalid sub-warehouse database and the inventory records generated by the newly entered inventory data and price data of the target resource; Obtain the request quantity parameter of the target resource, which represents the number of resource transfer requests received per unit time. In response to the request quantity parameter exceeding the request processing threshold, the inventory data of the comprehensive inventory record in the main warehouse database is reduced by the sub-warehouse inventory value to update the comprehensive inventory record. The request processing threshold is the sum of the maximum number of requests that the existing sub-warehouse databases can process per unit time. The comprehensive inventory record is used to record the total inventory of the target resource in the main warehouse database. The sum of the inventory data in the sub-warehouse inventory records in the existing sub-warehouse databases and the inventory data in the comprehensive inventory record is the total amount of the target resource currently on sale. Based on the sub-warehouse inventory value and the price data in the comprehensive inventory record, a sub-warehouse inventory record is generated, wherein the price data in the comprehensive inventory record is the latest unit price of the target resource; a sub-warehouse database is created based on the sub-warehouse inventory record, and the sub-warehouse inventory record is stored in the sub-warehouse database, which is used to store a portion of the inventory in the comprehensive inventory record; the main warehouse database is used for inventory management, and the sub-warehouse database is used to respond to resource transfer requests. Based on the received resource transfer request, update the sub-warehouse inventory records in the sub-warehouse database.

2. The method according to claim 1, characterized in that, The process of generating warehouse inventory records based on the warehouse inventory value and the price data in the overall inventory record includes: The sub-warehouse inventory value is used as the inventory data in the sub-warehouse inventory record; The price data in the comprehensive inventory record is used as the price data in the sub-warehouse inventory record.

3. The method according to claim 2, characterized in that, The method further includes: The price version identifier in the comprehensive inventory record is used as the price version identifier in the sub-warehouse inventory record. The price version identifier in the comprehensive inventory record is used to identify the latest unit price of the target resource.

4. The method according to claim 1, characterized in that, The step of updating the sub-warehouse inventory records in the sub-warehouse database based on the received resource transfer request includes any of the following: In response to the resource transfer request indicating the target resource for obtaining the first value, the first value is deducted from the inventory data in the sub-warehouse inventory record to update the sub-warehouse inventory record; In response to the resource transfer request indicating the target resource to be transferred out by the second value, the inventory data in the sub-warehouse inventory record is increased by the second value to update the sub-warehouse inventory record.

5. The method according to claim 4, characterized in that, The step of responding to the resource transfer request for indicating the target resource for obtaining the first value by deducting the first value from the inventory data in the sub-warehouse inventory record to update the sub-warehouse inventory record includes: In response to the resource transfer request indicating the target resource to obtain the first value, and the inventory data in the sub-warehouse inventory record is insufficient to deduct the first value, based on the comprehensive inventory record in the main warehouse database, the inventory data in the sub-warehouse inventory record is increased by a supplementary inventory value to update the sub-warehouse inventory record. The first value is subtracted from the inventory data in the updated sub-warehouse inventory record to update the sub-warehouse inventory record.

6. The method according to claim 1, characterized in that, After creating a sub-warehouse database based on the sub-warehouse storage records and storing the sub-warehouse storage records in the sub-warehouse database, the method further includes: In response to the inconsistency between the price data in the sub-warehouse inventory record and the price data in the overall inventory record, the sub-warehouse database is set to invalid. Based on the comprehensive inventory records, create a new warehouse database; Based on the received resource transfer request, update the warehouse storage records in the new warehouse database.

7. The method according to claim 1, characterized in that, The step of determining the integrated price data for the new batch based on the inventory data, the price data, the inventory data in the comprehensive inventory record, and the price data includes: The price data of the newly added batch is used as the weight of the price data of the newly added batch, and the inventory data in the comprehensive inventory record is used as the weight of the price data in the comprehensive inventory record. A weighted average is then performed on the price data of the newly added batch and the price data in the comprehensive inventory record to obtain the price data after integrating the newly added batch.

8. The method according to claim 1, characterized in that, Before retrieving the inventory data and price data of the new batch of the target resource from the unintegrated batch inventory records in the central warehouse database, the method further includes: In response to the total amount of temporary inventory stored in the temporary storage database of the target resource exceeding the temporary storage threshold, the temporary inventory records in the temporary storage database are treated as unintegrated batch inventory records. The temporary storage database is used to record the new inventory of the target resource.

9. The method according to claim 1, characterized in that, Before retrieving the inventory data and price data of the new batch of the target resource from the unintegrated batch inventory records in the central warehouse database, the method further includes: In response to the inventory data in the comprehensive inventory record being less than the total warehouse inventory threshold, the temporary inventory record in the temporary storage database of the target resource is treated as an unintegrated batch inventory record.

10. The method according to claim 8 or 9, characterized in that, The temporary inventory record is a warehouse inventory record in an expired warehouse database; or, the temporary inventory record is generated from the newly entered inventory data and price data of the target resource.

11. A resource processing device, characterized in that, The device includes: The data acquisition module is used to obtain the inventory data and price data of the new batch of the target resource from the unintegrated batch inventory records in the central warehouse database. The price data integration module is used to determine the price data after integrating the new batch based on the inventory data, the price data, the inventory data in the comprehensive inventory record, and the price data. The integrated inventory record update module is used to integrate the price data of the newly added batches as the price data in the integrated inventory record, and to use the sum of the inventory data of the newly added batches and the inventory data in the integrated inventory record as the inventory data in the integrated inventory record, so as to update the integrated inventory record; the unintegrated batch inventory records include the warehouse inventory records in the invalid warehouse database and the inventory records generated by the newly entered inventory data and price data of the target resource; The parameter acquisition module is used to acquire the request quantity parameter of the target resource, which represents the number of resource transfer requests received per unit time. The comprehensive inventory record update unit is used to respond to the request quantity parameter being greater than the request processing threshold by deducting the sub-warehouse inventory value from the inventory data of the comprehensive inventory record in the total warehouse database to update the comprehensive inventory record. The request processing threshold is the sum of the maximum number of requests that the existing sub-warehouse databases can process per unit time. The comprehensive inventory record is used to record the total inventory of the target resource in the total warehouse database. The sum of the inventory data in the sub-warehouse inventory records in the existing sub-warehouse databases and the inventory data in the comprehensive inventory record is the total amount of the target resource currently on sale. The warehouse inventory record generation unit is used to generate warehouse inventory records based on the warehouse inventory value and the price data in the comprehensive inventory record, wherein the price data in the comprehensive inventory record is the latest unit price of the target resource. The warehouse sub-database creation unit is used to create a warehouse sub-database based on the warehouse sub-database records, and to store the warehouse sub-database records in the warehouse sub-database. The warehouse sub-database is used to store a portion of the inventory in the comprehensive inventory records. The main warehouse database is used for inventory management, and the warehouse sub-database is used to respond to resource transfer requests. The sub-warehouse inventory record update module is used to update the sub-warehouse inventory records in the sub-warehouse database based on the received resource transfer request.

12. The apparatus according to claim 11, characterized in that, The sub-warehouse inventory record generation unit is used for: The sub-warehouse inventory value is used as the inventory data in the sub-warehouse inventory record; The price data in the comprehensive inventory record is used as the price data in the sub-warehouse inventory record.

13. The apparatus according to claim 12, characterized in that, The sub-warehouse inventory record generation unit is further configured to use the price version identifier in the comprehensive inventory record as the price version identifier in the sub-warehouse inventory record, wherein the price version identifier in the comprehensive inventory record is used to identify the latest unit price of the target resource.

14. The apparatus according to claim 11, characterized in that, The sub-warehouse inventory record update module includes any one of the following: An inventory data deduction unit is used to respond to the resource transfer request for indicating the target resource to obtain the first value, and to deduct the first value from the inventory data in the sub-warehouse inventory record to update the sub-warehouse inventory record. The inventory data increment unit is used to, in response to the resource transfer request indicating the target resource to be transferred out, increment the inventory data in the sub-warehouse inventory record by the second value to update the sub-warehouse inventory record.

15. The apparatus according to claim 14, characterized in that, The inventory data deduction unit is used for: In response to the resource transfer request indicating the target resource to obtain the first value, and the inventory data in the sub-warehouse inventory record is insufficient to deduct the first value, based on the comprehensive inventory record in the main warehouse database, the inventory data in the sub-warehouse inventory record is increased by a supplementary inventory value to update the sub-warehouse inventory record. The first value is subtracted from the inventory data in the updated sub-warehouse inventory record to update the sub-warehouse inventory record.

16. The apparatus according to claim 11, characterized in that, The device further includes: The warehouse database failure module is used to disable the warehouse database in response to a discrepancy between the price data in the warehouse inventory record and the price data in the comprehensive inventory record. The sub-warehouse database creation unit is also used to create a new sub-warehouse database based on the comprehensive inventory record; The sub-warehouse inventory record update module is also used to update the sub-warehouse inventory records in the new sub-warehouse database based on the received resource transfer request.

17. The apparatus according to claim 11, characterized in that, The price data integration module is used for: The price data of the newly added batch is used as the weight of the price data of the newly added batch, and the inventory data in the comprehensive inventory record is used as the weight of the price data in the comprehensive inventory record. A weighted average is then performed on the price data of the newly added batch and the price data in the comprehensive inventory record to obtain the price data after integrating the newly added batch.

18. The apparatus according to claim 11, characterized in that, The device further includes: The first batch inventory record determination module is used to determine the temporary inventory records in the temporary storage database as unintegrated batch inventory records in response to the total amount of temporary inventory stored in the temporary storage database of the target resource being greater than the temporary storage threshold. The temporary storage database is used to record the new inventory of the target resource.

19. The apparatus according to claim 11, characterized in that, The device further includes: The second batch inventory record determination module is used to determine the unintegrated batch inventory record in the temporary storage database of the target resource as an unintegrated batch inventory record in response to the inventory data in the comprehensive inventory record being less than the total warehouse inventory threshold.

20. The apparatus according to claim 18 or 19, characterized in that, The temporary inventory record is a warehouse inventory record in an expired warehouse database; or, the temporary inventory record is generated from the newly entered inventory data and price data of the target resource.

21. A server, characterized in that, The server includes a processor and a memory, the memory storing at least one line of program code, which is loaded and executed by the processor to implement the resource processing method as described in any one of claims 1-10.

22. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one piece of program code, which is loaded and executed by a processor to implement the resource processing method as described in any one of claims 1-10.

Citation Information

Patent Citations

  • Order processing system of high concurrency competitive inventory and processing method thereof

    CN103426072A

  • Information processing method and device, server and storage medium

    CN110196769A