WO2023165170A1 - Restocking system, method, and device - Google Patents

Restocking system, method, and device Download PDF

Info

Publication number
WO2023165170A1
WO2023165170A1 PCT/CN2022/133208 CN2022133208W WO2023165170A1 WO 2023165170 A1 WO2023165170 A1 WO 2023165170A1 CN 2022133208 W CN2022133208 W CN 2022133208W WO 2023165170 A1 WO2023165170 A1 WO 2023165170A1
Authority
WO
WIPO (PCT)
Prior art keywords
replenishment
data
task
fragmentation
node
Prior art date
Application number
PCT/CN2022/133208
Other languages
French (fr)
Chinese (zh)
Inventor
罗勋
Original Assignee
北京沃东天骏信息技术有限公司
北京京东世纪贸易有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京沃东天骏信息技术有限公司, 北京京东世纪贸易有限公司 filed Critical 北京沃东天骏信息技术有限公司
Publication of WO2023165170A1 publication Critical patent/WO2023165170A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/08Logistics, e.g. warehousing, loading or distribution; Inventory or stock management
    • G06Q10/087Inventory or stock management, e.g. order filling, procurement or balancing against orders
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions

Definitions

  • the embodiments of the present disclosure relate to the field of computer technology, and in particular to a replenishment system, method and device.
  • an intelligent replenishment system is usually built to assist in processes such as replenishment management, inventory management, and supply and demand balance. In order to continuously improve the service level for users.
  • Embodiments of the present disclosure provide replenishment systems, methods and devices.
  • a replenishment system in one or more embodiments of the embodiments of the present disclosure, includes a fragmentation node and a replenishment amount calculation node; the fragmentation node, in response to receiving a replenishment task, generates a replenishment The task identifier of the cargo task; query the attribute data of the replenishment task from the cache, and segment the attribute data of the replenishment task to obtain a data fragment set; for the data fragments in the data fragment set, generate the data fragment shard ID, and store the correspondence between task ID, shard ID and data shard in the cache; send the shard index of the replenishment task to the replenishment calculation node, where the shard index includes the task ID and shard ID; the replenishment amount calculation node, in response to receiving the shard index, obtains the data shard corresponding to the shard index from the cache, and obtains the replenishment demand corresponding to the data shard from the cached replenishment demand data Data; for each data fragment, the replenishment quantity corresponding to
  • a replenishment method includes: receiving a fragmentation index sent by a fragmentation node, obtaining a data fragment corresponding to the fragmentation index from a cache,
  • the shard index includes a task ID and a shard ID
  • the task ID is generated by the shard node in response to receiving the replenishment task
  • the shard ID is generated by the shard node through the following steps: Query the attributes of the replenishment task from the cache Data, and the attribute data of the replenishment task are fragmented to obtain the data fragmentation set; for the data fragmentation in the data fragmentation set, the fragmentation identification of the data fragmentation is generated, and the task identification and fragmentation are stored in the cache
  • the corresponding relationship between the identifier and the data fragmentation obtain the replenishment demand data corresponding to the fragmentation index from the cached replenishment demand data; for the data fragmentation corresponding to the fragmentation index, according to the data fragmentation and the corresponding replenishment
  • a replenishment device includes: a receiving unit receives the fragmentation index sent by the fragmentation node, obtains the data segment corresponding to the fragmentation index from the cache Slice, where the shard index includes a task ID and a shard ID, the task ID is generated by the shard node in response to receiving the replenishment task, and the shard ID is generated by the shard node through the following steps: Query the replenishment task from the cache The attribute data of the replenishment task, and the attribute data of the replenishment task are fragmented to obtain the data fragmentation set; for the data fragmentation in the data fragmentation set, the fragmentation identifier of the data fragmentation is generated, and the task identifier, The corresponding relationship between the fragmentation identifier and the data fragmentation; the acquisition unit obtains the replenishment demand data corresponding to the fragmentation index from the cached replenishment demand data; the determination unit for the data fragmentation corresponding to the fragmentation index, according to
  • a server includes: one or more processors; a storage device for storing one or more programs; when one or more programs Executed by one or more processors, so that the one or more processors implement the method as described in the second aspect.
  • a computer-readable medium on which a computer program is stored, and when the computer program is executed by a processor, the method as described in the second aspect is implemented.
  • the replenishment system, method, and device provided by the embodiments of the present disclosure perform heterogeneous decoupling and cache processing on the data required for the replenishment Shards are processed at a granularity, and during the entire processing process, by passing the shard index, the data shards are obtained through the cache query based on the shard index for calculation, and finally a one-time database storage is performed, which improves the replenishment task processing The overall processing efficiency and data throughput performance during processing.
  • FIG. 1 is an exemplary system architecture diagram to which an embodiment of the present disclosure can be applied;
  • Figure 2 is a timing diagram of one embodiment of a replenishment system according to the present disclosure
  • Fig. 3 is a schematic diagram of an application scenario of a replenishment system according to an embodiment of the present disclosure
  • FIG. 4 is a flowchart of one embodiment of a replenishment method according to the present disclosure.
  • Fig. 5 is a structural schematic diagram of an embodiment of a replenishment device according to the present disclosure.
  • FIG. 6 is a schematic structural diagram of an electronic device suitable for implementing an embodiment of the present disclosure.
  • FIG. 1 shows an exemplary architecture 100 to which embodiments of the replenishment system or replenishment method or replenishment apparatus of the present disclosure can be applied.
  • the system architecture 100 may include terminal devices 101 , 102 , 103 , a network 104 and a server 105 .
  • the network 104 is used as a medium for providing communication links between the terminal devices 101 , 102 , 103 and the server 105 .
  • Network 104 may include various connection types, such as wires, wireless communication links, or fiber optic cables, among others.
  • the terminal devices 101 , 102 , and 103 can interact with the server 105 through the network 104 to receive or send messages and the like.
  • Various client applications may be installed on the terminal devices 101, 102, 103.
  • browser applications For example, browser applications, search applications, replenishment applications, instant messaging tools, and so on.
  • the terminal devices 101, 102, 103 can use the client application installed on them to exchange information with the server 105.
  • the terminal devices 101, 102, and 103 may be hardware or software.
  • the terminal devices 101, 102, 103 When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices, including but not limited to smart phones, tablet computers, e-book readers, laptop computers, desktop computers and so on.
  • the terminal devices 101, 102, 103 When the terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above. It may be implemented as multiple software or software modules (for example, multiple software or software modules for providing distributed services), or as a single software or software module. No specific limitation is made here.
  • the server 105 can be used to provide various services (such as replenishment calculation and other services).
  • the terminal devices 101, 102, and 103 may send a replenishment request to the server 105, and the server 105 may generate a replenishment task and calculate a replenishment amount according to the replenishment request.
  • the server 105 may be hardware or software. When the server 105 is hardware, it can be implemented as a distributed server cluster composed of multiple servers, or as a single server. When the server 105 is software, it can be implemented as multiple software or software modules (for example, multiple software or software modules for providing distributed services), or can be implemented as a single software or software module. No specific limitation is made here. Each server or each software module in the server 105 can be used to provide different services respectively, and can cooperate. For example, each server or each software module in the server 105 can respectively provide several steps in the replenishment service, so as to coordinately complete the replenishment task, which helps to improve the replenishment efficiency.
  • the replenishment method provided by the embodiments of the present disclosure is generally executed by the server in the server 105 , and correspondingly, the replenishment device is generally set in the server in the server 105 .
  • terminal devices, networks and servers in FIG. 1 are only illustrative. According to the implementation requirements, there can be any number of terminal devices, networks and servers.
  • the replenishment system includes shard nodes and replenishment calculation nodes.
  • a shard node receives a replenishment task.
  • the replenishment task may refer to a task that assists in completing the replenishment.
  • Sharding nodes can receive replenishment tasks from the outside world (such as other nodes or user terminals, etc.). For example, relevant personnel can set replenishment tasks on user terminals, and send the replenishment tasks to shard nodes.
  • step 202 the shard node generates a task ID of the replenishment task.
  • the task ID of the replenishment task can be used to identify the replenishment task.
  • Shard nodes can use various methods to generate task IDs for replenishment tasks.
  • the task identifier is generated according to the current date and the quantity of the historical replenishment tasks of the replenishment task in the time period of the current date.
  • the task ID of the replenishment task may be generated through the snowflake algorithm.
  • step 203 the fragmentation node queries the attribute data of the replenishment task from the cache, and fragments the attribute data of the replenishment task to obtain a data fragmentation set.
  • the attribute data of the replenishment task may refer to various attribute data related to the replenishment task.
  • the attribute data of the replenishment task may include the attribute data of the replenishment object indicated by the replenishment task.
  • the replenishment task instruction replenishment object may refer to an object to be replenished (such as an item, etc.).
  • the attribute data of the replenishment object can be set according to the actual application scenario (such as the actual replenishment process, etc.).
  • the granularity of replenishment objects can be set according to actual application scenarios.
  • the replenishment object can use SKU (Stock Keeping Unit, inventory unit) as the identifier, and calculate the replenishment quantity based on the granularity of the SKU.
  • the attribute data of the replenishment object may include at least one of the following items: the identifier of the replenishment object, the category information of the replenishment object, the store information (such as the store logo, etc.) to which the replenishment object belongs, and the supplier information of the replenishment object (such as supplier identification, supplier type, etc.), availability status (such as whether it is currently available for procurement, etc.) and so on.
  • the attribute data of the replenishment task can be pre-stored in the cache. At this point, the attribute data of the replenishment task can be queried from the cache.
  • the specific cache mode and query mode can be flexibly set according to actual application requirements.
  • the attribute data of the replenishment task can be heterogeneous and cached, and the query key (Key) can be set at the same time.
  • the sharding node can use various sharding methods to shard the attribute data of the replenishment task to form a data shard set. For example, sharding can be performed according to specified attribute data (such as suppliers, etc.) in the attribute data of the replenishment task.
  • the sharding node In step 204, the sharding node generates a shard identifier of the data shard for the data shard in the data shard set, and stores the correspondence between the task identifier, the shard identifier and the data shard in the cache.
  • the sharding node can use various methods to generate the shard identifier of each data shard.
  • the fragment identifier can be used to identify a data fragment.
  • the fragment identifiers may generate fragment identifiers corresponding to each data fragment in a sequentially increasing manner.
  • the sharding node can store the corresponding relationship between the task ID, the shard ID and the data shard in the cache.
  • the corresponding relationship between task identifiers, fragment identifiers and data fragments may be stored in the Redis cache.
  • the specific data format of the task identifier, fragment identifier and data fragment stored in the cache can be flexibly set.
  • data fragments can be stored in the cache in the serialized format of JSON (JavaScript Object Notation, JavaScript Object Notation).
  • shard nodes can set up query services for data shards. For example, you can set the task identifier and fragment identifier as the keyword (Key) for query, and use the data fragment as the value (Value) to be queried.
  • step 205 the sharding node sends the sharding index of the replenishment task to the replenishment amount calculation node.
  • the shard index may include a task identifier and a shard identifier.
  • Sharding nodes can set sharding indexes to facilitate queries based on sharding indexes. Then, the sharding node can send the sharding index of the replenishment task to the replenishment quantity calculation node.
  • step 206 the replenishment quantity calculation node obtains the data fragment corresponding to the fragment index from the cache, and obtains the replenishment demand data corresponding to the data fragment from the cached replenishment demand data.
  • the replenishment calculation node can obtain the data shard corresponding to the shard index from the cache according to the shard index.
  • the replenishment quantity calculation node can obtain the replenishment demand data corresponding to the data shards from the pre-cached replenishment demand data.
  • the replenishment requirement data may be used to describe the replenishment requirement of the replenishment object corresponding to the data slice.
  • Replenishment demand data can be set according to specific application scenarios.
  • replenishment demand data includes forecast data and configuration data.
  • the forecast data may refer to replenishment demand data obtained by forecasting through various forecasting methods.
  • the forecast data includes but is not limited to at least one of the following: forecast sales in a future target time period (such as three months), forecast delivery time, the difference between historical forecast sales and corresponding actual sales (for example, it can be represented by standard deviation ).
  • Configuration data can refer to the replenishment demand data configured by relevant personnel through terminals and other input devices.
  • Configuration data includes but is not limited to at least one of the following: shelf display value (such as full display value and minimum display value, etc.), minimum order quantity requirements ( Such as minimum order quantity, etc.), minimum order amount, replenishment frequency, delivery time, etc.
  • Replenishment demand data can be pre-stored in cache. At this point, the replenishment demand data can be queried directly from the cache.
  • the specific cache mode and query mode can be flexibly set according to actual application requirements. For example, various existing data caching methods and query methods can be used to realize the cache and query services of replenishment demand data.
  • step 207 for each data fragment, the replenishment quantity calculation node determines the replenishment quantity corresponding to the data fragment according to the data fragment and the corresponding replenishment demand data.
  • the replenishment quantity calculation node can determine the replenishment quantity corresponding to each data fragment according to the obtained data fragments and replenishment demand data.
  • the replenishment quantity may refer to the replenishment quantity of the replenishment object.
  • the replenishment quantity calculation node may use various methods to calculate the replenishment quantity of the replenishment object in the data fragment according to each data fragment and the replenishment demand data corresponding to the data fragment.
  • a replenishment quantity calculation formula may be preset, and at this time, the replenishment quantity calculation node may directly obtain the replenishment quantity according to the calculation formula.
  • the replenishment quantity calculation node may use a preset replenishment quantity calculation model corresponding to the data characteristics of the data fragment to calculate the replenishment quantity of the data fragment according to the data characteristics of the data fragment.
  • the data characteristics of the data slices may be pre-stored in the cache of the data slices.
  • Data characteristics can be set according to actual application requirements or application scenarios. For example, data characteristics include whether it is new or not.
  • a corresponding replenishment quantity calculation model may be set for each data feature in advance, for example, a replenishment quantity calculation model corresponding to a new product may be set for a new product.
  • the data shard and the replenishment demand data corresponding to the data shard can be calculated using the replenishment quantity calculation model corresponding to the new product to obtain the replenishment demand data corresponding to the data shard. volume.
  • the replenishment demand data is used to calculate the replenishment quantity, so that each data fragment can be processed in parallel, and the index can be used to quickly query the required data from the cache, which in turn helps to improve the overall efficiency of replenishment task processing.
  • the replenishment system may further include a storage node. After the replenishment quantity calculation node obtains the replenishment quantity of each data fragment, it can add the replenishment quantity corresponding to the data fragment in the cache of each data fragment. Then, the replenishment calculation node can send the shard index of the replenishment task to the storage node.
  • the storage node After the storage node receives the shard index, it can obtain the data shard corresponding to the shard index from the cache, and then store the obtained data shard in the database, so as to realize the persistent storage of the replenishment quantity.
  • the intermediate results of each data shard are stored in the cache, and the data transfer is realized through the shard index.
  • the storage node After the calculation of the replenishment amount is completed, the storage node performs storage processing to further improve the efficiency of replenishment calculations and data throughput performance.
  • the replenishment system may further include an adjustment node. After adding the corresponding replenishment amount to the cache of each data shard, the replenishment calculation node can first send the shard index of the replenishment task to the adjustment node.
  • the adjustment node After receiving the shard index, the adjustment node can first obtain the data shard corresponding to the shard index from the cache, and then obtain the adjustment parameters from the cached replenishment demand data, and adjust the replenishment amount of the data shard according to the adjustment parameters Adjust to obtain the adjusted replenishment quantity. Then, the adjustment node can update the replenishment quantity in the cache with the adjusted replenishment quantity.
  • the adjustment node can send the fragmentation index of the replenishment task to the storage node, so that the storage node can obtain the data fragmentation corresponding to the fragmentation index from the cache in response to receiving the fragmentation index, and store the acquired data in the database. data fragmentation. It should be noted that at this point, the replenishment calculation node no longer needs to send the shard index to the storage node.
  • the pre-cached replenishment demand data may include tuning parameters.
  • the adjustment parameter can be used to adjust the replenishment amount calculated by the replenishment amount calculation node, and the specific adjustment parameter can be set according to an actual application scenario.
  • an adjustment parameter may be a minimum order quantity.
  • the replenishment quantity can be adjusted appropriately according to the MOQ, so that the replenishment quantity can meet the MOQ requirements.
  • the above replenishment demand data and adjustment parameters can also be obtained through an external system.
  • the RPC Remote Procedure Call
  • the external system can be used to obtain the replenishment Demand data and tuning parameters.
  • the adjustment node can use various adjustment methods to adjust the replenishment quantity calculated by the replenishment quantity calculation node according to the adjustment parameters.
  • a calculation formula for adjusting the replenishment quantity can be preset.
  • the adjustment node may adjust the replenishment quantity calculated by the replenishment quantity calculation node according to the calculation formula and the adjustment parameter.
  • Adjusting the replenishment quantity according to the actual application scenario will help to improve the accuracy of the replenishment quantity calculation and ensure that the calculated replenishment quantity matches the actual replenishment scenario, so as to accurately and Effective replenishment, and high-speed query services such as RPC can be used to perform concurrent queries, avoiding the inability to perform RPC calls during the processing of replenishment tasks in the existing replenishment system, so that the obtained data for replenishment calculations is not real-time advanced questions.
  • the replenishment system may further include a task initiation node.
  • the task initiation node can obtain the replenishment request within the target time period, and then generate the corresponding replenishment task according to the replenishment request, and send the replenishment task to the fragmentation node.
  • the replenishment request may be used to request replenishment quantity calculation.
  • the replenishment request can be sent by relevant personnel using the terminal, or a scheduled replenishment request sending task can be set, and the replenishment request can be sent using the scheduled task.
  • the target time period can be set according to the actual application scenario. For example, for a scenario where there are few replenishment requests and the replenishment priority is low, the target time period can be one week. At this time, the replenishment requests received during this week can be counted once a week, and corresponding replenishment tasks can be generated To calculate the replenishment quantity, and then complete the replenishment according to the replenishment quantity. For another example, for scenarios where replenishment requests are relatively frequent (such as for relatively large e-commerce platforms, etc.), the target time period can be one minute. At this time, the replenishment requests received within this minute can be counted every minute. And generate the corresponding replenishment task to calculate the replenishment quantity, and then complete the replenishment according to the replenishment quantity.
  • the replenishment task start node can pre-set a scheduled scan task (such as using XXL-JOB to write a scheduled scan task), and set an execution interval (such as once a minute). At this point, the replenishment task start node can query the replenishment requests within the current time range from the last scan time to the current time range by executing a scheduled scan task.
  • a scheduled scan task such as using XXL-JOB to write a scheduled scan task
  • an execution interval such as once a minute
  • the specific rules or strategies for operations such as deduplication, merging, and exclusion can be preset by relevant personnel according to actual application scenarios.
  • the de-duplication rule may be to delete replenishment requests that correspond to the same time, have the same store ID, and belong to the same category.
  • the merging rule can be for the same time, the same store ID, and the inclusion relationship between the categories, and the merging operation can be performed.
  • Exclusion rules can be for different times, and the store ID is the same, and there is an inclusion relationship between the categories, the included subcategory can be excluded, and the replenishment request corresponding to the excluded subcategory can be processed next time.
  • the task start node can create a replenishment task according to the preset task creation method, start the replenishment task at a specified time according to the demand, and send the replenishment task to the shard nodes at the same time.
  • task start nodes Using task start nodes, shard nodes, and replenishment quantity calculation nodes as a whole to automatically generate and process replenishment tasks will help improve the overall operating efficiency of the replenishment system and facilitate the control and management of the replenishment system.
  • the task start node is used to flexibly control the start time of the replenishment task through timing tasks, etc., so as to avoid the delay in starting the replenishment task that may occur in the existing replenishment system, and the fixed start time of the replenishment task that cannot be flexibly customized. And other issues.
  • the shard nodes may first determine the adjustment type of the replenishment task according to the attribute data of the replenishment task.
  • the adjustment type may include supply quantity adjustment and minimum order quantity adjustment.
  • the supply volume adjustment may refer to the adjustment of the replenishment volume according to the supply volume requirement.
  • the minimum order quantity adjustment may refer to the adjustment of the replenishment quantity according to the minimum order quantity requirement.
  • various methods may be used to determine the adjustment type of the replenishment task according to the attribute data of the replenishment task. For example, the corresponding relationship between attribute data and adjustment type can be set in advance, and at this time, the adjustment type of the replenishment task can be determined according to the attribute data of the replenishment task by querying the corresponding relationship.
  • attribute data may include supplier type.
  • the supplier types may include a first type with known supply and a second type with unknown supply.
  • first type usually it may be necessary to allocate the replenishment quantity of different stores according to the supply quantity, thus corresponding to the supply quantity adjustment.
  • second type whose supply quantity is unknown, such suppliers usually have restrictions such as minimum order quantity requirements or minimum delivery quantity requirements, so they have certain requirements for replenishment quantities, so they correspond to minimum order quantity adjustments.
  • the fragmentation node can fragment the attribute data related to the replenishment task according to different replenishment demand ends, the same replenishment supply end, and the same replenishment object.
  • the fragmentation node can fragment the attribute data related to the replenishment task according to different replenishment objects, the same replenishment demand end, and the same replenishment supply end.
  • the replenishment demand end may refer to stores, shops, sales points, etc. that have replenishment demands.
  • the replenishment supply end may refer to a supplier, a manufacturer, etc. that can supply replenishment objects.
  • the corresponding supply quantity adjustment or minimum order quantity adjustment is performed on the replenishment quantity, so that the adjusted replenishment quantity can meet the actual supply quantity and the corresponding supply quantity of the supplier.
  • MOQ requirements so as to ensure the effectiveness of subsequent replenishment operations based on replenishment quantities.
  • the replenishment quantity calculation node may also determine the total number of replenishment objects included in the data fragment set and the quantity of replenishment objects included in each data fragment, and store them in In the cache of the data shard. Wherein, the total number of replenishment objects included in the data shard set is equal to the sum of the numbers of replenishment objects included in each data shard in the data shard set.
  • the data fragments may include identifiers of replenishment objects. Therefore, the number of replenishment objects included in the data fragments may be determined by counting the number of identifiers of replenishment objects.
  • the fragment index of the data fragment may also include the number of replenishment objects contained in the data fragment.
  • the storage node can obtain the total number of replenishment objects contained in the data shard set from the cache, and count the sum of the number of replenishment objects contained in the received data shards corresponding to each shard index, and then determine to obtain Is the total number of the same as the sum obtained from the statistics. If they are the same, it may indicate that the calculation of the replenishment task is completed. If they are different, it may indicate that there are still data fragments that have not yet completed the corresponding replenishment calculation.
  • the storage node can also store the data fragments in the cache into a preset database. For example, data can be constructed in advance, and operations such as database and table division can be performed on the database according to actual application requirements (such as database division and table division by task identification, etc.). Afterwards, the storage node can send the data stored in the data (such as the store ID of the replenishment object, the supplier ID, and the replenishment amount, etc.) to the downstream processing system to further complete the actual replenishment operation.
  • the downstream processing system can be set according to actual needs.
  • downstream processing systems may include automated order fulfillment systems, procurement systems, and the like.
  • the automatic order execution system can generate several replenishment orders according to the data sent by the storage node, and the procurement system can be used to complete the purchase of replenishment objects in each replenishment order.
  • the shard index to record the number of replenishment objects contained in each shard, and pre-record the total number of replenishment objects corresponding to the replenishment task in the cache, so that according to the shard indexes of the processed data shards, the corresponding Comparing the sum of the quantity of replenishment objects with the pre-stored total quantity, it is determined whether the replenishment task is calculated, and then the corresponding processing or operation is performed according to whether the replenishment task is calculated, thereby improving the flexibility and system of replenishment task processing sex.
  • the nodes such as the sharding nodes, replenishment quantity calculation nodes, storage nodes, adjustment nodes, and task initiation nodes may communicate with each other through messages.
  • the task initiation node can send the created replenishment task to the shard nodes through the message middleware.
  • the message of the shard index is sent between the nodes through the message middleware.
  • a message can be used as a carrier of information to complete information exchange.
  • the message communication between the above nodes can be realized based on various existing message communication mechanisms. It should be noted that message communication is a well-known technology widely researched and applied at present, and will not be repeated here.
  • the above replenishment system may also include a message control node.
  • the message control node can control the messages corresponding to each data fragment in the fragment node, replenishment calculation node, storage node, adjustment node and task start node.
  • Specific control operations can be flexibly set according to actual application scenarios. For example, you can set up a message consumption exception retry mechanism, perform anti-recheck on the data fragmentation message consumption process, and so on.
  • each processing node transmits and processes information by sending and consuming messages, and at the same time, it can also use message control nodes to control the messages in the entire processing process, so that data analysis can be realized.
  • Slice-level control such as message failure retry, message manual resend and modification, etc., to avoid situations where the failure can only restart the entire replenishment task, etc., which facilitates manual intervention in the replenishment task processing process, thereby further improving the efficiency and flexibility of replenishment task processing
  • the replenishment calculation fails and the entire replenishment task can only be restarted.
  • the above-mentioned various cached data such as cached replenishment task attribute data and replenishment demand data, etc.
  • the corresponding database can be created and initialized first, and the query fields in the table can be indexed and divided into databases and tables according to requirements.
  • database clusters can be created according to the estimated amount of data carried in the future.
  • the created database can adopt a one-master-multiple-slave structure, and each main database can be divided into databases and tables. Each main database can have the same database table structure. At this time, hash modulo algorithms can be used for store identification, etc. Divide the data into different master databases. Specifically, you can use the Sharding-JDBC component to store and query data.
  • Use XXL-JOB to write timed tasks use the RPC-based batch query service provided by the public attribute database, and pull all the attribute data of the replenishment task from the public attribute database to initialize and update the database. At the same time, you can monitor the public The change message of the attribute database, to update the data in the database in real time.
  • the Binlog log of the database cluster can be collected in real time and written to Kafka, and the attribute data of Kafka messages in the heterogeneous replenishment task in the database cluster can be monitored, and query services can be provided. For example, provide query services based on replenishment object IDs and supplier IDs, query services based on store IDs and supplier IDs, etc.
  • the specific query services can be set according to actual application requirements.
  • the latest forecast data can be written into the preset forecast table every day (specifically, the old data in the forecast table can be cleared first, and then new forecast data can be written), and then Based on the ELK architecture, the Binlog log of the forecast table is collected in real time and written to Kafka, and the heterogeneous replenishment demand data is cached in the Redis cluster by listening to Kafka messages.
  • query services can also be provided, such as query services based on the replenishment object ID, store ID, supplier ID, and forecast time.
  • the visual configuration interface For the configuration data in the replenishment demand data, you can use the visual configuration interface to receive the configuration data input by the user, write the configuration data into the preset database, and then collect the Binlog log of the database in real time based on the ELK architecture and write it to Kafka. Caching of Kafka message heterogeneous configuration data in Redis cluster.
  • query services can also be provided, such as query services based on replenishment object IDs, store IDs, and supplier IDs.
  • timeout period (such as one day, etc.) can be set for the cached data according to the demand, so as to ensure the timeliness and accuracy of the replenishment quantity calculation.
  • the replenishment amount calculation node may use at least one of the following processing modes to obtain the replenishment demand data corresponding to the shard index from the cached replenishment demand data: thread pool, event-driven mode, and strategy mode.
  • the thread pool may refer to concurrent execution of the replenishment demand data corresponding to the slice indexes of each data slice through the thread pool.
  • the event-driven pattern defines a new event-sequence-driven data manipulation processing method. The basic principle is that one or more events are triggered instead of calling the procedure directly.
  • the strategy pattern can refer to selecting different algorithms or strategies to complete a certain function (such as data operation, etc.) according to different environments or conditions. It should be noted that thread pool, event-driven mode and strategy mode are well-known technologies widely researched and applied at present, and will not be repeated here.
  • the adjustment node can also use at least one of the following processing modes to obtain corresponding data fragments from the cache, and obtain adjustment parameters from the cache: thread pool, event-driven mode, and strategy mode.
  • Real-time data capture by using thread pool, event-driven mode, and strategy mode can realize parallel computing capabilities for distributed computing resources, thereby further ensuring the efficiency of replenishment task processing.
  • Fig. 3 is a schematic application scenario 300 of the replenishment system according to this embodiment.
  • the attribute data of the replenishment task can be heterogeneously obtained from the basic data system, and the forecast system and the configuration system can be used to heterogeneously generate forecast data and configuration data as replenishment demand data.
  • Various attribute data of replenishment objects can be stored in the basic data system.
  • the prediction system can predict replenishment demand data, and the configuration system can receive replenishment demand data input by users.
  • the fragmentation node can fragment the attribute data of the replenishment task according to the application scenario (such as the need to adjust the minimum order quantity) to form a data fragmentation set, and then store the data fragmentation and heterogeneous replenishment demand data in the cache, and Provide cache query service based on sharding index.
  • the replenishment quantity calculation node can use the shard index to query the data shards from the heterogeneous cache, and at the same time, based on the RPC provided by the external data system, obtain data such as store inventory, purchase in-transit information, and available supply in real time, and then based on the data analysis
  • the corresponding replenishment model is selected according to the data characteristics of the slice, and the replenishment quantity is calculated by using the data slice and the data obtained in real time by RPC.
  • the adjustment node can use the shard index to obtain the replenishment quantity of the query data shard from the heterogeneous cache, and then obtain data such as store inventory, purchase in-transit information, and available supply in real time based on the RPC provided by the external data system as adjustment parameters.
  • the replenishment quantity is adjusted according to the corresponding adjustment method (such as supply quantity adjustment or minimum order quantity adjustment, etc.), to obtain the adjusted replenishment quantity.
  • the storage node can send a replenishment suggestion to the replenishment workbench according to the adjusted replenishment amount, so that the replenishment workbench can carry out replenishment according to the replenishment suggestion.
  • the storage node can put the adjusted replenishment quantity and other data into storage to realize the replenishment quantity storage, such as storing the replenishment quantity and other data corresponding to this replenishment task in the historical replenishment quantity database.
  • the replenishment system provided by the above-mentioned embodiments of the present disclosure performs heterogeneous decoupling and caching processing on the data required for replenishment task processing, and performs fragmentation processing on the data, so that each node performs data fragmentation at the granularity of In the whole processing process, by passing the shard index, the data shards are obtained through the cache query based on the shard index for calculation, and finally a one-time database storage is performed, which improves the overall processing efficiency of the replenishment task processing and data throughput performance during processing.
  • This replenishment method includes the following steps:
  • Step 401 receiving a fragmentation index sent by a fragmentation node, and obtaining a data fragment corresponding to the fragmentation index from a cache.
  • the shard index may include a task identifier and a shard identifier.
  • Task IDs can be used to identify replenishment tasks.
  • Shard identifiers can be used to identify data shards.
  • Shard nodes can use various methods to generate task IDs for replenishment tasks. For example, the task identifier is generated according to the current date and the quantity of the historical replenishment tasks of the replenishment task in the time period of the current date. For another example, the task ID of the replenishment task may be generated through the snowflake algorithm.
  • a task identifier may be generated by a shard node in response to receiving a replenishment task.
  • Fragment identifiers can be generated by fragment nodes through the following steps: query the attribute data of the replenishment task from the cache, and fragment the attribute data of the replenishment task to obtain the data fragment set; for the data fragment set in the data fragment set slice, generate the slice ID of the data slice, and store the correspondence between the task ID, the slice ID and the data slice in the cache.
  • the attribute data of the replenishment task may refer to various attribute data related to the replenishment task.
  • the attribute data of the replenishment task may include the attribute data of the replenishment object indicated by the replenishment task.
  • the replenishment task instruction replenishment object may refer to an object to be replenished (such as an item, etc.).
  • the attribute data of the replenishment object can be set according to the actual application scenario (such as the actual replenishment process, etc.).
  • the granularity of replenishment objects can be set according to actual application scenarios.
  • the replenishment object can use SKU (Stock Keeping Unit, inventory unit) as the identifier, and calculate the replenishment quantity based on the granularity of the SKU.
  • the attribute data of the replenishment object may include at least one of the following items: the identifier of the replenishment object, the category information of the replenishment object, the store information (such as the store logo, etc.) to which the replenishment object belongs, and the supplier information of the replenishment object (such as supplier identification, supplier type, etc.), availability status (such as whether it is currently available for procurement, etc.) and so on.
  • the attribute data of the replenishment task can be pre-stored in the cache. At this point, the attribute data of the replenishment task can be queried from the cache.
  • the specific cache mode and query mode can be flexibly set according to actual application requirements.
  • the attribute data of the replenishment task can be heterogeneous and cached, and the query key (Key) can be set at the same time.
  • the sharding node can use various sharding methods to shard the attribute data of the replenishment task to form a data shard set. For example, fragmentation can be performed according to specified attribute data (such as suppliers, etc.) in the attribute data of the replenishment task.
  • a shard node can use various methods to generate a shard identifier for each data shard.
  • the fragment identifier can be used to identify a data fragment.
  • the fragment identifiers may generate fragment identifiers corresponding to each data fragment in a sequentially increasing manner.
  • the sharding node can store the corresponding relationship between the task ID, the shard ID and the data shard in the cache.
  • the corresponding relationship between task identifiers, fragment identifiers and data fragments may be stored in the Redis cache.
  • the specific data format of the task identifier, fragment identifier and data fragment stored in the cache can be flexibly set.
  • data fragments can be stored in the cache in JSON serialized format.
  • shard nodes can set up query services for data shards. For example, you can set the task identifier and fragment identifier as the keyword (Key) for query, and use the data fragment as the value (Value) to be queried.
  • Step 402 acquiring replenishment demand data corresponding to the shard index from the cached replenishment demand data.
  • the replenishment amount calculation node may obtain the data shard corresponding to the shard index from the cache according to the shard index.
  • the replenishment quantity calculation node can obtain the replenishment demand data corresponding to the data shards from the pre-cached replenishment demand data.
  • the replenishment requirement data may be used to describe the replenishment requirement of the replenishment object corresponding to the data slice.
  • Replenishment demand data can be set according to specific application scenarios.
  • replenishment demand data includes forecast data and configuration data.
  • the forecast data may refer to replenishment demand data obtained by forecasting through various forecasting methods.
  • the forecast data includes but is not limited to at least one of the following: forecast sales in a future target time period (such as three months), forecast delivery time, the difference between historical forecast sales and corresponding actual sales (for example, it can be represented by standard deviation ).
  • Configuration data can refer to the replenishment demand data configured by relevant personnel through terminals and other input devices.
  • Configuration data includes but is not limited to at least one of the following: shelf display value (such as full display value and minimum display value, etc.), minimum order quantity requirements ( Such as minimum order quantity, etc.), minimum order amount, replenishment frequency, delivery time, etc.
  • Replenishment demand data can be pre-stored in cache. At this point, the replenishment demand data can be queried directly from the cache.
  • the specific cache mode and query mode can be flexibly set according to actual application requirements. For example, various existing data caching methods and query methods can be used to realize the cache and query services of replenishment demand data.
  • Step 403 for the data segment corresponding to the segment index, determine the replenishment quantity corresponding to the data segment according to the data segment and the corresponding replenishment demand data.
  • the data characteristics of the data slice may be pre-stored in the cache of the data slice.
  • Data characteristics can be set according to actual application requirements or application scenarios. For example, data characteristics include whether it is new or not.
  • a corresponding replenishment quantity calculation model may be set for each data feature in advance, for example, a replenishment quantity calculation model corresponding to a new product may be set for a new product.
  • the data shard and the replenishment demand data corresponding to the data shard can be calculated using the replenishment quantity calculation model corresponding to the new product to obtain the replenishment demand data corresponding to the data shard. volume.
  • the above replenishment method further includes: adding the replenishment quantity corresponding to the data fragment in the cache of each data fragment, and sending the fragment index of the replenishment task to To the storage node, wherein, in response to receiving the shard index, the storage node acquires the data shard corresponding to the shard index from the cache, and stores the acquired data shard in the database.
  • the above replenishment method further includes: sending the fragment index of the replenishment task to To the adjustment node, wherein the adjustment node performs the following steps in response to receiving the fragment index: obtain the corresponding data fragment from the cache, and obtain the adjustment parameters from the cached replenishment demand data; according to the adjustment parameters, divide the data Adjust the replenishment amount in the slice to obtain the adjusted replenishment amount; use the adjusted replenishment amount to update the replenishment amount in the cache of the data shard, and send the shard index of the replenishment task to the storage node.
  • the fragmentation node receives the replenishment task sent by the task initiation node, wherein the task initiation node obtains the replenishment request within the target time period, and generates a corresponding replenishment request according to the replenishment request cargo task.
  • the fragmentation node determines the adjustment type of the replenishment task according to the attribute data of the replenishment task, wherein the adjustment type includes supply quantity adjustment and minimum order quantity adjustment; the fragmentation node responds to It is determined that the adjustment type of the replenishment task is supply adjustment, and the attribute data related to the replenishment task is segmented according to the different replenishment demand ends, the same replenishment supply end, and the same replenishment object; in response to determining the adjustment type of the replenishment task To adjust the minimum order quantity, the attribute data related to the replenishment task is segmented according to different replenishment objects, the same replenishment demand end, and the same replenishment supply end.
  • the above replenishment method further includes: determining the total number of replenishment objects contained in the data fragment set and the quantity of replenishment objects contained in each data fragment;
  • the cache of the slice stores the total number of replenishment objects contained in the data slice set and the number of replenishment objects contained in each data slice; and the slice index also includes the number of replenishment objects contained in the data slice; and stores
  • the node is used to perform the following steps: obtain the total number of replenishment objects contained in the data shard set from the cache, and determine whether the sum of the received number of replenishment objects corresponding to each shard index is the same as the total number; respond Since it is determined that the sum of the quantities of the replenishment objects corresponding to the received fragment indexes is the same as the total quantity, it is determined that the calculation of the replenishment task is completed.
  • the acquisition of the replenishment demand data corresponding to the data fragments from the cached replenishment demand data includes: using at least one of the following processing modes to obtain from the cached replenishment demand data Replenishment demand data corresponding to the shard index: thread pool, event-driven mode, and strategy mode; and the above-mentioned adjustment node uses at least one of the following processing modes to obtain the corresponding data fragment from the cache, and obtain adjustment parameters from the cache: thread Pools, event-driven patterns, and strategy patterns.
  • the above-mentioned fragmentation nodes, replenishment amount calculation nodes, storage nodes, adjustment nodes, and task initiation nodes communicate through messages;
  • the corresponding messages in the replenishment calculation node, storage node, adjustment node and task start node are controlled by the message control node.
  • the replenishment demand data is used to calculate the replenishment quantity, so that each data fragment can be processed in parallel, and the index can be used to quickly query the required data from the cache, which in turn helps to improve the overall efficiency of replenishment task processing.
  • the present disclosure provides an embodiment of a replenishment device, which corresponds to the method embodiment shown in FIG. 4 , and this device can be specifically applied to in various electronic devices.
  • the replenishment device 500 includes a receiving unit 501 , an acquiring unit 502 and a determining unit 503 .
  • the receiving unit 501 is configured to receive the fragmentation index sent by the fragmentation node, and obtain the data fragmentation corresponding to the fragmentation index from the cache, wherein, the fragmentation index includes a task identifier and a fragmentation identifier, and the task identifier is determined by the fragmentation node
  • the fragmentation identifier is generated by the fragmentation node through the following steps: query the attribute data of the replenishment task from the cache, and fragment the attribute data of the replenishment task to obtain a data fragmentation set ; For the data fragments in the data fragmentation set, generate the fragmentation identification of the data fragmentation, and store the corresponding relationship between the task identification, the fragmentation identification and the data fragmentation in the cache;
  • the acquisition unit 502 is configured to from the cache
  • the replenishment demand data corresponding to the fragmentation index is
  • step 401 the specific processing of the receiving unit 501, the obtaining unit 502, and the determining unit 503 and the technical effects brought about by them can refer to step 401, step 402, and Relevant descriptions of step 403 will not be repeated here.
  • the above-mentioned replenishment device further includes: a sending unit (not shown in the figure), configured to add a supplement corresponding to the data fragment in the cache of each data fragment
  • the quantity of goods, and the fragmentation index of the replenishment task is sent to the storage node, wherein, in response to receiving the fragmentation index, the storage node obtains the data fragmentation corresponding to the fragmentation index from the cache, and stores the acquired data in the database Fragmentation.
  • the sending unit is further configured to: send the fragmentation index of the replenishment task to the adjustment node, wherein the adjustment node performs the following steps in response to receiving the fragmentation index: Obtain the corresponding data fragments from the cache, and obtain the adjustment parameters from the cached replenishment demand data; adjust the replenishment quantity in the data fragment according to the adjustment parameters to obtain the adjusted replenishment quantity; use the adjusted Update the replenishment amount in the cache of the data shard, and send the shard index of the replenishment task to the storage node.
  • the fragmentation node receives the replenishment task sent by the task initiation node, wherein the task initiation node obtains the replenishment request within the target time period, and generates a corresponding replenishment request according to the replenishment request cargo task.
  • the fragmentation node determines the adjustment type of the replenishment task according to the attribute data of the replenishment task, wherein the adjustment type includes supply quantity adjustment and minimum order quantity adjustment; the fragmentation node responds to It is determined that the adjustment type of the replenishment task is supply adjustment, and the attribute data related to the replenishment task is segmented according to the different replenishment demand ends, the same replenishment supply end, and the same replenishment object; in response to determining the adjustment type of the replenishment task To adjust the minimum order quantity, the attribute data related to the replenishment task is segmented according to different replenishment objects, the same replenishment demand end, and the same replenishment supply end.
  • the determination unit 503 is further configured to: determine the total number of replenishment objects contained in the data fragment set and the quantity of replenishment objects contained in each data fragment;
  • the cache of the data shard stores the total number of replenishment objects contained in the data shard set and the number of replenishment objects contained in each data shard; and the shard index also includes the number of replenishment objects contained in the data shard;
  • the storage node is used to perform the following steps: obtain the total number of replenishment objects contained in the data shard set from the cache, and determine whether the sum of the received number of replenishment objects corresponding to each shard index is the same as the total number ; In response to determining that the sum of the quantities of the replenishment objects corresponding to the received shard indexes is the same as the total quantity, it is determined that the calculation of the replenishment task is completed.
  • the acquisition unit 502 is configured to: acquire the replenishment demand data corresponding to the data slice from the cached replenishment demand data includes: using at least one of the following processing modes to obtain from the cache Obtain the replenishment demand data corresponding to the shard index from the replenishment demand data of the shards: thread pool, event-driven mode, and strategy mode; Acquire tuning parameters in the cache: thread pool, event-driven mode and strategy mode.
  • the above-mentioned fragmentation nodes, replenishment amount calculation nodes, storage nodes, adjustment nodes, and task initiation nodes communicate through messages;
  • the corresponding messages in the replenishment calculation node, storage node, adjustment node and task start node are controlled by the message control node.
  • the receiving unit receives the fragmentation index sent by the fragmentation node, and obtains the data fragmentation corresponding to the fragmentation index from the cache, wherein the fragmentation index includes a task identifier and a fragmentation identifier, and the task
  • the identifier is generated by the shard node in response to receiving the replenishment task
  • the shard identifier is generated by the shard node through the following steps: querying the attribute data of the replenishment task from the cache, and fragmenting the attribute data of the replenishment task, Obtain the data fragmentation set; for the data fragmentation in the data fragmentation set, generate the fragmentation identifier of the data fragmentation, and store the corresponding relationship between the task identifier, the fragmentation identifier and the data fragmentation in the cache; the acquisition unit from The replenishment demand data corresponding to the shard index is obtained from the cached replenishment demand data; for the data shard corresponding to the shard index, the
  • FIG. 6 it shows a schematic structural diagram of a server (for example, the server in the server in FIG. 1 ) 600 suitable for implementing an embodiment of the present disclosure.
  • the server shown in FIG. 6 is only an example, and should not limit the functions and scope of use of the embodiments of the present disclosure.
  • an electronic device 600 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 601, which may be randomly accessed according to a program stored in a read-only memory (ROM) 602 or loaded from a storage device 608.
  • a processing device such as a central processing unit, a graphics processing unit, etc.
  • RAM memory
  • various programs and data necessary for the operation of the electronic device 600 are also stored.
  • the processing device 601, ROM 602, and RAM 603 are connected to each other through a bus 604.
  • An input/output (I/O) interface 605 is also connected to the bus 604 .
  • the following devices can be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speaker, vibration an output device 607 such as a computer; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609.
  • the communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While FIG. 6 shows electronic device 600 having various means, it should be understood that implementing or having all of the means shown is not a requirement. Additional or fewer devices may alternatively be implemented or provided. Each block shown in FIG. 6 may represent one device, or may represent multiple devices as required.
  • embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, where the computer program includes program codes for executing the methods shown in the flowcharts.
  • the computer program may be downloaded and installed from a network via communication means 609, or from storage means 608, or from ROM 602.
  • the processing device 601 the above-mentioned functions defined in the methods of the embodiments of the present disclosure are executed.
  • the computer-readable medium described in the embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two.
  • a computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device .
  • Program code embodied on a computer readable medium may be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
  • the above-mentioned computer-readable medium may be included in the above-mentioned server; it may also exist independently without being assembled into the server.
  • the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the server, the server: receives the shard index sent by the shard node, and obtains the data corresponding to the shard index from the cache Sharding, where the sharding index includes a task ID and a sharding ID, the task ID is generated by the sharding node in response to receiving the replenishment task, and the sharding ID is generated by the sharding node through the following steps: Query the replenishment from the cache The attribute data of the task, and the attribute data of the replenishment task are fragmented to obtain the data fragmentation set; for the data fragmentation in the data fragmentation set, the fragmentation identifier of the data fragmentation is generated, and the task identifier is stored in the cache ,
  • Computer program code for carrying out operations of embodiments of the present disclosure may be written in one or more programming languages, or combinations thereof, including object-oriented programming languages—such as Java, Smalltalk, C++, Also included are conventional procedural programming languages - such as the "C" language or similar programming languages.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
  • the remote computer may be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (for example, using an Internet service provider to connected via the Internet).
  • LAN local area network
  • WAN wide area network
  • Internet service provider for example, using an Internet service provider to connected via the Internet.
  • each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.
  • the units involved in the embodiments described in the present disclosure may be implemented by software or by hardware.
  • the described units may also be set in a processor, for example, it may be described as: a processor includes a receiving unit, an acquiring unit, and a determining unit. Wherein, the names of these units do not constitute a limitation on the unit itself under certain circumstances.
  • the obtaining unit can also be described as "acquiring the replenishment demand data corresponding to the fragment index from the cached replenishment demand data.” unit".

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Economics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Development Economics (AREA)
  • Tourism & Hospitality (AREA)
  • Quality & Reliability (AREA)
  • Operations Research (AREA)
  • Software Systems (AREA)
  • Human Resources & Organizations (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Embodiments of the present disclosure disclose a restocking system, a method, and a device. The system comprises a sharding node and a restock amount calculation node; in response to a received restock task, the sharding node generates a task identifier of the restock task; attribute data of the restock task is looked up from a cache, and the attribute data of the restock task is sharded; for each data shard, a shard identifier of the data shard is generated, and a correspondence relationship between the task identifier, the shard identifier, and the data shard are stored in the cache; a shard index of the restock task is sent to the restock amount calculation node, the shard index comprising the task identifier and a shard identifier; in response to the received shard index, the restock amount calculation node obtains a data shard corresponding to the shard index from the cache, and obtains restock demand data corresponding to the data shard from cached restock demand data; and a restock amount corresponding to the data shard is determined according to the data shard and the corresponding restock demand data.

Description

补货***、方法和装置Replenishment system, method and apparatus
交叉引用cross reference
本专利申请要求于2022年3月1日提交的、申请号为202210192703.3、发明名称为“补货***、方法和装置”的中国专利申请的优先权,该申请的全文以引用的方式并入本申请中。This patent application claims priority to a Chinese patent application with application number 202210192703.3 and titled "Replenishment System, Method, and Apparatus" filed on March 1, 2022, which is hereby incorporated by reference in its entirety Applying.
技术领域technical field
本公开的实施例涉及计算机技术领域,具体涉及补货***、方法和装置。The embodiments of the present disclosure relate to the field of computer technology, and in particular to a replenishment system, method and device.
背景技术Background technique
随着电子商务和人工智能等技术快速发展,对于一些较大型的电商平台或零售企业等,通常都构建有智能的补货***,以辅助于补货管理、库存管理、供需平衡等流程,从而不断提升对用户的服务水平。With the rapid development of technologies such as e-commerce and artificial intelligence, for some larger e-commerce platforms or retail enterprises, an intelligent replenishment system is usually built to assist in processes such as replenishment management, inventory management, and supply and demand balance. In order to continuously improve the service level for users.
现有的补货***通常采用如Spark和大数据仓库Hive等大数据计算框架,通过Hive进行数据清洗然后进入Spark计算。Existing replenishment systems usually use big data computing frameworks such as Spark and big data warehouse Hive. Data is cleaned through Hive and then entered into Spark for computing.
发明内容Contents of the invention
本公开的实施例提出了补货***、方法和装置。Embodiments of the present disclosure provide replenishment systems, methods and devices.
本公开的实施例的一种或多种实施例中,提供了一种补货***,该***包括分片节点和补货量计算节点;分片节点,响应于接收到补货任务,生成补货任务的任务标识;从缓存中查询补货任务的属性数据,以及对补货任务的属性数据进行分片,得到数据分片集;对于数据分片集中的数据分片,生成该数据分片的分片标识,以及在缓存中存储任务标识、分片标识和数据分片之间的对应关系;将补货任务的分片索引发送至补货量计算节点,其中,分片索引包括任务标识和分片标识;补货量计算节点,响应于接收到分片索引,从缓存中获取分 片索引对应的数据分片,以及从缓存的补货需求数据中获取数据分片对应的补货需求数据;对于每个数据分片,根据该数据分片和对应的补货需求数据,确定该数据分片对应的补货量。In one or more embodiments of the embodiments of the present disclosure, a replenishment system is provided, the system includes a fragmentation node and a replenishment amount calculation node; the fragmentation node, in response to receiving a replenishment task, generates a replenishment The task identifier of the cargo task; query the attribute data of the replenishment task from the cache, and segment the attribute data of the replenishment task to obtain a data fragment set; for the data fragments in the data fragment set, generate the data fragment shard ID, and store the correspondence between task ID, shard ID and data shard in the cache; send the shard index of the replenishment task to the replenishment calculation node, where the shard index includes the task ID and shard ID; the replenishment amount calculation node, in response to receiving the shard index, obtains the data shard corresponding to the shard index from the cache, and obtains the replenishment demand corresponding to the data shard from the cached replenishment demand data Data; for each data fragment, the replenishment quantity corresponding to the data fragment is determined according to the data fragment and the corresponding replenishment demand data.
本公开的实施例的一种或多种实施例中,提供了一种补货方法,该方法包括:接收分片节点发送的分片索引,从缓存中获取分片索引对应的数据分片,其中,分片索引包括任务标识和分片标识,任务标识由分片节点响应于接收到补货任务而生成,分片标识由分片节点通过如下步骤生成:从缓存中查询补货任务的属性数据,以及对补货任务的属性数据进行分片,得到数据分片集;对于数据分片集中的数据分片,生成该数据分片的分片标识,以及在缓存中存储任务标识、分片标识和数据分片之间的对应关系;从缓存的补货需求数据中获取分片索引对应的补货需求数据;对于分片索引对应的数据分片,根据该数据分片和对应的补货需求数据,确定该数据分片对应的补货量。In one or more embodiments of the embodiments of the present disclosure, a replenishment method is provided, the method includes: receiving a fragmentation index sent by a fragmentation node, obtaining a data fragment corresponding to the fragmentation index from a cache, Wherein, the shard index includes a task ID and a shard ID, the task ID is generated by the shard node in response to receiving the replenishment task, and the shard ID is generated by the shard node through the following steps: Query the attributes of the replenishment task from the cache Data, and the attribute data of the replenishment task are fragmented to obtain the data fragmentation set; for the data fragmentation in the data fragmentation set, the fragmentation identification of the data fragmentation is generated, and the task identification and fragmentation are stored in the cache The corresponding relationship between the identifier and the data fragmentation; obtain the replenishment demand data corresponding to the fragmentation index from the cached replenishment demand data; for the data fragmentation corresponding to the fragmentation index, according to the data fragmentation and the corresponding replenishment Demand data, determine the replenishment quantity corresponding to the data shard.
本公开的实施例的一种或多种实施例中,提供了一种补货装置,该装置包括:接收单元接收分片节点发送的分片索引,从缓存中获取分片索引对应的数据分片,其中,分片索引包括任务标识和分片标识,任务标识由分片节点响应于接收到补货任务而生成,分片标识由分片节点通过如下步骤生成:从缓存中查询补货任务的属性数据,以及对补货任务的属性数据进行分片,得到数据分片集;对于数据分片集中的数据分片,生成该数据分片的分片标识,以及在缓存中存储任务标识、分片标识和数据分片之间的对应关系;获取单元从缓存的补货需求数据中获取分片索引对应的补货需求数据;确定单元对于分片索引对应的数据分片,根据该数据分片和对应的补货需求数据,确定该数据分片对应的补货量。In one or more embodiments of the embodiments of the present disclosure, a replenishment device is provided, the device includes: a receiving unit receives the fragmentation index sent by the fragmentation node, obtains the data segment corresponding to the fragmentation index from the cache Slice, where the shard index includes a task ID and a shard ID, the task ID is generated by the shard node in response to receiving the replenishment task, and the shard ID is generated by the shard node through the following steps: Query the replenishment task from the cache The attribute data of the replenishment task, and the attribute data of the replenishment task are fragmented to obtain the data fragmentation set; for the data fragmentation in the data fragmentation set, the fragmentation identifier of the data fragmentation is generated, and the task identifier, The corresponding relationship between the fragmentation identifier and the data fragmentation; the acquisition unit obtains the replenishment demand data corresponding to the fragmentation index from the cached replenishment demand data; the determination unit for the data fragmentation corresponding to the fragmentation index, according to the data classification slice and the corresponding replenishment demand data, and determine the replenishment quantity corresponding to the data slice.
本公开的实施例的一种或多种实施例中,提供了一种服务器,该服务器包括:一个或多个处理器;存储装置,用于存储一个或多个程序;当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现如第二方面描述的方法。In one or more embodiments of the embodiments of the present disclosure, a server is provided, and the server includes: one or more processors; a storage device for storing one or more programs; when one or more programs Executed by one or more processors, so that the one or more processors implement the method as described in the second aspect.
本公开的实施例的一种或多种实施例中,提供了一种计算机可读介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如 第二方面描述的方法。In one or more embodiments of the embodiments of the present disclosure, a computer-readable medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the method as described in the second aspect is implemented.
本公开的实施例提供的补货***、方法和装置,通过对补货任务处理所需的数据进行异构解耦和高速缓存处理,并对数据进行分片处理,以使各个节点处以数据分片为粒度进行处理,而且整个处理过程中通过传递分片索引,通过基于分片索引的缓存查询获取数据分片以进行计算,并在最终进行一次性的数据库落库,提升了补货任务处理的整体处理效率和处理过程中的数据吞吐性能。The replenishment system, method, and device provided by the embodiments of the present disclosure perform heterogeneous decoupling and cache processing on the data required for the replenishment Shards are processed at a granularity, and during the entire processing process, by passing the shard index, the data shards are obtained through the cache query based on the shard index for calculation, and finally a one-time database storage is performed, which improves the replenishment task processing The overall processing efficiency and data throughput performance during processing.
附图说明Description of drawings
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本公开的其它特征、目的和优点将会变得更明显:Other characteristics, objects and advantages of the present disclosure will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
图1是本公开的一个实施例可以应用于其中的示例性***架构图;FIG. 1 is an exemplary system architecture diagram to which an embodiment of the present disclosure can be applied;
图2是根据本公开的补货***的一个实施例的时序图;Figure 2 is a timing diagram of one embodiment of a replenishment system according to the present disclosure;
图3是根据本公开的实施例的补货***的一个应用场景的示意图;Fig. 3 is a schematic diagram of an application scenario of a replenishment system according to an embodiment of the present disclosure;
图4是根据本公开的补货方法的一个实施例的流程图;Figure 4 is a flowchart of one embodiment of a replenishment method according to the present disclosure;
图5是根据本公开的补货装置的一个实施例的结构示意图;Fig. 5 is a structural schematic diagram of an embodiment of a replenishment device according to the present disclosure;
图6是适于用来实现本公开的实施例的电子设备的结构示意图。FIG. 6 is a schematic structural diagram of an electronic device suitable for implementing an embodiment of the present disclosure.
具体实施方式Detailed ways
下面结合附图和实施例对本公开作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关发明相关的部分。The present disclosure will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain related inventions, rather than to limit the invention. It should also be noted that, for the convenience of description, only the parts related to the related invention are shown in the drawings.
需要说明的是,在不冲突的情况下,本公开中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本公开。It should be noted that, in the case of no conflict, the embodiments in the present disclosure and the features in the embodiments can be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and embodiments.
图1示出了可以应用本公开的补货***或补货方法或补货装置的实施例的示例性架构100。FIG. 1 shows an exemplary architecture 100 to which embodiments of the replenishment system or replenishment method or replenishment apparatus of the present disclosure can be applied.
如图1所示,***架构100可以包括终端设备101、102、103,网络104和服务端105。网络104用以在终端设备101、102、103和服务端105之间提供通信链路的介质。网络104可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。As shown in FIG. 1 , the system architecture 100 may include terminal devices 101 , 102 , 103 , a network 104 and a server 105 . The network 104 is used as a medium for providing communication links between the terminal devices 101 , 102 , 103 and the server 105 . Network 104 may include various connection types, such as wires, wireless communication links, or fiber optic cables, among others.
终端设备101、102、103可以通过网络104与服务端105交互,以接收或发送消息等。终端设备101、102、103上可以安装有各种客户端应用。例如,浏览器类应用、搜索类应用、补货类应用、即时通信工具等等。终端设备101、102、103可以利用其上安装的客户端应用与服务端105进行信息交互。The terminal devices 101 , 102 , and 103 can interact with the server 105 through the network 104 to receive or send messages and the like. Various client applications may be installed on the terminal devices 101, 102, 103. For example, browser applications, search applications, replenishment applications, instant messaging tools, and so on. The terminal devices 101, 102, 103 can use the client application installed on them to exchange information with the server 105.
终端设备101、102、103可以是硬件,也可以是软件。当终端设备101、102、103为硬件时,可以是各种电子设备,包括但不限于智能手机、平板电脑、电子书阅读器、膝上型便携计算机和台式计算机等等。当终端设备101、102、103为软件时,可以安装在上述所列举的电子设备中。其可以实现成多个软件或软件模块(例如用来提供分布式服务的多个软件或软件模块),也可以实现成单个软件或软件模块。在此不做具体限定。The terminal devices 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices, including but not limited to smart phones, tablet computers, e-book readers, laptop computers, desktop computers and so on. When the terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above. It may be implemented as multiple software or software modules (for example, multiple software or software modules for providing distributed services), or as a single software or software module. No specific limitation is made here.
服务端105可以用于提供各种服务(如补货计算等服务)。例如,终端设备101、102、103可以向服务端105发送补货请求,服务端105可以根据该补货请求生成补货任务并计算补货量。The server 105 can be used to provide various services (such as replenishment calculation and other services). For example, the terminal devices 101, 102, and 103 may send a replenishment request to the server 105, and the server 105 may generate a replenishment task and calculate a replenishment amount according to the replenishment request.
需要说明的是,服务端105可以是硬件,也可以是软件。当服务端105为硬件时,可以实现成多个服务器组成的分布式服务器集群,也可以实现成单个服务器。当服务端105为软件时,可以实现成多个软件或软件模块(例如用来提供分布式服务的多个软件或软件模块),也可以实现成单个软件或软件模块。在此不做具体限定。服务端105中的各服务器或各软件模块等可以分别用于提供不同的服务,并且可以进行协作。例如,服务端105中的各服务器或各软件模块可以分别提供补货服务中的若干步骤,以协同完成补货任务,有助于提升补货效率。It should be noted that the server 105 may be hardware or software. When the server 105 is hardware, it can be implemented as a distributed server cluster composed of multiple servers, or as a single server. When the server 105 is software, it can be implemented as multiple software or software modules (for example, multiple software or software modules for providing distributed services), or can be implemented as a single software or software module. No specific limitation is made here. Each server or each software module in the server 105 can be used to provide different services respectively, and can cooperate. For example, each server or each software module in the server 105 can respectively provide several steps in the replenishment service, so as to coordinately complete the replenishment task, which helps to improve the replenishment efficiency.
需要说明的是,本公开的实施例所提供的补货方法一般由服务端105中的服务器执行,相应地,补货装置一般设置于服务端105中的 服务器中。It should be noted that the replenishment method provided by the embodiments of the present disclosure is generally executed by the server in the server 105 , and correspondingly, the replenishment device is generally set in the server in the server 105 .
应该理解,图1中的终端设备、网络和服务端的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务端。It should be understood that the numbers of terminal devices, networks and servers in FIG. 1 are only illustrative. According to the implementation requirements, there can be any number of terminal devices, networks and servers.
继续参考图2,其示出了根据本公开的补货***的一个实施例的时序图200。该补货***包括分片节点和补货量计算节点。With continued reference to FIG. 2 , a timing diagram 200 of one embodiment of a replenishment system according to the present disclosure is shown. The replenishment system includes shard nodes and replenishment calculation nodes.
在步骤201中,分片节点接收补货任务。In step 201, a shard node receives a replenishment task.
在本步骤中,补货任务可以指辅助于完成补货的任务。分片节点可以从外界(如其它节点或用户终端等等)接收补货任务。例如,可以由相关人员在用户终端上设置补货任务,并将补货任务发送至分片节点。In this step, the replenishment task may refer to a task that assists in completing the replenishment. Sharding nodes can receive replenishment tasks from the outside world (such as other nodes or user terminals, etc.). For example, relevant personnel can set replenishment tasks on user terminals, and send the replenishment tasks to shard nodes.
在步骤202中,分片节点生成补货任务的任务标识。In step 202, the shard node generates a task ID of the replenishment task.
在本步骤中,补货任务的任务标识可以用于标识补货任务。分片节点可以采用各种方法生成补货任务的任务标识。例如,根据当前日期和补货任务在当前日期所在时间段中的历史补货任务的数量生成任务标识。又例如,可以通过雪花算法生成补货任务的任务标识。In this step, the task ID of the replenishment task can be used to identify the replenishment task. Shard nodes can use various methods to generate task IDs for replenishment tasks. For example, the task identifier is generated according to the current date and the quantity of the historical replenishment tasks of the replenishment task in the time period of the current date. For another example, the task ID of the replenishment task may be generated through the snowflake algorithm.
在步骤203中,分片节点从缓存中查询补货任务的属性数据,以及对补货任务的属性数据进行分片,得到数据分片集。In step 203, the fragmentation node queries the attribute data of the replenishment task from the cache, and fragments the attribute data of the replenishment task to obtain a data fragmentation set.
在本步骤中,补货任务的属性数据可以指与补货任务相关的各种属性数据。一般地,补货任务的属性数据可以包括补货任务指示的补货对象的属性数据。其中,补货任务指示补货对象可以指待补货的对象(如物品等)。补货对象的属性数据可以根据实际的应用场景(如实际的补货流程等)设置。补货对象的粒度可以根据实际的应用场景进行设置。例如,补货对象可以使用SKU(Stock Keeping Unit,库存量单位)作为标识,基于SKU的粒度进行补货量计算。In this step, the attribute data of the replenishment task may refer to various attribute data related to the replenishment task. Generally, the attribute data of the replenishment task may include the attribute data of the replenishment object indicated by the replenishment task. Wherein, the replenishment task instruction replenishment object may refer to an object to be replenished (such as an item, etc.). The attribute data of the replenishment object can be set according to the actual application scenario (such as the actual replenishment process, etc.). The granularity of replenishment objects can be set according to actual application scenarios. For example, the replenishment object can use SKU (Stock Keeping Unit, inventory unit) as the identifier, and calculate the replenishment quantity based on the granularity of the SKU.
例如,补货对象的属性数据可以包括如下至少一项:补货对象的标识、补货对象的类目信息、补货对象所属的店铺信息(如店铺标识等)、补货对象的供应商信息(如供应商标识、供应商类型等等)、可采状态(如当前是否可以采购等等)等等。For example, the attribute data of the replenishment object may include at least one of the following items: the identifier of the replenishment object, the category information of the replenishment object, the store information (such as the store logo, etc.) to which the replenishment object belongs, and the supplier information of the replenishment object (such as supplier identification, supplier type, etc.), availability status (such as whether it is currently available for procurement, etc.) and so on.
补货任务的属性数据可以预先存储在缓存中。此时,可以从缓存 中查询补货任务的属性数据。具体的缓存方式和查询方式都可以根据实际的应用需求灵活设置。例如,可以异构补货任务的属性数据并缓存,同时设置查询关键字(Key)。The attribute data of the replenishment task can be pre-stored in the cache. At this point, the attribute data of the replenishment task can be queried from the cache. The specific cache mode and query mode can be flexibly set according to actual application requirements. For example, the attribute data of the replenishment task can be heterogeneous and cached, and the query key (Key) can be set at the same time.
分片节点可以采用各种分片方式对补货任务的属性数据进行分片,从而形成数据分片集。例如,可以根据按照补货任务的属性数据中的指定属性数据(如供应商等)进行分片。The sharding node can use various sharding methods to shard the attribute data of the replenishment task to form a data shard set. For example, sharding can be performed according to specified attribute data (such as suppliers, etc.) in the attribute data of the replenishment task.
在步骤204中,分片节点对于数据分片集中的数据分片,生成该数据分片的分片标识,以及在缓存中存储任务标识、分片标识和数据分片之间的对应关系。In step 204, the sharding node generates a shard identifier of the data shard for the data shard in the data shard set, and stores the correspondence between the task identifier, the shard identifier and the data shard in the cache.
在本步骤中,分片节点可以采用各种方法生成每个数据分片的分片标识。其中,分片标识可以用于标识数据分片。例如,分片标识可以按照顺序递增的方式生成各数据分片分别对应的分片标识。In this step, the sharding node can use various methods to generate the shard identifier of each data shard. Wherein, the fragment identifier can be used to identify a data fragment. For example, the fragment identifiers may generate fragment identifiers corresponding to each data fragment in a sequentially increasing manner.
分片节点可以在缓存中存储任务标识、分片标识和数据分片之间的对应关系。例如,可以在Redis缓存中存储任务标识、分片标识和数据分片之间的对应关系。根据实际的应用需求,任务标识、分片标识和数据分片在缓存中存储的具体数据格式可以灵活设置。例如,数据分片可以采用JSON(JavaScript Object Notation,JavaScript对象简谱)序列化的格式存储于缓存中。The sharding node can store the corresponding relationship between the task ID, the shard ID and the data shard in the cache. For example, the corresponding relationship between task identifiers, fragment identifiers and data fragments may be stored in the Redis cache. According to actual application requirements, the specific data format of the task identifier, fragment identifier and data fragment stored in the cache can be flexibly set. For example, data fragments can be stored in the cache in the serialized format of JSON (JavaScript Object Notation, JavaScript Object Notation).
同时,分片节点可以设置数据分片的查询服务。例如,可以设置任务标识和分片标识作为查询用的关键字(Key),将数据分片作为查询到的值(Value)。At the same time, shard nodes can set up query services for data shards. For example, you can set the task identifier and fragment identifier as the keyword (Key) for query, and use the data fragment as the value (Value) to be queried.
在步骤205中,分片节点将补货任务的分片索引发送至补货量计算节点。In step 205, the sharding node sends the sharding index of the replenishment task to the replenishment amount calculation node.
在本步骤中,分片索引可以包括任务标识和分片标识。分片节点可以将设置分片索引,以便于基于分片索引的查询。然后,分片节点可以将补货任务的分片索引发送至补货量计算节点。In this step, the shard index may include a task identifier and a shard identifier. Sharding nodes can set sharding indexes to facilitate queries based on sharding indexes. Then, the sharding node can send the sharding index of the replenishment task to the replenishment quantity calculation node.
在步骤206中,补货量计算节点从缓存中获取分片索引对应的数据分片,以及从缓存的补货需求数据中获取数据分片对应的补货需求数据。In step 206, the replenishment quantity calculation node obtains the data fragment corresponding to the fragment index from the cache, and obtains the replenishment demand data corresponding to the data fragment from the cached replenishment demand data.
在本步骤中,补货量计算节点在接收到分片索引之后,可以根据 分片索引,从缓存中获取分片索引对应的数据分片。同时,补货量计算节点可以从预先缓存的补货需求数据中获取数据分片对应的补货需求数据。其中,补货需求数据可以用于描述数据分片对应的补货对象的补货需求。In this step, after receiving the shard index, the replenishment calculation node can obtain the data shard corresponding to the shard index from the cache according to the shard index. At the same time, the replenishment quantity calculation node can obtain the replenishment demand data corresponding to the data shards from the pre-cached replenishment demand data. Wherein, the replenishment requirement data may be used to describe the replenishment requirement of the replenishment object corresponding to the data slice.
补货需求数据可以根据具体的应用场景进行设置。例如,补货需求数据包括预测数据和配置数据。预测数据可以指通过各种预测方法进行预测得到的补货需求数据。作为示例,预测数据包括但不限于以下至少一项:未来目标时间段(如三个月)的预测销量、预测的送货时长、历史预测销量和对应实际销量的差异(如可以采用标准差表示)。配置数据可以指相关人员通过终端等输入设备等配置的补货需求数据,配置数据包括但不限于以下至少一项:货架陈列值(如满陈值和最小陈列值等)、起订量要求(如最小起订量等)、起订金额、补货频率、收货时长等等。Replenishment demand data can be set according to specific application scenarios. For example, replenishment demand data includes forecast data and configuration data. The forecast data may refer to replenishment demand data obtained by forecasting through various forecasting methods. As an example, the forecast data includes but is not limited to at least one of the following: forecast sales in a future target time period (such as three months), forecast delivery time, the difference between historical forecast sales and corresponding actual sales (for example, it can be represented by standard deviation ). Configuration data can refer to the replenishment demand data configured by relevant personnel through terminals and other input devices. Configuration data includes but is not limited to at least one of the following: shelf display value (such as full display value and minimum display value, etc.), minimum order quantity requirements ( Such as minimum order quantity, etc.), minimum order amount, replenishment frequency, delivery time, etc.
补货需求数据可以预先存储在缓存中。此时,可以直接从缓存中查询补货需求数据。具体的缓存方式和查询方式都可以根据实际的应用需求灵活设置。例如,可以采用现有的各种数据缓存方法和查询方法实现补货需求数据的缓存和查询服务。Replenishment demand data can be pre-stored in cache. At this point, the replenishment demand data can be queried directly from the cache. The specific cache mode and query mode can be flexibly set according to actual application requirements. For example, various existing data caching methods and query methods can be used to realize the cache and query services of replenishment demand data.
在步骤207中,补货量计算节点对于每个数据分片,根据该数据分片和对应的补货需求数据,确定该数据分片对应的补货量。In step 207, for each data fragment, the replenishment quantity calculation node determines the replenishment quantity corresponding to the data fragment according to the data fragment and the corresponding replenishment demand data.
在本步骤中,补货量计算节点可以根据获取的数据分片和补货需求数据,确定每个数据分片对应的补货量。其中,补货量可以指补货对象的补货数量。具体地,补货量计算节点可以采用各种方法根据每个数据分片和该数据分片对应的补货需求数据,计算该数据分片中的补货对象的补货量。例如,可以预先设置有补货量计算公式,此时,补货量计算节点可以直接按照该计算公式得出补货量。In this step, the replenishment quantity calculation node can determine the replenishment quantity corresponding to each data fragment according to the obtained data fragments and replenishment demand data. Wherein, the replenishment quantity may refer to the replenishment quantity of the replenishment object. Specifically, the replenishment quantity calculation node may use various methods to calculate the replenishment quantity of the replenishment object in the data fragment according to each data fragment and the replenishment demand data corresponding to the data fragment. For example, a replenishment quantity calculation formula may be preset, and at this time, the replenishment quantity calculation node may directly obtain the replenishment quantity according to the calculation formula.
可选地,补货量计算节点可以根据数据分片的数据特征,利用预设的、与数据分片的数据特征对应的补货量计算模型进行该数据分片的补货量计算。Optionally, the replenishment quantity calculation node may use a preset replenishment quantity calculation model corresponding to the data characteristics of the data fragment to calculate the replenishment quantity of the data fragment according to the data characteristics of the data fragment.
其中,数据分片的数据特征可以预先存储在数据分片的缓存中。数据特征可以根据实际的应用需求或应用场景进行设置。例如,数据 特征包括是否为新品。具体地,可以预先针对每种数据特征设置对应的补货量计算模型,例如,针对新品可以设置新品对应的补货量计算模型。此时,若确定数据分片的数据特征为新品,则可以将数据分片和该数据分片对应的补货需求数据,利用新品对应的补货量计算模型计算得到该数据分片对应的补货量。Wherein, the data characteristics of the data slices may be pre-stored in the cache of the data slices. Data characteristics can be set according to actual application requirements or application scenarios. For example, data characteristics include whether it is new or not. Specifically, a corresponding replenishment quantity calculation model may be set for each data feature in advance, for example, a replenishment quantity calculation model corresponding to a new product may be set for a new product. At this point, if it is determined that the data feature of the data shard is a new product, the data shard and the replenishment demand data corresponding to the data shard can be calculated using the replenishment quantity calculation model corresponding to the new product to obtain the replenishment demand data corresponding to the data shard. volume.
通过对补货任务的属性数据进行分片,并对补货任务的属性数据和补货需求数据进行预先缓存,同时利用数据分片的分片索引从缓存中获取数据分片和数据分片对应的补货需求数据以进行补货量计算,从而可以实现各数据分片并行处理,利用索引从缓存中快速查询所需数据,进而有助于提升补货任务处理的整体效率。By sharding the attribute data of the replenishment task, and pre-caching the attribute data and replenishment demand data of the replenishment task, and using the shard index of the data shard to obtain the data shard and the corresponding data shard from the cache The replenishment demand data is used to calculate the replenishment quantity, so that each data fragment can be processed in parallel, and the index can be used to quickly query the required data from the cache, which in turn helps to improve the overall efficiency of replenishment task processing.
在本实施例的一些可选的实现方式中,补货***还可以包括存储节点。补货量计算节点在得到每个数据分片的补货量之后,可以在每个数据分片的缓存中添加该数据分片对应的补货量。然后,补货量计算节点可以将补货任务的分片索引发送至存储节点。In some optional implementation manners of this embodiment, the replenishment system may further include a storage node. After the replenishment quantity calculation node obtains the replenishment quantity of each data fragment, it can add the replenishment quantity corresponding to the data fragment in the cache of each data fragment. Then, the replenishment calculation node can send the shard index of the replenishment task to the storage node.
存储节点在接收到分片索引之后,可以从缓存中获取该分片索引对应的数据分片,然后再数据库中存储获取到的数据分片,以实现对补货量的持久化存储。After the storage node receives the shard index, it can obtain the data shard corresponding to the shard index from the cache, and then store the obtained data shard in the database, so as to realize the persistent storage of the replenishment quantity.
在补货任务的处理过程中,对每个数据分片的处理中间结果都利用缓存进行存储,且数据传递通过分片索引来实现,在补货量计算完成之后,再由存储节点进行落库处理,进一步提升补货计算的效率和数据的吞吐性能。During the processing of the replenishment task, the intermediate results of each data shard are stored in the cache, and the data transfer is realized through the shard index. After the calculation of the replenishment amount is completed, the storage node performs storage processing to further improve the efficiency of replenishment calculations and data throughput performance.
在本实施例的一些可选的实现方式中,补货***还可以包括调节节点。补货量计算节点在将每个数据分片的缓存中添加对应的补货量之后,可以将补货任务的分片索引先发送至调节节点。In some optional implementations of this embodiment, the replenishment system may further include an adjustment node. After adding the corresponding replenishment amount to the cache of each data shard, the replenishment calculation node can first send the shard index of the replenishment task to the adjustment node.
调节节点在接收分片索引后,可以先从缓存中获取该分片索引对应的数据分片,然后从缓存的补货需求数据中获取调节参数,并根据调节参数对数据分片的补货量进行调节,从而得到调节后的补货量。然后,调节节点可以利用调节后的补货量更新缓存中的补货量。After receiving the shard index, the adjustment node can first obtain the data shard corresponding to the shard index from the cache, and then obtain the adjustment parameters from the cached replenishment demand data, and adjust the replenishment amount of the data shard according to the adjustment parameters Adjust to obtain the adjusted replenishment quantity. Then, the adjustment node can update the replenishment quantity in the cache with the adjusted replenishment quantity.
进一步地,调节节点可以将补货任务的分片索引发送至存储节点,以使存储节点响应于接收到分片索引,从缓存中获取分片索引对应的 数据分片,以及在数据库中存储获取的数据分片。需要说明的是,此时,补货量计算节点就不再需要将分片索引发送至存储节点。Further, the adjustment node can send the fragmentation index of the replenishment task to the storage node, so that the storage node can obtain the data fragmentation corresponding to the fragmentation index from the cache in response to receiving the fragmentation index, and store the acquired data in the database. data fragmentation. It should be noted that at this point, the replenishment calculation node no longer needs to send the shard index to the storage node.
这种情况下,预先缓存的补货需求数据可以包括调节参数。其中,调节参数可以用于对补货量计算节点计算出的补货量进行调整,具体的调节参数可以根据实际的应用场景进行设置。例如,调节参数可以是起订量。此时,可以根据起订量对补货量进行适当调整,以使补货量满足起订量要求。In this case, the pre-cached replenishment demand data may include tuning parameters. Wherein, the adjustment parameter can be used to adjust the replenishment amount calculated by the replenishment amount calculation node, and the specific adjustment parameter can be set according to an actual application scenario. For example, an adjustment parameter may be a minimum order quantity. At this time, the replenishment quantity can be adjusted appropriately according to the MOQ, so that the replenishment quantity can meet the MOQ requirements.
可选地,根据实际的补货计算方法,上述补货需求数据和调节参数还可以通过外部***获取,此时,可以利用外部***提供的RPC(Remote Procedure Call,远程过程调用)调用获取补货需求数据和调节参数。Optionally, according to the actual replenishment calculation method, the above replenishment demand data and adjustment parameters can also be obtained through an external system. At this time, the RPC (Remote Procedure Call) provided by the external system can be used to obtain the replenishment Demand data and tuning parameters.
调节节点可以采用各种调节方法根据调节参数对补货量计算节点计算得到的补货量进行调节。例如,可以预先设置调节补货量的计算公式。此时,调节节点可以按照该计算公式根据调节参数对补货量计算节点计算得到的补货量进行调节。The adjustment node can use various adjustment methods to adjust the replenishment quantity calculated by the replenishment quantity calculation node according to the adjustment parameters. For example, a calculation formula for adjusting the replenishment quantity can be preset. At this time, the adjustment node may adjust the replenishment quantity calculated by the replenishment quantity calculation node according to the calculation formula and the adjustment parameter.
根据实际的应用场景对补货量进行对应的调节,有助于提升补货量计算的准确性,保证计算得到的补货量与实际的补货场景相匹配,以根据补货量进行准确且有效的补货,且可以通过RPC等高速查询服务进行并发查询,避免现有的补货***中补货任务处理过程中无法进行RPC调用,使得获取到的用于补货计算的数据实时性不高等问题。Adjusting the replenishment quantity according to the actual application scenario will help to improve the accuracy of the replenishment quantity calculation and ensure that the calculated replenishment quantity matches the actual replenishment scenario, so as to accurately and Effective replenishment, and high-speed query services such as RPC can be used to perform concurrent queries, avoiding the inability to perform RPC calls during the processing of replenishment tasks in the existing replenishment system, so that the obtained data for replenishment calculations is not real-time advanced questions.
在本实施例的一些可选的实现方式中,补货***还可以包括任务启动节点。任务启动节点可以获取目标时间段内的补货请求,然后根据补货请求生成对应的补货任务,并将补货任务发送至分片节点。其中,补货请求可以用于请求进行补货量计算。补货请求可以由相关人员利用终端发送,也可以设置定时补货请求发送任务,并利用该定时任务发送补货请求。In some optional implementations of this embodiment, the replenishment system may further include a task initiation node. The task initiation node can obtain the replenishment request within the target time period, and then generate the corresponding replenishment task according to the replenishment request, and send the replenishment task to the fragmentation node. Wherein, the replenishment request may be used to request replenishment quantity calculation. The replenishment request can be sent by relevant personnel using the terminal, or a scheduled replenishment request sending task can be set, and the replenishment request can be sent using the scheduled task.
目标时间段可以根据实际的应用场景进行设置。例如,对于补货请求较少且补货优先级较低的场景,目标时间段可以为一周,此时,可以每周统计一次这一周内收到的补货请求,并生成对应的补货任务以进行补货量计算,进而根据补货量完成补货。又例如,对于补货请 求比较频繁的场景(如对于比较大型的电商平台等),目标时间段可以为一分钟,此时,可以每分钟统计一次这一分钟内接收到的补货请求,并生成对应的补货任务以进行补货量计算,进而根据补货量完成补货。The target time period can be set according to the actual application scenario. For example, for a scenario where there are few replenishment requests and the replenishment priority is low, the target time period can be one week. At this time, the replenishment requests received during this week can be counted once a week, and corresponding replenishment tasks can be generated To calculate the replenishment quantity, and then complete the replenishment according to the replenishment quantity. For another example, for scenarios where replenishment requests are relatively frequent (such as for relatively large e-commerce platforms, etc.), the target time period can be one minute. At this time, the replenishment requests received within this minute can be counted every minute. And generate the corresponding replenishment task to calculate the replenishment quantity, and then complete the replenishment according to the replenishment quantity.
作为示例,补货任务启动节点可以预先设置定时扫描任务(如使用XXL-JOB编写定时扫描任务),并设置执行间隔(如一分钟执行一次)。此时,补货任务启动节点可以通过执行定时扫描任务查询上次扫描时间截止到当前时间范围内的补货请求。As an example, the replenishment task start node can pre-set a scheduled scan task (such as using XXL-JOB to write a scheduled scan task), and set an execution interval (such as once a minute). At this point, the replenishment task start node can query the replenishment requests within the current time range from the last scan time to the current time range by executing a scheduled scan task.
在扫描完成后,还可以对扫描到的补货请求进行去重、合并、排他等操作以整理扫描到的补货请求。其中,去重、合并、排他等操作的具体规则或策略可以由相关人员根据实际的应用场景预先设置。例如,去重规则可以是删除对应时间相同,且门店标识相同,且所属类目也相同的补货请求。合并规则可以是针对时间相同、且门店标识相同,且所属类目之间具有包含关系的,可以进行合并操作。排他规则可以是针对时间不同,且门店标识相同,且所属类目之间具有包含关系的,可以排除被包含的子类目,被排除的子类目对应的补货请求可以在下次处理。After the scanning is completed, operations such as deduplication, merging, and exclusive operations can also be performed on the scanned replenishment requests to organize the scanned replenishment requests. Among them, the specific rules or strategies for operations such as deduplication, merging, and exclusion can be preset by relevant personnel according to actual application scenarios. For example, the de-duplication rule may be to delete replenishment requests that correspond to the same time, have the same store ID, and belong to the same category. The merging rule can be for the same time, the same store ID, and the inclusion relationship between the categories, and the merging operation can be performed. Exclusion rules can be for different times, and the store ID is the same, and there is an inclusion relationship between the categories, the included subcategory can be excluded, and the replenishment request corresponding to the excluded subcategory can be processed next time.
任务启动节点可以按照预先设置的任务创建方式创建补货任务,并根据需求在指定时刻启动该补货任务,同时将补货任务发送至分片节点。The task start node can create a replenishment task according to the preset task creation method, start the replenishment task at a specified time according to the demand, and send the replenishment task to the shard nodes at the same time.
利用任务启动节点和分片节点、补货量计算节点等作为整体进行补货任务的自动生成和处理,有助于提升补货***整体的运行效率,也便于对补货***的控制和管理。而且利用任务启动节点通过定时任务等对补货任务的启动时间等进行灵活控制,避免现有的补货***中可能会出现的补货任务启动不及时、补货任务启动时间固定而无法灵活定制等问题。Using task start nodes, shard nodes, and replenishment quantity calculation nodes as a whole to automatically generate and process replenishment tasks will help improve the overall operating efficiency of the replenishment system and facilitate the control and management of the replenishment system. Moreover, the task start node is used to flexibly control the start time of the replenishment task through timing tasks, etc., so as to avoid the delay in starting the replenishment task that may occur in the existing replenishment system, and the fixed start time of the replenishment task that cannot be flexibly customized. And other issues.
可选地,分片节点可以先根据补货任务的属性数据确定补货任务的调节类型。其中,调节类型可以包括供应量调节和起订量调节。供应量调节可以指根据供应量要求进行补货量的调节。起订量调节可以指根据起订量要求进行补货量的调节。具体地,可以采用各种方法根据补货任务的属性数据确定补货任务的调节类型。例如,可以预先设 置属性数据与调节类型的对应关系,此时,通过查询该对应关系根据补货任务的属性数据确定补货任务的调节类型。Optionally, the shard nodes may first determine the adjustment type of the replenishment task according to the attribute data of the replenishment task. Wherein, the adjustment type may include supply quantity adjustment and minimum order quantity adjustment. The supply volume adjustment may refer to the adjustment of the replenishment volume according to the supply volume requirement. The minimum order quantity adjustment may refer to the adjustment of the replenishment quantity according to the minimum order quantity requirement. Specifically, various methods may be used to determine the adjustment type of the replenishment task according to the attribute data of the replenishment task. For example, the corresponding relationship between attribute data and adjustment type can be set in advance, and at this time, the adjustment type of the replenishment task can be determined according to the attribute data of the replenishment task by querying the corresponding relationship.
作为示例,属性数据可以包括供应商类型。供应商类型可以包括供应量已知的第一类型和供应量未知的第二类型。此时,对于供应量已知的第一类型,通常可能需要根据供应量分配不同的门店的补货量等,因此对应于供应量调节。对于供应量未知的第二类型,这种供应商通常具有起订量要求或起送量要求等限制,从而对补货量具有一定要求,因此对应于起订量调节。As an example, attribute data may include supplier type. The supplier types may include a first type with known supply and a second type with unknown supply. At this time, for the first type whose supply quantity is known, usually it may be necessary to allocate the replenishment quantity of different stores according to the supply quantity, thus corresponding to the supply quantity adjustment. For the second type whose supply quantity is unknown, such suppliers usually have restrictions such as minimum order quantity requirements or minimum delivery quantity requirements, so they have certain requirements for replenishment quantities, so they correspond to minimum order quantity adjustments.
在确定补货任务的调节类型为供应量调节时,分片节点可以按照补货需求端不同且补货供给端相同且补货对象相同对补货任务相关的属性数据进行分片。在确定补货任务的调节类型为起订量调节时,分片节点可以按照补货对象不同且补货需求端相同且补货供给端相同对补货任务相关的属性数据进行分片。其中,补货需求端可以指具有补货需求的门店、店铺、销售点等等。补货供给端可以指能够供给补货对象的供应商、生产厂家等等。When determining that the adjustment type of the replenishment task is supply adjustment, the fragmentation node can fragment the attribute data related to the replenishment task according to different replenishment demand ends, the same replenishment supply end, and the same replenishment object. When it is determined that the adjustment type of the replenishment task is MOQ adjustment, the fragmentation node can fragment the attribute data related to the replenishment task according to different replenishment objects, the same replenishment demand end, and the same replenishment supply end. Wherein, the replenishment demand end may refer to stores, shops, sales points, etc. that have replenishment demands. The replenishment supply end may refer to a supplier, a manufacturer, etc. that can supply replenishment objects.
根据实际的应用场景中供应量和起订量的要求,对补货量进行对应的供应量调节或起订量调节,以使调节后的补货量能够满足实际中供应商对应的供应量和起订量的要求,从而保证后续基于补货量的补货操作的有效性。According to the requirements of the supply quantity and minimum order quantity in the actual application scenario, the corresponding supply quantity adjustment or minimum order quantity adjustment is performed on the replenishment quantity, so that the adjusted replenishment quantity can meet the actual supply quantity and the corresponding supply quantity of the supplier. MOQ requirements, so as to ensure the effectiveness of subsequent replenishment operations based on replenishment quantities.
在本实施例的一些可选的实现方式中,补货量计算节点还可以确定数据分片集包括的补货对象的总数量和每个数据分片包含的补货对象的数量,并存储于数据分片的缓存中。其中,数据分片集包括的补货对象的总数量等于数据分片集中的各数据分片分别包含的补货对象的数量的总和。一般地,数据分片中可以包括补货对象的标识,因此,可以通过统计补货对象的标识的数量来确定数据分片包含的补货对象的数量。In some optional implementations of this embodiment, the replenishment quantity calculation node may also determine the total number of replenishment objects included in the data fragment set and the quantity of replenishment objects included in each data fragment, and store them in In the cache of the data shard. Wherein, the total number of replenishment objects included in the data shard set is equal to the sum of the numbers of replenishment objects included in each data shard in the data shard set. Generally, the data fragments may include identifiers of replenishment objects. Therefore, the number of replenishment objects included in the data fragments may be determined by counting the number of identifiers of replenishment objects.
此时,数据分片的分片索引还可以包括该数据分片所包含的补货对象的数量。存储节点可以从缓存中获取数据分片集包含的补货对象的总数量,并统计已接收到的各分片索引分别对应的数据分片所包含的补货对象的数量的总和,然后确定获取的总数量与统计得到的总和 是否相同。若相同,则可以表示补货任务计算完成。若不同,则可以表示还有数据分片未完成对应的补货计算。At this time, the fragment index of the data fragment may also include the number of replenishment objects contained in the data fragment. The storage node can obtain the total number of replenishment objects contained in the data shard set from the cache, and count the sum of the number of replenishment objects contained in the received data shards corresponding to each shard index, and then determine to obtain Is the total number of the same as the sum obtained from the statistics. If they are the same, it may indicate that the calculation of the replenishment task is completed. If they are different, it may indicate that there are still data fragments that have not yet completed the corresponding replenishment calculation.
在确定补货任务计算完成后,存储节点还可以将缓存中的数据分片存储至预设的数据库中。例如,可以预先构建数据,并根据实际的应用需求对数据库进行分库和分表等操作(如以任务标识进行分库和分表等等)。之后,存储节点可以将数据中存储的数据(如补货对象的门店标识、供应商标识和补货量等等)发送给下游处理***,以进一步完成实际的补货操作。其中,下游处理***可以根据实际需求设置。例如,下游处理***可以包括自动单执行***、采购***等等。自动单执行***可以根据存储节点发送的数据生成若干补货订单,采购***可以用于完成各个补货订单中的补货对象的采购。After determining that the calculation of the replenishment task is completed, the storage node can also store the data fragments in the cache into a preset database. For example, data can be constructed in advance, and operations such as database and table division can be performed on the database according to actual application requirements (such as database division and table division by task identification, etc.). Afterwards, the storage node can send the data stored in the data (such as the store ID of the replenishment object, the supplier ID, and the replenishment amount, etc.) to the downstream processing system to further complete the actual replenishment operation. Among them, the downstream processing system can be set according to actual needs. For example, downstream processing systems may include automated order fulfillment systems, procurement systems, and the like. The automatic order execution system can generate several replenishment orders according to the data sent by the storage node, and the procurement system can be used to complete the purchase of replenishment objects in each replenishment order.
利用分片索引记录每个分片包含的补货对象的数量,以及在缓存中预先记录补货任务对应的补货对象的总数量,从而根据已处理的数据分片的分片索引分别对应的补货对象的数量的总和与预存的总数量的比较,确定补货任务是否计算完成,进而根据补货任务是否计算完成分别执行对应的处理或操作,进而提升补货任务处理的灵活性和***性。Use the shard index to record the number of replenishment objects contained in each shard, and pre-record the total number of replenishment objects corresponding to the replenishment task in the cache, so that according to the shard indexes of the processed data shards, the corresponding Comparing the sum of the quantity of replenishment objects with the pre-stored total quantity, it is determined whether the replenishment task is calculated, and then the corresponding processing or operation is performed according to whether the replenishment task is calculated, thereby improving the flexibility and system of replenishment task processing sex.
可选地,上述分片节点、补货量计算节点、存储节点、调节节点和任务启动节点等各个节点之间互相可以通过消息进行通信。例如,任务启动节点可以将创建的补货任务通过消息中间件发送消息至分片节点。又例如,各节点之间通过消息中间件发送分片索引的消息。Optionally, the nodes such as the sharding nodes, replenishment quantity calculation nodes, storage nodes, adjustment nodes, and task initiation nodes may communicate with each other through messages. For example, the task initiation node can send the created replenishment task to the shard nodes through the message middleware. For another example, the message of the shard index is sent between the nodes through the message middleware.
其中,消息(Message)可以作为信息的载体以完成信息交换。具体地,可以基于现有的各种消息通信机制实现上述各节点之间的消息通信。需要说明的是,消息通信是目前广泛研究和应用的公知技术,在此不再赘述。Among them, a message (Message) can be used as a carrier of information to complete information exchange. Specifically, the message communication between the above nodes can be realized based on various existing message communication mechanisms. It should be noted that message communication is a well-known technology widely researched and applied at present, and will not be repeated here.
此时,上述补货***还可以包括消息控制节点。消息控制节点可以对每个数据分片对应在分片节点、补货量计算节点、存储节点、调节节点和任务启动节点中的消息进行控制。At this time, the above replenishment system may also include a message control node. The message control node can control the messages corresponding to each data fragment in the fragment node, replenishment calculation node, storage node, adjustment node and task start node.
具体的控制操作可以根据实际的应用场景灵活设置。例如,可以设置消息消费异常重试机制、对数据分片消息消费处理过程进行防重 校验等等。Specific control operations can be flexibly set according to actual application scenarios. For example, you can set up a message consumption exception retry mechanism, perform anti-recheck on the data fragmentation message consumption process, and so on.
通过在补货任务的处理过程中,每个处理节点都以发送、消费消息等方式进行信息传递和处理,同时还可以使用消息控制节点等对整个处理过程中的消息进行控制,可以实现数据分片维度的如消息失败重试、消息手动重发和修改等控制,避免失败只能重启整个补货任务等情况,便于人工干预补货任务处理过程,从而进一步提升补货任务处理的效率和灵活性,避免现有的补货***在补货计算过程中无法人工干预、补货计算失败只能重启整个补货任务等问题。During the processing of the replenishment task, each processing node transmits and processes information by sending and consuming messages, and at the same time, it can also use message control nodes to control the messages in the entire processing process, so that data analysis can be realized. Slice-level control such as message failure retry, message manual resend and modification, etc., to avoid situations where the failure can only restart the entire replenishment task, etc., which facilitates manual intervention in the replenishment task processing process, thereby further improving the efficiency and flexibility of replenishment task processing In order to avoid the problems that the existing replenishment system cannot be manually intervened in the replenishment calculation process, and the replenishment calculation fails and the entire replenishment task can only be restarted.
可选地,上述各种缓存的数据,如缓存的补货任务的属性数据和补货需求数据等等可以通过对公用数据进行异构并缓存。Optionally, the above-mentioned various cached data, such as cached replenishment task attribute data and replenishment demand data, etc., can be heterogeneous and cached by public data.
例如,对于补货任务的属性数据,可以先创建对应的数据库并初始化,并可以根据需求对表中的查询字段进行索引创建和分库、分表等操作。同时,可以根据预估的未来承载的数据量创建数据库集群。For example, for the attribute data of the replenishment task, the corresponding database can be created and initialized first, and the query fields in the table can be indexed and divided into databases and tables according to requirements. At the same time, database clusters can be created according to the estimated amount of data carried in the future.
创建的数据库可以采用一主多从结构,对每个主库进行分库和分表,每个主库可以具有相同的库表结构,此时,可以针对门店标识等利用哈希取模算法等将数据分散到不同的主库中。具体可以使用Sharding-JDBC组件等进行数据的落库和查询。The created database can adopt a one-master-multiple-slave structure, and each main database can be divided into databases and tables. Each main database can have the same database table structure. At this time, hash modulo algorithms can be used for store identification, etc. Divide the data into different master databases. Specifically, you can use the Sharding-JDBC component to store and query data.
使用XXL-JOB等编写定时任务利用公用的属性数据库提供的基于RPC实现的批量查询服务,从公用的属性数据库中全量拉取补货任务的属性数据进行数据库的初始化和全量更新,同时可以监听公用的属性数据库的变更消息,以实时更新数据库中的数据。Use XXL-JOB to write timed tasks, use the RPC-based batch query service provided by the public attribute database, and pull all the attribute data of the replenishment task from the public attribute database to initialize and update the database. At the same time, you can monitor the public The change message of the attribute database, to update the data in the database in real time.
针对创建的数据库集群,可以基于ELK(Elasticsearch、Logstash、Kibana)架构实时采集数据库集群的Binlog日志写入Kafka,并监听Kafka消息在数据库集群中异构补货任务的属性数据,并提供查询服务。例如,提供基于补货对象标识和供应商标识的查询服务、基于门店标识和供应商标识的查询服务等等,具体的查询服务可以根据实际的应用需求进行设置。For the created database cluster, based on the ELK (Elasticsearch, Logstash, Kibana) architecture, the Binlog log of the database cluster can be collected in real time and written to Kafka, and the attribute data of Kafka messages in the heterogeneous replenishment task in the database cluster can be monitored, and query services can be provided. For example, provide query services based on replenishment object IDs and supplier IDs, query services based on store IDs and supplier IDs, etc. The specific query services can be set according to actual application requirements.
又例如,对于补货需求数据中的预测数据,可以每天将最新的预测数据写入预设的预测表中(具体可以先清空预测表中的旧数据,然后写入新的预测数据),然后基于ELK架构实时采集预测表的Binlog 日志写入Kafka,通过监听Kafka消息在Redis集群中异构补货需求数据的缓存。同时,还可以提供查询服务,如基于补货对象标识、门店标识、供应商标识和预测时间的查询服务等。For another example, for the forecast data in the replenishment demand data, the latest forecast data can be written into the preset forecast table every day (specifically, the old data in the forecast table can be cleared first, and then new forecast data can be written), and then Based on the ELK architecture, the Binlog log of the forecast table is collected in real time and written to Kafka, and the heterogeneous replenishment demand data is cached in the Redis cluster by listening to Kafka messages. At the same time, query services can also be provided, such as query services based on the replenishment object ID, store ID, supplier ID, and forecast time.
对于补货需求数据中的配置数据,可以利用可视化配置界面接收用户输入的配置数据,并将配置数据写入预设的数据库,再基于ELK架构实时采集该数据库的Binlog日志写入Kafka,通过监听Kafka消息在Redis集群中异构配置数据的缓存。同时,还可以提供查询服务,如基于补货对象标识、门店标识和供应商标识的查询服务等。For the configuration data in the replenishment demand data, you can use the visual configuration interface to receive the configuration data input by the user, write the configuration data into the preset database, and then collect the Binlog log of the database in real time based on the ELK architecture and write it to Kafka. Caching of Kafka message heterogeneous configuration data in Redis cluster. At the same time, query services can also be provided, such as query services based on replenishment object IDs, store IDs, and supplier IDs.
此外,缓存的数据可以根据需求设置超时时间(如一天等),以保证补货量计算的时效性和准确性。In addition, the timeout period (such as one day, etc.) can be set for the cached data according to the demand, so as to ensure the timeliness and accuracy of the replenishment quantity calculation.
通过对补货任务处理中使用的所有数据进行异构缓存和数据分片,并提供数据的高速查询服务,可以实现补货任务处理过程中的各种数据的高速并发查询,从而有助于提升补货任务处理的处理效率。By performing heterogeneous caching and data sharding on all data used in replenishment task processing, and providing high-speed data query services, high-speed concurrent query of various data in the process of replenishment task processing can be realized, thereby helping to improve Processing efficiency of replenishment task processing.
可选地,补货量计算节点可以利用如下至少一项处理模式从缓存的补货需求数据中获取分片索引对应的补货需求数据:线程池、事件驱动模式和策略模式。Optionally, the replenishment amount calculation node may use at least one of the following processing modes to obtain the replenishment demand data corresponding to the shard index from the cached replenishment demand data: thread pool, event-driven mode, and strategy mode.
其中,线程池可以指通过线程池并发执行各数据分片的分片索引分别对应的补货需求数据。事件驱动模式定义了一种新的事件序列驱动型数据操作处理方法,基本原理是并不直接调用过程,而是触发一个或多个事件。策略模式可以指根据环境或者条件的不同选择不同的算法或者策略来完成某一功能(如数据操作等)。需要说明的是,线程池、事件驱动模式和策略模式是目前广泛研究和应用的公知技术,在此不再赘述。Wherein, the thread pool may refer to concurrent execution of the replenishment demand data corresponding to the slice indexes of each data slice through the thread pool. The event-driven pattern defines a new event-sequence-driven data manipulation processing method. The basic principle is that one or more events are triggered instead of calling the procedure directly. The strategy pattern can refer to selecting different algorithms or strategies to complete a certain function (such as data operation, etc.) according to different environments or conditions. It should be noted that thread pool, event-driven mode and strategy mode are well-known technologies widely researched and applied at present, and will not be repeated here.
对应地,调节节点也可以利用如下至少一项处理模式从缓存中获取对应的数据分片,以及从缓存中获取调节参数:线程池、事件驱动模式和策略模式。Correspondingly, the adjustment node can also use at least one of the following processing modes to obtain corresponding data fragments from the cache, and obtain adjustment parameters from the cache: thread pool, event-driven mode, and strategy mode.
利用线程池、事件驱动模式和策略模式等进行实时的数据抓取,可以实现对分布式计算资源的并行计算能力,从而进一步保证补货任务处理的高效性。Real-time data capture by using thread pool, event-driven mode, and strategy mode can realize parallel computing capabilities for distributed computing resources, thereby further ensuring the efficiency of replenishment task processing.
继续参见图3,图3是根据本实施例的补货***的一个示意性的 应用场景300。在图3的应用场景中,可以从基础数据***中异构补货任务的属性数据,同时利用预测***和配置***分别异构预测数据和配置数据作为补货需求数据。基础数据***中可以存储补货对象的各种属性数据等。预测***可以预测补货需求数据,配置***可以接收用户输入的补货需求数据。分片节点可以根据应用场景(如需要起订量调节)对补货任务的属性数据进行分片,形成数据分片集,然后在缓存中存储数据分片和异构的补货需求数据,并提供基于分片索引的高速缓存查询服务。Continuing to refer to Fig. 3, Fig. 3 is a schematic application scenario 300 of the replenishment system according to this embodiment. In the application scenario in Figure 3, the attribute data of the replenishment task can be heterogeneously obtained from the basic data system, and the forecast system and the configuration system can be used to heterogeneously generate forecast data and configuration data as replenishment demand data. Various attribute data of replenishment objects can be stored in the basic data system. The prediction system can predict replenishment demand data, and the configuration system can receive replenishment demand data input by users. The fragmentation node can fragment the attribute data of the replenishment task according to the application scenario (such as the need to adjust the minimum order quantity) to form a data fragmentation set, and then store the data fragmentation and heterogeneous replenishment demand data in the cache, and Provide cache query service based on sharding index.
然后,补货量计算节点可以利用分片索引从异构缓存中查询数据分片,同时基于外部数据***提供的RPC实时获取如门店库存、采购在途信息、可供应量等数据,然后根据数据分片的数据特征选择对应的补货模型,利用数据分片和利用RPC实时获取的数据进行补货量计算。Then, the replenishment quantity calculation node can use the shard index to query the data shards from the heterogeneous cache, and at the same time, based on the RPC provided by the external data system, obtain data such as store inventory, purchase in-transit information, and available supply in real time, and then based on the data analysis The corresponding replenishment model is selected according to the data characteristics of the slice, and the replenishment quantity is calculated by using the data slice and the data obtained in real time by RPC.
调节节点可以利用分片索引从异构缓存中获取查询数据分片的补货量,然后可以基于外部数据***提供的RPC实时获取如门店库存、采购在途信息、可供应量等数据作为调节参数,按照对应的调节方式(如供应量调节或起订量调节等)对补货量进行调节,得到调节后的补货量。The adjustment node can use the shard index to obtain the replenishment quantity of the query data shard from the heterogeneous cache, and then obtain data such as store inventory, purchase in-transit information, and available supply in real time based on the RPC provided by the external data system as adjustment parameters. The replenishment quantity is adjusted according to the corresponding adjustment method (such as supply quantity adjustment or minimum order quantity adjustment, etc.), to obtain the adjusted replenishment quantity.
存储节点可以根据调节后的补货量向补货工作台发送补货建议,以使补货工作台按照补货建议进行补货。同时,存储节点可以将调节后的补货量等数据进行落库,以实现补货量存储,如在历史补货量数据库中存储本次补货任务对应的补货量等数据。The storage node can send a replenishment suggestion to the replenishment workbench according to the adjusted replenishment amount, so that the replenishment workbench can carry out replenishment according to the replenishment suggestion. At the same time, the storage node can put the adjusted replenishment quantity and other data into storage to realize the replenishment quantity storage, such as storing the replenishment quantity and other data corresponding to this replenishment task in the historical replenishment quantity database.
本公开的上述实施例提供的补货***通过对补货任务处理所需的数据进行异构解耦和高速缓存处理,并对数据进行分片处理,以使各个节点处以数据分片为粒度进行处理,而且整个处理过程中通过传递分片索引,通过基于分片索引的缓存查询获取数据分片以进行计算,并在最终进行一次性的数据库落库,提升了补货任务处理的整体处理效率和处理过程中的数据吞吐性能。The replenishment system provided by the above-mentioned embodiments of the present disclosure performs heterogeneous decoupling and caching processing on the data required for replenishment task processing, and performs fragmentation processing on the data, so that each node performs data fragmentation at the granularity of In the whole processing process, by passing the shard index, the data shards are obtained through the cache query based on the shard index for calculation, and finally a one-time database storage is performed, which improves the overall processing efficiency of the replenishment task processing and data throughput performance during processing.
进一步参考图4,其示出了根据本公开的补货方法的一个实施例 的流程400。该补货方法包括以下步骤:With further reference to Figure 4, a flow 400 of one embodiment of the replenishment method according to the present disclosure is shown. This replenishment method includes the following steps:
步骤401,接收分片节点发送的分片索引,从缓存中获取分片索引对应的数据分片。 Step 401, receiving a fragmentation index sent by a fragmentation node, and obtaining a data fragment corresponding to the fragmentation index from a cache.
在本实施例中,分片索引可以包括任务标识和分片标识。任务标识可以用于标识补货任务。分片标识可以用于标识数据分片。分片节点可以采用各种方法生成补货任务的任务标识。例如,根据当前日期和补货任务在当前日期所在时间段中的历史补货任务的数量生成任务标识。又例如,可以通过雪花算法生成补货任务的任务标识。In this embodiment, the shard index may include a task identifier and a shard identifier. Task IDs can be used to identify replenishment tasks. Shard identifiers can be used to identify data shards. Shard nodes can use various methods to generate task IDs for replenishment tasks. For example, the task identifier is generated according to the current date and the quantity of the historical replenishment tasks of the replenishment task in the time period of the current date. For another example, the task ID of the replenishment task may be generated through the snowflake algorithm.
任务标识可以由分片节点响应于接收到补货任务而生成。分片标识可以由分片节点通过如下步骤生成:从缓存中查询补货任务的属性数据,以及对补货任务的属性数据进行分片,得到数据分片集;对于数据分片集中的数据分片,生成该数据分片的分片标识,以及在缓存中存储任务标识、分片标识和数据分片之间的对应关系。A task identifier may be generated by a shard node in response to receiving a replenishment task. Fragment identifiers can be generated by fragment nodes through the following steps: query the attribute data of the replenishment task from the cache, and fragment the attribute data of the replenishment task to obtain the data fragment set; for the data fragment set in the data fragment set slice, generate the slice ID of the data slice, and store the correspondence between the task ID, the slice ID and the data slice in the cache.
补货任务的属性数据可以指与补货任务相关的各种属性数据。一般地,补货任务的属性数据可以包括补货任务指示的补货对象的属性数据。其中,补货任务指示补货对象可以指待补货的对象(如物品等)。补货对象的属性数据可以根据实际的应用场景(如实际的补货流程等)设置。补货对象的粒度可以根据实际的应用场景进行设置。例如,补货对象可以使用SKU(Stock Keeping Unit,库存量单位)作为标识,基于SKU的粒度进行补货量计算。The attribute data of the replenishment task may refer to various attribute data related to the replenishment task. Generally, the attribute data of the replenishment task may include the attribute data of the replenishment object indicated by the replenishment task. Wherein, the replenishment task instruction replenishment object may refer to an object to be replenished (such as an item, etc.). The attribute data of the replenishment object can be set according to the actual application scenario (such as the actual replenishment process, etc.). The granularity of replenishment objects can be set according to actual application scenarios. For example, the replenishment object can use SKU (Stock Keeping Unit, inventory unit) as the identifier, and calculate the replenishment quantity based on the granularity of the SKU.
例如,补货对象的属性数据可以包括如下至少一项:补货对象的标识、补货对象的类目信息、补货对象所属的店铺信息(如店铺标识等)、补货对象的供应商信息(如供应商标识、供应商类型等等)、可采状态(如当前是否可以采购等等)等等。For example, the attribute data of the replenishment object may include at least one of the following items: the identifier of the replenishment object, the category information of the replenishment object, the store information (such as the store logo, etc.) to which the replenishment object belongs, and the supplier information of the replenishment object (such as supplier identification, supplier type, etc.), availability status (such as whether it is currently available for procurement, etc.) and so on.
补货任务的属性数据可以预先存储在缓存中。此时,可以从缓存中查询补货任务的属性数据。具体的缓存方式和查询方式都可以根据实际的应用需求灵活设置。例如,可以异构补货任务的属性数据并缓存,同时设置查询关键字(Key)。The attribute data of the replenishment task can be pre-stored in the cache. At this point, the attribute data of the replenishment task can be queried from the cache. The specific cache mode and query mode can be flexibly set according to actual application requirements. For example, the attribute data of the replenishment task can be heterogeneous and cached, and the query key (Key) can be set at the same time.
分片节点可以采用各种分片方式对补货任务的属性数据进行分片,从而形成数据分片集。例如,可以根据按照补货任务的属性数据 中的指定属性数据(如供应商等)进行分片。The sharding node can use various sharding methods to shard the attribute data of the replenishment task to form a data shard set. For example, fragmentation can be performed according to specified attribute data (such as suppliers, etc.) in the attribute data of the replenishment task.
分片节点可以采用各种方法生成每个数据分片的分片标识。其中,分片标识可以用于标识数据分片。例如,分片标识可以按照顺序递增的方式生成各数据分片分别对应的分片标识。A shard node can use various methods to generate a shard identifier for each data shard. Wherein, the fragment identifier can be used to identify a data fragment. For example, the fragment identifiers may generate fragment identifiers corresponding to each data fragment in a sequentially increasing manner.
分片节点可以在缓存中存储任务标识、分片标识和数据分片之间的对应关系。例如,可以在Redis缓存中存储任务标识、分片标识和数据分片之间的对应关系。根据实际的应用需求,任务标识、分片标识和数据分片在缓存中存储的具体数据格式可以灵活设置。例如,数据分片可以采用JSON序列化的格式存储于缓存中。The sharding node can store the corresponding relationship between the task ID, the shard ID and the data shard in the cache. For example, the corresponding relationship between task identifiers, fragment identifiers and data fragments may be stored in the Redis cache. According to actual application requirements, the specific data format of the task identifier, fragment identifier and data fragment stored in the cache can be flexibly set. For example, data fragments can be stored in the cache in JSON serialized format.
同时,分片节点可以设置数据分片的查询服务。例如,可以设置任务标识和分片标识作为查询用的关键字(Key),将数据分片作为查询到的值(Value)。At the same time, shard nodes can set up query services for data shards. For example, you can set the task identifier and fragment identifier as the keyword (Key) for query, and use the data fragment as the value (Value) to be queried.
步骤402,从缓存的补货需求数据中获取分片索引对应的补货需求数据。 Step 402, acquiring replenishment demand data corresponding to the shard index from the cached replenishment demand data.
在本实施例中,补货量计算节点在接收到分片索引之后,可以根据分片索引,从缓存中获取分片索引对应的数据分片。同时,补货量计算节点可以从预先缓存的补货需求数据中获取数据分片对应的补货需求数据。其中,补货需求数据可以用于描述数据分片对应的补货对象的补货需求。In this embodiment, after receiving the shard index, the replenishment amount calculation node may obtain the data shard corresponding to the shard index from the cache according to the shard index. At the same time, the replenishment quantity calculation node can obtain the replenishment demand data corresponding to the data shards from the pre-cached replenishment demand data. Wherein, the replenishment requirement data may be used to describe the replenishment requirement of the replenishment object corresponding to the data slice.
补货需求数据可以根据具体的应用场景进行设置。例如,补货需求数据包括预测数据和配置数据。预测数据可以指通过各种预测方法进行预测得到的补货需求数据。作为示例,预测数据包括但不限于以下至少一项:未来目标时间段(如三个月)的预测销量、预测的送货时长、历史预测销量和对应实际销量的差异(如可以采用标准差表示)。配置数据可以指相关人员通过终端等输入设备等配置的补货需求数据,配置数据包括但不限于以下至少一项:货架陈列值(如满陈值和最小陈列值等)、起订量要求(如最小起订量等)、起订金额、补货频率、收货时长等等。Replenishment demand data can be set according to specific application scenarios. For example, replenishment demand data includes forecast data and configuration data. The forecast data may refer to replenishment demand data obtained by forecasting through various forecasting methods. As an example, the forecast data includes but is not limited to at least one of the following: forecast sales in a future target time period (such as three months), forecast delivery time, the difference between historical forecast sales and corresponding actual sales (for example, it can be represented by standard deviation ). Configuration data can refer to the replenishment demand data configured by relevant personnel through terminals and other input devices. Configuration data includes but is not limited to at least one of the following: shelf display value (such as full display value and minimum display value, etc.), minimum order quantity requirements ( Such as minimum order quantity, etc.), minimum order amount, replenishment frequency, delivery time, etc.
补货需求数据可以预先存储在缓存中。此时,可以直接从缓存中查询补货需求数据。具体的缓存方式和查询方式都可以根据实际的应 用需求灵活设置。例如,可以采用现有的各种数据缓存方法和查询方法实现补货需求数据的缓存和查询服务。Replenishment demand data can be pre-stored in cache. At this point, the replenishment demand data can be queried directly from the cache. The specific cache mode and query mode can be flexibly set according to actual application requirements. For example, various existing data caching methods and query methods can be used to realize the cache and query services of replenishment demand data.
步骤403,对于分片索引对应的数据分片,根据该数据分片和对应的补货需求数据,确定该数据分片对应的补货量。 Step 403, for the data segment corresponding to the segment index, determine the replenishment quantity corresponding to the data segment according to the data segment and the corresponding replenishment demand data.
在本实施例中,数据分片的数据特征可以预先存储在数据分片的缓存中。数据特征可以根据实际的应用需求或应用场景进行设置。例如,数据特征包括是否为新品。具体地,可以预先针对每种数据特征设置对应的补货量计算模型,例如,针对新品可以设置新品对应的补货量计算模型。此时,若确定数据分片的数据特征为新品,则可以将数据分片和该数据分片对应的补货需求数据,利用新品对应的补货量计算模型计算得到该数据分片对应的补货量。In this embodiment, the data characteristics of the data slice may be pre-stored in the cache of the data slice. Data characteristics can be set according to actual application requirements or application scenarios. For example, data characteristics include whether it is new or not. Specifically, a corresponding replenishment quantity calculation model may be set for each data feature in advance, for example, a replenishment quantity calculation model corresponding to a new product may be set for a new product. At this point, if it is determined that the data feature of the data shard is a new product, the data shard and the replenishment demand data corresponding to the data shard can be calculated using the replenishment quantity calculation model corresponding to the new product to obtain the replenishment demand data corresponding to the data shard. volume.
在本实施例的一些可选的实现方式中,上述补货方法还包括:在每个数据分片的缓存中添加该数据分片对应的补货量,以及将补货任务的分片索引发送至存储节点,其中,存储节点响应于接收到分片索引,从缓存中获取分片索引对应的数据分片,以及在数据库中存储获取的数据分片。In some optional implementations of this embodiment, the above replenishment method further includes: adding the replenishment quantity corresponding to the data fragment in the cache of each data fragment, and sending the fragment index of the replenishment task to To the storage node, wherein, in response to receiving the shard index, the storage node acquires the data shard corresponding to the shard index from the cache, and stores the acquired data shard in the database.
在本实施例的一些可选的实现方式中,在每个数据分片的缓存中添加该数据分片对应的补货量后,上述补货方法还包括:将补货任务的分片索引发送至调节节点,其中,调节节点响应于接收到分片索引,执行如下步骤:从缓存中获取对应的数据分片,以及从缓存的补货需求数据中获取调节参数;根据调节参数,对数据分片中的补货量进行调节,得到调节后的补货量;利用调节后的补货量对数据分片的缓存中的补货量进行更新,以及将补货任务的分片索引发送至存储节点。In some optional implementations of this embodiment, after adding the replenishment quantity corresponding to the data fragment in the cache of each data fragment, the above replenishment method further includes: sending the fragment index of the replenishment task to To the adjustment node, wherein the adjustment node performs the following steps in response to receiving the fragment index: obtain the corresponding data fragment from the cache, and obtain the adjustment parameters from the cached replenishment demand data; according to the adjustment parameters, divide the data Adjust the replenishment amount in the slice to obtain the adjusted replenishment amount; use the adjusted replenishment amount to update the replenishment amount in the cache of the data shard, and send the shard index of the replenishment task to the storage node.
在本实施例的一些可选的实现方式中,分片节点接收任务启动节点发送的补货任务,其中,任务启动节点获取目标时间段内的补货请求,以及根据补货请求生成对应的补货任务。In some optional implementations of this embodiment, the fragmentation node receives the replenishment task sent by the task initiation node, wherein the task initiation node obtains the replenishment request within the target time period, and generates a corresponding replenishment request according to the replenishment request cargo task.
在本实施例的一些可选的实现方式中,分片节点根据补货任务的属性数据确定补货任务的调节类型,其中,调节类型包括供应量调节和起订量调节;分片节点响应于确定补货任务的调节类型为供应量调节,按照补货需求端不同且补货供给端相同且补货对象相同对补货任 务相关的属性数据进行分片;响应于确定补货任务的调节类型为起订量调节,按照补货对象不同且补货需求端相同且补货供给端相同对补货任务相关的属性数据进行分片。In some optional implementations of this embodiment, the fragmentation node determines the adjustment type of the replenishment task according to the attribute data of the replenishment task, wherein the adjustment type includes supply quantity adjustment and minimum order quantity adjustment; the fragmentation node responds to It is determined that the adjustment type of the replenishment task is supply adjustment, and the attribute data related to the replenishment task is segmented according to the different replenishment demand ends, the same replenishment supply end, and the same replenishment object; in response to determining the adjustment type of the replenishment task To adjust the minimum order quantity, the attribute data related to the replenishment task is segmented according to different replenishment objects, the same replenishment demand end, and the same replenishment supply end.
在本实施例的一些可选的实现方式中,上述补货方法还包括:确定数据分片集包含的补货对象的总数量和每个数据分片包含的补货对象的数量;在数据分片的缓存中存储数据分片集包含的补货对象的总数量和每个数据分片包含的补货对象的数量;以及分片索引还包括数据分片包含的补货对象的数量;以及存储节点用于执行如下步骤:从缓存中获取数据分片集包含的补货对象的总数量,以及确定接收到的各分片索引分别对应的补货对象的数量的总和与总数量是否相同;响应于确定接收到的各分片索引分别对应的补货对象的数量的总和与总数量相同,确定补货任务计算完成。In some optional implementations of this embodiment, the above replenishment method further includes: determining the total number of replenishment objects contained in the data fragment set and the quantity of replenishment objects contained in each data fragment; The cache of the slice stores the total number of replenishment objects contained in the data slice set and the number of replenishment objects contained in each data slice; and the slice index also includes the number of replenishment objects contained in the data slice; and stores The node is used to perform the following steps: obtain the total number of replenishment objects contained in the data shard set from the cache, and determine whether the sum of the received number of replenishment objects corresponding to each shard index is the same as the total number; respond Since it is determined that the sum of the quantities of the replenishment objects corresponding to the received fragment indexes is the same as the total quantity, it is determined that the calculation of the replenishment task is completed.
在本实施例的一些可选的实现方式中,上述从缓存的补货需求数据中获取数据分片对应的补货需求数据包括:利用如下至少一项处理模式从缓存的补货需求数据中获取分片索引对应的补货需求数据:线程池、事件驱动模式和策略模式;以及上述调节节点利用如下至少一项处理模式从缓存中获取对应的数据分片,以及从缓存中获取调节参数:线程池、事件驱动模式和策略模式。In some optional implementations of this embodiment, the acquisition of the replenishment demand data corresponding to the data fragments from the cached replenishment demand data includes: using at least one of the following processing modes to obtain from the cached replenishment demand data Replenishment demand data corresponding to the shard index: thread pool, event-driven mode, and strategy mode; and the above-mentioned adjustment node uses at least one of the following processing modes to obtain the corresponding data fragment from the cache, and obtain adjustment parameters from the cache: thread Pools, event-driven patterns, and strategy patterns.
在本实施例的一些可选的实现方式中,上述分片节点、补货量计算节点、存储节点、调节节点和任务启动节点之间通过消息进行通信;以及每个数据分片在分片节点、补货量计算节点、存储节点、调节节点和任务启动节点中对应的消息由消息控制节点进行控制。In some optional implementations of this embodiment, the above-mentioned fragmentation nodes, replenishment amount calculation nodes, storage nodes, adjustment nodes, and task initiation nodes communicate through messages; The corresponding messages in the replenishment calculation node, storage node, adjustment node and task start node are controlled by the message control node.
通过对补货任务的属性数据进行分片,并对补货任务的属性数据和补货需求数据进行预先缓存,同时利用数据分片的分片索引从缓存中获取数据分片和数据分片对应的补货需求数据以进行补货量计算,从而可以实现各数据分片并行处理,利用索引从缓存中快速查询所需数据,进而有助于提升补货任务处理的整体效率。By sharding the attribute data of the replenishment task, and pre-caching the attribute data and replenishment demand data of the replenishment task, and using the shard index of the data shard to obtain the data shard and the corresponding data shard from the cache The replenishment demand data is used to calculate the replenishment quantity, so that each data fragment can be processed in parallel, and the index can be used to quickly query the required data from the cache, which in turn helps to improve the overall efficiency of replenishment task processing.
进一步参考图5,作为对上述各图所示方法的实现,本公开提供了补货装置的一个实施例,该装置实施例与图4所示的方法实施例相 对应,该装置具体可以应用于各种电子设备中。Further referring to FIG. 5 , as an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a replenishment device, which corresponds to the method embodiment shown in FIG. 4 , and this device can be specifically applied to in various electronic devices.
如图5所示,本实施例提供的补货装置500包括接收单元501、获取单元502和确定单元503。其中,接收单元501被配置成接收分片节点发送的分片索引,从缓存中获取分片索引对应的数据分片,其中,分片索引包括任务标识和分片标识,任务标识由分片节点响应于接收到补货任务而生成,分片标识由分片节点通过如下步骤生成:从缓存中查询补货任务的属性数据,以及对补货任务的属性数据进行分片,得到数据分片集;对于数据分片集中的数据分片,生成该数据分片的分片标识,以及在缓存中存储任务标识、分片标识和数据分片之间的对应关系;获取单元502被配置成从缓存的补货需求数据中获取分片索引对应的补货需求数据;确定单元503被配置成对于分片索引对应的数据分片,根据该数据分片和对应的补货需求数据,确定该数据分片对应的补货量。As shown in FIG. 5 , the replenishment device 500 provided in this embodiment includes a receiving unit 501 , an acquiring unit 502 and a determining unit 503 . Wherein, the receiving unit 501 is configured to receive the fragmentation index sent by the fragmentation node, and obtain the data fragmentation corresponding to the fragmentation index from the cache, wherein, the fragmentation index includes a task identifier and a fragmentation identifier, and the task identifier is determined by the fragmentation node Generated in response to receiving a replenishment task, the fragmentation identifier is generated by the fragmentation node through the following steps: query the attribute data of the replenishment task from the cache, and fragment the attribute data of the replenishment task to obtain a data fragmentation set ; For the data fragments in the data fragmentation set, generate the fragmentation identification of the data fragmentation, and store the corresponding relationship between the task identification, the fragmentation identification and the data fragmentation in the cache; the acquisition unit 502 is configured to from the cache The replenishment demand data corresponding to the fragmentation index is obtained from the replenishment demand data of the fragmentation index; the determining unit 503 is configured to determine the data fragmentation according to the data fragmentation and the corresponding replenishment demand data for the data fragmentation corresponding to the fragmentation index The replenishment quantity corresponding to the tablet.
在本实施例中,补货装置500中:接收单元501、获取单元502和确定单元503的具体处理及其所带来的技术效果可分别参考图4对应实施例中的步骤401、步骤402和步骤403的相关说明,在此不再赘述。In this embodiment, in the replenishment device 500: the specific processing of the receiving unit 501, the obtaining unit 502, and the determining unit 503 and the technical effects brought about by them can refer to step 401, step 402, and Relevant descriptions of step 403 will not be repeated here.
在本实施例的一些可选的实现方式中,上述补货装置还包括:发送单元(图中未示出),被配置成在每个数据分片的缓存中添加该数据分片对应的补货量,以及将补货任务的分片索引发送至存储节点,其中,存储节点响应于接收到分片索引,从缓存中获取分片索引对应的数据分片,以及在数据库中存储获取的数据分片。In some optional implementations of this embodiment, the above-mentioned replenishment device further includes: a sending unit (not shown in the figure), configured to add a supplement corresponding to the data fragment in the cache of each data fragment The quantity of goods, and the fragmentation index of the replenishment task is sent to the storage node, wherein, in response to receiving the fragmentation index, the storage node obtains the data fragmentation corresponding to the fragmentation index from the cache, and stores the acquired data in the database Fragmentation.
在本实施例的一些可选的实现方式中,上述发送单元进一步被配置成:将补货任务的分片索引发送至调节节点,其中,调节节点响应于接收到分片索引,执行如下步骤:从缓存中获取对应的数据分片,以及从缓存的补货需求数据中获取调节参数;根据调节参数,对数据分片中的补货量进行调节,得到调节后的补货量;利用调节后的补货量对数据分片的缓存中的补货量进行更新,以及将补货任务的分片索引发送至存储节点。In some optional implementations of this embodiment, the sending unit is further configured to: send the fragmentation index of the replenishment task to the adjustment node, wherein the adjustment node performs the following steps in response to receiving the fragmentation index: Obtain the corresponding data fragments from the cache, and obtain the adjustment parameters from the cached replenishment demand data; adjust the replenishment quantity in the data fragment according to the adjustment parameters to obtain the adjusted replenishment quantity; use the adjusted Update the replenishment amount in the cache of the data shard, and send the shard index of the replenishment task to the storage node.
在本实施例的一些可选的实现方式中,分片节点接收任务启动节 点发送的补货任务,其中,任务启动节点获取目标时间段内的补货请求,以及根据补货请求生成对应的补货任务。In some optional implementations of this embodiment, the fragmentation node receives the replenishment task sent by the task initiation node, wherein the task initiation node obtains the replenishment request within the target time period, and generates a corresponding replenishment request according to the replenishment request cargo task.
在本实施例的一些可选的实现方式中,分片节点根据补货任务的属性数据确定补货任务的调节类型,其中,调节类型包括供应量调节和起订量调节;分片节点响应于确定补货任务的调节类型为供应量调节,按照补货需求端不同且补货供给端相同且补货对象相同对补货任务相关的属性数据进行分片;响应于确定补货任务的调节类型为起订量调节,按照补货对象不同且补货需求端相同且补货供给端相同对补货任务相关的属性数据进行分片。In some optional implementations of this embodiment, the fragmentation node determines the adjustment type of the replenishment task according to the attribute data of the replenishment task, wherein the adjustment type includes supply quantity adjustment and minimum order quantity adjustment; the fragmentation node responds to It is determined that the adjustment type of the replenishment task is supply adjustment, and the attribute data related to the replenishment task is segmented according to the different replenishment demand ends, the same replenishment supply end, and the same replenishment object; in response to determining the adjustment type of the replenishment task To adjust the minimum order quantity, the attribute data related to the replenishment task is segmented according to different replenishment objects, the same replenishment demand end, and the same replenishment supply end.
在本实施例的一些可选的实现方式中,上述确定单元503进一步被配置成:确定数据分片集包含的补货对象的总数量和每个数据分片包含的补货对象的数量;在数据分片的缓存中存储数据分片集包含的补货对象的总数量和每个数据分片包含的补货对象的数量;以及分片索引还包括数据分片包含的补货对象的数量;以及存储节点用于执行如下步骤:从缓存中获取数据分片集包含的补货对象的总数量,以及确定接收到的各分片索引分别对应的补货对象的数量的总和与总数量是否相同;响应于确定接收到的各分片索引分别对应的补货对象的数量的总和与总数量相同,确定补货任务计算完成。In some optional implementations of this embodiment, the determination unit 503 is further configured to: determine the total number of replenishment objects contained in the data fragment set and the quantity of replenishment objects contained in each data fragment; The cache of the data shard stores the total number of replenishment objects contained in the data shard set and the number of replenishment objects contained in each data shard; and the shard index also includes the number of replenishment objects contained in the data shard; And the storage node is used to perform the following steps: obtain the total number of replenishment objects contained in the data shard set from the cache, and determine whether the sum of the received number of replenishment objects corresponding to each shard index is the same as the total number ; In response to determining that the sum of the quantities of the replenishment objects corresponding to the received shard indexes is the same as the total quantity, it is determined that the calculation of the replenishment task is completed.
在本实施例的一些可选的实现方式中,上述获取单元502被配置成:从缓存的补货需求数据中获取数据分片对应的补货需求数据包括:利用如下至少一项处理模式从缓存的补货需求数据中获取分片索引对应的补货需求数据:线程池、事件驱动模式和策略模式;以及上述调节节点利用如下至少一项处理模式从缓存中获取对应的数据分片,以及从缓存中获取调节参数:线程池、事件驱动模式和策略模式。In some optional implementations of this embodiment, the acquisition unit 502 is configured to: acquire the replenishment demand data corresponding to the data slice from the cached replenishment demand data includes: using at least one of the following processing modes to obtain from the cache Obtain the replenishment demand data corresponding to the shard index from the replenishment demand data of the shards: thread pool, event-driven mode, and strategy mode; Acquire tuning parameters in the cache: thread pool, event-driven mode and strategy mode.
在本实施例的一些可选的实现方式中,上述分片节点、补货量计算节点、存储节点、调节节点和任务启动节点之间通过消息进行通信;以及每个数据分片在分片节点、补货量计算节点、存储节点、调节节点和任务启动节点中对应的消息由消息控制节点进行控制。In some optional implementations of this embodiment, the above-mentioned fragmentation nodes, replenishment amount calculation nodes, storage nodes, adjustment nodes, and task initiation nodes communicate through messages; The corresponding messages in the replenishment calculation node, storage node, adjustment node and task start node are controlled by the message control node.
本公开的上述实施例提供的装置,通过接收单元接收分片节点发 送的分片索引,从缓存中获取分片索引对应的数据分片,其中,分片索引包括任务标识和分片标识,任务标识由分片节点响应于接收到补货任务而生成,分片标识由分片节点通过如下步骤生成:从缓存中查询补货任务的属性数据,以及对补货任务的属性数据进行分片,得到数据分片集;对于数据分片集中的数据分片,生成该数据分片的分片标识,以及在缓存中存储任务标识、分片标识和数据分片之间的对应关系;获取单元从缓存的补货需求数据中获取分片索引对应的补货需求数据;确定单元对于分片索引对应的数据分片,根据该数据分片和对应的补货需求数据,确定该数据分片对应的补货量,可以实现各数据分片并行处理,利用索引从缓存中快速查询所需数据,进而有助于提升补货任务处理的整体效率。In the device provided by the above-mentioned embodiments of the present disclosure, the receiving unit receives the fragmentation index sent by the fragmentation node, and obtains the data fragmentation corresponding to the fragmentation index from the cache, wherein the fragmentation index includes a task identifier and a fragmentation identifier, and the task The identifier is generated by the shard node in response to receiving the replenishment task, and the shard identifier is generated by the shard node through the following steps: querying the attribute data of the replenishment task from the cache, and fragmenting the attribute data of the replenishment task, Obtain the data fragmentation set; for the data fragmentation in the data fragmentation set, generate the fragmentation identifier of the data fragmentation, and store the corresponding relationship between the task identifier, the fragmentation identifier and the data fragmentation in the cache; the acquisition unit from The replenishment demand data corresponding to the shard index is obtained from the cached replenishment demand data; for the data shard corresponding to the shard index, the determining unit determines the corresponding data shard according to the data shard and the corresponding replenishment demand data Replenishment volume can realize parallel processing of each data slice, and use the index to quickly query the required data from the cache, which in turn helps to improve the overall efficiency of replenishment task processing.
下面参考图6,其示出了适于用来实现本公开的实施例的服务器(例如图1中的服务端中的服务器)600的结构示意图。图6示出的服务器仅仅是一个示例,不应对本公开的实施例的功能和使用范围带来任何限制。Referring now to FIG. 6 , it shows a schematic structural diagram of a server (for example, the server in the server in FIG. 1 ) 600 suitable for implementing an embodiment of the present disclosure. The server shown in FIG. 6 is only an example, and should not limit the functions and scope of use of the embodiments of the present disclosure.
如图6所示,电子设备600可以包括处理装置(例如中央处理器、图形处理器等)601,其可以根据存储在只读存储器(ROM)602中的程序或者从存储装置608加载到随机访问存储器(RAM)603中的程序而执行各种适当的动作和处理。在RAM 603中,还存储有电子设备600操作所需的各种程序和数据。处理装置601、ROM 602以及RAM 603通过总线604彼此相连。输入/输出(I/O)接口605也连接至总线604。As shown in FIG. 6, an electronic device 600 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 601, which may be randomly accessed according to a program stored in a read-only memory (ROM) 602 or loaded from a storage device 608. Various appropriate actions and processes are executed by programs in the memory (RAM) 603 . In the RAM 603, various programs and data necessary for the operation of the electronic device 600 are also stored. The processing device 601, ROM 602, and RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to the bus 604 .
通常,以下装置可以连接至I/O接口605:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置606;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置607;包括例如磁带、硬盘等的存储装置608;以及通信装置609。通信装置609可以允许电子设备600与其他设备进行无线或有线通信以交换数据。虽然图6示出了具有各种装置的电子设备600,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或 更少的装置。图6中示出的每个方框可以代表一个装置,也可以根据需要代表多个装置。Typically, the following devices can be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speaker, vibration an output device 607 such as a computer; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While FIG. 6 shows electronic device 600 having various means, it should be understood that implementing or having all of the means shown is not a requirement. Additional or fewer devices may alternatively be implemented or provided. Each block shown in FIG. 6 may represent one device, or may represent multiple devices as required.
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置609从网络上被下载和安装,或者从存储装置608被安装,或者从ROM 602被安装。在该计算机程序被处理装置601执行时,执行本公开的实施例的方法中限定的上述功能。In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, where the computer program includes program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via communication means 609, or from storage means 608, or from ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are executed.
需要说明的是,本公开的实施例所述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的***、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开的实施例中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行***、装置或者器件使用或者与其结合使用。而在本公开的实施例中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行***、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。It should be noted that the computer-readable medium described in the embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two. A computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In the embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the embodiments of the present disclosure, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device . Program code embodied on a computer readable medium may be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
上述计算机可读介质可以是上述服务器中所包含的;也可以是单 独存在,而未装配入该服务器中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该服务器执行时,使得该服务器:接收分片节点发送的分片索引,从缓存中获取分片索引对应的数据分片,其中,分片索引包括任务标识和分片标识,任务标识由分片节点响应于接收到补货任务而生成,分片标识由分片节点通过如下步骤生成:从缓存中查询补货任务的属性数据,以及对补货任务的属性数据进行分片,得到数据分片集;对于数据分片集中的数据分片,生成该数据分片的分片标识,以及在缓存中存储任务标识、分片标识和数据分片之间的对应关系;从缓存的补货需求数据中获取分片索引对应的补货需求数据;对于分片索引对应的数据分片,根据该数据分片和对应的补货需求数据,确定该数据分片对应的补货量。The above-mentioned computer-readable medium may be included in the above-mentioned server; it may also exist independently without being assembled into the server. The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the server, the server: receives the shard index sent by the shard node, and obtains the data corresponding to the shard index from the cache Sharding, where the sharding index includes a task ID and a sharding ID, the task ID is generated by the sharding node in response to receiving the replenishment task, and the sharding ID is generated by the sharding node through the following steps: Query the replenishment from the cache The attribute data of the task, and the attribute data of the replenishment task are fragmented to obtain the data fragmentation set; for the data fragmentation in the data fragmentation set, the fragmentation identifier of the data fragmentation is generated, and the task identifier is stored in the cache , the corresponding relationship between the fragment identifier and the data fragment; obtain the replenishment demand data corresponding to the fragment index from the cached replenishment demand data; for the data fragment corresponding to the fragment index, according to the data fragment and the corresponding The replenishment demand data of the data fragment determines the replenishment quantity corresponding to the data fragment.
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的实施例的操作的计算机程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)——连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for carrying out operations of embodiments of the present disclosure may be written in one or more programming languages, or combinations thereof, including object-oriented programming languages—such as Java, Smalltalk, C++, Also included are conventional procedural programming languages - such as the "C" language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (for example, using an Internet service provider to connected via the Internet).
附图中的流程图和框图,图示了按照本公开各种实施例的***、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组 合,可以用执行规定的功能或操作的专用的基于硬件的***来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.
描述于本公开的实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元也可以设置在处理器中,例如,可以描述为:一种处理器包括接收单元、获取单元和确定单元。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定,例如,获取单元还可以被描述为“从缓存的补货需求数据中获取分片索引对应的补货需求数据的单元”。The units involved in the embodiments described in the present disclosure may be implemented by software or by hardware. The described units may also be set in a processor, for example, it may be described as: a processor includes a receiving unit, an acquiring unit, and a determining unit. Wherein, the names of these units do not constitute a limitation on the unit itself under certain circumstances. For example, the obtaining unit can also be described as "acquiring the replenishment demand data corresponding to the fragment index from the cached replenishment demand data." unit".
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开的实施例中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述发明构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开的实施例中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is only a preferred embodiment of the present disclosure and an illustration of the applied technical principles. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solution formed by the specific combination of the above-mentioned technical features, but also covers the above-mentioned invention without departing from the above-mentioned inventive concept. Other technical solutions formed by any combination of technical features or equivalent features. For example, a technical solution formed by replacing the above-mentioned features with technical features with similar functions disclosed in (but not limited to) the embodiments of the present disclosure.

Claims (12)

  1. 一种补货***,包括分片节点和补货量计算节点;A replenishment system, including shard nodes and replenishment calculation nodes;
    所述分片节点,响应于接收到补货任务,生成所述补货任务的任务标识;从缓存中查询所述补货任务的属性数据,以及对所述补货任务的属性数据进行分片,得到数据分片集;对于所述数据分片集中的数据分片,生成该数据分片的分片标识,以及在缓存中存储所述任务标识、分片标识和数据分片之间的对应关系;将所述补货任务的分片索引发送至所述补货量计算节点,其中,所述分片索引包括任务标识和分片标识;The sharding node, in response to receiving the replenishment task, generates a task identifier of the replenishment task; queries the attribute data of the replenishment task from the cache, and fragments the attribute data of the replenishment task , to obtain the data fragmentation set; for the data fragmentation in the data fragmentation set, generate the fragmentation identifier of the data fragmentation, and store the correspondence between the task identifier, the fragmentation identifier and the data fragmentation in the cache relationship; sending the fragmentation index of the replenishment task to the replenishment amount calculation node, wherein the fragmentation index includes a task identifier and a fragmentation identifier;
    所述补货量计算节点,响应于接收到分片索引,从缓存中获取所述分片索引对应的数据分片,以及从缓存的补货需求数据中获取数据分片对应的补货需求数据;对于每个数据分片,根据该数据分片和对应的补货需求数据,确定该数据分片对应的补货量。The replenishment quantity calculation node, in response to receiving the shard index, acquires the data shard corresponding to the shard index from the cache, and acquires the replenishment demand data corresponding to the data shard from the cached replenishment demand data ; For each data fragment, determine the replenishment quantity corresponding to the data fragment according to the data fragment and the corresponding replenishment demand data.
  2. 根据权利要求1所述的***,其中,所述***还包括存储节点;以及The system of claim 1, wherein the system further comprises a storage node; and
    所述补货量计算节点,在每个数据分片的缓存中添加该数据分片对应的补货量,以及将所述补货任务的分片索引发送至所述存储节点;The replenishment quantity calculation node adds the replenishment quantity corresponding to the data fragment in the cache of each data fragment, and sends the fragment index of the replenishment task to the storage node;
    所述存储节点,响应于接收到分片索引,从缓存中获取所述分片索引对应的数据分片,以及在数据库中存储获取的数据分片。The storage node, in response to receiving the shard index, acquires the data shard corresponding to the shard index from the cache, and stores the acquired data shard in the database.
  3. 根据权利要求2所述的***,其中,所述***还包括调节节点;以及The system of claim 2, wherein the system further comprises a regulating node; and
    所述补货量计算节点,在每个数据分片的缓存中添加该数据分片对应的补货量后,将所述补货任务的分片索引发送至所述调节节点;The replenishment quantity calculation node, after adding the replenishment quantity corresponding to the data fragment in the cache of each data fragment, sends the fragment index of the replenishment task to the adjustment node;
    所述调节节点,响应于接收到分片索引,从缓存中获取对应的数据分片,以及从缓存的补货需求数据中获取调节参数;根据调节参数,对数据分片中的补货量进行调节,得到调节后的补货量;利用调节后的补货量对数据分片的缓存中的补货量进行更新,以及将所述补货任 务的分片索引发送至所述存储节点。The adjustment node, in response to receiving the fragmentation index, obtains the corresponding data fragmentation from the cache, and obtains the adjustment parameter from the cached replenishment demand data; according to the adjustment parameter, the replenishment amount in the data fragmentation is Adjusting to obtain an adjusted replenishment amount; using the adjusted replenishment amount to update the replenishment amount in the cache of the data fragmentation, and sending the fragmentation index of the replenishment task to the storage node.
  4. 根据权利要求3所述的***,其中,所述***还包括任务启动节点;The system according to claim 3, wherein the system further comprises a task initiation node;
    所述任务启动节点,获取目标时间段内的补货请求,以及根据补货请求生成对应的补货任务;将补货任务发送至所述分片节点。The task start node acquires the replenishment request within the target time period, and generates a corresponding replenishment task according to the replenishment request; and sends the replenishment task to the sharding node.
  5. 根据权利要求1-3之一所述的***,其中,所述分片节点根据所述补货任务的属性数据确定所述补货任务的调节类型,其中,所述调节类型包括供应量调节和起订量调节;The system according to any one of claims 1-3, wherein the fragmentation node determines the adjustment type of the replenishment task according to the attribute data of the replenishment task, wherein the adjustment type includes supply quantity adjustment and MOQ adjustment;
    所述分片节点,响应于确定所述补货任务的调节类型为供应量调节,按照补货需求端不同且补货供给端相同且补货对象相同对所述补货任务相关的属性数据进行分片;响应于确定所述补货任务的调节类型为起订量调节,按照补货对象不同且补货需求端相同且补货供给端相同对所述补货任务相关的属性数据进行分片。The sharding node, in response to determining that the adjustment type of the replenishment task is supply adjustment, conducts the attribute data related to the replenishment task according to the fact that the replenishment demand end is different, the replenishment supply end is the same, and the replenishment object is the same. Fragmentation: In response to determining that the adjustment type of the replenishment task is MOQ adjustment, fragment the attribute data related to the replenishment task according to different replenishment objects, the same replenishment demand end, and the same replenishment supply end .
  6. 根据权利要求1-3之一所述的***,其中,所述补货量计算节点确定所述数据分片集包含的补货对象的总数量和每个数据分片包含的补货对象的数量;在数据分片的缓存中存储所述数据分片集包含的补货对象的总数量和每个数据分片包含的补货对象的数量;以及The system according to any one of claims 1-3, wherein the replenishment quantity calculation node determines the total quantity of replenishment objects contained in the data fragment set and the quantity of replenishment objects contained in each data fragment ; store the total number of replenishment objects contained in the data fragment set and the quantity of replenishment objects contained in each data fragment in the cache of the data fragment; and
    所述分片索引包括数据分片包含的补货对象的数量;以及The shard index includes the number of replenishment objects contained in the data shard; and
    所述存储节点,从缓存中获取所述数据分片集包含的补货对象的总数量,以及确定接收到的各分片索引分别对应的补货对象的数量的总和与所述总数量是否相同;响应于确定接收到的各分片索引分别对应的补货对象的数量的总和与所述总数量相同,确定所述补货任务计算完成。The storage node acquires the total number of replenishment objects contained in the data fragmentation set from the cache, and determines whether the sum of the received quantity of replenishment objects corresponding to each fragmentation index is the same as the total quantity ; In response to determining that the sum of the quantities of replenishment objects corresponding to the respective fragment indexes received is the same as the total quantity, it is determined that the computation of the replenishment task is completed.
  7. 根据权利要求1-3之一所述的***,其中,所述补货量计算节点,利用如下至少一项处理模式从缓存的补货需求数据中获取所述分片索引对应的补货需求数据:线程池、事件驱动模式和策略模式;以 及The system according to any one of claims 1-3, wherein the replenishment quantity calculation node uses at least one of the following processing modes to obtain the replenishment demand data corresponding to the shard index from the cached replenishment demand data : thread pools, event-driven patterns, and strategy patterns; and
    所述调节节点利用如下至少一项处理模式从缓存中获取对应的数据分片,以及从缓存中获取调节参数:线程池、事件驱动模式和策略模式。The adjustment node uses at least one of the following processing modes to obtain corresponding data fragments from the cache, and obtain adjustment parameters from the cache: thread pool, event-driven mode, and strategy mode.
  8. 根据权利要求4所述的***,其中,所述分片节点、补货量计算节点、存储节点、调节节点和任务启动节点之间通过消息进行通信;以及The system according to claim 4, wherein the sharding nodes, replenishment amount calculation nodes, storage nodes, adjustment nodes and task initiation nodes communicate through messages; and
    所述***还包括消息控制节点,所述消息控制节点对所述每个数据分片在分片节点、补货量计算节点、存储节点、调节节点和任务启动节点中对应的消息进行控制。The system further includes a message control node, and the message control node controls the corresponding messages of each data fragment in the fragmentation node, replenishment calculation node, storage node, adjustment node and task initiation node.
  9. 一种补货方法,应用于补货量计算节点,包括:A replenishment method, applied to the replenishment quantity calculation node, including:
    接收分片节点发送的分片索引,从缓存中获取所述分片索引对应的数据分片,其中,所述分片索引包括任务标识和分片标识,所述任务标识由所述分片节点响应于接收到补货任务而生成,所述分片标识由所述分片节点通过如下步骤生成:从缓存中查询所述补货任务的属性数据,以及对所述补货任务的属性数据进行分片,得到数据分片集;对于所述数据分片集中的数据分片,生成该数据分片的分片标识,以及在缓存中存储所述任务标识、分片标识和数据分片之间的对应关系;Receive the fragmentation index sent by the fragmentation node, and obtain the data fragmentation corresponding to the fragmentation index from the cache, wherein the fragmentation index includes a task identifier and a fragmentation identifier, and the task identifier is determined by the fragmentation node Generated in response to receiving a replenishment task, the shard identifier is generated by the shard node through the following steps: querying the attribute data of the replenishment task from a cache, and performing an operation on the attribute data of the replenishment task Fragmentation to obtain a data fragmentation set; for the data fragmentation in the data fragmentation set, generate the fragmentation identifier of the data fragmentation, and store the task identifier, fragmentation identifier and data fragmentation in the cache corresponding relationship;
    从缓存的补货需求数据中获取所述分片索引对应的补货需求数据;Acquiring the replenishment demand data corresponding to the shard index from the cached replenishment demand data;
    对于所述分片索引对应的数据分片,根据该数据分片和对应的补货需求数据,确定该数据分片对应的补货量。For the data segment corresponding to the segment index, according to the data segment and the corresponding replenishment demand data, the replenishment quantity corresponding to the data segment is determined.
  10. 一种补货装置,应用于补货量计算节点,包括:A replenishment device, applied to a replenishment quantity calculation node, comprising:
    接收单元,被配置成接收分片节点发送的分片索引,从缓存中获取所述分片索引对应的数据分片,其中,所述分片索引包括任务标识和分片标识,所述任务标识由所述分片节点响应于接收到补货任务而生成,所述分片标识由所述分片节点通过如下步骤生成:从缓存中查 询所述补货任务的属性数据,以及对所述补货任务的属性数据进行分片,得到数据分片集;对于所述数据分片集中的数据分片,生成该数据分片的分片标识,以及在缓存中存储所述任务标识、分片标识和数据分片之间的对应关系;The receiving unit is configured to receive the fragmentation index sent by the fragmentation node, and acquire the data fragmentation corresponding to the fragmentation index from the cache, wherein the fragmentation index includes a task identifier and a fragmentation identifier, and the task identifier Generated by the shard node in response to receiving the replenishment task, the shard identifier is generated by the shard node through the following steps: querying the attribute data of the replenishment task from the cache, and querying the replenishment task The attribute data of the cargo task is fragmented to obtain a data fragmentation set; for the data fragmentation in the data fragmentation set, the fragmentation identification of the data fragmentation is generated, and the task identification and fragmentation identification are stored in the cache Correspondence with data shards;
    获取单元,被配置成从缓存的补货需求数据中获取所述分片索引对应的补货需求数据;The acquiring unit is configured to acquire the replenishment demand data corresponding to the shard index from the cached replenishment demand data;
    确定单元,被配置成对于所述分片索引对应的数据分片,根据该数据分片和对应的补货需求数据,确定该数据分片对应的补货量。The determining unit is configured to, for the data fragment corresponding to the fragment index, determine the replenishment quantity corresponding to the data fragment according to the data fragment and the corresponding replenishment demand data.
  11. 一种服务器,包括:A server comprising:
    一个或多个处理器;one or more processors;
    存储装置,其上存储有一个或多个程序;a storage device having one or more programs stored thereon;
    当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求9所述的方法。When the one or more programs are executed by the one or more processors, the one or more processors implement the method as claimed in claim 9 .
  12. 一种计算机可读介质,其上存储有计算机程序,其中,该程序被处理器执行时实现如权利要求9所述的方法。A computer-readable medium, on which a computer program is stored, wherein, when the program is executed by a processor, the method as claimed in claim 9 is realized.
PCT/CN2022/133208 2022-03-01 2022-11-21 Restocking system, method, and device WO2023165170A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210192703.3 2022-03-01
CN202210192703.3A CN116739468A (en) 2022-03-01 2022-03-01 Restocking system, method and device

Publications (1)

Publication Number Publication Date
WO2023165170A1 true WO2023165170A1 (en) 2023-09-07

Family

ID=87882881

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/133208 WO2023165170A1 (en) 2022-03-01 2022-11-21 Restocking system, method, and device

Country Status (2)

Country Link
CN (1) CN116739468A (en)
WO (1) WO2023165170A1 (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831146A (en) * 2012-06-19 2012-12-19 天津神舟通用数据技术有限公司 Database substring filtering index system and method for constructing and inquiring database substring filtering index system
CN106528683A (en) * 2016-10-25 2017-03-22 深圳市盛凯信息科技有限公司 Index segmenting equalization based big data cloud search platform and method thereof
CN112884389A (en) * 2019-11-29 2021-06-01 北京沃东天骏信息技术有限公司 Data processing method and device
CN113177824A (en) * 2021-05-06 2021-07-27 北京沃东天骏信息技术有限公司 Replenishment task processing method, replenishment task processing device, computer system and readable storage medium
CN113450047A (en) * 2020-03-27 2021-09-28 北京沃东天骏信息技术有限公司 Processing method and device for electronic replenishment equipment and electronic replenishment equipment
CN113537861A (en) * 2020-04-16 2021-10-22 北京京东振世信息技术有限公司 Replenishment method and replenishment device
CN113673872A (en) * 2021-08-23 2021-11-19 北京京东振世信息技术有限公司 Replenishment processing method and device, storage medium and electronic equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831146A (en) * 2012-06-19 2012-12-19 天津神舟通用数据技术有限公司 Database substring filtering index system and method for constructing and inquiring database substring filtering index system
CN106528683A (en) * 2016-10-25 2017-03-22 深圳市盛凯信息科技有限公司 Index segmenting equalization based big data cloud search platform and method thereof
CN112884389A (en) * 2019-11-29 2021-06-01 北京沃东天骏信息技术有限公司 Data processing method and device
CN113450047A (en) * 2020-03-27 2021-09-28 北京沃东天骏信息技术有限公司 Processing method and device for electronic replenishment equipment and electronic replenishment equipment
CN113537861A (en) * 2020-04-16 2021-10-22 北京京东振世信息技术有限公司 Replenishment method and replenishment device
CN113177824A (en) * 2021-05-06 2021-07-27 北京沃东天骏信息技术有限公司 Replenishment task processing method, replenishment task processing device, computer system and readable storage medium
CN113673872A (en) * 2021-08-23 2021-11-19 北京京东振世信息技术有限公司 Replenishment processing method and device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN116739468A (en) 2023-09-12

Similar Documents

Publication Publication Date Title
JP6887544B2 (en) Enriching events with dynamically typed big data for event processing
JP7333424B2 (en) Graph generation for distributed event processing systems
JP7316341B2 (en) Spatial change detector in stream data
US11321321B2 (en) Record expansion and reduction based on a processing task in a data intake and query system
US10482113B2 (en) Systems and methods to build and utilize a search infrastructure
US10217256B2 (en) Visually exploring and analyzing event streams
US10853847B2 (en) Methods and systems for near real-time lookalike audience expansion in ads targeting
US20190310977A1 (en) Bucket data distribution for exporting data to worker nodes
US20190258637A1 (en) Partitioning and reducing records at ingest of a worker node
US10048830B2 (en) System and method for integrating microservices
US9606840B2 (en) Enterprise data-driven system for predictive resource provisioning in cloud environments
US10824608B2 (en) Feature generation and storage in a multi-tenant environment
US10394805B2 (en) Database management for mobile devices
US20180173767A1 (en) System and method for facilitating queries via request-prediction-based temporary storage of query results
US10375157B2 (en) System and method for reducing data streaming and/or visualization network resource usage
US20210089649A1 (en) Machine learning anomaly detection mechanism
WO2023165170A1 (en) Restocking system, method, and device
US20210103561A1 (en) Performance measurement mechanism
US11562319B1 (en) Machine learned item destination prediction system and associated machine learning techniques
US20180173705A1 (en) System and method for facilitating queries via request-prediction-based temporary storage of query results
US11526258B1 (en) Systems and methods for synthetic data aggregations
US20200159834A1 (en) Systems and methods of processing transaction data
US20230367761A1 (en) Managing Master Data For Distributed Environments
US20230350871A1 (en) Efficiently Managing Changes To Master Data
US10706190B2 (en) Transfer and visualization of time streams for forecast simulation

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22929598

Country of ref document: EP

Kind code of ref document: A1