Disclosure of Invention
In view of this, the embodiment of the present invention provides a method for merging target orders, which can meet merging requirements of users in different scenarios, reduce user cost, reduce order merging time, and improve order merging efficiency.
To achieve the above object, according to a first aspect of the embodiments of the present invention, a method for merging target orders is provided.
The method for merging the target orders in the embodiment of the invention comprises the following steps: generating a target order corresponding to the order information according to the received order information, and generating a merge key of the target order; according to the order information, inquiring a target merging strategy matched with the target order, and extracting merging information meeting the target merging strategy from the order information; and determining key value information of the merge key according to the merge information and the unique identifier of the target order, and merging the target order according to the key value information.
Optionally, before querying the target merging policy matched with the target order, the method further includes: a merging strategy set is configured in advance; and according to the order information, inquiring a target merging strategy matched with the target order, wherein the method comprises the following steps: determining a pushing party of the order information, and determining a pushing party merging strategy set corresponding to the pushing party according to the merging strategy set; selecting a target merging strategy set from the pusher merging strategy set according to the order information; and selecting the merging strategy with the highest priority as the target merging strategy from the target merging strategy set.
Optionally, the determining, according to the merging information and the unique identifier of the target order, key value information of the merging key includes: and based on a Hash hash algorithm, encrypting the merging information and the unique identifier of the target order, and determining that the result of encryption processing is the key value information of the merging key.
Optionally, after generating the merge key of the target order, the method further comprises: increasing the index of the merge key; and the merging process is carried out on the target order according to the key value information, and comprises the following steps: adding the target order with the key value information into an order list; and scanning the key value information of the orders in the order list according to a preset period by using the index, and merging the orders with the same key value information.
To achieve the above object, according to a second aspect of the embodiments of the present invention, there is provided an apparatus for merging target orders.
The device for merging the target orders in the embodiment of the invention comprises the following components: the generating module is used for generating a target order corresponding to the order information according to the received order information and generating a merge key of the target order; the extraction module is used for inquiring a target merging strategy matched with the target order according to the order information and extracting merging information meeting the target merging strategy from the order information; and the merging module is used for determining key value information of the merging key according to the merging information and the unique identifier of the target order and merging the target order according to the key value information.
Optionally, the apparatus further comprises a configuration module configured to: a merging strategy set is configured in advance; and the extraction module is further configured to: determining a pushing party of the order information, and determining a pushing party merging strategy set corresponding to the pushing party according to the merging strategy set; selecting a target merging strategy set from the pusher merging strategy set according to the order information; and selecting the merging strategy with the highest priority as the target merging strategy from the target merging strategy set.
Optionally, the merging module is further configured to: and based on a Hash hash algorithm, encrypting the merging information and the unique identifier of the target order, and determining that the result of encryption processing is the key value information of the merging key.
Optionally, the generating module is further configured to: increasing the index of the merge key; and the merging module is further configured to: adding the target order with the key value information into an order list; and scanning the key value information of the orders in the order list according to a preset period by using the index, and merging the orders with the same key value information.
To achieve the above object, according to a third aspect of embodiments of the present invention, there is provided an electronic apparatus.
An electronic device of an embodiment of the present invention includes: one or more processors; the storage device is used for storing one or more programs, and when the one or more programs are executed by one or more processors, the one or more processors implement the method for merging target orders of the embodiment of the invention.
To achieve the above object, according to a fourth aspect of embodiments of the present invention, there is provided a computer-readable medium.
A computer-readable medium of an embodiment of the present invention has a computer program stored thereon, and when executed by a processor, the computer program implements a method for merging target orders of an embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: because the logistics system can inquire the matched target merging strategy according to the order information, the problem that the merging requirements of different scenes of a user cannot be met is solved. In addition, the logistics system can generate the target order and the merging key of the target order according to the order information, and then obtains the key value information of the merging key by using the merging strategy, so that the order merging can be directly carried out through the key value information, and the order merging efficiency is improved. In addition, the invention pre-configures a merging strategy set, extracts a target strategy set from the merging strategy set by using a pushing party (namely a user) of order information and specific order information, and considers the actual requirements of the user. In addition, when the key value information is determined, the hash algorithm technology is adopted to encrypt the combined information and the unique identifier of the target order, so that the uniqueness of the character string of the key value information and the length uniformity of the character string can be ensured. Finally, the invention also adds the index of the merge key, thereby achieving the purpose of quickly scanning the key value information of the merge key by using the index, reducing the order merge time and improving the order merge efficiency.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
FIG. 1 is a schematic diagram of the main steps of a method of consolidating a target order according to an embodiment of the present invention. As a reference embodiment of the present invention, as shown in fig. 1, the main steps of the method for merging target orders according to an embodiment of the present invention may include:
step S101: and generating a target order corresponding to the order information according to the received order information, and generating a merge key of the target order. In the invention, the merchant pushes the order information to the logistics system, the logistics system generates the target order corresponding to the order information after receiving the order information, and the logistics system needs to generate the merge key of the target order, so that the order merge can be realized by using the merge key in the subsequent operation. The merchant is a user for pushing order information to the logistics system, and considering that users with order combination demands are mostly merchants needing large quantities of goods, the user can be a merchant on a telephone platform or a merchant of an off-line entity shop. For convenience of description, the user is replaced by the merchant in the detailed description of the invention, and the user of the invention is not limited to the merchant. The order information pushed by the merchant may include: contact, contact phone, harvest address, harvest factory, harvest person, and item information, and the like.
Step S102: and inquiring a target merging strategy matched with the target order according to the order information, and extracting merging information meeting the target merging strategy from the order information. The invention can inquire the target merging strategy matched with the target order in the merging strategy set of the logistics system according to the received order information. Therefore, in the embodiment of the present invention, before querying the target merging policy matched with the target order, the merging policy set needs to be configured in advance in the logistics system. In addition, the merge policy may be provided by the merchant itself, for example, the merchant a provides the merge policy for the logistics system to provide the order information pushed by the merchant a, the merchant B provides the logistics system with the merge policy for the order information pushed by the merchant B, or the merge policy set is a merge policy generated by the logistics system according to merge conditions provided by different merchants, which is not limited in this invention.
The method for merging the target orders aims to solve the requirements of different scenes of merchants, so that how to select the target merging strategy matched with the target orders is a main technical point of the scheme. As another example of the present invention, querying the target merging strategy matching the target order may include:
step S1021: determining a pushing party of the order information, and determining a pushing party merging strategy set corresponding to the pushing party according to the merging strategy set;
step S1022: selecting a target merging strategy set from a pushing party merging strategy set according to order information;
step S1023: and selecting the merging strategy with the highest priority as a target merging strategy from the target merging strategy set.
In step S1021, a pusher for pushing the order information, that is, a merchant for pushing the order information to the logistics system, is first determined, and then a merge policy related to the pusher, that is, a merge policy set of the pusher, is screened from a preset merge policy set. This is done because, considering that there are merging policies of different merchants in the merging policy set of the logistics system, there are different merging policies for different merchants, and therefore it is necessary to first determine the merging policy set related to the pusher of the order information.
After the merging policy set of the pushing party is obtained, step S1022 is executed, and a target merging policy set is selected from the merging policy set of the pushing party according to the specific order information pushed by the merchant. For a merchant, it may preset not only one policy set in the logistics system, but for different target orders, there may be multiple merge policies matched with the target order, so it is necessary to select a target policy set from the merge policy sets of the pushing party according to the order information. For example, for the dealer a merge policy set of dealer a, according to a specific target order, the merge policies matching the specific target order are determined to be merge policy H1, merge policy H2, and merge policy H3, so that the merge policies H1, H2, and H3 constitute the target merge policy set of the specific target order. The merging strategy H1 may be merging orders with the same contact; h2 may be merging orders with the same contact and harvest address; h3 may be a merger of orders from the same e-commerce platform (orders may come from different e-commerce platforms given that the merchant may sell their own items on different e-commerce platforms) and contact the same.
After the target merging strategy set is obtained, the merging strategies in the target merging strategy set need to be sequenced according to the priority, and then the merging strategy with the highest priority is selected as the target merging strategy. Next, an example of determining the target merge policy set is described, where the merge policies H1, H2, and H3 corresponding to a specific target order are sorted from high to low according to the priority into H2, H3, and H1, and therefore the merge policy H2 is determined as the target merge policy of the specific target order.
After the target merging strategy is acquired in step S102, merging information meeting the target merging strategy needs to be selected from the order information according to the target merging strategy. For example, if the target merge policy is to merge orders with the same contact, the contact of the order is selected from the order information as the merge information. Next, step S103 is executed: and determining key value information of the merge key according to the merge information and the unique identifier of the target order, and merging the target order according to the key value information. In the present invention, the merge key of the target order is generated in step S101, and then the key value information of the merge key is calculated in step S103 by using the merge information and the unique identifier of the target order, so that the target order can be merged by using the key value information obtained by calculation.
As another referential embodiment of the present invention, determining key value information of a merge key may include: and based on a Hash hash algorithm, encrypting the combined information and the unique identifier of the target order, and determining that the encryption result is the key value information of the combined key. Among other things, hash algorithms, which can map a binary value of any length to a smaller binary value of a fixed length, referred to as a hash value. Hash values are a unique and extremely compact representation of a piece of data as a value. If a piece of plaintext is hashed and even if only one letter of the piece is altered, the subsequent hash will produce a different value. It is computationally infeasible to find two different inputs whose hash is the same value, so the hash value of the data can verify the integrity of the data. Based on the characteristics of the hash algorithm, the method and the device can ensure the uniqueness of the processing result obtained after the combined information and the unique identifier of the target order are processed, and can convert the combined information and the unique identifier with any length into key value information with fixed length. The advantage of doing so is that if the merge information is longer, for example, specific harvest address, it is inconvenient to find, and it is converted into key value information with fixed length, which is convenient to find, reduces merge time, and provides merge efficiency.
The above mentioned invention utilizes the key value information of the merge key to merge orders, and the specific explanation is made here on how to use the key value information to merge orders. After the merge key of the target order is generated according to the order information, the index of the merge key is added. Then, the merging process of the target order according to the key value information may specifically include: adding the target order with the key value information into an order list; and scanning the key value information of the orders in the order list according to a preset period by using the index, and merging the orders with the same key value information.
In step S102, the key value information of the merge key is obtained, then the target order with the key value information is added to the order list, and then the index of the merge key is used to scan the key value information of the orders in the order list according to a preset period, so as to merge the orders with the same key value information. The scanning function can be realized by the thread pool, namely, the order in the order list is scanned at regular time by using the timing function of the thread pool, and the orders with the same key value information of the merging keys are merged to generate a new order.
FIG. 2 is a block diagram of a system for consolidating target orders, according to a referenced embodiment of the present invention. As can be seen from FIG. 2, the system for consolidating target orders of the present invention may comprise: the system comprises five parts, namely a list merging executor, a strategy selector, a strategy factory, a thread pool and a merging process. The order closing actuator can generate an order closing key according to the order information, and key value information of the order closing key is generated by using the order closing information and the unique identification of the target order. The policy selector may select a target order-closing policy from the policy factory based on the order information. The strategy factory stores various pre-configured contract strategies. The thread pool is used for establishing a timing task and scanning the order list at regular time. The merging process is to merge the orders meeting the order-merging strategy according to the scanning so as to generate a new order.
FIG. 3 is a schematic main flow diagram of a method of consolidating target orders according to yet another referenced embodiment of the present invention. As shown in fig. 3, the method for merging target orders may mainly include:
step S301: the logistics system receives order information pushed by a merchant, generates a target order corresponding to the order information, generates a merge key of the target order, and increases an index of the merge key;
step S302: the logistics system determines the merchant pushing the order information, and then selects a merchant merging strategy set corresponding to the merchant from the merging strategy set in the logistics system;
step S303: the logistics system selects a target merging strategy set from the merchant merging strategy set according to order information pushed by the merchant;
step S304: selecting the merging strategy with the highest priority as the target merging strategy matched with the target order from the target merging strategy set,
step S305: according to the selected target merging strategy, merging information meeting the target merging strategy is extracted from the pushed order information;
step S306: based on a Hash hash algorithm, carrying out encryption processing on the combined information and the unique identifier of the target order, and determining that the encryption processing result is key value information of the combined key;
step S307: adding the target order with the key value information into an order list;
step S308: and scanning the key value information of the orders in the order list according to a preset period set in the thread pool technology by using the index, and merging the orders with the same key value information.
It should be noted that, before selecting the merchant merged policy set corresponding to the merchant from the merged policy set in the logistics system in step S302, the present invention also needs to preset the merged policy set. In addition, the execution sequence of step S301 may be adjusted according to actual conditions as long as it is executed before step S306.
According to the technical scheme for merging the target orders, the logistics system can inquire the matched target merging strategy according to the order information, so that the problem that the merging requirements of different scenes of a user cannot be met is solved. In addition, the logistics system can generate the target order and the merging key of the target order according to the order information, and then obtains the key value information of the merging key by using the merging strategy, so that the order merging can be directly carried out through the key value information, and the order merging efficiency is improved. In addition, the invention pre-configures a merging strategy set, extracts a target strategy set from the merging strategy set by using a pushing party (namely a user) of order information and specific order information, and considers the actual requirements of the user. In addition, when the key value information is determined, the hash algorithm technology is adopted to encrypt the combined information and the unique identifier of the target order, so that the uniqueness of the character string of the key value information and the length uniformity of the character string can be ensured. Finally, the invention also adds the index of the merge key, thereby achieving the purpose of quickly scanning the key value information of the merge key by using the index, reducing the order merge time and improving the order merge efficiency.
FIG. 4 is a schematic diagram of the main modules of an apparatus for consolidating target orders, according to an embodiment of the present invention. As shown in fig. 4, the apparatus 400 for merging target orders according to the embodiment of the present invention mainly includes the following modules: a generation module 401, an extraction module 402 and a merging module 403. Wherein the content of the first and second substances,
the generation module 401 may be configured to: generating a target order corresponding to the order information according to the received order information, and generating a merge key of the target order;
the extraction module 402 may be configured to: according to the order information, inquiring a target merging strategy matched with the target order, and extracting merging information meeting the target merging strategy from the order information;
the merge module 403 may be configured to: and determining key value information of the merge key according to the merge information and the unique identifier of the target order, and merging the target order according to the key value information.
In this embodiment of the present invention, the apparatus for merging target orders may further include: a configuration module (not shown in fig. 4). The configuration module may be operable to: and pre-configuring a merging strategy set. And the extraction module 402 is further operable to: determining a pushing party of the order information, and determining a pushing party merging strategy set corresponding to the pushing party according to the merging strategy set; selecting a target merging strategy set from a pushing party merging strategy set according to order information; and selecting the merging strategy with the highest priority as a target merging strategy from the target merging strategy set.
In this embodiment of the present invention, the merging module 403 may further be configured to: and based on a Hash hash algorithm, encrypting the combined information and the unique identifier of the target order, and determining that the encryption result is the key value information of the combined key.
In this embodiment of the present invention, the generating module 402 may further be configured to: adding the index of the merge key; and the merge module 403 is further operable to: adding the target order with the key value information into an order list; and scanning the key value information of the orders in the order list according to a preset period by using the index, and merging the orders with the same key value information.
From the above description, it can be seen that, by using the device for merging target orders in the embodiment of the present invention, a matching target merging strategy can be queried according to order information, and the problem that merging requirements of users in different scenarios cannot be met is solved. In addition, the logistics system can generate the target order and the merging key of the target order according to the order information, and then obtains the key value information of the merging key by using the merging strategy, so that the order merging can be directly carried out through the key value information, and the order merging efficiency is improved. In addition, the invention pre-configures a merging strategy set, extracts a target strategy set from the merging strategy set by using a pushing party (namely a user) of order information and specific order information, and considers the actual requirements of the user. In addition, when the key value information is determined, the hash algorithm technology is adopted to encrypt the combined information and the unique identifier of the target order, so that the uniqueness of the character string of the key value information and the length uniformity of the character string can be ensured. Finally, the invention also adds the index of the merge key, thereby achieving the purpose of quickly scanning the key value information of the merge key by using the index, reducing the order merge time and improving the order merge efficiency.
Fig. 5 illustrates an exemplary system architecture 500 of a method of consolidating target orders or an apparatus for consolidating target orders to which embodiments of the present invention may be applied.
As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 serves to provide a medium for communication links between the terminal devices 501, 502, 503 and the server 505. Network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 501, 502, 503 to interact with a server 505 over a network 504 to receive or send messages or the like. The terminal devices 501, 502, 503 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 501, 502, 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 505 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 501, 502, 503. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the method for merging target orders provided by the embodiment of the present invention is generally executed by the server 505, and accordingly, the apparatus for merging target orders is generally disposed in the server 505.
It should be understood that the number of terminal devices, networks, and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 6, a block diagram of a computer system 600 suitable for use with a terminal device implementing an embodiment of the invention is shown. The terminal device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
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 invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). 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 the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a generation module, an extraction module, and a merging module. The names of these modules do not limit the modules themselves in some cases, and for example, the generation module may also be described as a "module that generates a target order corresponding to order information and generates a merge key of the target order according to received order information".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: generating a target order corresponding to the order information according to the received order information, and generating a merge key of the target order; according to the order information, inquiring a target merging strategy matched with the target order, and extracting merging information meeting the target merging strategy from the order information; and determining key value information of the merge key according to the merge information and the unique identifier of the target order, and merging the target order according to the key value information.
According to the technical scheme of the embodiment of the invention, the logistics system can inquire the matched target merging strategy according to the order information, so that the problem that the merging requirements of different scenes of a user cannot be met is solved. In addition, the logistics system can generate the target order and the merging key of the target order according to the order information, and then obtains the key value information of the merging key by using the merging strategy, so that the order merging can be directly carried out through the key value information, and the order merging efficiency is improved. In addition, the invention pre-configures a merging strategy set, extracts a target strategy set from the merging strategy set by using a pushing party (namely a user) of order information and specific order information, and considers the actual requirements of the user. In addition, when the key value information is determined, the hash algorithm technology is adopted to encrypt the combined information and the unique identifier of the target order, so that the uniqueness of the character string of the key value information and the length uniformity of the character string can be ensured. Finally, the invention also adds the index of the merge key, thereby achieving the purpose of quickly scanning the key value information of the merge key by using the index, reducing the order merge time and improving the order merge efficiency.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.