CN108416643A - A kind of competition for orders method and system - Google Patents
A kind of competition for orders method and system Download PDFInfo
- Publication number
- CN108416643A CN108416643A CN201810024367.5A CN201810024367A CN108416643A CN 108416643 A CN108416643 A CN 108416643A CN 201810024367 A CN201810024367 A CN 201810024367A CN 108416643 A CN108416643 A CN 108416643A
- Authority
- CN
- China
- Prior art keywords
- order
- competition
- orders
- message queue
- request
- Prior art date
- Legal status (The legal status 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 status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Commerce
- G06Q30/06—Buying, selling or leasing transactions
- G06Q30/0601—Electronic shopping [e-shopping]
- G06Q30/0633—Lists, e.g. purchase orders, compilation or processing
- G06Q30/0635—Processing of requisition or of purchase orders
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/546—Message passing systems or structures, e.g. queues
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1097—Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/568—Storing data temporarily at an intermediate stage, e.g. caching
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Business, Economics & Management (AREA)
- Finance (AREA)
- General Physics & Mathematics (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- Accounting & Taxation (AREA)
- Software Systems (AREA)
- Computer Networks & Wireless Communication (AREA)
- Economics (AREA)
- Marketing (AREA)
- Strategic Management (AREA)
- General Business, Economics & Management (AREA)
- Development Economics (AREA)
- General Engineering & Computer Science (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the present invention discloses a kind of competition for orders method and system, and method includes:For each order, the competition for orders request that user terminal is sent is received, all competition for orders are asked that corresponding first message queue is added, to carry out peak clipping using first message queue and convert the competition for orders of reception request to asynchronous system by the high concurrent method of synchronization;A competition for orders for being taken out each order from one or more first message queues respectively using multithreading polling mode is asked and is carried out subtracting inventory operations using Redis cache tools;In the user basic information in returning to the competition for orders request taken out successfully and will each order order essential information pre-loaded in Cache clusters and each order after subtracting inventory operations success is stored in and corresponds to second message queue;Utilize the user basic information and order essential information generation order in deposit second message queue.The present invention can cope with big flow impact when competition for orders, peak load shifting, and server load pressure when reducing competition for orders promotes competition for orders efficiency, reduces resource consumption.
Description
Technical field
The present embodiments relate to technical field of computer software development, and in particular to a kind of competition for orders method and system.
Background technology
Currently, existing single system of robbing mainly controls competition for orders by DB (database)+Cache (cache memory),
Resource loading efficiency is promoted by caching, it is concurrent that DB locks control.Asking of being recorded at first is chosen in all concurrent requests
It asks, the corresponding user's mark of the request is to have robbed single user, remaining fails labeled as competition for orders.In this way for one it is single rob for be
Acceptable then cannot be configured flexibly when needing flexible control that can rob quantity.Competition for orders is embedded in as a function module
In operation system, and it is deployed in same cluster.It can in most cases be broken out in certain periods in competition for orders flow set.And
It is then relatively steady for other functions of operation system.Have can for the larger pole of the resource consumptions such as server when competition for orders flow is larger
It can lead to delay machine accident, and the machine resources of other business is usually supported then to show slightly more than needed.
But existing single system of robbing has the disadvantage that:
One, user by ceaselessly refreshing browser page ensures that competition for orders will not be missed, these are asked before competition for orders starts
If asked according to general website application architecture, application server, connection database are accessed, it can application server, database
Server causes great load pressure.
Two, the data of database are stored in hard disk, and frequent database IO (input and output) operation can tie down machine
Performance influences efficiency.
Three, it is a small function in website to rob single module, can generally be concentrated in certain periods.This period takes
Business device request increases sharply, and causes server immense pressure.And it is then relatively uniform in the request of other times section, server is then relatively flat
Surely.
In consideration of it, how to provide one kind robbing single system, impacted with coping with big flow when competition for orders, server when reducing competition for orders
Load pressure, promoted competition for orders efficiency become the current technical issues that need to address.
Invention content
Since existing method is there are the above problem, the embodiment of the present invention proposes that one kind robbing single system, when coping with competition for orders
Big flow impact, peak load shifting, reduce competition for orders when server load pressure, promoted competition for orders efficiency, reduce resource consumption.
In a first aspect, the embodiment of the present invention proposes a kind of competition for orders method, including:
For each order, the competition for orders request that user terminal is sent is received, all competition for orders request of reception is added and is corresponded to
First message queue, with using the first message queue carry out peak clipping and by the competition for orders of reception ask by the high concurrent side of synchronization
Formula is converted into asynchronous system;
Take out each order from one or more first message queues respectively using multithreading polling mode one robs
It is single to ask and carry out subtracting inventory operations using Redis cache tools;
After subtracting inventory operations success, return successfully and each order is pre- in cache memory Cache clusters
User basic information deposit corresponding second in the competition for orders request that the order essential information and each order first loaded is taken out
In message queue;
Generation order is carried out using the user basic information and order essential information that are stored in second message queue.
Optionally, it after subtracting inventory operations success, returns successfully and believes the pre-stored order of each order substantially
Before user basic information in breath and the competition for orders request taken out is stored in corresponding second message queue, the method is also wrapped
It includes:
The order essential information of each order is generated in advance, and the order essential information of each order is stored in advance in number
According in library;
It is when about band sees that the container load service of system starts, the pre-stored order essential information of each order is pre-
It is first loaded into Cache clusters as read-only data.
Optionally, the competition for orders for each order that element summation is equal to reception in the corresponding first message queue of each order is asked
The quantity summation asked.
Optionally, the method further includes:
After subtracting inventory operations success, it is by the remaining competition for orders request marks not being removed in the first message queue
Competition for orders fails.
Second aspect, the embodiment of the present invention also propose that one kind robbing single system, including:
Module is added, for for each order, the competition for orders request that user terminal is sent being received, by all competition for orders of reception
Corresponding first message queue is added in request, with using the first message queue carry out peak clipping and by the competition for orders of reception ask by
The high concurrent method of synchronization is converted into asynchronous system;
Module is taken out, it is each for being taken out from one or more first message queues respectively using multithreading polling mode
One competition for orders of order is asked and is carried out subtracting inventory operations using Redis cache tools;
It is stored in module, for after subtracting inventory operations success, returning successfully and by each order in cache memory
User basic information in the competition for orders request that pre-loaded order essential information and each order are taken out in Cache clusters is deposited
Enter in corresponding second message queue;
Generation module, for being given birth to using the user basic information and order essential information that are stored in second message queue
At order.
Optionally, the system also includes:
Pre-stored module, the order essential information for each order to be generated in advance, and the order of each order is basic
Information prestores in the database;
Preloaded components, when for seeing that the container of system loads service startup in about band, by prestoring for each order
Order essential information be loaded previously into Cache clusters as read-only data.
Optionally, it is described rob single system and about band see in system in addition to it is described rob single system other than other module/systems
It is to separate independently to dispose by way of being grouped and disposing, and described rob the individual domain name of single system application.
Optionally, the system also includes:
Mark module, for subtract inventory operations success after, it is remaining by not being removed in the first message queue
Competition for orders request marks fail for competition for orders.
The third aspect, the embodiment of the present invention also propose a kind of electronic equipment, including:Processor, memory, bus and storage
On a memory and the computer program that can run on a processor;
Wherein, the processor, memory complete mutual communication by the bus;
The processor realizes the above method when executing the computer program.
Fourth aspect, the embodiment of the present invention provide a kind of non-transient computer readable storage medium, the non-transient calculating
It is stored with computer program on machine readable storage medium storing program for executing, which realizes the above method when being executed by processor.
As shown from the above technical solution, the embodiment of the present invention passes through the competition for orders that is sent for each order reception user terminal
Corresponding first message queue is added in all competition for orders request by request, to carry out peak clipping using first message queue and will receive
Competition for orders ask by the high concurrent method of synchronization to be converted into asynchronous system, using multithreading polling mode respectively from one or more the
The competition for orders that each order is taken out in one message queue is asked and is carried out subtracting inventory operations using Redis cache tools, is being subtracted
Is returned after inventory operations success successfully and by each order order essential information pre-loaded in Cache clusters with each order
User basic information in single competition for orders request taken out is stored in corresponding second message queue, utilizes deposit second message team
User basic information and order essential information in row carry out generation order, thus, it is possible to competition for orders be realized, when coping with competition for orders
Big flow impact, peak load shifting, reduce competition for orders when server load pressure, promoted competition for orders efficiency, reduce resource consumption.
Description of the drawings
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
Other attached drawings are obtained according to these figures.
Fig. 1 is a kind of flow diagram for competition for orders method that one embodiment of the invention provides;
Fig. 2 is a kind of structural schematic diagram for robbing single system that one embodiment of the invention provides;
Fig. 3 is a kind of principle configuration diagram for robbing single system provided in an embodiment of the present invention;
Fig. 4 is the logic diagram for the electronic equipment that one embodiment of the invention provides.
Specific implementation mode
Below in conjunction with the accompanying drawings, the specific implementation mode of the present invention is further described.Following embodiment is only used for more
Technical scheme of the present invention is clearly demonstrated, and not intended to limit the protection scope of the present invention.
Fig. 1 shows a kind of flow diagram for competition for orders method that one embodiment of the invention provides, as shown in Figure 1, this reality
The competition for orders method of example is applied, including:
S1, for each order, receive the competition for orders request that user terminal is sent, all competition for orders request of reception be added pair
The first message queue answered, to carry out peak clipping using the first message queue and synchronize the competition for orders of reception request by high concurrent
Mode is converted into asynchronous system.
Wherein, the competition for orders for each order that element summation is equal to reception in the corresponding first message queue of each order is asked
Quantity summation.
S2, take out each order from one or more first message queues respectively using multithreading polling mode one
Competition for orders is asked and is carried out subtracting inventory operations using Redis.
It is understood that the high concurrent ability of Redis cache tools is notable, theoretical peak, which is that single machine is per second, can support 10
Ten thousand read-writes, Redis can also support distributed type assemblies autgmentability strong, and competition for orders is typically to read to write few scene more, be suitble to
Operate memory and not operation hard disk.The operation of Redis cache tools itself is to ensure atomicity, it is possible to which guarantee requests
The Thread safety for the operation of Redis write.
S3, subtract inventory operations success after, return successfully and by each order in Cache (cache memory) cluster
In user basic information deposit in the competition for orders request taken out of pre-loaded order essential information and each order it is corresponding
In second message queue.
In a particular application, the step S3 can also include:
After subtracting inventory operations success, it is by the remaining competition for orders request marks not being removed in the first message queue
Competition for orders fails.
S4, generation order is carried out using the user basic information and order essential information that are stored in second message queue.
It is understood that can mitigate the second using first message queue and second message queue asynchronous process business kills height
Peak period server load.
The competition for orders method of the present embodiment is asked by the competition for orders sent for each order reception user terminal, will be owned
Corresponding first message queue is added in competition for orders request, with using first message queue carry out peak clipping and by the competition for orders of reception ask by
The high concurrent method of synchronization is converted into asynchronous system, using multithreading polling mode respectively from one or more first message queues
A competition for orders for taking out each order is asked and is carried out subtracting inventory operations using Redis cache tools, and inventory operations success is being subtracted
Return to successfully and by each order that pre-loaded order essential information and each order in Cache clusters taken out afterwards robs
User basic information in single request is stored in corresponding second message queue, utilizes user's base in deposit second message queue
This information and order essential information carry out generation order, thus, it is possible to realize competition for orders, cope with big flow punching when competition for orders
It hits, peak load shifting, server load pressure when reducing competition for orders promotes competition for orders efficiency, reduces resource consumption.
Further, in a particular application, before above-mentioned steps S3, the present embodiment the method can also include:
The order essential information of each order is generated in advance, and the order essential information of each order is stored in advance in number
According in library;
It is when about band sees that the container load service of system starts, the pre-stored order essential information of each order is pre-
It is first loaded into Cache clusters as read-only data.
It is understood that seeing the order essential information of order (for example, order essential information by the way that about band is generated in advance
May include:Relevant employee information of attribute information and order that order itself includes etc., the present embodiment not to its into
Row limitation) and prestore in the database, when about band sees that the container load service of system starts, by the advance of each order
The order essential information of storage is loaded previously into Cache clusters as read-only data, can maximize improving performance, promotes visitor
It experiences and ensures that front end quickly loads in family.
A kind of competition for orders method of the present embodiment copes with big flow impact when competition for orders, peak load shifting, when reducing competition for orders
Server load pressure promotes competition for orders efficiency, reduces resource consumption.
Fig. 2 shows a kind of structural schematic diagrams for robbing single system that one embodiment of the invention provides, as shown in Fig. 2, this reality
The single system of robbing of example is applied, including:Module 21 is added, takes out module 22, deposit module 23 and generation module 24;Wherein:
The addition module 21, for for each order, the competition for orders request that user terminal is sent being received, by the institute of reception
There is competition for orders request that corresponding first message queue is added, with using first message queue progress peak clipping and by the competition for orders of reception
Request is converted into asynchronous system by the high concurrent method of synchronization;
The taking-up module 22, for being taken from one or more first message queues respectively using multithreading polling mode
A competition for orders for going out each order is asked and is carried out subtracting inventory operations using Redis cache tools;
The deposit module 23, for after subtracting inventory operations success, returning successfully and by each order in speed buffering
User in the competition for orders request that pre-loaded order essential information and each order are taken out in memory Cache clusters is basic
Information is stored in corresponding second message queue;
The generation module 24, for utilizing the user basic information and order essential information in deposit second message queue
Carry out generation order.
Specifically, the addition module 21 receives the competition for orders request that user terminal is sent, by reception for each order
Corresponding first message queue is added in all competition for orders requests, to carry out peak clipping and robbing reception using the first message queue
Single request is converted into asynchronous system by the high concurrent method of synchronization;The taking-up module 22 is using multithreading polling mode respectively from one
The competition for orders that each order is taken out in a or multiple first message queues is asked and is carried out subtracting inventory using Redis cache tools
Operation;The deposit module 23 returns successfully and by each order after subtracting inventory operations success in cache memory
User basic information in the competition for orders request that pre-loaded order essential information and each order are taken out in Cache clusters is deposited
Enter in corresponding second message queue;The generation module 24 is using the user basic information being stored in second message queue and orders
Single essential information carries out generation order.
Wherein, the competition for orders for each order that element summation is equal to reception in the corresponding first message queue of each order is asked
Quantity summation.
In a particular application, system described in the present embodiment can also include not shown in the figure:
Mark module, for subtract inventory operations success after, it is remaining by not being removed in the first message queue
Competition for orders request marks fail for competition for orders.
In a particular application, competition for orders system deployment described in the present embodiment is seen in about band in system, it is described rob single system with about
Band see in system in addition to it is described rob single system other than other module/systems be that independent deployment is separated by way of being grouped and disposing
, and described rob the individual domain name of single system application.
It is understood that it is described rob single system and about band see in system in addition to it is described rob single system other than other moulds
Block/system is that independent deployment is separated by way of being grouped and disposing, and is the isolation for doing system at runtime, can avoid the short time
Interior big visit capacity is impacted caused by website business, and described robs the individual domain name of single system application, it is therefore an objective to
It allows competition for orders request to fall in different clusters, even if competition for orders system crash, website will not be impacted
It is understood that can mitigate the second using first message queue and second message queue asynchronous process business kills height
Peak period server load.
It is understood that the high concurrent ability of Redis cache tools is notable, theoretical peak, which is that single machine is per second, can support 10
Ten thousand read-writes, Redis can also support distributed type assemblies autgmentability strong, and competition for orders is typically to read to write few scene more, be suitble to
Operate memory and not operation hard disk.The operation of Redis cache tools itself is to ensure atomicity, it is possible to which guarantee requests
The Thread safety for the operation of Redis write.
The present embodiment robs single system, and competition for orders may be implemented, and copes with big flow when competition for orders and impacts, peak load shifting,
Server load pressure when reducing competition for orders promotes competition for orders efficiency, reduces resource consumption.
Further, in a particular application, system described in the present embodiment can also include not shown in the figure:
Pre-stored module, the order essential information for each order to be generated in advance, and the order of each order is basic
Information prestores in the database;
Preloaded components, when for seeing that the container of system loads service startup in about band, by prestoring for each order
Order essential information be loaded previously into Cache clusters as read-only data.
See the order essential information of order (for example, ordering it is understood that about band is generated in advance by pre-stored module
Single essential information may include:Relevant employee information of attribute information and order that order itself includes etc., the present embodiment
It is not limited) and prestore in the database, preloaded components see that the container load service of system is opened in about band
When dynamic, the pre-stored order essential information of each order is loaded previously into as read-only data in Cache clusters, it can
Improving performance is maximized, customer experience is promoted and ensures that front end quickly loads.
Further, it includes loose-leaf to be robbed described in the present embodiment in single system, wherein having many videos and figure
Piece resource, if so from our gateway real time access, we can be accounted for limited network bandwidth more users by these requests
According to sizable resource, it is likely to result in page load slowly, influences user experience.This system can be by this part static resource
(i.e. video and picture resource) is deployed on content distributing network CDN, can refer to Fig. 3, accelerates visitor by way of data preheating
The flow of the access speed at family end, gateway mainly comes from the request of the small data during competition for orders.
Further, in order to observe the performance state of competition for orders service in real time, possible trouble is taken precautions against, the present embodiment can be with profit
With existing service monitoring system (for example, chain man is from grinding monitoring system " Hawk " etc.) to the modules robbed in single system
It is monitored, facilitates engineering staff to understand the state of service in time, can refer to Fig. 3.
The present embodiment robs single system, and competition for orders may be implemented, and copes with big flow when competition for orders and impacts, peak load shifting,
Server load pressure when reducing competition for orders promotes competition for orders efficiency, reduces resource consumption.
The present embodiment robs single system, can be used for executing the technical solution described in preceding method embodiment, realizes former
Reason is similar with technique effect, and details are not described herein again.
Fig. 4 shows the entity structure schematic diagram of a kind of electronic equipment provided in an embodiment of the present invention, as shown in figure 4, should
Electronic equipment may include:It processor 41, memory 42, bus 43 and is stored on memory 42 and can be transported on processor 41
Capable computer program;
Wherein, the processor 41, memory 42 complete mutual communication by the bus 43;
The processor 41 realizes the method that above-mentioned each method embodiment is provided when executing the computer program, such as
Including:For each order, the competition for orders request that user terminal is sent is received, all competition for orders request of reception is added corresponding the
One message queue, to carry out peak clipping using the first message queue and turn the competition for orders of reception request by the high concurrent method of synchronization
Turn to asynchronous system;Using multithreading polling mode the one of each order is taken out from one or more first message queues respectively
A competition for orders is asked and is carried out subtracting inventory operations using Redis cache tools;After subtracting inventory operations success, return successfully and will be every
The competition for orders that pre-loaded order essential information and each order are taken out in cache memory Cache clusters of a order
User basic information in request is stored in corresponding second message queue;It is basic using the user in deposit second message queue
Information and order essential information carry out generation order.
The embodiment of the present invention provides a kind of non-transient computer readable storage medium, is stored thereon with computer program, should
Realize the method that above-mentioned each method embodiment is provided when computer program is executed by processor, such as including:It is ordered for each
It is single, the competition for orders request that user terminal is sent is received, corresponding first message queue is added in all competition for orders request of reception, with profit
Peak clipping is carried out with the first message queue and asks the competition for orders of reception to be converted into asynchronous system by the high concurrent method of synchronization;Profit
Take out the competition for orders request of each order and profit from one or more first message queues respectively with multithreading polling mode
It is carried out subtracting inventory operations with Redis cache tools;After subtracting inventory operations success, return successfully and each order is slow in high speed
Rush user's base in the competition for orders request that pre-loaded order essential information and each order are taken out in memory Cache clusters
This information is stored in corresponding second message queue;It is basic using the user basic information and order that are stored in second message queue
Information carries out generation order.
It should be understood by those skilled in the art that, embodiments herein can be provided as method, apparatus or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the application
Apply the form of example.Moreover, the application can be used in one or more wherein include computer usable program code computer
The computer program production implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
The application be with reference to according to the method, apparatus of the embodiment of the present application and the flow chart of computer program product and/or
Block diagram describes.It should be understood that each flow that can be realized by computer program instructions in flowchart and/or the block diagram and/or
The combination of flow and/or box in box and flowchart and/or the block diagram.These computer program instructions can be provided to arrive
All-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices processor to generate one
Machine so that the instruction executed by computer or the processor of other programmable data processing devices generates flowing
The device/system for the function of being specified in one flow of journey figure or multiple flows and/or one box of block diagram or multiple boxes.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that instruction generation stored in the computer readable memory includes referring to
Enable the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device so that count
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, in computer or
The instruction executed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in a box or multiple boxes.
It should be noted that herein, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also include other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including the element.The fingers such as term "upper", "lower"
The orientation or positional relationship shown is to be based on the orientation or positional relationship shown in the drawings, and is merely for convenience of the description present invention and simplifies
Description, does not indicate or imply the indicated device or element must have a particular orientation, with specific azimuth configuration and behaviour
Make, therefore is not considered as limiting the invention.Unless otherwise clearly defined and limited, term " installation ", " connected ",
" connection " shall be understood in a broad sense, for example, it may be being fixedly connected, may be a detachable connection, or be integrally connected;Can be
Mechanical connection can also be electrical connection;It can be directly connected, can also can be indirectly connected through an intermediary two
Connection inside element.For the ordinary skill in the art, above-mentioned term can be understood at this as the case may be
Concrete meaning in invention.
In the specification of the present invention, numerous specific details are set forth.Although it is understood that the embodiment of the present invention can
To put into practice without these specific details.In some instances, well known method, structure and skill is not been shown in detail
Art, so as not to obscure the understanding of this description.Similarly, it should be understood that disclose in order to simplify the present invention and helps to understand respectively
One or more of a inventive aspect, in the above description of the exemplary embodiment of the present invention, each spy of the invention
Sign is grouped together into sometimes in single embodiment, figure or descriptions thereof.However, should not be by the method solution of the disclosure
It releases and is intended in reflection is following:The feature that i.e. the claimed invention requirement ratio is expressly recited in each claim is more
More features.More precisely, as the following claims reflect, inventive aspect is to be less than single reality disclosed above
Apply all features of example.Therefore, it then follows thus claims of specific implementation mode are expressly incorporated in the specific implementation mode,
Wherein each claim itself is as a separate embodiment of the present invention.It should be noted that in the absence of conflict, this
The feature in embodiment and embodiment in application can be combined with each other.The invention is not limited in any single aspect,
It is not limited to any single embodiment, is also not limited to the arbitrary combination and/or displacement of these aspects and/or embodiment.And
And can be used alone of the invention each aspect and/or embodiment or with other one or more aspects and/or its implement
Example is used in combination.
Finally it should be noted that:The above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent
Present invention has been described in detail with reference to the aforementioned embodiments for pipe, it will be understood by those of ordinary skill in the art that:Its according to
So can with technical scheme described in the above embodiments is modified, either to which part or all technical features into
Row equivalent replacement;And these modifications or replacements, various embodiments of the present invention technology that it does not separate the essence of the corresponding technical solution
The range of scheme should all cover in the claim of the present invention and the range of specification.
Claims (10)
1. a kind of competition for orders method, which is characterized in that including:
For each order, the competition for orders request that user terminal is sent is received, all competition for orders request of reception is added corresponding the
One message queue, to carry out peak clipping using the first message queue and turn the competition for orders of reception request by the high concurrent method of synchronization
Turn to asynchronous system;
A competition for orders for taking out each order from one or more first message queues respectively using multithreading polling mode is asked
It asks and carries out subtracting inventory operations using Redis cache tools;
After subtracting inventory operations success, returns successfully and add each order in advance in cache memory Cache clusters
User basic information in the competition for orders request that the order essential information of load and each order are taken out is stored in corresponding second message
In queue;
Generation order is carried out using the user basic information and order essential information that are stored in second message queue.
2. according to the method described in claim 1, it is characterized in that, after subtracting inventory operations success, return successfully and will be each
User basic information deposit corresponding second in the pre-stored order essential information of order and the competition for orders request of taking-up disappears
Before ceasing in queue, the method further includes:
The order essential information of each order is generated in advance, and the order essential information of each order is stored in advance in database
In;
When about band sees that the container load service of system starts, the pre-stored order essential information of each order is added in advance
It is downloaded in Cache clusters as read-only data.
3. according to the method described in claim 1, it is characterized in that, element summation in each corresponding first message queue of order
Equal to the quantity summation of the competition for orders request of each order of reception.
4. method according to any one of claim 1-3, which is characterized in that the method further includes:
It is competition for orders by the remaining competition for orders request marks not being removed in the first message queue after subtracting inventory operations success
Failure.
5. one kind robbing single system, which is characterized in that including:
Module is added, for for each order, receiving the competition for orders request that user terminal is sent, all competition for orders of reception being asked
Corresponding first message queue is added, to carry out peak clipping using the first message queue and ask the competition for orders of reception by height simultaneously
The hair method of synchronization is converted into asynchronous system;
Module is taken out, for utilizing multithreading polling mode to take out each order from one or more first message queues respectively
A competition for orders ask and carry out subtracting inventory operations using Redis cache tools;
It is stored in module, for after subtracting inventory operations success, returning successfully and by each order in cache memory Cache
User basic information deposit pair in the competition for orders request that pre-loaded order essential information and each order are taken out in cluster
In the second message queue answered;
Generation module is ordered for being carried out generating using the user basic information and order essential information that are stored in second message queue
It is single.
6. system according to claim 5, which is characterized in that the system also includes:
Pre-stored module, the order essential information for each order to be generated in advance, and by the order essential information of each order
It prestores in the database;
Preloaded components, when for seeing that the container of system loads service startup in about band, pre-stored by each order is ordered
Single essential information is loaded previously into Cache clusters as read-only data.
7. system according to claim 5, which is characterized in that it is described rob single system and seen in system with about band robbed in addition to described
Other module/systems except single system are to separate independently to dispose by way of being grouped and disposing, and described rob single system
Individual domain name is applied for.
8. according to the system described in any one of claim 5-7, which is characterized in that the system also includes:
Mark module, the remaining competition for orders for after subtracting inventory operations success, will not be removed in the first message queue
Request marks fail for competition for orders.
9. a kind of electronic equipment, which is characterized in that including:Processor, memory, bus and storage on a memory and can located
The computer program run on reason device;
Wherein, the processor, memory complete mutual communication by the bus;
The processor realizes the method as described in any one of claim 1-4 when executing the computer program.
10. a kind of non-transient computer readable storage medium, which is characterized in that in the non-transient computer readable storage medium
It is stored with computer program, the side as described in any one of claim 1-4 is realized when which is executed by processor
Method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810024367.5A CN108416643A (en) | 2018-01-10 | 2018-01-10 | A kind of competition for orders method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810024367.5A CN108416643A (en) | 2018-01-10 | 2018-01-10 | A kind of competition for orders method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108416643A true CN108416643A (en) | 2018-08-17 |
Family
ID=63125445
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810024367.5A Pending CN108416643A (en) | 2018-01-10 | 2018-01-10 | A kind of competition for orders method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108416643A (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109064105A (en) * | 2018-09-28 | 2018-12-21 | 阿里巴巴集团控股有限公司 | A kind of resource transfers request processing method, device and electronic equipment |
CN109194586A (en) * | 2018-08-31 | 2019-01-11 | 重庆富民银行股份有限公司 | Peak clipping processing method based on distributed token bucket |
CN110322280A (en) * | 2019-06-05 | 2019-10-11 | 上海易点时空网络有限公司 | The discount coupon second based on fair competition kills system and method |
CN111177158A (en) * | 2018-11-12 | 2020-05-19 | 商派软件有限公司 | Method for matching order with stock consistently |
CN112015745A (en) * | 2020-08-19 | 2020-12-01 | 北京达佳互联信息技术有限公司 | Data management method and device |
CN112347111A (en) * | 2019-12-05 | 2021-02-09 | 北京沃东天骏信息技术有限公司 | Data updating method and device |
CN112749199A (en) * | 2021-01-25 | 2021-05-04 | 上海伯俊软件科技有限公司 | Inventory management method |
CN112954004A (en) * | 2021-01-26 | 2021-06-11 | 广州华多网络科技有限公司 | Second-killing activity service response method and device, equipment and medium thereof |
CN112950319A (en) * | 2021-03-03 | 2021-06-11 | 汉海信息技术(上海)有限公司 | Method and system for processing network taxi appointment orders |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104281673A (en) * | 2014-09-22 | 2015-01-14 | 珠海许继芝电网自动化有限公司 | Cache building system and method for database |
CN106170016A (en) * | 2016-07-28 | 2016-11-30 | 深圳市创梦天地科技有限公司 | A kind of method and system processing high concurrent data requests |
CN106713388A (en) * | 2015-11-13 | 2017-05-24 | 阿里巴巴集团控股有限公司 | Emergent business processing method and device |
CN107273220A (en) * | 2017-05-11 | 2017-10-20 | 广东网金控股股份有限公司 | A kind of electric business platform data processing method, device and user terminal |
CN107291769A (en) * | 2016-04-11 | 2017-10-24 | 北京京东尚科信息技术有限公司 | The method and apparatus for handling concurrent order |
-
2018
- 2018-01-10 CN CN201810024367.5A patent/CN108416643A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104281673A (en) * | 2014-09-22 | 2015-01-14 | 珠海许继芝电网自动化有限公司 | Cache building system and method for database |
CN106713388A (en) * | 2015-11-13 | 2017-05-24 | 阿里巴巴集团控股有限公司 | Emergent business processing method and device |
CN107291769A (en) * | 2016-04-11 | 2017-10-24 | 北京京东尚科信息技术有限公司 | The method and apparatus for handling concurrent order |
CN106170016A (en) * | 2016-07-28 | 2016-11-30 | 深圳市创梦天地科技有限公司 | A kind of method and system processing high concurrent data requests |
CN107273220A (en) * | 2017-05-11 | 2017-10-20 | 广东网金控股股份有限公司 | A kind of electric business platform data processing method, device and user terminal |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109194586A (en) * | 2018-08-31 | 2019-01-11 | 重庆富民银行股份有限公司 | Peak clipping processing method based on distributed token bucket |
CN109194586B (en) * | 2018-08-31 | 2022-02-22 | 重庆富民银行股份有限公司 | Peak clipping processing method based on distributed token bucket |
CN109064105B (en) * | 2018-09-28 | 2021-11-30 | 创新先进技术有限公司 | Resource transfer request processing method and device and electronic equipment |
CN109064105A (en) * | 2018-09-28 | 2018-12-21 | 阿里巴巴集团控股有限公司 | A kind of resource transfers request processing method, device and electronic equipment |
CN111177158A (en) * | 2018-11-12 | 2020-05-19 | 商派软件有限公司 | Method for matching order with stock consistently |
CN111177158B (en) * | 2018-11-12 | 2021-06-01 | 商派软件有限公司 | Method for matching order with stock consistently |
CN110322280A (en) * | 2019-06-05 | 2019-10-11 | 上海易点时空网络有限公司 | The discount coupon second based on fair competition kills system and method |
CN112347111A (en) * | 2019-12-05 | 2021-02-09 | 北京沃东天骏信息技术有限公司 | Data updating method and device |
CN112015745A (en) * | 2020-08-19 | 2020-12-01 | 北京达佳互联信息技术有限公司 | Data management method and device |
CN112015745B (en) * | 2020-08-19 | 2024-05-17 | 北京达佳互联信息技术有限公司 | Data management method and device |
CN112749199A (en) * | 2021-01-25 | 2021-05-04 | 上海伯俊软件科技有限公司 | Inventory management method |
CN112954004A (en) * | 2021-01-26 | 2021-06-11 | 广州华多网络科技有限公司 | Second-killing activity service response method and device, equipment and medium thereof |
CN112950319A (en) * | 2021-03-03 | 2021-06-11 | 汉海信息技术(上海)有限公司 | Method and system for processing network taxi appointment orders |
CN112950319B (en) * | 2021-03-03 | 2022-11-01 | 汉海信息技术(上海)有限公司 | Method and system for processing network taxi appointment orders |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108416643A (en) | A kind of competition for orders method and system | |
CN111506412B (en) | Airflow-based distributed asynchronous task construction and scheduling system and method | |
CN104579905B (en) | Message delivery method and system and MOM servers, receiving terminal | |
CN108076098A (en) | A kind of method for processing business and system | |
CN109491776A (en) | Task method of combination and system | |
CN110308983A (en) | Method for balancing resource load and system, service node and client | |
CN104462370A (en) | Distributed task scheduling system and method | |
CN101739296B (en) | Data processing system and method | |
CN102567015A (en) | Method and system for DYNAMIC SOFTWARE VERSION SELECTION | |
CN103209223A (en) | Distributed application conversation information sharing method and system and application server | |
CN110502572A (en) | A kind of method and server that data are synchronous | |
CN107748689A (en) | A kind of web page display method and apparatus | |
CN102819478A (en) | Agent-free data processing system monitoring and management method | |
CN110532493A (en) | Processing method and processing device, storage medium and the electronic device of data | |
US20200220910A1 (en) | Idempotent processing of data streams | |
CN109271367A (en) | Distributed file system multinode snapshot rollback method and system | |
US20170220624A1 (en) | Transaction processor | |
CN103562876A (en) | Redirecting requests to secondary location during temporary outage | |
CN109167819A (en) | Data synchronous system, method, apparatus and storage medium | |
CN110515741A (en) | A kind of degradation processing method and device based on local task queue | |
CN104735137A (en) | Method and system for achieving asynchronous interaction of client and server | |
CN109918381A (en) | Method and apparatus for storing data | |
CN107644020B (en) | Data storage and calling method and device | |
CN110807058B (en) | Method and system for exporting data | |
CN109241110A (en) | Order management method and system, electronic equipment, storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180817 |