Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, rather than whole embodiment.Embodiment based in the present invention, those of ordinary skills, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
The embodiment of the present invention provides a kind of data processing method, device and data handling system.Below be elaborated respectively.
Embodiment mono-,
The present embodiment is described the angle from data processing unit to method how to avoid data cell and garbage reclamation thread to share data collision.This data processing unit is specially the equipment such as processing data packets module or central processing unit (CPU, Central Processing Unit).
Fig. 1 is the flow chart of the data processing method that provides of the embodiment of the present invention one, and as shown in Figure 1, idiographic flow can be as follows:
101, obtain packet, wherein, in packet, carry contextual feature information;
For example, in packet, can carry the information such as Internet protocol (IP, Internet Protocol) address and port (Port) and protocol number.
102, according to the contextual feature acquisition of information context in the packet getting;
For example, based on context characteristic information calculates context index, then according to the context index calculating, obtains contextual pointer, then obtains context according to the contextual pointer getting.It should be noted that, context index can not correspond to context one by one, may be corresponding with a plurality of contexts, in the different moment, according to certain context index, may get different context pointers, but index is unique within certain time period.
Can access flag if the context getting in 103 steps 102 does not have release mark and has, this context is stamped by after data processing unit usage flag, this context is conducted interviews, when needs discharge these contexts, these contexts are stamped and needed aging mark, put into the recovery fifo fifo queue of data processing unit, and after access completes, remove this by data processing unit usage flag;
Concrete, if the context getting in step 102 has release mark, for example, " discharge " and be labeled as 0, and having can access flag, for example, " can access " is labeled as 1, and data processing unit is stamped and after data processing unit usage flag, this context conducted interviews this context.In the process of access, if discovery needs the context getting in release steps 102, for this context is set up expression, need aging mark, and put into the recovery fifo queue of this thread; Such as, this contextual " needing aging " mark is put to 1, then put into " the recovery fifo queue " of data processing unit.
It should be noted that, each different data processing unit need to be used different " being used by data processing unit " marks, that is to say, should have a mark array in context, and different data processing unit access have different marks.
The embodiment of the present invention adopts the contextual feature information of carrying in packet, then according to this contextual feature acquisition of information context, and the not isolabeling is based on context processed accordingly to context, when needs discharge this context, this context is stamped and needed aging mark, put into the recovery fifo fifo queue of data processing unit, facilitate the follow-up mark in based on context of garbage reclamation thread to process accordingly context, make in the situation that not locking, to complete to contextual Concurrency Access or revise context, avoid between garbage reclamation thread and data processing unit when realizing data processing problem, the problem includes: sharing conflict problem, thereby increased the concurrency of system deal with data, elevator system treatment effeciency.
Further, as shown in Figure 2, on the basis of the embodiment shown in Fig. 1, the method can also comprise step 104:
Can access flag if the context getting in 104 steps 102 has release mark or do not have, obtain new context, and new context is stamped can access flag.
Certainly, it should be noted that, stamp can access flag before, need to remove all marks.In addition, the context to new conduct interviews and stamp can access flag before, also need accessed context to stamp by data processing unit usage flag, after access, should remove this by data processing unit usage flag.
Such as, if contextual " discharging " of getting in step 102 is labeled as 1, or " can access " and be labeled as 0, obtain new context, this new context is stamped to " being accessed by data processing unit " mark, for example, the mark of this new contextual " being accessed by data processing unit " is set to 1, and new contextual " can access " mark is put to 1, after access, remove " being accessed by data processing unit " mark, be about to " being accessed by data processing unit " mark and set to 0.
In like manner, if in the new contextual process of access, discovery needs the new context getting in release steps 104, for this context is set up expression, needs aging mark, and puts into the recovery fifo queue of this thread.Such as, this contextual " needing aging " mark is put to 1, then put into " the recovery fifo queue " of data processing unit.
Further, when not needing to discharge the context get, can the accessing operation such as read and write to context, and after access completes, remove " being used by the data processing unit " mark in this context.
As from the foregoing, the embodiment of the present invention adopts the contextual feature information of carrying in packet, then according to this contextual feature acquisition of information context, and the not isolabeling is based on context made corresponding processing to context, for example if this context has " can access " mark and do not there is " discharging " mark, this context is conducted interviews, if this context has " discharging " mark or does not have " can access " mark, obtain new context, and new context is stamped to " can access " mark; If desired free context, for this context is set up expression " need to be aging " mark, and puts into the recovery fifo queue of this thread, etc.; Adopt this programme can in the situation that not locking, complete a plurality of data processing unit Concurrency Access or revise context, avoid the sharing conflict between garbage reclamation thread and data processing unit simultaneously, thereby increased the concurrency of system deal with data, elevator system treatment effeciency.
Embodiment bis-,
Corresponding with above-described embodiment, for avoiding the sharing conflict of garbage reclamation thread and data processing unit, the present embodiment carries out processing method by the angle from garbage reclamation thread to data and is described.
As shown in Figure 3, idiographic flow can be as follows:
201, the recovery fifo queue of visit data processing unit, by having in the recovery fifo queue of this data processing unit can access flag and the wait that needs the context of aging mark to put into garbage reclamation thread discharge fifo queue, this is put into and waits for that the context that discharges fifo queue is stamped and wait for release mark simultaneously;
Concrete, during the recovery fifo queue of visit data processing unit, can be only can access flag and need the context of aging mark process to having, for all the other contexts in the recovery fifo queue of this data processing unit, disregard.
Optionally, for fear of repeating release, step 201 is specifically as follows: the recovery fifo queue of visit data processing unit, can access flag and need aging mark and do not have waiting for that the context of release mark puts into the wait release fifo queue of garbage reclamation thread by having in the recovery fifo queue of this data processing unit, the context of simultaneously this being put into wait release fifo queue is stamped and is waited for release mark, for all the other contexts in the recovery fifo queue of this data processing unit, disregards.
Such as, " can access " in " the recovery fifo queue " of data processing unit is labeled as to 1, " needing aging " be labeled as 1 and " waiting for releases " be labeled as " waiting for release fifo queue " that garbage reclamation thread put in 0 context, to putting into contextual " waiting for release mark " of " wait for and discharge fifo queue ", put 1 simultaneously, for all the other contexts in " the recovery fifo queue " of data processing unit, disregard.
202, the wait of access garbage reclamation thread discharges fifo queue, to the wait of garbage reclamation thread discharge in fifo queue have can access flag, need aging mark and do not have to be put into and discharge fifo queue by the context of data processing unit usage flag, release mark stamped in the context of simultaneously this being put into " having discharged fifo queue ", make data processing unit when getting this context, this context is not conducted interviews.
Such as, " can access " in " wait for discharge fifo queue " of garbage reclamation thread is labeled as to 1, " needing aging " be labeled as 1 and " by data processing unit, being used " be labeled as 0 context and put into " having discharged fifo queue ", and contextual " being released " mark that this is put into " having discharged fifo queue " is set to 1, for other contexts in " having discharged fifo queue ", disregard, other contexts still rest in former queue.
It should be noted that, the context of stamping " being released mark " does not represent and discharges, stamp " being released mark " herein just in order to prevent that data processing unit from conducting interviews, and facilitate follow-up processing, such as, in step 203, just can according to this, " be released mark " context has been discharged.
203, the release fifo queue of access garbage reclamation thread, does not have and is discharged by the context of data processing unit usage flag discharging in fifo queue, and removing can access flag.Context after release can be placed into the idle context fifo queue of data processing unit;
It should be noted that, if there are a plurality of data processing units, the idle context fifo queue of each data processing unit can be put into according to different marks in context after discharging, while creating new context for data processing unit, use, for example, when data processing unit needs newly-built context, can from its idle context fifo queue, obtain contextual pointer, if obtained successfully, initialization context.
Further, garbage reclamation thread can also travel through all contexts, timestamp in determining context and the difference of current time are greater than preset threshold value, and this context has can access flag, do not have the aging mark of needs, do not have when waiting for release mark and not having by data processing unit usage flag, the wait of this context being put into this thread discharges fifo queue, and stamp the aging mark of needs, such as will " needing aging ", mark puts 1.
It should be noted that, in system, may have a plurality of data processing units, if there are a plurality of data processing units, garbage reclamation thread conducts interviews one by one to these data processing units.
As from the foregoing, the garbage reclamation thread of the embodiment of the present invention is by the recovery fifo queue of visit data processing unit, context in the recovery fifo queue of data processing unit is reclaimed and stamps release mark, make data processing unit when getting this context, this context is not conducted interviews, but obtain new context, avoided the sharing conflict between garbage reclamation thread and data processing unit, make in the situation that not locking, to complete Concurrency Access or revise context, thereby increased the concurrency of system deal with data, elevator system treatment effeciency.
Embodiment tri-,
According to embodiment mono-and the described method of embodiment bis-, below will be for example from the angle of data processing unit and garbage reclamation thread to how avoiding the method for the sharing conflict between garbage reclamation thread and data processing unit to be elaborated.It should be noted that, the operational environment of implementing the embodiment of the present invention need to meet following condition:
(1) packet contains contextual feature information, and can calculate contextual index value according to characteristic information.
(2) packet that specific context is corresponding can only be processed by specific data processing unit.
As before, (background technology) is described, known, " writing one reads " in the situation that, may occur that data are inconsistent, be the problem of sharing conflict,, when share and access, can occur a performance element write information simultaneously, and the situation that another one is read, in embodiments of the present invention, be embodied between garbage reclamation thread and data processing unit, can be summarized as following several situation:
A) in context " can access flag ": when context is created, " can access flag " wherein can be set to 1, when garbage reclamation thread discharges this context, this " can access flag " can be eliminated, although both carried out write operation, but because the operating time is divided (because garbage reclamation thread conventionally needs first dormancy a period of time before access context, this time can carry out preset according to the demand of practical application), so can not cause conflict.
B) in context, " by data processing unit, used " mark: when data processing unit conducts interviews to context, " being used by data processing unit " mark in this context can be put to 1, when garbage reclamation thread reads this context, know that " by data processing unit, being used " is labeled as 1, so define other threads (being data processing unit at this), may carry out write operation, now, garbage reclamation thread is only to carry out read operation to this context, these above read-write operations are all atomicities, this situation can not cause the inconsistence problems of data.
C) " timestamp of last visit " in context: data processing unit is during to packet executable operations, " timestamp of last visit " in the corresponding context of this packet is set up to the new time, and whether garbage reclamation thread only can read this contextual " timestamp of last visit " overtime to determine this context, if overtime, and this context has can access flag, do not there is the aging mark of needs, do not have and waiting for release mark and do not having by data processing unit usage flag, the wait of this context being put into garbage reclamation thread discharges fifo queue, this context is put to " needing aging " mark simultaneously, these above read-write operations are all atomicities, can not cause the inconsistence problems of data.
D) in context " need " mark aging: data processing unit is during to data package operation, " needing aging " mark in the corresponding context of this packet can be put to 1, garbage reclamation thread is when traversal context, if find that according to " timestamp of last visit " this context is overtime, also can put 1 to " needing aging " mark, but because being all puts 1 operation, conflict can not cause the inconsistent problem of data yet.
E) in context, " discharge " mark: garbage reclamation thread puts 1 to " the discharging " mark in context, data processing unit is when getting this context, know that " discharging " is labeled as 1, so think that this context is out-of-date, data processing unit can obtain new context, and new contextual " can access " is labeled as to 1, can be referring to description above, do not repeat them here, these above read-write operations are all atomicities, can not cause the inconsistence problems of data.
In addition, it should be noted that, for fear of the conflict of data processing unit data sharing, can packet delivery be arrived to specific data processing unit according to packet contextual feature, and need to guarantee that the packet delivery with identical feature is to identical data processing unit.
Clearer in order to describe, below will from the angle of data processing unit (WORKTHREAD) and garbage reclamation thread (AGETHREAD), be described respectively, concrete enforcement can be as follows:
(1) data processing unit
During concrete enforcement, data processing unit can comprise following data entity (being data structure):
A) reclaim fifo queue (SESSION reclaims fifo queue, above the recovery fifo queue of the said data processing unit of embodiment), for depositing the contextual pointer of preparing recovery.When data processing unit needs free context, first " needing aging " mark is put to 1, then contextual pointer is put into this context and reclaim fifo queue.
B) idle context fifo queue (idle SESSIONFIFO queue), be used for depositing idle contextual pointer, when data processing unit needs newly-built context, attempt obtaining contextual pointer from this queue, if obtained successfully, initialization context.
The course of work of data processing unit can be as follows:
Obtain the packet (PACKAGE) of input, wherein, in packet, carry contextual feature information, according to the characteristic information in packet, calculate context index, based on context the contextual pointer that index obtains, and obtain context according to the contextual pointer getting;
If have in this context, represent the mark that context do not have d/d mark (not having release mark) and can access (for example contextual " discharging " be labeled as 0 and " can access " be labeled as 1) illustrating can this context of secure access, so data processing unit is stamped by data processing unit usage flag this context, this context is conducted interviews, if need free context, for this context, stamp expression and need aging mark, for example this contextual " needing aging " mark is set to 1, and put into recovery fifo queue,
If have in this context, represent d/d mark and there is no " can access " mark (for example of context, contextual " discharging " be labeled as 1 or " can access " be labeled as 0) from idle context fifo queue, obtain new context, and new context is stamped to " can access " mark, for example new contextual " can access " mark is set to 1, other mark positions are 0.
It should be noted that, context index can not correspond to context one by one, may be corresponding with a plurality of contexts, but index is unique within certain time period.
Also it should be noted that, before context being stamped to " can access " mark, need to remove all marks.In addition, when the context to new conducts interviews, also need accessed context to stamp " being used by data processing unit " mark, after access, should remove this and " by data processing unit, be used " mark.
(2) garbage reclamation thread
During concrete enforcement, garbage reclamation thread can comprise following data entity (being data structure):
A) wait for and discharge fifo queue (SESSION waits for and discharges fifo queue), for depositing the contextual pointer of waiting for release.
B) discharged fifo queue (having discharged the queue of SESSION), for depositing the contextual pointer having discharged.
The course of work of garbage reclamation thread can be as follows:
(1) garbage reclamation thread " the recovery fifo queue " of visit data processing unit (take and have a plurality of data processing units as example at this) one by one, determining that the context being somebody's turn to do in " recovery fifo queue " has " can access " mark and " needing aging " mark, and while not thering is " waiting for release " mark, such as, " can access flag " be 1 determining that this is contextual, " needing aging mark " is 1, and " waiting for release mark " is 0 o'clock, this context is put into garbage reclamation thread " wait for and discharge fifo queue ", stamp the expression mark of " waiting for release " simultaneously, such as this contextual " waiting for release " mark is set to 1.For other contexts in this recovery fifo queue, disregard;
(2) garbage reclamation thread has " can access " mark in " waiting for and discharge fifo queue " in this thread, " need aging " mark and the context without the mark of " being used by data processing unit " are put into " having discharged fifo queue ", stamp " discharging " mark simultaneously, such as, by " can access flag " in " wait for discharge fifo queue " in this thread, be 1, " needing aging mark " is 1, and " by data processing unit, used " and be labeled as 0 context and put into " having discharged fifo queue ", this contextual " discharging " mark is set to 1 simultaneously, for other contexts in " wait for and discharge fifo queue ", disregard, to be that other contexts still rest on original " waits for and discharging in fifo queue,
(3) garbage reclamation thread discharges the context in " having discharged fifo queue " in this thread without " being used by data processing unit " mark, for example, " by data processing unit, being used " in " having discharged fifo queue " being labeled as to 0 context discharges, for other contexts in " having discharged fifo queue ", disregard, still rest in former queue.
Context after release can be placed into the idle context fifo queue of data processing unit, it should be noted that, if there are a plurality of data processing units, the idle context fifo queue of each data processing unit can be put into according to different marks in context after discharging, while creating new context for data processing unit, use, when data processing unit needs newly-built context, can from this free time context fifo queue, obtain contextual pointer, if obtained successfully, initialization context.
(4) garbage reclamation thread also can be accessed this thread " recovery fifo queue ", determining that the context being somebody's turn to do in " recovery fifo queue " has " can access " mark, " need aging " mark and while there is no " waiting for release " mark, such as determining that contextual " can access flag " in should " recovery fifo queue " be 1, " need aging " be labeled as 1 and " waiting for release " be labeled as at 0 o'clock, this context is put into the wait release fifo queue of this thread, simultaneously for the expression mark of " waiting for release " stamped in this context, such as this contextual " waiting for release " mark is set to 1, for other contexts in " recovery fifo queue ", disregard.
(5) travel through all contexts, compare timestamp and current time in context, if overtime, if the difference of the timestamp in context and current time is greater than preset value, at definite this context, having can access flag, do not have the aging mark of needs, do not have when waiting for release mark and not having by data processing unit usage flag, this context is put into garbage reclamation thread " wait for and discharge fifo queue ", and stamp " needing aging " mark, such as will " needing aging ", mark puts 1.
As from the foregoing, the embodiment of the present invention adopts the contextual feature information of carrying in packet, then according to this contextual feature acquisition of information context, and the not isolabeling based on context reclaims the formed time difference (garbage reclamation thread need first dormancy a period of time just start access context) in conjunction with garbage reclamation thread to context context is made to corresponding processing, for example if this context has " can access " mark and do not there is " discharging " mark, this context is conducted interviews, if this context has " discharging " mark or there is no " can access " mark, obtain new context, and new context is stamped to " can access " mark, if desired free context, for this context is set up expression " need to be aging " mark, and puts into the recovery fifo queue of this thread, etc., adopt this programme can in the situation that not locking, complete contextual Concurrency Access or revise context, avoid the sharing conflict between garbage reclamation thread and data processing unit, thereby increased the concurrency of system deal with data, elevator system treatment effeciency.
Embodiment tetra-
In order to implement better above method, the embodiment of the present invention also correspondingly provides a kind of data processing equipment, this device embodiment by the angle of the data processing unit from multiple nucleus system to avoiding the sharing conflict between garbage reclamation thread and data processing unit to be described, as shown in Figure 4, this data processing equipment can comprise data capture unit 401, context the first acquiring unit 402 and addressed location 403, wherein:
Data capture unit 401, for obtaining packet, wherein, packet carries contextual feature information;
Context the first acquiring unit 402, for the contextual feature acquisition of information context getting according to data capture unit 401;
For example, based on context characteristic information calculates context index, then according to the context index calculating, obtains contextual pointer, then obtains context according to the contextual pointer getting.It should be noted that, context index can not correspond to context one by one, may be corresponding with a plurality of contexts, in the different moment, according to certain context index, may get different context pointers, but index is unique within certain time period.
Addressed location 403, for the context that gets at context the first acquiring unit 402, having can access flag and while not having release mark, this context is stamped by after data processing unit usage flag, this context is conducted interviews, when the context that needs free context the first acquiring unit 402 to get, for being set up, this context needs aging mark, put into the recovery fifo fifo queue of this device, after access completes, remove this by data processing unit usage flag;
Concrete, if the context that context the first acquiring unit 402 gets has release mark, for example, " discharge " and be labeled as 0, and having can access flag, for example, " can access flag " be 1, after addressed location 403 puts 1 by this contextual " being used by data processing unit " mark, this context is conducted interviews, when the context that needs free context the first acquiring unit 402 to get, this contextual " needing aging " mark is put to 1, then put into " the recovery fifo queue " of data processing equipment, and after access completes, should " by data processing unit, be used " mark to set to 0.
It should be noted that, each different data processing equipment need to use different " being used by data processing unit " marks, that is to say, should have a mark array in context, and different data processing unit access have different marks.
The embodiment of the present invention adopts the contextual feature information of carrying in packet, then according to this contextual feature acquisition of information context, and the not isolabeling is based on context processed accordingly to context, when needs discharge this context, this context is stamped and needed aging mark, put into the recovery fifo fifo queue of data processing equipment, facilitate the follow-up mark in based on context of garbage reclamation thread to process accordingly context, make in the situation that not locking, to complete to contextual Concurrency Access or revise context, avoid garbage reclamation thread and data processing unit when realizing data processing problem, the problem includes: sharing conflict problem, thereby increased the concurrency of system deal with data, elevator system treatment effeciency.
Further, as shown in Figure 5, on the basis of the embodiment shown in Fig. 4, this data processing equipment can also comprise:
Context second acquisition unit 404, has release mark or does not have can access flag time for the context getting at context the first acquiring unit 402, obtains new context, and new context is stamped can access flag.
Certainly, it should be noted that, stamp can access flag before, need to remove all marks.In addition, the context to new conduct interviews and stamp can access flag before, also need accessed context to stamp by data processing unit usage flag, after access, should remove this by data processing unit usage flag; Such as, if contextual " discharging " that the first acquiring unit 402 gets is labeled as 1, or " can access " and be labeled as 0, obtain new context, this new contextual " being accessed by data processing unit " mark is put to 1, after access, remove all marks, such as this new contextual " being accessed by data processing unit " mark is set to 0 etc., then new contextual " can access " mark is put to 1.
Addressed location 403, during also for context needing free context second acquisition unit 404 to get, needs aging mark for this context is set up, and the recovery fifo fifo queue of putting into data processing equipment; Such as, this contextual " needing aging " mark is put to 1, then put into " the recovery fifo queue " of data processing equipment (being data processing list) unit.
Further, it should be noted that, when do not need free context the first acquiring unit 402 and context second acquisition unit 404 to get context time, addressed location 403 can the accessing operation such as read and write to the context getting, and after access completes, remove by data processing unit usage flag.
The concrete enforcement of above unit can not repeat them here referring to embodiment of the method above, it should be noted that, while specifically implementing, above unit can be entity independently, also can be arbitrarily made with same or several entities.
As from the foregoing, the embodiment of the present invention adopts the contextual feature information of carrying in packet, like this, when the data capture unit 401 of data processing equipment gets after packet, context the first acquiring unit 402 just can be according to this contextual feature acquisition of information context, and the not isolabeling based on context reclaims the formed time difference in conjunction with garbage reclamation thread to context and utilizes different performance elements to make corresponding processing to context, if for example this context comprises and represents that context is not also released mark and can access flag time, by 403 pairs of these contexts of addressed location, conducted interviews, if this context comprises when expression has been released or has there is no " can access " mark, by context second acquisition unit 404, obtain new context, and new context is stamped to " can access " mark, if desired free context, for this context is set up expression " need to be aging " mark, and puts into the recovery fifo queue of this device, etc., adopt this programme can in the situation that not locking, complete Concurrency Access or revise context, avoid the sharing conflict between garbage reclamation thread and data processing unit, thereby increased the concurrency of system deal with data, elevator system treatment effeciency.
Embodiment five,
In order to implement better above method, the embodiment of the present invention also correspondingly provides a kind of garbage recovery device, and as shown in Figure 6, this garbage recovery device can comprise waits for releasing unit 501, release pretreatment unit 502 and releasing unit 503;
Wait for releasing unit 501, recovery fifo fifo queue for visit data processing unit, by reclaiming, in fifo queue, have can access flag and have the wait that needs the context of aging mark to put into garbage recovery device and discharge fifo queue, this is put into and waits for that the context that discharges fifo queue is stamped and wait for release mark simultaneously;
Discharge pretreatment unit 502, for accessing the wait of garbage recovery device, discharge fifo queue, by wait for releasing unit 501 put into wait for discharge having of fifo queue can access flag, there is the aging mark of needs and do not there is the release fifo queue of being put into garbage recovery device by the context of data processing unit usage flag, this context is stamped to release mark simultaneously, make data processing unit when getting this context, this context is not conducted interviews, but obtain new context, specifically can be referring to embodiment mono-, other contexts still rest in original queue,
Releasing unit 503, for accessing the release fifo queue of garbage recovery device, puts into and discharges fifo queue and do not have and discharged by the context of data processing unit usage flag discharging pretreatment unit 502, and remove can access flag.
Further, for fear of repeating release, wait for releasing unit 501, recovery fifo fifo queue specifically for visit data processing unit, by reclaim in fifo queue, have can access flag, have and need aging mark and do not there is the context of waiting for release mark to put into the wait of garbage recovery device and discharge fifo queue, this is put into and waits for that the context that discharges fifo queue is stamped and wait for release mark simultaneously.
Such as, " can access flag " in data processing equipment " recovery fifo queue " be 1, " needing aging " be labeled as 1 and " waiting for releases " be labeled as " waiting for release fifo queue " that this device put in 0 context, to putting into contextual " waiting for release mark " of " wait for and discharge fifo queue ", put 1 simultaneously, for all the other contexts in " the recovery fifo queue " of data processing unit, disregard.
Further, referring to Fig. 7, this garbage recovery device can also comprise supply unit 504;
Supply unit 504, for the context after releasing unit 503 releases being put into the idle context fifo queue of data processing equipment, is used while creating new context for data processing equipment.
Further, wait for releasing unit 501, also for traveling through all contexts, the difference of timestamp and current time is greater than to preset value and have can access flag, do not have and need aging mark, do not have and wait for release mark and do not there is the wait of being put into garbage recovery device by the context of data processing unit usage flag and discharge fifo queue, and stamp the aging mark of needs, such as will " needing aging ", mark puts 1.
The concrete enforcement of above unit can not repeat them here referring to previous methods embodiment, it should be noted that, while specifically implementing, above unit can be entity independently, also can be arbitrarily made with same or several entities.
As from the foregoing, the wait releasing unit 502 of the garbage recovery device of the embodiment of the present invention is by the recovery fifo queue of visit data processing unit, then the context in the recovery fifo queue of data processing unit is reclaimed and stamp after " discharging " mark by discharging pretreatment unit 502, by releasing unit 503, discharged, make data processing unit when getting this context, this context is not conducted interviews, but obtain new context, avoided the sharing conflict between garbage reclamation thread and data processing unit, make in the situation that not locking, to complete Concurrency Access or revise context, thereby increased the concurrency of system deal with data, elevator system treatment effeciency.
Embodiment six,
Correspondingly, the embodiment of the present invention also provides a kind of data handling system, and as shown in Figure 8, this data handling system comprises data processing equipment 601 and garbage recovery device 602;
Data processing equipment 601, be used for obtaining packet, wherein, packet carries contextual feature information, according to this contextual feature acquisition of information context, can access flag and do not there is release mark if the context obtaining has, this context is stamped by after data processing unit usage flag, this context is conducted interviews, need free context, for being set up, this context needs aging mark, and the recovery fifo fifo queue of putting into data processing equipment 601, so that garbage recovery device 602 reclaims, after access completes, remove this by data processing unit usage flag, can access flag or there is release mark if the context obtaining does not have, obtain new context, and new context is stamped can access flag,
Garbage recovery device 602, recovery fifo queue for visit data processing unit 601, by reclaim in fifo queue, have can access flag, have and need aging mark and do not there is the context of waiting for release mark to put into the wait of garbage recovery device 602 and discharge fifo queue, this is put into and waits for that the context that discharges fifo queue is stamped and wait for release mark simultaneously; The wait of access garbage recovery device 602 discharges fifo queue, by wait for to discharge in fifo queue have can access flag, there is the aging mark of needs and do not there is the release fifo queue of being put into garbage recovery device 602 by the context of data processing unit usage flag, this context is stamped to release mark simultaneously; The release fifo queue of access garbage recovery device 602, does not have and is discharged by the context of data processing unit usage flag discharging in fifo queue, and removing can access flag.
Wherein, this data processing equipment 601 can comprise data capture unit 401, context the first acquiring unit 402, addressed location 403 and context second acquisition unit 404;
This garbage recovery device 602 can comprise waits for releasing unit 501, release pretreatment unit 502 and releasing unit 503, and this garbage recovery device 602 can also comprise supply unit 504.
It should be noted that, the data handling system cocoa of the present embodiment is for realizing the whole technical schemes in said method embodiment and device embodiment, the function of its each functional module can be according to the method specific implementation in said method embodiment, its specific implementation process can, with reference to the associated description in above-described embodiment, repeat no more herein.
As from the foregoing, the data handling system that the embodiment of the present invention provides adopts the contextual feature information of carrying in packet, make the data processing equipment 601 can be according to this contextual feature acquisition of information context, and the not isolabeling based on context reclaims the formed time difference in conjunction with 602 pairs of contexts of garbage recovery device context is made to corresponding processing, for example if this context has " can access " mark and do not there is " discharging " mark, this context is conducted interviews, if this context has " discharging " mark or does not have " can access " mark, obtain new context, and new context is stamped to " can access " mark, if desired free context, for this context is set up expression " need to be aging " mark, and puts into the recovery fifo queue of data processing equipment 601, etc., adopt this programme in the situation that not locking, to complete and send out access or revise context, avoid the sharing conflict of 601 of garbage recovery device 602 and data processing equipments simultaneously, thereby increased the concurrency of system deal with data, elevator system treatment effeciency.
It should be noted that, for aforesaid each embodiment of the method, for simple description, therefore it is all expressed as to a series of combination of actions, but those skilled in the art should know, the present invention is not subject to the restriction of described sequence of movement, because according to the present invention, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in specification all belongs to preferred embodiment, and related action and module might not be that the present invention is necessary.
In the above-described embodiments, the description of each embodiment is all emphasized particularly on different fields, in certain embodiment, there is no the part of detailed description, can be referring to the associated description of other embodiment.
One of ordinary skill in the art will appreciate that all or part of step in the whole bag of tricks of above-described embodiment is to come the hardware that instruction is relevant to complete by program, this program can be stored in a computer-readable recording medium, storage medium can comprise: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), disk or CD etc.
A kind of data processing method, device and the data handling system that above the embodiment of the present invention are provided are described in detail, applied specific case herein principle of the present invention and execution mode are set forth, the explanation of above embodiment is just for helping to understand method of the present invention and core concept thereof; , for one of ordinary skill in the art, according to thought of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention meanwhile.