CN107203918A - Order processing method and apparatus - Google Patents
Order processing method and apparatus Download PDFInfo
- Publication number
- CN107203918A CN107203918A CN201610159017.0A CN201610159017A CN107203918A CN 107203918 A CN107203918 A CN 107203918A CN 201610159017 A CN201610159017 A CN 201610159017A CN 107203918 A CN107203918 A CN 107203918A
- Authority
- CN
- China
- Prior art keywords
- order
- handled
- container
- threshold
- thread
- 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
- 238000003672 processing method Methods 0.000 title claims abstract description 23
- 238000012545 processing Methods 0.000 claims abstract description 30
- 230000005540 biological transmission Effects 0.000 claims abstract description 25
- 238000000034 method Methods 0.000 claims abstract description 20
- 230000004044 response Effects 0.000 claims abstract description 9
- 238000000151 deposition Methods 0.000 claims description 3
- 238000004519 manufacturing process Methods 0.000 claims description 3
- 238000003860 storage Methods 0.000 description 13
- 230000006854 communication Effects 0.000 description 6
- 230000006870 function Effects 0.000 description 6
- 230000008569 process Effects 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 238000004590 computer program Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 2
- 230000003139 buffering effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 235000013399 edible fruits Nutrition 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012805 post-processing Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
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/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/38—Concurrent instruction execution, e.g. pipeline or look ahead
- G06F9/3824—Operand accessing
- G06F9/383—Operand prefetching
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- Development Economics (AREA)
- General Business, Economics & Management (AREA)
- Strategic Management (AREA)
- Marketing (AREA)
- Economics (AREA)
- General Engineering & Computer Science (AREA)
- Computer And Data Communications (AREA)
Abstract
This application discloses order processing method and apparatus.One embodiment of methods described includes:In response to the transmission request for the currently pending order for receiving client transmission, producer thread determines the quantity of the order to be handled in the order set to be handled that is stored in container;If the quantity is less than default first threshold, the producer thread receive currently pending order and by the currently pending order be cached in the container described in order set to be handled;Consumer thread determines the quantity of the order to be handled in the order set to be handled that is stored in container;If the quantity is more than zero, the consumer thread obtained from the order set to be handled in the container described in order to be handled.The embodiment reduces the memory headroom occupancy of order, while order is cached and handled by parallel form, improves the efficiency of order processing.
Description
Technical field
The application is related to field of computer technology, and in particular to Internet technical field, especially relates to
And order processing method and apparatus.
Background technology
With the development of Internet technology, increasing user starts to select shopping at network, this
So that the quantity on order of electronic emporium etc. occurs in that growth at full speed.Therefore, how efficiently to locate
Managing order turns into major issue of concern.
Prior art generally carries out processing by the way of being set to order processing system and ordered
It is single, allow its at regular intervals section the order stored in database is loaded and handled.
This method requires that pending order is loaded into internal memory by system first, then to above-mentioned internal memory
Middle order is handled one by one.But, it is every using the above method with being continuously increased for quantity on order
Secondary to be required for loading substantial amounts of order to internal memory, this needs to take substantial amounts of memory headroom.Also,
The above method is to use the serialized manner processing order for first loading post processing, and efficiency is low.
The content of the invention
The purpose of the application is to propose a kind of improved order processing method and apparatus, to solve
The technical problem that background section above is mentioned.
In a first aspect, this application provides a kind of order processing method, methods described includes:Ring
Ying Yu receives the transmission request of the currently pending order of client transmission, and producer thread is true
The quantity of order to be handled in the order set to be handled stored in constant volume device;If
The quantity is less than default first threshold, then the producer thread receives currently pending order
It is single and by the currently pending order be cached in the container described in order to be handled
In set;Consumer thread determines having in the order set to be handled stored in container
The quantity of pending order;If the quantity is more than zero, the consumer thread is from the container
In order set to be handled in obtain described in order to be handled.
In certain embodiments, if in the order set to be handled stored in the container
When the quantity of order to be handled is more than or equal to the first threshold, the producer thread
The currently pending order is not cached to the container.
In certain embodiments, it is described if the quantity is less than default first threshold
Producer thread receives currently pending order and is cached to the currently pending order described
In the order set to be handled in container, including:If the quantity is less than default
First threshold, judges whether the quantity of the currently pending order is more than or equal to default the
Two threshold values;Wait to locate if so, the producer thread receives the current of the quantity of the Second Threshold
Reason order and by the currently pending order be cached in the container described in it is to be handled
In order set;If it is not, the producer thread receives all currently pending orders and will
The currently pending order is cached to the order set to be handled in the container
In.
In certain embodiments, if the quantity is more than zero, the consumer thread is from institute
Order to be handled described in being obtained in the order set to be handled in container is stated, including:
Judge whether the quantity is more than or equal to default 3rd threshold value;If so, the then consumer
Thread obtains the quantity of the 3rd threshold value from the order set to be handled of the container
Order to be handled;If it is not, then the consumer thread obtain the container needed located
Manage all orders to be handled in order set.
In certain embodiments, the first threshold is more than the Second Threshold, and described first
Threshold value is more than the 3rd threshold value.
In certain embodiments, the consumer thread orders to be handled in the container
Order to be handled also includes described in being obtained in single set:The consumer thread judges described
It whether there is the order to be handled being in process of caching in order set to be handled,
If in the presence of, the consumer thread not from the acquisition in the order set to be handled
Order to be handled.
Second aspect, this application provides a kind of order processing device, described device includes:The
One quantity determining module, is configured to currently pending the ordering in response to receiving client transmission
Single transmission request, producer thread is determined in the order set to be handled that is stored in container
Order to be handled quantity;Cache module, presets if being configured to the quantity and being less than
First threshold, then the producer thread receive currently pending order and currently treated described
Processing order is cached in the order set to be handled in the container;Second quantity
Determining module, is configured to the order collection to be handled that consumer thread determines to store in container
The quantity of order to be handled in conjunction;Acquisition module, is more than if being configured to the quantity
Zero, the consumer thread obtains described from the order set to be handled in the container
Order to be handled.
In certain embodiments, if in the order set to be handled stored in the container
When the quantity of order to be handled is more than or equal to the first threshold, the producer thread
The currently pending order is not cached to the container.
In certain embodiments, cache module configuration specifically for:If the quantity is less than
Default first threshold, judges whether the quantity of the currently pending order is more than or equal in advance
If Second Threshold;If so, the producer thread receives working as the quantity of the Second Threshold
The currently pending order is simultaneously cached to described existing in the container by preceding pending order
In pending order set;If it is not, the producer thread receives all currently pending order
It is single and by the currently pending order be cached in the container described in order to be handled
In set.
In certain embodiments, acquisition module configuration specifically for:Judging the quantity is
It is no to be more than or equal to default 3rd threshold value;If so, then the consumer thread is from the container
Order set to be handled in obtain the to be handled of quantity of the 3rd threshold value and order
It is single;If it is not, then the consumer thread is obtained in the order set to be handled of the container
All orders to be handled.
In certain embodiments, the first threshold is more than the Second Threshold, and described first
Threshold value is more than the 3rd threshold value.
In certain embodiments, the acquisition module configuration is further used for:Consumer's line
It whether there is in order set to be handled described in journey judgement and be in having needed in process of caching
Order is handled, if in the presence of the consumer thread is not from the order set to be handled
It is middle to obtain order to be handled.
The order processing method and apparatus that the application is provided, are receiving the current of client transmission
During the transmission request of pending order, judge the quantity of container order to be handled, producing
In the case that person's thread determines that the quantity is less than default first threshold, what caching was received works as
In order set to be handled of the preceding pending order into container, while judging consumption
Person's thread determines the order to be handled in the order set to be handled that is stored in container
Whether quantity is more than zero, and in the case where the quantity is more than zero, consumer thread is from container
Order to be handled is obtained, so that by the way that the producer is cached into currently pending order and consumption
The order to be handled that person's processing is obtained is performed parallel, improves the efficiency of order processing, together
When also by setting first threshold to reduce the EMS memory occupation amount of order.
Brief description of the drawings
Retouched by reading with reference to the detailed of being made to non-limiting example of being made of the following drawings
State, other features, objects and advantages will become more apparent upon:
Fig. 1 is that the application can apply to exemplary system architecture figure therein;
Fig. 2 is the flow chart of one embodiment of the order processing method according to the application;
Fig. 3 is the flow chart of another embodiment of the order processing method according to the application;
Fig. 4 is the structural representation of one embodiment of the order processing device according to the application;
Fig. 5 is adapted for for realizing the terminal device of the embodiment of the present application or the computer of server
The structural representation of system.
Embodiment
The application is described in further detail with reference to the accompanying drawings and examples.It is appreciated that
, specific embodiment described herein is used only for explaining related invention, rather than to the hair
Bright restriction.It also should be noted that, illustrate only for the ease of description, in accompanying drawing with
About the related part of invention.
It should be noted that in the case where not conflicting, embodiment and embodiment in the application
In feature can be mutually combined.Describe this in detail below with reference to the accompanying drawings and in conjunction with the embodiments
Application.
Fig. 1, which is shown, can apply the order processing method of the application or the reality of order processing device
Apply the exemplary system architecture 100 of example.
As shown in figure 1, system architecture 100 can include client 101, network 102,104,
Server 103 and server 105.Network 102,104 is used in client 101, server
The medium of communication link is provided between 103 and server 105.Network 102,104 can include
Various connection types, such as wired, wireless communication link or fiber optic cables etc..
In the present embodiment, client 101 is as a kind of electronic equipment, and it can have for operation
Multiple applications can set data to provide a user on the server of online service, the server
Storehouse, for being provided for the produced order of the application that is run on each terminal device (not shown)
Order data storage service.Server 105 can be ordered to terminal device (not shown) generation
Forms data carries out the processing such as data analysis.Client 101 can receive user in terminal device (not
Show) on the order data that the application of various telecommunication customer ends is produced, such as web page browsing are installed
Device application, the application of shopping class, searching class application, JICQ, mailbox client, society
Hand over platform software etc..
Server 103 can be to provide the server of various services, such as to client 101
Order data provides the background server supported.Background server can be to order for receiving etc.
Loading caching process is carried out, and result is sent to server 105.
It should be noted that the order processing method that the embodiment of the present application is provided is general by servicing
Device 103 is performed, correspondingly, and order processing device is generally positioned in server 103.
It should be understood that the number of the client, network and server in Fig. 1 is only schematic
's.According to needs are realized, can have any number of client, network and server.
With continued reference to Fig. 2, it illustrates the implementation of one of the order processing method according to the application
The flow 200 of example.Described order processing method, comprises the following steps:
Step 201, the transmission of the currently pending order in response to receiving client transmission please
Ask, producer thread determines that having needed in the order set to be handled stored in container is located
Manage the quantity of order.
In the present embodiment, electronic equipment (such as Fig. 1 of order processing method operation thereon
Shown server 103) visitor can be received by wired connection mode or radio connection
The user of family end storage carries out the currently pending order of the generations such as net purchase using terminal device.When
When above-mentioned electronic equipment receives the transmission request of the currently pending order of client transmission, in advance
What the producer thread first created can determine to store in the container being pre-created to be handled orders
The quantity of order to be handled in single set.It is pointed out that above-mentioned producer thread
Unlatching that can be arranged side by side with above-mentioned consumer thread is run.Here, above-mentioned radio connection can
With include but is not limited to 3G/4G connections, WiFi connections, bluetooth connection, WiMAX connections,
Zigbee connections, UWB (ultra wideband) connections and other currently known or future
The radio connection of exploitation.
Step 202, if the quantity of order to be handled is less than default first threshold, give birth to
Production person's thread receives currently pending order and is cached to currently pending order in container
In order set to be handled.
In the present embodiment, it is to be handled based on what is stored in the container obtained in step 201
The quantity of order to be handled in order set, above-mentioned electronic equipment is (such as shown in Fig. 1
Server 103) may determine that the quantity whether be less than default first threshold, if the number
Amount is less than above-mentioned first threshold, and above-mentioned producer thread can receive currently pending order and will
The currently pending order of above-mentioned reception is cached in the order set to be handled in container.
This method passes through to be handled in the order set to be handled stored in said vesse
The quantity of order sets a first threshold so that no matter the currently pending order that client is sent
Quantity be how many, the occupancy of the internal memory of above-mentioned electronic equipment is no more than predetermined threshold value, can
With the occupancy for the internal memory for efficiently controlling above-mentioned electronic equipment.
In some optional implementations of the present embodiment, if above-mentioned electronic equipment determine it is above-mentioned
The quantity of order to be handled in the order set to be handled stored in container be more than or
During equal to first threshold, then producer thread does not cache currently pending order to said vesse.
In some optional implementations of the present embodiment, when having for being stored in said vesse
When the quantity of order to be handled in pending order set is less than default first threshold,
Then illustrate that said vesse can also cache above-mentioned currently pending order.It can now continue to judge
Whether the quantity of above-mentioned currently pending order is more than or equal to default Second Threshold;If above-mentioned
The quantity of currently pending order is more than or equal to default Second Threshold, then producer thread can
With the currently pending order for the quantity for receiving Second Threshold and by the Second Threshold quantity received
Currently pending order be cached in the order set to be handled in container;If above-mentioned work as
The quantity of preceding pending order is less than default Second Threshold, then producer thread can receive institute
All currently pending orders received are simultaneously cached to above-mentioned appearance by the currently pending order that has
In order set to be handled in device.
Step 203, consumer thread is determined in the order set to be handled that is stored in container
Order to be handled quantity.
In the present embodiment, above-mentioned consumer thread can determine that what is stored in said vesse has
The quantity of order to be handled in pending order set.Here, above-mentioned electronic equipment is pre-
The consumer thread first created is mainly used in the order set to be handled for determining to store in container
Whether it is empty;If the order collection to be handled stored in the container is combined into sky, consumer
Thread can not therefrom obtain order to be handled;If what is stored in the container is to be handled
Order set is not sky, then consumer thread can therefrom obtain order to be handled.
Step 204, if the quantity of order to be handled is more than zero, consumer thread is from container
In order set to be handled in obtain order to be handled.
In the present embodiment, based on step 203 determine said vesse in store needed located
It is not sky that the quantity of order to be handled in reason order set, which is more than zero, the i.e. container, on
State consumer thread and obtain to be handled order from the order set to be handled in the container
It is single.
In some optional implementations of the present embodiment, equivalent to one public affairs of container here
Buffering area, can be used for the currently pending order of producer thread caching and is ordered to be handled altogether
In single set, the order to be handled after caching can be obtained by consumer thread.And on
Producer thread is stated during currently pending order is cached, consumer thread can be handled
The order to be handled obtained, this producer thread caching order and consumer thread
The method that processing order is performed side by side can effectively improve the efficiency of order processing.
The method that above-described embodiment of the application is provided, by the to be handled of container storage
The quantity of order to be handled in order set sets threshold value, and the internal memory for reducing order is empty
Between occupancy, in addition also by the way that producer thread is cached into currently pending order and consumer
The mode that the order to be handled that thread process has been obtained is performed parallel, improves order processing
Efficiency.
With further reference to Fig. 3, it illustrates the flow of another embodiment of order processing method
300.The flow 300 of the order processing method, comprises the following steps:
Step 301, the transmission of the currently pending order in response to receiving client transmission please
Ask, producer thread determines that having needed in the order set to be handled stored in container is located
Manage the quantity of order.
In the present embodiment, electronic equipment (such as Fig. 1 of order processing method operation thereon
Shown server 103) visitor can be received by wired connection mode or radio connection
The user of family end storage carries out the currently pending order of the generations such as net purchase using terminal device.When
When above-mentioned electronic equipment receives the transmission request of the currently pending order of client transmission, in advance
What the producer thread first created can determine to store in the container being pre-created to be handled orders
The quantity of order to be handled in single set.
Step 302, judge whether the quantity of order to be handled is less than default first threshold.
In the present embodiment, above-mentioned electronic equipment can be located to having needed of being stored in container in advance
The quantity for managing the order to be handled in order set sets a first threshold, the first threshold
It can be configured according to the size of internal memory.Stored in the container determined based on step 301
The quantity of order to be handled in order set to be handled, judges whether the quantity is less than
Above-mentioned first threshold, if the quantity is less than above-mentioned first threshold, goes to step 303, such as
Really the quantity is more than or equal to above-mentioned first threshold, then goes to step 304.
Step 303, judge whether the quantity of currently pending order is more than or equal to default the
Two threshold values.
In the present embodiment, based on step 302 determine said vesse in store needed located
The quantity for managing the order to be handled in order set is less than above-mentioned first threshold, continues to judge
It is pre- whether the quantity for the currently pending order that the above-mentioned client received is sent is more than or equal to
If Second Threshold.If the quantity of currently pending order is more than or equal to default second threshold
Value, then go to step 305, the currently pending order of Second Threshold quantity be cached into container
In order set to be handled in.If the quantity of currently pending order is less than default
Second Threshold, then go to step 306, and all currently pending orders are cached in container
In order set to be handled.The step is the producer in said vesse less than in the case of
Being cached in container for the currently pending Order Batch time that client can be sent, contributes to
The quantity of order to be handled, Ke Yiyou in order set to be handled in control container
The occupancy of effect ground reduction internal memory.
Step 304, producer thread does not cache currently pending order to container.
In the present embodiment, based on step 302 determine said vesse in store needed located
The quantity for managing the order to be handled in order set is more than or equal to above-mentioned first threshold, then
Above-mentioned producer thread does not cache currently pending order into container.Here, deposit in a reservoir
The quantity of order to be handled in the order set to be handled of storage is more than or equal to above-mentioned
In the case of first threshold, producer thread no longer caches currently pending order into said vesse
It is single, the quantity of the order to be handled stored in container can be efficiently controlled, you can to have
The occupancy of effect ground control memory headroom.
Step 305, producer thread receives the currently pending order of the quantity of Second Threshold simultaneously
The currently pending order received is cached in the order set to be handled in container.
In the present embodiment, the quantity based on the currently pending order determined in step 303 is big
In or equal to default Second Threshold, the producer thread in above-mentioned electronic equipment receives the second threshold
The currently pending order of the quantity of value and by the currently pending of the Second Threshold quantity received
Order is cached in the order set to be handled in container.
In some optional implementations of the present embodiment, above-mentioned first threshold is more than above-mentioned the
It is each that quantity in two threshold values, i.e. container in order set to be handled is more than producer thread
The quantity of the currently pending order of caching.Which caches currently pending in producer thread
, can be by visitor in the case that order and consumer thread obtain the execution arranged side by side of order to be handled
The currently pending order that family end is sent every time is divided into be cached in container several times, can be effective
Ground reduces occupancy of the pending order to internal memory.
Step 306, producer thread receives all currently pending orders and will received
Currently pending order is cached in the order set to be handled in container.
In the present embodiment, the quantity based on the currently pending order determined in step 303 is small
Producer thread in default Second Threshold, above-mentioned electronic equipment receives all current treat
Processing order simultaneously to be handled is ordered what the currently pending order received was cached in container
In single set.For example, when client send currently pending order quantity be 30, and on
State Second Threshold for 20 when, above-mentioned producer thread for the first time can be by Second Threshold quantity 20
Individual currently pending order is cached in the order set to be handled in container, now remaining
The quantity of currently pending order be 10, it can be determined that go out already less than Second Threshold, therefore
Above-mentioned producer thread for the second time can delay remaining 10 all currently pending orders
It is stored in the order set to be handled in container.
Step 307, consumer thread is determined in the order set to be handled that is stored in container
Order to be handled quantity.
In the present embodiment, above-mentioned consumer thread can determine that what is stored in said vesse has
The quantity of order to be handled in pending order set.Here, above-mentioned electronic equipment is pre-
The consumer thread first created can be also used for the order collection to be handled for determining to store in container
Whether close is empty;If the order collection to be handled stored in the container is combined into sky, consume
Person's thread can not therefrom obtain order to be handled;If having needed of being stored in the container is located
It is not sky to manage order set, then consumer thread can therefrom obtain order to be handled.
In some optional implementations of the present embodiment, above-mentioned consumer thread judges existing
It whether there is the order to be handled being in process of caching in pending order set, if depositing
Then consumer thread does not obtain any to be handled order from order set to be handled
It is single.
Step 308, judge whether the quantity of order to be handled is more than or equal to default the
Three threshold values.
In the present embodiment, if if the order set to be handled stored in said vesse
It is not sky, then above-mentioned electronic equipment continues the order to be handled for judging to store in said vesse
Whether the quantity of the order to be handled in set is more than or equal to default 3rd threshold value, such as
The quantity of order to be handled in the order set to be handled stored in fruit said vesse
More than or equal to default 3rd threshold value, then step 309 is gone to, step 310 is otherwise gone to.
Step 309, consumer thread obtains the 3rd from the order set to be handled of container
The order to be handled of the quantity of threshold value.
In the present embodiment, based on step 308 determine said vesse in store needed located
The quantity for managing the order to be handled in order set is more than or equal to default 3rd threshold value,
Above-mentioned consumer thread obtains the 3rd number of thresholds from the order set to be handled of container
Order to be handled.
In some optional implementations of this implementation, above-mentioned first threshold can be more than above-mentioned
In 3rd threshold value, i.e. said vesse the maximum of the quantity of order to be handled can be more than disappear
The maximum of the quantity for the order to be handled that expense person's thread is obtained every time.
Step 310, consumer thread obtain container order set to be handled in it is all
Order to be handled.
In the present embodiment, when above-mentioned producer thread does not cache currently pending order to container
When, in the said vesse determined based on step 308 in the order set to be handled that stores
The quantity of order to be handled is less than default 3rd threshold value, and consumer thread obtains container
All orders to be handled in order set to be handled.For example, in said vesse
Order to be handled is 30 (first threshold can be the arbitrary integer not less than 30), and above-mentioned
When 3rd threshold value is 20, above-mentioned consumer thread can obtain the 3rd threshold value from container for the first time
The order to be handled of quantity, now the quantity of remaining order to be handled is in container
10, it can be determined that go out less than the 3rd threshold value 20, therefore above-mentioned consumer thread can obtain for second
Remaining all 10 orders to be handled in extracting container.
The method that above-described embodiment of the application is provided, the caching of producer thread in batches is current
The order to be handled that pending order and consumer thread's processing are obtained is performed side by side, can be with
The efficiency of order processing is improved, while the quantity of the order to be handled cached to container is set
First threshold, can also further reduce the occupancy of memory headroom.
With further reference to Fig. 4, as the realization to method shown in above-mentioned each figure, the application is provided
A kind of one embodiment of order processing device, the device embodiment and the method shown in Fig. 2
Embodiment is corresponding, and the device specifically can apply in various electronic equipments.
As shown in figure 4, the order processing device 400 described in the present embodiment includes:First quantity
Determining module 401, cache module 402, the second quantity determining module 403 and acquisition module 404.
Wherein, the first quantity determining module 401 is configured in response to receiving working as client transmission
The transmission request of preceding pending order, it is to be handled that producer thread determines to store in container
The quantity of order to be handled in order set;If cache module 402 is configured to above-mentioned
Quantity is less than default first threshold, then producer thread receives currently pending order and will be upper
Currently pending order is stated to be cached in the order set to be handled in said vesse;Second
It is to be handled that quantity determining module 403 is configured to that consumer thread determines to store in container
The quantity of order to be handled in order set;If acquisition module 404 is configured to above-mentioned
Quantity is more than zero, and consumer thread obtains from the order set to be handled in said vesse
Order to be handled.
In some optional implementations of the present embodiment, if what is stored in said vesse has
The quantity of order to be handled in pending order set is more than or equal to above-mentioned first threshold
When, producer thread does not cache currently pending order to container.
In some optional implementations of the present embodiment, cache module 402 configures specific use
In:If above-mentioned quantity is less than default first threshold, judging the quantity of currently pending order is
It is no to be more than or equal to default Second Threshold;If so, above-mentioned producer thread receives Second Threshold
Quantity currently pending order and by the currently pending order of the quantity of above-mentioned Second Threshold
It is cached in the order set to be handled in container;If it is not, above-mentioned producer thread is received
All currently pending orders are simultaneously cached in container by all currently pending order
In order set to be handled.
In some optional implementations of the present embodiment, acquisition module 404 configures specific use
In:Judge whether above-mentioned quantity is more than or equal to default 3rd threshold value;If so, then consumer
Thread obtains having for the quantity of above-mentioned 3rd threshold value from the order set to be handled of container
Pending order;If it is not, then consumer thread is obtained in the order set to be handled of container
All orders to be handled.
In some optional implementations of the present embodiment, above-mentioned first threshold is more than above-mentioned the
Two threshold values, and above-mentioned first threshold is more than above-mentioned 3rd threshold value.
In some optional implementations of the present embodiment, acquisition module 404 is configured further
For:Above-mentioned consumer thread judges to whether there is in caching in order set to be handled
During order to be handled, if in the presence of consumer thread is not from described needed
Order to be handled is obtained in reason order set.
It will be understood by those skilled in the art that the above order processing unit 400 also includes some its
His known features, such as processor, memory, in order to unnecessarily obscure the reality of the disclosure
Example is applied, these known structures are not shown in Fig. 4.
Below with reference to Fig. 5, it illustrates suitable for for realizing the terminal device of the embodiment of the present application
Or the structural representation of the computer system 500 of server.
As shown in figure 5, computer system 500 includes CPU (CPU) 501, its
Can according to the program being stored in read-only storage (ROM) 502 or from storage part 508
The program that is loaded into random access storage device (RAM) 503 and perform various appropriate actions
And processing.In RAM 503, the system that is also stored with 500 operates required various program sums
According to.CPU 501, ROM 502 and RAM 503 are connected with each other by bus 504.Input
/ output (I/O) interface 505 is also connected to bus 504.
I/O interfaces 505 are connected to lower component:Importation 506 including keyboard, mouse etc.;
Include the output par, c 507 of cathode-ray tube (CRT), liquid crystal display (LCD) etc.;
Storage part 508 including hard disk etc.;And including LAN card, modem etc.
The communications portion 509 of NIC.Communications portion 509 is held via the network of such as internet
Row communication process.Driver 510 is also according to needing to be connected to I/O interfaces 505.Detachable media
511, such as disk, CD, magneto-optic disk, semiconductor memory etc. are arranged on as needed
On driver 510, deposited in order to which the computer program read from it is mounted into as needed
Store up part 508.
Especially, in accordance with an embodiment of the present disclosure, the process described above with reference to flow chart can be with
It is implemented as computer software programs.For example, embodiment of the disclosure includes a kind of computer journey
Sequence product, it includes being tangibly embodied in the computer program on machine readable media, the meter
Calculation machine program bag, which contains, is used for the program code of the method shown in execution flow chart.Implement such
In example, the computer program can be downloaded and installed by communications portion 509 from network,
And/or be mounted from detachable media 511.
Flow chart and block diagram in accompanying drawing, it is illustrated that according to the system of the various embodiments of the application,
Architectural framework in the cards, function and the operation of method and computer program product.This point
On, each square frame in flow chart or block diagram can represent a module, program segment or code
A part, the part of the module, program segment or code is used for comprising one or more
The executable instruction of logic function as defined in realizing.It should also be noted that being used as replacement at some
In realization, the function of being marked in square frame can also be with different from the order marked in accompanying drawing hair
It is raw.For example, two square frames succeedingly represented can essentially be performed substantially in parallel, they
Sometimes it can also perform in the opposite order, this is depending on involved function.It is also noted that
It is, each square frame in block diagram and/or flow chart and the square frame in block diagram and/or flow chart
Combination, can be realized with the special hardware based system of defined function or operation is performed,
Or can be realized with the combination of specialized hardware and computer instruction.
Being described in module involved in the embodiment of the present application can be real by way of software
It is existing, it can also be realized by way of hardware.Described module can also be arranged on processing
In device, for example, can be described as:A kind of processor includes the first quantity determining module, caching
Module, the second quantity determining module and acquisition module.Wherein, the title of these modules is at certain
In the case of do not constitute restriction to the module in itself, for example, the first quantity determining module may be used also
To be described as " the currently pending order in response to receiving client transmission, producer's line
The quantity of order to be handled in the order set to be handled stored in the true constant volume device of journey
Module ".
As on the other hand, present invention also provides a kind of nonvolatile computer storage media,
The nonvolatile computer storage media can be described in above-described embodiment included in device
Nonvolatile computer storage media;Can also be individualism, without non-in supplying terminal
Volatile computer storage medium.Above-mentioned nonvolatile computer storage media be stored with one or
The multiple programs of person, when one or more of programs are performed by an equipment so that described
Equipment:In response to the transmission request for the currently pending order for receiving client transmission, production
Person's thread determines the order to be handled in the order set to be handled that is stored in container
Quantity;If the quantity is less than default first threshold, the producer thread receives current
Pending order and by the currently pending order be cached in the container described in needed
Handle in order set;Consumer thread determines the order set to be handled stored in container
In order to be handled quantity;If the quantity be more than zero, the consumer thread from
Order to be handled described in being obtained in order set to be handled in the container.
Above description is only the preferred embodiment of the application and saying to institute's application technology principle
It is bright.It will be appreciated by those skilled in the art that invention scope involved in the application, is not limited
In the technical scheme of the particular combination of above-mentioned technical characteristic, do not departed from while should cover yet
In the case of the inventive concept, it is combined by above-mentioned technical characteristic or its equivalent feature
Formed by other technical schemes.Such as features described above and (but not limited to) disclosed herein
Technical characteristic with similar functions carries out technical scheme formed by replacement mutually.
Claims (12)
1. a kind of order processing method, it is characterised in that methods described includes:
In response to the transmission request for the currently pending order for receiving client transmission, the producer
Thread determines the number of the order to be handled in the order set to be handled that is stored in container
Amount;
If the quantity is less than default first threshold, the producer thread is received and currently treated
Processing order and by the currently pending order be cached in the container described in needed to be located
Manage in order set;
Consumer thread determines that having needed in the order set to be handled stored in container is located
Manage the quantity of order;
If the quantity is more than zero, the consumer thread is to be handled in the container
Order to be handled described in being obtained in order set.
2. order processing method according to claim 1, it is characterised in that if described hold
The quantity of order to be handled in the order set to be handled stored in device is more than or waited
When the first threshold, the producer thread currently is not waited to locate to container caching is described
Manage order.
3. order processing method according to claim 2, it is characterised in that if the institute
State quantity and be less than default first threshold, then the producer thread receives currently pending order
And by the currently pending order be cached in the container described in order collection to be handled
In conjunction, including:
If the quantity is less than default first threshold, the number of the currently pending order is judged
Whether amount is more than or equal to default Second Threshold;
If so, the currently pending of quantity that the producer thread receives the Second Threshold is ordered
It is single and by the currently pending order be cached in the container described in order to be handled
In set;
If it is not, the producer thread receives all currently pending orders and will be described current
Pending order is cached in the order set to be handled in the container.
4. order processing method according to claim 1, it is characterised in that if the institute
Quantity is stated more than zero, the consumer thread is from the order set to be handled in the container
Order to be handled described in middle acquisition, including:
Judge whether the quantity is more than or equal to default 3rd threshold value;
If so, then the consumer thread obtains from the order set to be handled of the container
Take the order to be handled of the quantity of the 3rd threshold value;
If it is not, then the consumer thread is obtained in the order set to be handled of the container
All orders to be handled.
5. the order processing method according to one of claim 1-4, it is characterised in that institute
First threshold is stated more than the Second Threshold, and the first threshold is more than the 3rd threshold value.
6. order processing method according to claim 5, it is characterised in that the consumption
Person's thread to be handled is ordered described in being obtained from the order set to be handled in the container
It is single also to include:
It whether there is in order set to be handled described in consumer thread's judgement in slow
Order to be handled during depositing, if in the presence of, the consumer thread not from it is described
Order to be handled is obtained in order set to be handled.
7. a kind of order processing device, it is characterised in that described device includes:
First quantity determining module, is configured to treat in response to receiving the current of client transmission
The transmission request of order is handled, producer thread determines the order to be handled stored in container
The quantity of order to be handled in set;
Cache module, if being configured to the quantity less than default first threshold, the life
Production person's thread receives currently pending order and the currently pending order is cached into the appearance
In the order set to be handled in device;
Second quantity determining module, is configured to consumer thread and determines that what is stored in container has
The quantity of order to be handled in pending order set;
Acquisition module, if being configured to the quantity more than zero, the consumer thread is from described
Order to be handled described in being obtained in order set to be handled in container.
8. order processing device according to claim 7, it is characterised in that if described hold
The quantity of order to be handled in the order set to be handled stored in device is more than or waited
When the first threshold, the producer thread currently is not waited to locate to container caching is described
Manage order.
9. order processing device according to claim 8, it is characterised in that the caching
Module configuration specifically for:
If the quantity is less than default first threshold, the number of the currently pending order is judged
Whether amount is more than or equal to default Second Threshold;
If so, the currently pending of quantity that the producer thread receives the Second Threshold is ordered
It is single and by the currently pending order be cached in the container described in order to be handled
In set;
If it is not, the producer thread receives all currently pending orders and will be described current
Pending order is cached in the order set to be handled in the container.
10. order processing device according to claim 7, it is characterised in that described to obtain
Modulus block configuration specifically for:
Judge whether the quantity is more than or equal to default 3rd threshold value;
If so, then the consumer thread obtains from the order set to be handled of the container
Take the order to be handled of the quantity of the 3rd threshold value;
If it is not, then the consumer thread is obtained in the order set to be handled of the container
All orders to be handled.
11. the order processing device according to one of claim 7-10, it is characterised in that
The first threshold is more than the Second Threshold, and the first threshold is more than the 3rd threshold value.
12. order processing device according to claim 11, it is characterised in that described to obtain
The configuration of modulus block is further used for:
It whether there is in order set to be handled described in consumer thread's judgement in slow
Order to be handled during depositing, if in the presence of, the consumer thread not from it is described
Order to be handled is obtained in order set to be handled.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610159017.0A CN107203918A (en) | 2016-03-18 | 2016-03-18 | Order processing method and apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610159017.0A CN107203918A (en) | 2016-03-18 | 2016-03-18 | Order processing method and apparatus |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107203918A true CN107203918A (en) | 2017-09-26 |
Family
ID=59904680
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610159017.0A Pending CN107203918A (en) | 2016-03-18 | 2016-03-18 | Order processing method and apparatus |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107203918A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110046948A (en) * | 2018-01-16 | 2019-07-23 | 北京京东尚科信息技术有限公司 | Order processing method, system, electronic equipment and computer-readable medium |
CN110097303A (en) * | 2018-01-30 | 2019-08-06 | 北京京东尚科信息技术有限公司 | A kind of method and apparatus of order management |
CN110135925A (en) * | 2018-02-08 | 2019-08-16 | 北京京东尚科信息技术有限公司 | Order processing system, method and apparatus |
CN110164046A (en) * | 2019-06-19 | 2019-08-23 | 深圳市小兔充充科技有限公司 | Ordering method, device and the storage medium of charging station |
CN113762570A (en) * | 2020-10-22 | 2021-12-07 | 北京京东振世信息技术有限公司 | Order picking task order forming method and device |
CN116743796A (en) * | 2023-05-09 | 2023-09-12 | 内蒙古忠信网络科技有限公司 | Data management and control system and method based on Internet of things |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104182361A (en) * | 2014-08-20 | 2014-12-03 | 北京国双科技有限公司 | Data caching processing method and device |
US20150127704A1 (en) * | 2013-11-07 | 2015-05-07 | Alibaba Group Holding Limited | Data Processing |
CN105159782A (en) * | 2015-08-28 | 2015-12-16 | 北京百度网讯科技有限公司 | Cloud host based method and apparatus for allocating resources to orders |
-
2016
- 2016-03-18 CN CN201610159017.0A patent/CN107203918A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150127704A1 (en) * | 2013-11-07 | 2015-05-07 | Alibaba Group Holding Limited | Data Processing |
CN104182361A (en) * | 2014-08-20 | 2014-12-03 | 北京国双科技有限公司 | Data caching processing method and device |
CN105159782A (en) * | 2015-08-28 | 2015-12-16 | 北京百度网讯科技有限公司 | Cloud host based method and apparatus for allocating resources to orders |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110046948A (en) * | 2018-01-16 | 2019-07-23 | 北京京东尚科信息技术有限公司 | Order processing method, system, electronic equipment and computer-readable medium |
CN110097303A (en) * | 2018-01-30 | 2019-08-06 | 北京京东尚科信息技术有限公司 | A kind of method and apparatus of order management |
CN110135925A (en) * | 2018-02-08 | 2019-08-16 | 北京京东尚科信息技术有限公司 | Order processing system, method and apparatus |
CN110135925B (en) * | 2018-02-08 | 2023-09-26 | 北京京东尚科信息技术有限公司 | Order processing system, method and device |
CN110164046A (en) * | 2019-06-19 | 2019-08-23 | 深圳市小兔充充科技有限公司 | Ordering method, device and the storage medium of charging station |
CN113762570A (en) * | 2020-10-22 | 2021-12-07 | 北京京东振世信息技术有限公司 | Order picking task order forming method and device |
CN113762570B (en) * | 2020-10-22 | 2024-05-24 | 北京京东振世信息技术有限公司 | Method and device for sorting task group list |
CN116743796A (en) * | 2023-05-09 | 2023-09-12 | 内蒙古忠信网络科技有限公司 | Data management and control system and method based on Internet of things |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107203918A (en) | Order processing method and apparatus | |
CN105320766B (en) | Information-pushing method and device | |
CN107105031A (en) | Information-pushing method and device | |
CN105260229A (en) | Method and device for pulling mirror image files of virtual machines | |
CN110334036A (en) | A kind of method and apparatus for realizing data cached scheduling | |
CN102279963B (en) | The method, apparatus and system of the prompting of two-stage budget reasonalbeness check and Automatic Optimal | |
CN102982106B (en) | The pre- method and apparatus for opening webpage | |
CN108933822B (en) | Method and apparatus for handling information | |
CN107908666A (en) | A kind of method and apparatus of identification equipment mark | |
CN108984553A (en) | Caching method and device | |
CN108629611A (en) | Method and apparatus for distributing resource | |
CN107547629A (en) | Method, apparatus, electronic equipment and the computer-readable recording medium that client static resource is downloaded | |
CN107329963A (en) | Accelerate the method and apparatus of web page access | |
CN109471783A (en) | The method and apparatus for predicting task run parameter | |
CN107613040A (en) | A kind of method and apparatus of domain name system DNS server lookup | |
CN109684079A (en) | Data display processing method, device and electronic equipment | |
CN107347093A (en) | Collocation method and device for distributed server system | |
CN110020310A (en) | Method, apparatus, terminal and the storage medium of resource load | |
CN112162762B (en) | Gray level distribution method, gray level distribution device and electronic equipment | |
WO2024113966A1 (en) | Article identifier information generation method and apparatus, and device, medium and program product | |
CN105608128B (en) | Streetscape video generation method and device based on path planning | |
CN110019393A (en) | A kind of method and apparatus of fuzzy query | |
CN105373310B (en) | Method and apparatus based on the user's operation real-time update page | |
CN104144126B (en) | Method and system, the client of flow optimization are realized by image procossing | |
CN108959289A (en) | Categories of websites acquisition methods and device |
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 |