Data processing method and device, equipment, storage medium and product

By adding inventory and refreshing the local cache in response to target orders in the distributed system, the problem that the local cache of the distributed application system cannot be refreshed in time is solved, and the inventory information is quickly updated and consistent, and the user's shopping experience is improved.

CN119784473AActive Publication Date: 2025-04-08INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202411909796.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-04-08
Estimated Expiration
2044-12-24

AI Technical Summary

Technical Problem

During business promotion activities, the local cache of distributed application systems cannot be refreshed in time, resulting in inconsistent cache data with database data, affecting business development.

Method used

By adding inventory in response to the target order, the target inventory information is stored in a container of the distributed system and written to the cache database based on an asynchronous processing algorithm. If the write fails, determine the write failure timestamp and refresh the local cache configured by the container based on the timestamp and the target inventory information to ensure that the inventory information of the container and local cache is consistent.

Benefits of technology

It realizes that when the cache database write fails, it quickly responds to additional inventory requests, and ensures rapid update and consistency of inventory information, improving user shopping experience, especially in high concurrency limited-time rush-up scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119784473A_ABST
    Figure CN119784473A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method and device, equipment, a storage medium and a product, which can be applied to the fields of big data and financial science and technology. The method comprises the following steps: in response to additional inventory for a target order, storing target inventory information in a container of a distributed system; writing the target inventory information in the container into a cache database based on an asynchronous processing algorithm to obtain a writing result; determining a write-in failure timestamp under the condition that the write-in result represents write-in failure; and a local cache configured by the container is refreshed based on the write-in failure timestamp and the target inventory information, so that the inventory information of the container and the inventory information of the local cache are consistent, and the default mode of obtaining the inventory information by the local cache is obtaining the inventory information from the cache database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the fields of big data and financial technology, and specifically to a data processing method, device, equipment, storage medium and product. Background Art

[0002] With the development of the Internet, many products launch various business promotion activities every day, such as limited-time flash sales, discount sales, and seat purchase activities to promote user activity and develop new users. In the process of realizing the concept of the present disclosure, the inventors found that there are at least the following problems in the relevant technology. When adding inventory to business promotion activities, since the local cache of the distributed application system cannot be refreshed in time, it is easy to cause the risk of inconsistency between the cache data and the database data, thereby causing a certain impact on business development. Summary of the invention

[0003] In view of the above problems, the present disclosure provides a data processing method, apparatus, device, storage medium and product.

[0004] According to a first aspect of the present disclosure, a data processing method is provided, including: in response to adding inventory to a target order, storing target inventory information in a container of a distributed system; writing the target inventory information in the container into a cache database based on an asynchronous processing algorithm to obtain a write result; when the write result indicates a write failure, determining a write failure timestamp; refreshing a local cache configured for the container based on the write failure timestamp and the target inventory information so that the inventory information of the container and the local cache are consistent, and the default method for the local cache to obtain the inventory information is to obtain the inventory information from the cache database.

[0005] According to an embodiment of the present disclosure, refreshing the local cache configured for the container based on the write failure timestamp and the target inventory information so that the inventory information of the container and the local cache are consistent includes:

[0006] The error time identifier in the order metadata is updated based on the write failure timestamp to obtain an update result, wherein the order metadata includes a target order identifier and an error time identifier; when the update result indicates that the update is successful, the local cache configured for the container is refreshed based on the target inventory information to make the inventory information of the container and the local cache consistent.

[0007] According to an embodiment of the present disclosure, the data processing method further includes:

[0008] Before responding to adding inventory to the target order, the inventory identifier of the container without inventory is a first identifier, wherein the first identifier represents that the inventory is zero; when the local cache is successfully refreshed, the first identifier is changed to a second identifier, wherein the second identifier represents that there is inventory.

[0009] According to an embodiment of the present disclosure, in response to adding inventory to a target order, storing target inventory information in a container of a distributed system includes:

[0010] In response to adding inventory to a target order, additional inventory information is obtained; target inventory information is obtained according to the container quantity and the inventory information; and the target inventory information is stored in a container of the distributed system.

[0011] According to an embodiment of the present disclosure, target inventory information is obtained according to the container quantity and inventory information, including:

[0012] Determine the remaining inventory of each of the multiple containers; when the remaining inventory is less than the inventory threshold, determine the container as a target container; divide the inventory quantity in the inventory information by the container quantity of the target container to obtain the target inventory information.

[0013] According to an embodiment of the present disclosure, the data processing method further includes:

[0014] When the writing result indicates that the writing is successful, the local cache is updated periodically based on the inventory information in the cache database.

[0015] According to an embodiment of the present disclosure, the inventory information includes:

[0016] Order ID, inventory quantity, inventory cost, inventory location.

[0017] A second aspect of the present disclosure provides a data processing device, including: a storage module, for storing target inventory information in a container of a distributed system in response to adding inventory to a target order; a write result obtaining module, for writing the target inventory information in the container into a cache database based on an asynchronous processing algorithm to obtain a write result; a write failure timestamp determination module, for determining a write failure timestamp when the write result indicates a write failure; and a refresh module, for refreshing a local cache configured for the container based on the write failure timestamp and the target inventory information, so that the inventory information of the container and the local cache are consistent, and the default method for the local cache to obtain the inventory information is to obtain the inventory information from the cache database.

[0018] A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.

[0019] The fourth aspect of the present disclosure further provides a computer-readable storage medium having a computer program or instructions stored thereon, which implements the steps of the above method when the above computer program or instructions are executed by a processor.

[0020] The fifth aspect of the present disclosure further provides a computer program product, including a computer program or instructions, which implement the steps of the above method when the above computer program or instructions are executed by a processor.

[0021] According to an embodiment of the present disclosure, by responding to additional inventory for a target order, the target inventory information is stored in a container of a distributed system; the target inventory information in the container can be written to a cache database based on an asynchronous processing algorithm to obtain a write result; in the case where the write result represents a write failure, the write failure timestamp can be determined; the local cache configured for the container is refreshed based on the write failure timestamp and the target inventory information to make the inventory information of the container and the local cache consistent, and the default way for the local cache to obtain the inventory information is to obtain the inventory information from the cache database. Since the system can quickly respond to additional inventory requests and can actively refresh the local cache based on the write failure timestamp and the target inventory information when the cache database write fails, there is no need to wait for the local cache to be refreshed periodically, which helps to improve the user's shopping experience, especially in high-concurrency limited-time purchase scenarios, can ensure the rapid update and consistency of inventory information, and can better support large-scale user access and order processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0023] Figure 1 The application scenario diagram of the data processing method according to the embodiment of the present disclosure is schematically shown;

[0024] Figure 2 A flowchart schematically shows a data processing method according to an embodiment of the present disclosure;

[0025] Figure 3 A flowchart of a method for obtaining target inventory information according to an embodiment of the present disclosure is schematically shown;

[0026] Figure 4 The structure block diagram of the data processing device according to the embodiment of the present disclosure is schematically shown;

[0027] Figure 5 A block diagram of an electronic device suitable for implementing a data processing method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0028] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0029] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0030] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0031] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0032] With the development of the Internet, many products launch various business promotion activities every day, such as limited-time flash sales, discount sales, and seat purchase activities to promote user activity and develop new users. In the process of realizing the concept of the present disclosure, the inventors found that there are at least the following problems in the relevant technology. When adding inventory to business promotion activities, the local cache of the distributed application system cannot be refreshed in time, which easily causes the risk of inconsistency between the cache data and the database data, thereby causing a certain impact on business development.

[0033] In view of this, the present disclosure provides a data processing method, a data processing device, a device, a storage medium and a product. The method includes: in response to adding inventory to a target order, storing the target inventory information in a container of a distributed system; writing the target inventory information in the container to a cache database based on an asynchronous processing algorithm to obtain a write result; in the case where the write result indicates a write failure, determining a write failure timestamp; refreshing the local cache configured for the container based on the write failure timestamp and the target inventory information so that the inventory information of the container and the local cache are consistent, and the default way for the local cache to obtain the inventory information is to obtain the inventory information from the cache database.

[0034] It should be noted that the data processing method and data processing device provided by the present disclosure can be used in the field of financial technology, such as banks and other financial institutions, and can also be used in any field other than the field of financial technology, such as the field of big data. Therefore, the application field of the data processing method and data processing device provided by the present disclosure is not limited.

[0035] In the technical solution of the present disclosure, the user information (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0036] In the scenario of using personal information for automated decision-making, the methods, devices, and systems provided by the embodiments of the present disclosure provide users with corresponding operation portals for users to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered. The expression "automated decision-making" here refers to the activity of automatically analyzing and evaluating a person's behavioral habits, interests and hobbies, or economic, health, credit status, etc. through computer programs, and making decisions. The expression "expert decision-making" here refers to the activity of making decisions by people who specialize in a certain field, have specialized experience, knowledge and skills, and have reached a certain level of professionalism.

[0037] Figure 1 The application scenario diagram of the data processing method according to the embodiment of the present disclosure is schematically shown.

[0038] like Figure 1As shown, the application scenario 100 according to this embodiment may include a scenario of recommending bank financial products. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0039] The user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).

[0040] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0041] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.

[0042] It should be noted that the data processing method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the data processing device provided in the embodiment of the present disclosure can generally be set in the server 105. The data processing method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the data processing device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.

[0043] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0044] Figure 2 The flowchart of the data processing method according to the embodiment of the present disclosure is schematically shown.

[0045] like Figure 2 As shown, the data processing method of this embodiment includes operations S210 to S240, and the data processing method can be executed by an electronic device.

[0046] In operation S210 , in response to adding inventory to a target order, target inventory information is stored in a container of a distributed system.

[0047] In operation S220, the target inventory information in the container is written into the cache database based on the asynchronous processing algorithm to obtain a writing result.

[0048] In operation S230 , in the case where the write result indicates a write failure, a write failure timestamp is determined.

[0049] In operation S240 , the local cache configured for the container is refreshed based on the write failure timestamp and the target inventory information, so that the inventory information of the container and the local cache are consistent.

[0050] According to an embodiment of the present disclosure, a target order may refer to goods in a limited-time rush sale, such as electronic products, household appliances, or clothing, but is not limited thereto. The embodiment of the present disclosure does not limit the target order. The target inventory information may represent inventory information corresponding to the target order, such as inventory quantity, inventory number, batch number, etc., but is not limited thereto. The embodiment of the present disclosure does not limit the target inventory information. In response to adding inventory to the target order, the target inventory information may be stored in a container of the distributed system.

[0051] According to the embodiments of the present disclosure, the asynchronous processing algorithm can send order information to the cache database, and the next order information can be generated without waiting for the response of the database. The asynchronous processing algorithm can include Kafka, message queues, etc., but is not limited to this, and the embodiments of the present disclosure do not limit this. The target inventory information in the container can be written into the cache database based on the asynchronous processing algorithm, thereby obtaining a write result.

[0052] According to an embodiment of the present disclosure, when the write result indicates that the target inventory information fails to be written into the cache database, the write failure timestamp corresponding to the failure to write into the cache database can be determined. At the moment corresponding to the write failure timestamp, the local cache configured for the container can be refreshed based on the target inventory information to make the inventory of the container and the local cache consistent, thereby avoiding the problem of order failure caused by the failure or untimely refresh of the local cache when there is inventory in the container, and ensuring the consistency and correctness of the container cache in the distributed system additional inventory business scenario.

[0053] According to the embodiments of the present disclosure, the background scheduled task will periodically read the basic information of the limited-time purchase in the cache database, and update the local cache of each container in the cluster periodically if the timestamp meets the conditions. Generally, the inventory of a certain product is stored in a key-value structure. In order to avoid a large number of requests being concentrated on the same server, we will split the product inventory into multiple containers to disperse the traffic to different servers. For example, 10w stocks are divided into 5 parts, each with 2w stocks. The corresponding data structures are container 1-2w, container 2-2w, container 3-2w, container 4-2w, and container 5-2w. The inventory information of each container will be updated to the local cache through the above-mentioned scheduled tasks. By dividing a large amount of inventory information into multiple containers, the traffic is dispersed, which improves database performance and user experience.

[0054] According to an embodiment of the present disclosure, by responding to additional inventory for a target order, the target inventory information is stored in a container of a distributed system; the target inventory information in the container can be written to a cache database based on an asynchronous processing algorithm to obtain a write result; in the case where the write result represents a write failure, the write failure timestamp can be determined; the local cache configured for the container is refreshed based on the write failure timestamp and the target inventory information to make the inventory information of the container and the local cache consistent, and the default way for the local cache to obtain the inventory information is to obtain the inventory information from the cache database. Since the system can quickly respond to additional inventory requests and can actively refresh the local cache based on the write failure timestamp and the target inventory information when the cache database write fails, there is no need to wait for the local cache to be refreshed periodically, which helps to improve the user's shopping experience, especially in high-concurrency limited-time purchase scenarios, can ensure the rapid update and consistency of inventory information, and can better support large-scale user access and order processing.

[0055] According to an embodiment of the present disclosure, a local cache configured for a container is refreshed based on a write failure timestamp and target inventory information to make the inventory information of the container consistent with that of the local cache, including: updating an error time identifier in order metadata based on the write failure timestamp to obtain an update result, wherein the order metadata includes a target order identifier and an error time identifier; when the update result indicates that the update is successful, refreshing the local cache configured for the container based on the target inventory information to make the inventory information of the container consistent with that of the local cache.

[0056] According to an embodiment of the present disclosure, the order metadata may include the target order identifier and error time identifier corresponding to the current activity, but does not include the start time, end time, and inventory of the limited-time sale activity. The reason is that in the scenario of adding inventory, the modification of the start time and end time is not involved, while the inventory and other information are obtained and modified on the container. The target order identifier uniquely identifies the limited-time sale activity currently in progress, and adding is to increase the inventory of the activity. The error time identifier is a field stored in the order metadata, which is used by the background scheduled task to scan the limited-time sale activities within the time window and store them in the local cache of each container. The cached information can include order metadata and an identifier of whether there is inventory, so that the local cache can be directly obtained instead of accessing the container or database during the limited-time sale, thereby reducing the interface response time.

[0057] The data structure of order metadata can be err={"proid":"s1","time":"1714"}. Among them, err is in hashmap format, the proid field represents the activity id, which is used to uniquely identify the limited-time flash sale activity; the time field represents the write failure timestamp of the current system time, that is, the number of milliseconds from 0:00 on January 1, 1970, Coordinated Universal Time to the present, which is used to distinguish whether the err value has changed.

[0058] According to an embodiment of the present disclosure, the error time identifier in the order metadata can be updated based on the write failure timestamp to obtain an updated result. Specifically, in the case where the cache database write result indicates a write failure, the program will go to the exception handling branch to update the value of err. Regardless of whether the proid is consistent with the last time the exception occurred, time will be updated to the latest time. At this time, all distributed containers will listen to the change of err, and actively refresh the local cache instead of waiting for the scheduled task to refresh. The result of refreshing the local cache is that the storage identifier of all containers, that is, whether there is inventory, is updated to true in each container, so that the situation of being unable to buy due to database write exceptions for adding inventory will not occur.

[0059] According to an embodiment of the present disclosure, when the update result indicates that the update is successful, the local cache configured for the container may be refreshed based on the target inventory information so that the inventory information of the container and the local cache are consistent.

[0060] According to the embodiments of the present disclosure, since the distributed system consists of multiple containers forming a cluster, each container has its own local cache. Updating the error time identifier of the cache through unified order metadata can also avoid the situation where some containers can be sold out instantly while others cannot, thereby avoiding inconsistency in cache data.

[0061] According to an embodiment of the present disclosure, the data processing method also includes: before responding to adding inventory to a target order, the inventory identifier of a container without inventory is a first identifier, wherein the first identifier represents that the inventory is zero; when the local cache is successfully refreshed, the first identifier is changed to a second identifier, wherein the second identifier represents that there is inventory.

[0062] According to an embodiment of the present disclosure, each container has an identifier for marking whether there is inventory on the container, which is false when the inventory is 0 and true when the inventory is not 0, and the initial value is true. Before responding to the additional inventory for the target order, the inventory identifier of some containers is a first identifier of false, and the first identifier can represent that the inventory is zero. When the local cache is successfully refreshed, the first identifier is changed to a second identifier, and the second identifier can represent that there is inventory. Specifically, after the limited-time rush purchase of goods begins, the rush purchase request will be dispersed to multiple containers. When the inventory of a container is deducted to 0, the inventory identifier of the container will be set to false, and the next rush purchase request will only be evenly distributed to the remaining containers with inventory.

[0063] According to an embodiment of the present disclosure, if the storage of the inventory information of the additional inventory is abnormal, it will cause the local cache to be updated in time. Specifically, if the storage identification of some containers is false before the addition, the inventory information of the database should be updated by the scheduled task after the addition, and the storage identification of these containers should be updated to true. However, since the database write result indicates a write failure, the storage identification of these containers is false, resulting in that even if the inventory is added, the newly added inventory of these containers will not be snapped up normally. In addition, since multiple containers have their own local caches, an abnormality in writing to the database on a certain container will cause inconsistencies in the local caches of each container.

[0064] According to the embodiments of the present disclosure, by using identification to simplify the representation of inventory status, inventory management becomes more intuitive and easier, and management complexity is reduced.

[0065] According to an embodiment of the present disclosure, in response to adding inventory to a target order, the target inventory information is stored in a container of a distributed system, including: in response to adding inventory to a target order, obtaining additional inventory information; obtaining target inventory information based on the container quantity and inventory information; and storing the target inventory information in a container of a distributed system.

[0066] According to an embodiment of the present disclosure, additional inventory information can be obtained by responding to a request for additional inventory of a target order, and the inventory information can include the additional inventory quantity. The target inventory information can be obtained according to the container quantity and the inventory quantity, and the obtained target inventory information is stored in a container of the distributed system.

[0067] According to the embodiments of the present disclosure, target inventory information can be obtained based on the number of containers and the additional inventory information, and the target inventory information can be stored on the container, which can flexibly respond to changes in market demand, replenish inventory in a timely manner, improve customer satisfaction, and optimize inventory costs and operational efficiency.

[0068] Figure 3 The flowchart of the method for obtaining target inventory information according to an embodiment of the present disclosure is schematically shown.

[0069] like Figure 3 As shown, the target inventory information obtaining method of this embodiment includes operations S310 to S330, and the data processing method can be executed by an electronic device.

[0070] In operation S310, remaining inventory amounts on respective ones of the plurality of containers are determined.

[0071] In operation S320, when the remaining inventory amount is less than the inventory threshold, the container is determined as a target container.

[0072] In operation S330, the inventory quantity in the inventory information is divided by the container quantity of the target container to obtain the target inventory information.

[0073] According to an embodiment of the present disclosure, the remaining inventory can represent the remaining inventory of the target order in a limited-time rush sale. The remaining inventory of each of the multiple containers can be determined. When the remaining inventory is less than the inventory threshold, the container can be determined as the target container, and the inventory quantity in the inventory information can be divided by the container quantity of the target container to obtain the target inventory information. For example, there are 5 containers in total, and the remaining inventory is 20, 60, 80, 5, and 15 respectively. The inventory threshold is 50, so it can be known that the container with a remaining inventory less than 50 can be determined as the target container, and there are 3 target containers. The inventory in the inventory information is 150. According to the inventory in the inventory information and the target container quantity, it can be obtained that the additional inventory in the target container is 50.

[0074] According to an embodiment of the present disclosure, by allocating inventory to containers with less remaining inventory, uniform distribution and load balancing of inventory information in the containers can be ensured.

[0075] According to an embodiment of the present disclosure, the data processing method further includes: when the writing result indicates that the writing is successful, regularly updating the local cache based on the inventory information in the cache database.

[0076] According to an embodiment of the present disclosure, when the writing result indicates that the target inventory information is successfully written into the cache database, the inventory information can be obtained from the cache database based on the default method of obtaining inventory information from the local cache, and the local cache can be updated regularly.

[0077] According to an embodiment of the present disclosure, the inventory information includes: order identification, inventory quantity, inventory cost, and inventory location.

[0078] According to an embodiment of the present disclosure, inventory information may include order identification, inventory quantity, inventory cost, and inventory location. The order identification may represent a unique identifier for each order, and may include an order number, an order date, and the like. The inventory quantity may represent the actual quantity of the target order in the current inventory, including the quantity in stock, the quantity booked, and the like. The inventory cost may represent the purchase cost or production cost of the commodity, and may include the cost of raw materials, the manufacturing cost, the transportation cost, and the like. The inventory location may represent the specific storage location of the commodity in the warehouse, and may include a shelf number, an area number, and the like.

[0079] Figure 4 The structure block diagram of a data processing device according to an embodiment of the present disclosure is schematically shown.

[0080] like Figure 4 As shown, the data processing device 400 of this embodiment includes a storage module 410 , a write result obtaining module 420 , a write failure timestamp determining module 430 , and a refresh module 440 .

[0081] The storage module 410 is configured to store target inventory information in a container of the distributed system in response to adding inventory to a target order.

[0082] The writing result obtaining module 420 is used to write the target inventory information in the container into the cache database based on the asynchronous processing algorithm to obtain the writing result.

[0083] The write failure timestamp determination module 430 is used to determine the write failure timestamp when the write result indicates a write failure.

[0084] The refresh module 440 is used to refresh the local cache configured by the container based on the write failure timestamp and the target inventory information to make the inventory information of the container consistent with that of the local cache. The default method for the local cache to obtain the inventory information is to obtain the inventory information from the cache database.

[0085] According to an embodiment of the present disclosure, by responding to additional inventory for a target order, the target inventory information is stored in a container of a distributed system; the target inventory information in the container can be written to a cache database based on an asynchronous processing algorithm to obtain a write result; in the case where the write result represents a write failure, the write failure timestamp can be determined; the local cache configured for the container is refreshed based on the write failure timestamp and the target inventory information to make the inventory information of the container and the local cache consistent, and the default way for the local cache to obtain the inventory information is to obtain the inventory information from the cache database. Since the system can quickly respond to additional inventory requests and can actively refresh the local cache based on the write failure timestamp and the target inventory information when the cache database write fails, there is no need to wait for the local cache to be refreshed periodically, which helps to improve the user's shopping experience, especially in high-concurrency limited-time purchase scenarios, can ensure the rapid update and consistency of inventory information, and can better support large-scale user access and order processing.

[0086] According to an embodiment of the present disclosure, the refresh module includes: an update result obtaining unit and a refresh unit.

[0087] The update result obtaining unit is used to update the error time identifier in the order metadata based on the write failure timestamp to obtain the update result, wherein the order metadata includes the target order identifier and the error time identifier.

[0088] The refresh unit is used to refresh the local cache configured for the container based on the target inventory information when the update result indicates that the update is successful, so that the inventory information of the container and the local cache are consistent.

[0089] According to an embodiment of the present disclosure, the data processing device 400 of this embodiment further includes: a first identification module and a second identification module.

[0090] The first identification module is used to identify the inventory of the container without inventory as a first identification before responding to the target order to add inventory, wherein the first identification represents that the inventory is zero.

[0091] The second identification module is used to change the first identification to a second identification when the local cache is successfully refreshed, and the second identification indicates that there is inventory.

[0092] According to an embodiment of the present disclosure, the storage module includes: an acquisition unit, a target inventory information obtaining unit and a storage unit.

[0093] The acquisition unit is used to acquire additional inventory information in response to adding inventory to the target order.

[0094] The target inventory information obtaining unit is used to obtain the target inventory information according to the container quantity and the inventory information.

[0095] The storage unit is used to store the target inventory information in a container of the distributed system.

[0096] According to an embodiment of the present disclosure, the target inventory information obtaining unit includes: a remaining inventory quantity determining subunit, a target container determining subunit and a target inventory information obtaining subunit.

[0097] The remaining inventory quantity determination subunit is used to determine the remaining inventory quantity of each of the plurality of containers.

[0098] The target container determination subunit is used to determine the container as the target container when the remaining inventory is less than the inventory threshold.

[0099] The target inventory information obtaining subunit is used to divide the inventory quantity in the inventory information by the container quantity of the target container to obtain the target inventory information.

[0100] According to an embodiment of the present disclosure, the data processing device 400 of this embodiment further includes: a timing update module.

[0101] The timing update module is used to regularly update the local cache based on the inventory information in the cache database when the writing result indicates that the writing is successful.

[0102] According to an embodiment of the present disclosure, the inventory information includes: order identification, inventory quantity, inventory cost, and inventory location.

[0103] According to an embodiment of the present disclosure, any multiple modules of the storage module 410, the write result obtaining module 420, the write failure timestamp determination module 430, and the refresh module 440 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the storage module 410, the write result obtaining module 420, the write failure timestamp determination module 430, and the refresh module 440 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, at least one of the storage module 410, the write result obtaining module 420, the write failure timestamp determination module 430, and the refresh module 440 may be at least partially implemented as a computer program module, and when the computer program module is executed, the corresponding function may be executed.

[0104] Figure 5 A block diagram of an electronic device suitable for implementing a data processing method according to an embodiment of the present disclosure is schematically shown.

[0105] like Figure 5 As shown, the electronic device 500 according to an embodiment of the present disclosure includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 to a random access memory (RAM) 503. The processor 501 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 501 may also include an onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0106] In RAM 503, various programs and data required for the operation of electronic device 500 are stored. Processor 501, ROM 502 and RAM 503 are connected to each other via bus 504. Processor 501 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 502 and / or RAM 503. It should be noted that the program can also be stored in one or more memories other than ROM 502 and RAM 503. Processor 501 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.

[0107] According to an embodiment of the present disclosure, the electronic device 500 may further include an input / output (I / O) interface 505, which is also connected to the bus 504. The electronic device 500 may further include one or more of the following components connected to the input / output (I / O) interface 505: an input portion 506 including a keyboard, a mouse, etc.; an output portion 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 508 including a hard disk, etc.; and a communication portion 509 including a network interface card such as a LAN card, a modem, etc. The communication portion 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the input / output (I / O) interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage portion 508 as needed.

[0108] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

[0109] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 502 and / or RAM 503 described above and / or one or more memories other than ROM 502 and RAM 503.

[0110] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the data processing method provided by the embodiment of the present disclosure.

[0111] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 501. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0112] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 509, and / or installed from the removable medium 511. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0113] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the processor 501, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.

[0114] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).

[0115] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0116] It will be appreciated by those skilled in the art that the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations or combinations are not explicitly described in the present disclosure. In particular, without departing from the spirit and teachings of the present disclosure, the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.

[0117] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. A data processing method, characterized in that: include: In response to adding inventory to the target order, storing the target inventory information in a container of the distributed system; Writing the target inventory information in the container into a cache database based on an asynchronous processing algorithm to obtain a writing result; In the case where the write result indicates a write failure, determining a write failure timestamp; The local cache configured for the container is refreshed based on the write failure timestamp and the target inventory information to make the inventory information of the container consistent with that of the local cache, and the default way for the local cache to obtain the inventory information is to obtain the inventory information from the cache database.

2. The method according to claim 1, characterized in that: The refreshing of the local cache configured for the container based on the write failure timestamp and the target inventory information so that the inventory information of the container is consistent with that of the local cache includes: Based on the write failure timestamp, the error time identifier in the order metadata is updated to obtain an update result, wherein the order metadata includes a target order identifier and an error time identifier; When the update result indicates that the update is successful, the local cache configured for the container is refreshed based on the target inventory information so that the inventory information of the container is consistent with that of the local cache.

3. The method according to claim 2, characterized in that The method further comprises: Before responding to the target order to add inventory, the inventory identification of the container without inventory is a first identification, wherein the first identification represents that the inventory is zero; When the local cache is successfully refreshed, the first identifier is changed to a second identifier, where the second identifier indicates that there is inventory.

4. The method according to claim 1, characterized in that: In response to adding inventory to the target order, storing the target inventory information in a container of the distributed system includes: In response to adding inventory to the target order, obtaining additional inventory information; Obtaining target inventory information according to the container quantity and the inventory information; The target inventory information is stored in a container of a distributed system.

5. The method according to claim 4, characterized in that The step of obtaining target inventory information according to the container quantity and the inventory information includes: determining the remaining inventory on each of the multiple containers; When the remaining inventory is less than an inventory threshold, determining the container as a target container; The target inventory information is obtained by dividing the inventory quantity in the inventory information by the container quantity of the target container.

6. The method according to claim 1, characterized in that The method further comprises: When the writing result indicates that the writing is successful, the local cache is updated regularly based on the inventory information in the cache database.

7. The method according to claim 1, characterized in that The inventory information includes: Order ID, inventory quantity, inventory cost, inventory location.

8. A data processing device, characterized in that: include: A storage module, configured to store target inventory information in a container of a distributed system in response to adding inventory to a target order; A writing result obtaining module is used to write the target inventory information in the container into a cache database based on an asynchronous processing algorithm to obtain a writing result; A write failure timestamp determination module, configured to determine a write failure timestamp when the write result indicates a write failure; A refresh module is used to refresh the local cache configured for the container based on the write failure timestamp and the target inventory information so that the inventory information of the container and the local cache are consistent, and the default way for the local cache to obtain the inventory information is to obtain the inventory information from the cache database.

9. An electronic device, comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

11. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Inventory information processing method and system, computer system and readable storage medium

    CN111292028A

  • Distributed local cache processing method and system

    CN111988427A

  • Data writing method and device, equipment and storage medium

    CN113392098A

  • Incremental update data storage method and device, electronic equipment and storage medium

    CN113704227A

  • Data storage method and device

    CN115098519A