Order merging method, device, equipment and storage medium
By detecting the order merging task, obtaining the merging parameters, determining the target associated key and shard identification, and using asynchronous threads to process the order merging, the problem of long order merging logic processing time caused by the large number of sub-orders is solved, and the order merging efficiency and system processing are improved. ability.
Patent Information
- Application Number
- CN202110499996.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-08
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-05-08
AI Technical Summary
When there are a large number of child orders and too many details, the combined order logic processing time will be long, resulting in the failure of the parent order to be issued in time, and unreasonable scanning logic will block the time node and affect the normal processing of the order.
By detecting the order merging task, obtaining the merging parameters, determining the target associated key and shard identification, processing the order merging based on asynchronous threads, using the hashing algorithm to encrypt the item ownership and logistics information, and generating order merging instructions to achieve order concurrency. processing and merging.
It improves the efficiency of order merging, ensures that parent orders can be issued in time, avoids blocking caused by delay in sub-order processing, and improves the system's processing capacity and efficiency.
Smart Images

Figure CN113159689B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of warehousing and logistics technology, and in particular, to an order merging method, device, equipment and storage medium. Background Art
[0002] Order consolidation is used to solve the transportation of unified planning and orders with the same origin and destination. It can be merged according to the user's configuration, thereby saving transportation costs and warehouse production costs. When placing an ordinary order, it first passes the basic verification, inventory pre-occupancy and other pre-process verifications, and then is dispatched to the warehouse for production, shipped out, and sent to the destination. After the orders that need to be consolidated pass a series of pre-verifications such as basic verification, they will not be dispatched to the warehouse for production temporarily, and will wait until the unified delivery time, and then be dispatched to the warehouse for production and sent to the destination.
[0003] In the process of implementing the present invention, the inventors found that there are at least the following technical problems in the prior art: when there are a large number of sub-orders and too many sub-order details, the logical processing time of the combined order is long, resulting in the parent order not being able to be issued in time, and unreasonable scanning of the sub-orders will also scan the merchant's order for judgment logic, resulting in blocking the parent order that should be issued at that time node. Summary of the invention
[0004] The embodiments of the present invention provide an order merging method, device, equipment and storage medium to improve the efficiency of order merging.
[0005] In a first aspect, an embodiment of the present invention provides an order merging method, comprising:
[0006] In response to the detected order merging task, obtaining order merging parameters corresponding to the order merging task;
[0007] Determine the target association key and target shard identifier of the order merging task according to the order merging parameters;
[0008] An asynchronous thread is created based on the target shard identifier, and an order merging instruction is generated by using the target association key and the target shard identifier and sent to the order merging party, so that the order merging party merges the orders according to the target association key and the target shard identifier.
[0009] Optionally, based on the above solution, the order merging parameters include item ownership information and logistics information, and the target association key and target shard identifier of the order merging task are determined according to the order merging parameters, including:
[0010] Merge and encrypt the item ownership information and logistics information to obtain the target association key;
[0011] The target shard identifier is determined based on the target association key and the preset shard range.
[0012] Optionally, based on the above solution, the order merging task is triggered based on a scheduled task.
[0013] Optionally, based on the above solution, it also includes:
[0014] According to the received order information, determine the order association key corresponding to the order information;
[0015] Add the order information to the combined order pool according to the order association key and the order merging parameters corresponding to the order information.
[0016] Optionally, based on the above solution, the order information includes item ownership information and logistics information. According to the received order information, the order association key corresponding to the order information is determined, including:
[0017] The item ownership information and logistics information are combined and encrypted to obtain the order association key.
[0018] Optionally, based on the above solution, the item ownership information and logistics information are combined and encrypted to obtain an order association key, including:
[0019] Based on the hash algorithm, the item ownership information and logistics information are encrypted, and the encryption result is used as the order association key.
[0020] Optionally, based on the above solution, the order merging parameters include a preset order merging time, and the order information is added to the order merging pool according to the order association key and the order merging parameters corresponding to the order information, including:
[0021] Determine the order shard identifier corresponding to the order information according to the order association key;
[0022] Determine the order closing time corresponding to the order information according to the preset order closing time;
[0023] Add the order ID, order association key, order shard ID, order consolidation time and order consolidation status to the order consolidation pool.
[0024] In a second aspect, an embodiment of the present invention further provides an order merging device, comprising:
[0025] A merging parameter acquisition module, used to obtain order merging parameters corresponding to the order merging task in response to the detected order merging task;
[0026] A target identification determination module is used to determine a target association key and a target shard identification of an order merging task according to order merging parameters;
[0027] The order merging module is used to create an asynchronous thread based on the target shard identifier, generate an order merging instruction based on the target association key and the target shard identifier, and send it to the order merging party, so that the order merging party merges the orders according to the target association key and the target shard identifier.
[0028] In a third aspect, an embodiment of the present invention further provides a computer device, the device comprising:
[0029] one or more processors;
[0030] A storage device for storing one or more programs;
[0031] When one or more programs are executed by one or more processors, the one or more processors implement the order merging method provided by any embodiment of the present invention.
[0032] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements an order merging method as provided in any embodiment of the present invention.
[0033] The embodiment of the present invention obtains order merging parameters corresponding to the order merging task in response to the detected order merging task; determines the target association key and target shard identifier of the order merging task according to the order merging parameters; creates an asynchronous thread based on the target shard identifier, generates an order merging instruction with the target association key and the target shard identifier and sends it to the order merging party, so that the order merging party merges the orders according to the target association key and the target shard identifier. When the order merging task is detected, an asynchronous thread is created to process the order merging process based on the target shard corresponding to the order merging task, so that the order merging can be processed concurrently, thereby improving the order merging efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 is a flow chart of an order merging method provided by Embodiment 1 of the present invention;
[0035] Figure 2 This is an overall architecture diagram of an order merging method provided by Embodiment 2 of the present invention;
[0036] Figure 3 It is a structural schematic diagram of an order merging device provided in Embodiment 3 of the present invention;
[0037] Figure 4 It is a structural diagram of a computer device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0038] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0039] Embodiment 1
[0040] Figure 1 1 is a flowchart of an order merging method provided in the first embodiment of the present invention. This embodiment is applicable to the situation where the merchant's orders are merged and shipped in an e-commerce platform. The method can be executed by an order merging device, which can be implemented in software and / or hardware. For example, the order merging device can be configured in a computer device. Figure 1 As shown, the method includes:
[0041] S110 . In response to the detected order merging task, obtain order merging parameters corresponding to the order merging task.
[0042] In this embodiment, the order merging task may be triggered by the user and is used to indicate an instruction to merge the orders. Optionally, the user may trigger the order merging task according to actual needs. Optionally, the order merging task may also be triggered based on a scheduled task. For example, a default frequency (such as 1 minute / time) is set to trigger the order merging task on a scheduled basis. After the order merging task is detected, the order merging parameters corresponding to the order merging task are obtained, and the order merging task is executed based on the order merging parameters.
[0043] Optionally, the order merging parameters can be parameters pre-set by the user, which are used to determine whether orders can be merged. Exemplarily, the order merging conditions may include the scope of merging orders (such as document businesses that have been connected to the order merging function), order merging rules (such as documents that can be merged if there are the same matching fields, etc.), order merging waves (such as the unified time point for merging orders), etc. Correspondingly, the order merging parameters may include the above parameters. In general, the necessary order merging conditions include item ownership information and logistics information. Sub-orders with the same item ownership information and the same logistics information are merged, that is, the order merging parameters are the item ownership information and logistics information.
[0044] Generally, the same user (such as a merchant) will set a unified order merging parameter. On this basis, obtaining the order merging parameter corresponding to the order merging task can be: determining the user ID corresponding to the order merging task, and using the order merging parameter corresponding to the user ID as the order merging parameter corresponding to the order merging task.
[0045] S120. Determine a target association key and a target shard identifier of the order merging task according to the order merging parameters.
[0046] In this embodiment, order information is stored in different shards to achieve asynchronous concurrent processing of order merging. To achieve order merging of the same user in the same shard, the target shard identifier can be determined based on the order merging parameters set by the user, and the asynchronous concurrent processing of order merging tasks of different users can be achieved based on the shard corresponding to the target shard identifier.
[0047] In one embodiment, the target association key and target shard identifier of the order merging task are determined according to the order merging parameters, including: merging and encrypting the item ownership information and the logistics information to obtain the target association key; determining the target shard identifier based on the target association key and the preset shard interval. In general, the necessary order merging conditions include the same item ownership information and the same logistics information. Therefore, the order merging parameters can be set to include the item ownership information and the logistics information, and the item ownership information and the logistics information are merged and encrypted to obtain the target association key; after determining the target association key, the target association key is compared with the preset shard interval, and the shard identifier corresponding to the shard interval containing the target association key is used as the target shard identifier. Exemplarily, assuming that the target association key is 984 and the interval corresponding to shard 1 is [0,1000], shard 1 is used as the target shard identifier. Among them, the merging encryption algorithm of the item ownership information and the logistics information can refer to the merging encryption algorithm in the prior art, and is not limited here.
[0048] To ensure that the order information can be obtained from the correct shard when executing the order merging task, the order management key and order shard identifier need to be determined in the same way when storing the order information for information storage. In other words, the target shard identifier determined by the order merging task is the same as the order shard identifier used when storing the order information corresponding to the order merging task.
[0049] Optionally, when storing order information, after receiving the order, the order association key corresponding to the order information is determined according to the received order information; the order information is added to the order pool according to the order association key and the order merging parameters corresponding to the order information. By determining the order association key corresponding to the order information in advance according to the order merging parameters (i.e., order merging conditions), the order information is stored in advance corresponding to the order association key, and the subsequent order merging operation process is simplified by preprocessing the order information. Among them, the order association key corresponding to the order information can be specifically determined according to the order merging parameters used for presetting. Exemplarily, assuming that the order merging parameters include the item attribution party information and the item purchaser information, the order association key corresponding to the order information is determined based on the item attribution party and the item purchaser. Among them, the item attribution party information includes the item attribution party identifier and / or the business department identifier, and the logistics information includes at least one of the originating warehouse identifier, the carrier identifier, and the destination identifier. Among them, the item attribution party identifier can be understood as a merchant identifier, the business department identifier can be understood as a business department identifier, and the carrier identifier can be understood as a carrier identifier.
[0050] In one embodiment, the order information includes item ownership information and logistics information. Based on the received order information, an order association key corresponding to the order information is determined, including: merging and encrypting the item ownership information and the logistics information to obtain the order association key.
[0051] Generally, the necessary conditions for combining orders include the item ownership information and logistics information, that is, orders with the same item ownership information and logistics information are combined. Therefore, the item ownership information and logistics information can be combined and encrypted to obtain the order association key. Among them, the combined encryption algorithm of the item ownership information and logistics information can refer to the combined encryption algorithm in the prior art, and is not limited here.
[0052] Preferably, the item ownership information and logistics information are combined and encrypted to obtain an order association key, including: encrypting the item ownership information and logistics information based on a hash algorithm, and using the encryption result as the order association key.
[0053] In this embodiment, the item ownership information and logistics information can be encrypted by a hash algorithm to obtain an order association key. The hash algorithm can ensure the uniqueness of information with shorter information. This mark is related to each byte of the information, and it is difficult to find a reverse rule. To a certain extent, it guarantees the uniqueness of the order association key, and further ensures the accuracy of order merging based on the order association key.
[0054] On the basis of the above solution, the merging conditions configured by the user (merchant) corresponding to the sub-order can also be obtained, and the association key corresponding to the order information is generated based on the information in the merging conditions.
[0055] In one embodiment of the present invention, the order merging parameters include a preset order merging time, and the order information is added to the order merging pool according to the order association key and the order merging parameters corresponding to the order information, including: determining the order shard identifier corresponding to the order information according to the order association key; determining the order merging time corresponding to the order information according to the preset order merging time; adding the order identifier, order association key, order shard identifier, order merging time and order merging status to the order merging pool.
[0056] After determining the order association key corresponding to the order information, the order shard identifier is determined based on the order association key, and the order closing time pre-set by the user corresponding to the order information is obtained. A closing time is selected from the pre-set closing time as the order closing time corresponding to the order information, and the order identifier, order association key, order shard identifier, order closing time and closing status are added to the closing pool. Among them, selecting a closing time from the pre-set closing time as the order closing time corresponding to the order information can be: taking the closing time closest to the order time as the order closing time. Determining the order shard identifier based on the order association key can be: comparing the order association key with the pre-set shard interval to determine the order shard identifier. The specific implementation can refer to the above embodiment and will not be repeated here. The order information is processed in advance, and the order identifier, order association key, order shard identifier, order closing time and closing status are added to the closing pool, which simplifies the subsequent processing of closing orders and enables closing orders to be controlled based on the time dimension.
[0057] S130. Create an asynchronous thread based on the target shard identifier, generate an order merge instruction using the target association key and the target shard identifier, and send the instruction to the order merger, so that the order merger merges the orders according to the target association key and the target shard identifier.
[0058] In this embodiment, an asynchronous thread is created by the shard corresponding to the target shard identifier, and the order merging operation is performed based on the target association key. It should be noted that the specific order merging operation is performed by the service consumer (i.e., the downstream application that calls the service, the order merger party), and the order merger party performs the specific order merging operation. After the order merging device determines the target association key, it sends the target association key and the target shard identifier to the message queue, and sends it to the service consumer to process the specific order merging business.
[0059] Optionally, the order merger party merges the sub-orders in the shard according to the target association key and the target shard identifier, which can be: the order merger party merges the orders whose association key is the target association key and whose order merger status is the pending order merger status to obtain a merged order.
[0060] The embodiment of the present invention obtains order merging parameters corresponding to the order merging task in response to the detected order merging task; determines the target association key and target shard identifier of the order merging task according to the order merging parameters; creates an asynchronous thread based on the target shard identifier, generates an order merging instruction with the target association key and the target shard identifier and sends it to the order merging party, so that the order merging party merges the orders according to the target association key and the target shard identifier. When the order merging task is detected, an asynchronous thread is created to process the order merging process based on the target shard corresponding to the order merging task, so that the order merging can be processed concurrently, thereby improving the order merging efficiency.
[0061] Embodiment 2
[0062] Based on the above solution, this embodiment concretizes the items into commodities, and provides a preferred embodiment. In general, the embodiment of the present invention performs scheduled task scanning and tilting at different time points. When scanning scheduled tasks, there is no need to scan tasks that have not yet arrived, thereby achieving time isolation, so that orders that have not yet arrived will not affect orders that should be executed. In addition, for the parallel processing of sub-orders at the same time point, the scheduled task framework is used to process the tasks that have arrived in time in parallel, thereby improving the processing efficiency of the combined orders at a single time point.
[0063] Figure 2 This is an overall architecture diagram of an order merging method provided by Embodiment 2 of the present invention. Figure 2 As shown, the specific implementation of the order merging method provided in the embodiment of the present invention includes:
[0064] 1. Sub-order creation process
[0065] The sub-document contains fields such as merchant, business unit, origin warehouse, destination store, carrier, soMark (special configuration for other order-related details), expected delivery date, order time, consignee, order details (one sub-document contains n order details), etc. The required order-merging conditions are merchant, business unit, origin warehouse, destination store, and carrier. Other order-merging conditions can be read from the configuration center. After obtaining them, a string is generated based on these conditions and encrypted using a special algorithm to generate a unique key (i.e., association key) (if the above conditions are the same for multiple sub-orders, these sub-orders can be combined into one parent order). The information recorded in the order-merging pool is: sub-order number, unique key (sub-orders with the same key can be combined into one parent order), order-merging time (the merchant configures multiple time points, and the latest trigger time point that meets the configuration will be calculated here according to the configuration), shard position (the shard position is calculated using the unique key), order-merging status (to be merged / merged, etc.). At this point, the sub-order creation process ends.
[0066] 2. Order triggering process
[0067] Use the scheduled task to trigger the order closing action. The default frequency is 1 minute / time (configurable). When the scheduled task is triggered, the defined shard creates an asynchronous thread, and queries the unique key that meets the conditions according to the order closing status and order closing time. Send the unique key and shard status to the message queue for the service consumer to handle the specific order closing business.
[0068] 3. Business process of order combination
[0069] Consume the message queue, use the unique key to prevent duplication, query all sub-orders with the same unique key and the status of pending order combination, and trigger specific order combination business.
[0070] The order merging method provided by the embodiment of the present invention can change the order merging method of batch execution from being uncontrollable to being controlled according to the time dimension and concurrency, thereby achieving the decoupling of order merging tasks without affecting each other.
[0071] Embodiment 3
[0072] Figure 3 1 is a schematic diagram of the structure of an order merging device provided in Embodiment 3 of the present invention. The order merging device can be implemented in software and / or hardware, for example, the order merging device can be configured in a computer device. Figure 3 As shown, the device includes a merging parameter acquisition module 310, a target identifier determination module 320 and an order merging module 330, wherein:
[0073] A merging parameter acquisition module 310 is used to obtain order merging parameters corresponding to the order merging task in response to the detected order merging task;
[0074] A target identifier determination module 320, used to determine a target association key and a target shard identifier of an order merging task according to order merging parameters;
[0075] The order merging module 330 is used to create an asynchronous thread based on the target shard identifier, generate an order merging instruction based on the target association key and the target shard identifier, and send it to the order merging party, so that the order merging party merges the orders according to the target association key and the target shard identifier.
[0076] The embodiment of the present invention obtains the order merging parameters corresponding to the order merging task in response to the detected order merging task through the merging parameter acquisition module; the target identifier determination module determines the target association key and target shard identifier of the order merging task according to the order merging parameters; the order merging module creates an asynchronous thread based on the target shard identifier, generates an order merging instruction with the target association key and the target shard identifier and sends it to the order merging party, so that the order merging party merges the orders according to the target association key and the target shard identifier. When the order merging task is detected, an asynchronous thread is created to process the order merging process based on the target shard corresponding to the order merging task, so that the order merging can be processed concurrently, thereby improving the order merging efficiency.
[0077] Optionally, based on the above solution, the device further includes an order information processing module, including:
[0078] An association key determination unit, used to determine an order association key corresponding to the order information according to the received order information;
[0079] The order information storage unit is used to add the order information to the order pool according to the order association key and the order merging parameters corresponding to the order information.
[0080] Optionally, based on the above solution, the order information includes item ownership information and logistics information, and the association key determination unit is specifically used to:
[0081] The item ownership information and logistics information are combined and encrypted to obtain the order association key.
[0082] Optionally, based on the above solution, the association key determination unit is specifically used to:
[0083] Based on the hash algorithm, the item ownership information and logistics information are encrypted, and the encryption result is used as the order association key.
[0084] Optionally, based on the above solution, the order merging parameters include a preset order merging time, and the order information storage unit is specifically used for:
[0085] Determine the order shard identifier corresponding to the order information according to the order association key;
[0086] Determine the order closing time corresponding to the order information according to the preset order closing time;
[0087] Add the order ID, order association key, order shard ID, order consolidation time and order consolidation status to the order consolidation pool.
[0088] Optionally, based on the above solution, the order merging parameters include item ownership information and logistics information, and the target identification determination module 320 is specifically used to:
[0089] Merge and encrypt the item ownership information and logistics information to obtain the target association key;
[0090] The target shard identifier is determined based on the target association key and the preset shard range.
[0091] Optionally, based on the above solution, the order merging task is triggered based on a scheduled task.
[0092] The order merging device provided in the embodiment of the present invention can execute the order merging method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0093] Embodiment 4
[0094] Figure 4 It is a structural diagram of a computer device provided in Embodiment 4 of the present invention. Figure 4 It is a structural diagram of a computer device provided in Embodiment 4 of the present invention. Figure 4 A block diagram of an exemplary computer device 412 suitable for use in implementing embodiments of the present invention is shown. Figure 4 The computer device 412 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0095] like Figure 4 As shown, the computer device 412 is in the form of a general-purpose computing device. The components of the computer device 412 may include, but are not limited to: one or more processors 414, a system memory 428, and a bus 418 that connects different system components (including the system memory 428 and the processor 414).
[0096] Bus 418 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a local bus to processor 414, or a bus structure using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0097] The computer device 412 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 412, including volatile and non-volatile media, removable and non-removable media.
[0098] System memory 428 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 430 and / or cache memory 432. Computer device 412 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage device 434 may be used to read and write non-removable, non-volatile magnetic media ( Figure 4 not shown, usually called a "hard drive"). Although Figure 4 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 418 via one or more data medium interfaces. The memory 428 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0099] A program / utility 440 having a set (at least one) of program modules 442 may be stored, for example, in memory 428, such program modules 442 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 442 generally perform the functions and / or methods of the embodiments described herein.
[0100] The computer device 412 may also communicate with one or more external devices 414 (e.g., keyboard, pointing device, display 424, etc.), may also communicate with one or more devices that enable a user to interact with the computer device 412, and / or communicate with any device that enables the computer device 412 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed via input / output (I / O) interface 422. Furthermore, the computer device 412 may also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN) and / or public network, such as the Internet) via network adapter 420. As shown, the network adapter 420 communicates with other modules of the computer device 412 via bus 418. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the computer device 412, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0101] The processor 414 executes various functional applications and data processing by running the program stored in the system memory 428, for example, implementing the order merging method provided in the embodiment of the present invention, which includes:
[0102] In response to the detected order merging task, obtaining order merging parameters corresponding to the order merging task;
[0103] Determine the target association key and target shard identifier of the order merging task according to the order merging parameters;
[0104] An asynchronous thread is created based on the target shard identifier, and an order merging instruction is generated by using the target association key and the target shard identifier and sent to the order merging party, so that the order merging party merges orders according to the target association key and the target shard identifier.
[0105] Of course, those skilled in the art can understand that the processor can also implement the technical solution of the order merging method provided by any embodiment of the present invention.
[0106] Embodiment 5
[0107] Embodiment 5 of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the order merging method provided in the embodiment of the present invention is implemented. The method includes:
[0108] In response to the detected order merging task, obtaining order merging parameters corresponding to the order merging task;
[0109] Determine the target association key and target shard identifier of the order merging task according to the order merging parameters;
[0110] An asynchronous thread is created based on the target shard identifier, and an order merging instruction is generated by using the target association key and the target shard identifier and sent to the order merging party, so that the order merging party merges orders according to the target association key and the target shard identifier.
[0111] Of course, the computer-readable storage medium provided by the embodiment of the present invention stores a computer program which is not limited to the above method operations, but can also execute related operations of the order merging method provided by any embodiment of the present invention.
[0112] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0113] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0114] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0115] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0116] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. An order merging method, characterized in that: include: In response to the detected order merging task, obtaining order merging parameters corresponding to the order merging task; Determine the target association key and target shard identifier of the order merging task according to the order merging parameters; The target shard identifier is determined based on the target association key and the preset shard interval, wherein determining the target shard identifier includes: comparing the target association key with the preset shard interval, and taking the shard identifier corresponding to the shard interval containing the target association key as the target shard identifier; Creating an asynchronous thread based on the target shard identifier, generating an order merging instruction using the target association key and the target shard identifier and sending the instruction to the order merging party, so that the order merging party merges the orders according to the target association key and the target shard identifier; The method further comprises: Determine, according to the received order information, an order association key corresponding to the order information; Adding the order information to the combined order pool according to the order association key and the order merging parameter corresponding to the order information; The order merging parameters include a preset order merging time, and the adding the order information to the order merging pool according to the order association key and the order merging parameters corresponding to the order information includes: Compare the order association key with a preset sharding interval to determine an order sharding identifier corresponding to the order information; Selecting an order closing time from the preset order closing times as the order closing time corresponding to the order information; wherein the order closing time is the order closing time closest to the order time; Add the order ID, the order association key, the order shard ID, the order closing time and the order closing status to the order closing pool; The target shard identifier of the order merging task is the same as the order shard identifier used when storing the order information corresponding to the order merging task.
2. The method according to claim 1, characterized in that The order merging parameters include item ownership information and logistics information, and determining the target association key and target shard identifier of the order merging task according to the order merging parameters includes: The item ownership information and the logistics information are combined and encrypted to obtain the target association key.
3. The method according to claim 1, characterized in that The order merging task is triggered based on a scheduled task.
4. The method according to claim 1, characterized in that: The order information includes item ownership information and logistics information. The step of determining the order association key corresponding to the order information according to the received order information includes: The item ownership information and the logistics information are combined and encrypted to obtain the order association key.
5. The method according to claim 4, characterized in that The combining and encrypting the item ownership information and the logistics information to obtain the order association key includes: Based on the hash algorithm, the item ownership information and the logistics information are encrypted, and the encryption result is used as the order association key.
6. An order merging device, characterized in that: include: A merging parameter acquisition module, used to obtain, in response to a detected order merging task, an order merging parameter corresponding to the order merging task; A target identification determination module, used to determine a target association key and a target shard identification of the order merging task according to the order merging parameters; The target shard identifier is determined based on the target association key and the preset shard interval, wherein determining the target shard identifier includes: comparing the target association key with the preset shard interval, and taking the shard identifier corresponding to the shard interval containing the target association key as the target shard identifier; An order merging module, used to create an asynchronous thread based on the target shard identifier, generate an order merging instruction based on the target association key and the target shard identifier, and send it to the order merging party, so that the order merging party merges the orders according to the target association key and the target shard identifier; The device also includes an order information processing module, including: An association key determining unit, configured to determine an order association key corresponding to the order information according to the received order information; An order information storage unit, used to add the order information to the combined order pool according to the order association key and the order merging parameter corresponding to the order information; The order merging parameters include a preset order merging time, and the order information storage unit is specifically used for: Compare the order association key with a preset sharding interval to determine an order sharding identifier corresponding to the order information; Selecting an order closing time from the preset order closing times as the order closing time corresponding to the order information; wherein the order closing time is the order closing time closest to the order time; Add the order ID, the order association key, the order shard ID, the order closing time and the order closing status to the order closing pool; The target shard identifier of the order merging task is the same as the order shard identifier used when storing the order information corresponding to the order merging task.
7. A computer device, characterized in that: The device comprises: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the order consolidation method as described in any one of claims 1-5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the order merging method as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
A data processing method and apparatus
CN109032796A
Method and device for merging target orders
CN111612388A
