A kind of conversation processing method, device, equipment and storage medium
Technical field
The present embodiments relate to network technologies more particularly to a kind of conversation processing method, device, equipment and storage to be situated between
Matter.
Background technique
With becoming increasingly popular for mobile Internet, network size constantly expands.Since legacy network devices are mostly with closing
The form of hardware is delivered and deployment, so that existing computer network increasingly highlights it in face of network application abundant
The limitation of structure evolution.It in view of this, can be many to carry by using the general purpose hardwares such as x86 and virtualization technology
The software of function is handled, to reduce network equipment cost.For example, network can be made by software and hardware decoupling and function modeling
Functions of the equipments are no longer dependent on specialized hardware, and resource sufficiently can flexibly be shared, and realize the quick exploitation and deployment of new business.
In the prior art, it is mainly based upon kernel in Message processing, business is embedded into core protocol by mount point
In some process flow of stack.It is each message information to be saved as into corresponding session node, and lead to when forwarding each message
The mode of segmentation traversal is crossed, such as 10,000 session nodes of traversal every time, the session node that time-out terminates is deleted, so as to
Carry out premature maintenance.
However, at least there are the following problems in the prior art for inventor's discovery in realizing process of the present invention:
Due to when segmentation traverses session node, it is possible to which most of session node is all in 10,000 session nodes of traversal
The session node for being not timed-out, and having timed, out can just traverse after waiting the long periods, need for example, it is assumed that traversal is primary
600 seconds, if some session node also needs 1 second just time-out after when secondary traversal, which but needed until next time time
It can be just traversed to after going through i.e. 600 seconds, thus greatly reduce the premature maintenance efficiency of session, increase performance loss.
Summary of the invention
The embodiment of the invention provides a kind of conversation processing method, device, equipment and storage mediums, to improve session timeout
Maintenance efficiency, and device resource is saved, improve process performance.
In a first aspect, the embodiment of the invention provides a kind of conversation processing methods, comprising:
It is not stored when having session node corresponding to currently received message in detecting cache unit set, create institute
The corresponding session node of message is stated, determines that first is absolute based on the corresponding opposite time-out time of current time and the session node
Time-out time, and the information of the first absolute timeout time and the message are stored in the session node of creation;
According to the corresponding Schedule Start Time of the cache unit set and the first absolute timeout time, determine described in
The corresponding target cache unit of session node, and the session node of creation is stored into the target cache unit;
Wherein, the cache unit set includes multiple cache units being arranged successively, and according to putting in order to each
A cache unit carries out circuiting sequentially scheduling, to carry out premature maintenance to the session node stored in each cache unit.
Second aspect, the embodiment of the invention also provides a kind of Dialog processing devices, comprising:
Session node creation module has currently received message institute right for not stored in detecting cache unit set
When the session node answered, the corresponding session node of the message is created, is based on current time and the corresponding phase of the session node
First absolute timeout time was determined to time-out time, and the information of the first absolute timeout time and the message are stored in
In the session node of creation;
Session node memory module, for according to the corresponding Schedule Start Time of the cache unit set and described first
The absolute timeout time determines the corresponding target cache unit of the session node, and the session node of creation is stored to described
In target cache unit;
Wherein, the cache unit set includes multiple cache units being arranged successively, and according to putting in order to each
A cache unit carries out circuiting sequentially scheduling, to carry out premature maintenance to the session node stored in each cache unit.
The third aspect, the embodiment of the invention also provides a kind of equipment, the equipment includes:
One or more processors;
Memory, for storing one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processing
Device realizes such as conversation processing method step provided by any embodiment of the invention.
Fourth aspect, the embodiment of the invention also provides a kind of computer readable storage mediums, are stored thereon with computer
Program realizes such as conversation processing method step provided by any embodiment of the invention when the program is executed by processor.
Embodiment in foregoing invention have the following advantages that or the utility model has the advantages that
When detect in cache unit set it is not stored have session node corresponding to currently received message when, creation should
The corresponding session node of message, and determine the session node corresponding first absolute timeout time, when according to the first absolute timeout
Between Schedule Start Time corresponding with cache unit set determine the corresponding target cache unit of the session node, so as to will
The session node is stored based on the first absolute timeout time into correspondingly target cache unit, so as to absolutely super in arrival first
When the time when session node can be scheduled.By the way that the session node of all creations was based on for the first absolute timeout time
Sequential storage into cache unit set, it is right so as to putting in order based on the cache unit in cache unit set
Each cache unit carries out circuiting sequentially scheduling, can be just in the cache unit when reaching for the first absolute timeout time
Session node be scheduled, to delete the session node of time-out in time, and then improve session timeout maintenance efficiency, and
Device resource is saved, process performance is improved.
Detailed description of the invention
Fig. 1 is a kind of flow chart for conversation processing method that the embodiment of the present invention one provides;
Fig. 2 is a kind of example of cache unit set involved in the embodiment of the present invention one;
Fig. 3 is a kind of flow chart of conversation processing method provided by Embodiment 2 of the present invention;
Fig. 4 is a kind of flow chart of session maintaining method involved in the embodiment of the present invention two;
Fig. 5 is a kind of structural schematic diagram for Dialog processing device that the embodiment of the present invention three provides;
Fig. 6 is a kind of structural schematic diagram for equipment that the embodiment of the present invention four provides.
Specific embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining the present invention rather than limiting the invention.It also should be noted that in order to just
Only the parts related to the present invention are shown in description, attached drawing rather than entire infrastructure.
Embodiment one
Fig. 1 is a kind of flow chart for conversation processing method that the embodiment of the present invention one provides, and the present embodiment is applicable to
When receiving message, creation for stored messages information session node and storage creation session node, in order to and
The case where Shi Jinhang premature maintenance.This method can be executed by Dialog processing device, which can be by software and/or hardware
Mode realize, be integrated in the network equipment.This method specifically includes the following steps:
It is S110, not stored when having session node corresponding to currently received message in detecting cache unit set,
The corresponding session node of message is created, determines that first is absolutely super based on the corresponding opposite time-out time of current time and session node
When the time, and the information of the first absolute timeout time and message are stored in the session node of creation.
Wherein, cache unit can be pre-assigned, for storing session node.Each cache unit can correspond to one
A slot s lot, to dispatch the cache unit in the slot.Cache unit set can be to be made of multiple cache units.
Cache unit set in the present embodiment can be but not limited to the presence of the data structure form of array or chained list, for example,
When cache unit collection is combined into cache unit chained list, each cache unit can successively be dispatched based on the form of chained list.
Each cache unit in the present embodiment can store one or more session nodes, and particular number can be based on cache unit
Space size predefine.Session node can refer to the node of the information for storing every kind of message.The information of message can
To include but is not limited to source IP (Internet Protocol, the agreement interconnected between network) address, source port, destination IP
Location, destination port and transport layer protocol.The corresponding session node of every kind of message in the present embodiment, to store this kind of message
Information.The corresponding opposite time-out time of session node can refer to for current time that the session node of creation has
Imitate the time, to avoid in client and server there is no corresponding session node is stored always when interacting, to drop
Low performance loss.
Specifically, if being currently received a message, detecting, which whether there is in current cache unit set, has storage should
The session node of message information then shows that this kind of message is that first time is received, for example, Transmission Control Protocol if it does not exist
(Transmission Control Protocol, transmission control protocol) is SYN (Synchronize Sequence
Numbers, synchronizing sequence number) packet, at this time a session and corresponding session node can be created with storage allocation.This reality
Example is applied to store the information of the first absolute timeout time and message into session node, so as to it is subsequent can quickly and conveniently according to
First absolute timeout time carried out premature maintenance to session node.
Illustratively, when determining the first absolute timeout based on the corresponding opposite time-out time of current time and session node
Between, it may include: to be added current time opposite time-out time corresponding with session node, and will add up result and be determined as
First absolute timeout time.For example, the corresponding opposite time-out time of some session node is 1 point if current time was 4 o'clock sharps
Clock, then the session node corresponding first absolute timeout time is 4. 01 minutes.It should be noted that the present embodiment can incite somebody to action
Current time is scaled after same chronomere with opposite time-out time and carries out being added for time again.
S120, according to the corresponding Schedule Start Time of cache unit set and the first absolute timeout time, determine session section
The corresponding target cache unit of point, and the session node of creation is stored into target cache unit;Wherein, cache unit set
Each cache unit is carried out to circuit sequentially scheduling including multiple cache units being arranged successively, and according to putting in order, with
Premature maintenance is carried out to the session node stored in each cache unit.
Wherein, at the beginning of Schedule Start Time can refer to scheduling cache unit set, i.e., most start scheduling caching
The calling moment of first cache unit in unit set, such as in 4 o'clock sharps to each caching list in cache unit set
Member starts to carry out round-robin scheduling, then Schedule Start Time was 4 o'clock sharps.
Specifically, start to circuit sequentially each cache unit in scheduling cache unit set in Schedule Start Time.
It can determine dispatching when reaching for the first absolute timeout time according to Schedule Start Time and the first absolute timeout time
Cache unit will be stored with message information and the first absolute timeout time and using the cache unit as target cache unit
Session node store into target cache unit, when being scheduled to target cache unit, to show that current time arrives
Reached for the first absolute timeout time, so as to carry out premature maintenance in time to the target cache unit, when too long without waiting
Between, improve maintenance efficiency.
Illustratively, according to the corresponding Schedule Start Time of cache unit set and the first absolute timeout time, meeting is determined
The corresponding target cache unit of node is talked about, may include: by the scheduling corresponding with cache unit set of the first absolute timeout time
Difference between initial time is determined as delay time;By delay time divided by the corresponding cycle period of cache unit set, obtain
The remainder obtained is as shift time;By shift time divided by cache unit corresponding scheduling time, the calculated result conduct of acquisition
Target ordinal number, and the corresponding cache unit of target ordinal number in cache unit set is determined as target cache unit.
Wherein, when cycle period can refer to required for cache unit all in cache unit set of scheduling
Between.Scheduling time can refer to the time required for one cache unit of scheduling.Illustratively, when the max-timeout of session node
Between be 600 seconds, so as to set cycle period to 600 seconds, each cache unit corresponding scheduling time is 1 millisecond, i.e.,
The cache unit set includes 600000 cache units.Specifically, if Schedule Start Time is 4 o'clock sharps, the first absolute timeout
Time be 4 points 15 minutes, current time be 4 points 11 minutes, then when delay between the first absolute timeout time and Schedule Start Time
Between be 15 minutes, i.e., 900 seconds.900 seconds delay times, obtained quotient was 1 divided by cycle period 600 seconds, and remainder is 300 seconds, i.e.,
It demonstrates the need for being scheduled at the in second period the 300th second.By shift time 300 seconds divided by 1 millisecond of scheduling time, obtain
The result obtained is 300000, at this time can be using the 300000th cache unit in cache unit set as target cache list
Member.
Illustratively, the present embodiment can also be determined currently to dispatch according to current time and Schedule Start Time
The serial number of cache unit, and the difference between the first absolute timeout time and current time is obtained, and by the difference and dispatch
The serial number for the cache unit currently dispatched and serial number offset are carried out phase as serial number offset by the ratio between the time
Add, the result of acquisition is target sequence number.For example, Schedule Start Time was 4 o'clock sharps, current time be 4 points 11 minutes, then it is current
The serial number 60000 of the cache unit of scheduling, the first 15 minutes 4 points of absolute timeout time and current time 4: 11/ difference
Value is 240000 milliseconds;It divided by 1 millisecond is 240000 that serial number offset, which is 240000 milliseconds, then target sequence number is 240000 to add
60000 are equal to 300000, i.e. the 300000th in cache unit set cache unit is target cache unit.
Illustratively, the session node of creation is stored into target cache unit, may include: to obtain target cache list
The session node quantity that member is included;If session node quantity is less than preset quantity, the session node of creation is stored to mesh
It marks in cache unit;If session node quantity is equal to preset quantity, the session node of creation is stored to target cache unit
Next cache unit in.
Wherein, preset quantity can refer to the quantity for the session node that cache unit at most can store.Preset quantity can
To be configured according to the space size of business demand and cache unit and/or schedule speed are default.Illustratively, preset quantity
It can be set to 1000, so as to dispatch all session nodes of storage in 1 millisecond of scheduling time.
Specifically, it stores by the session node of creation to before target cache unit, needs to judge that current target is slow
The session node quantity that memory cell is included is less than preset quantity, if so, showing that the target cache unit can also continue to deposit
Session node is stored up, can directly be stored the session node of creation into target cache unit at this time;If it is not, then showing the target
Cache unit has been filled with, and can not continue to store session node, can be obtained at this time based on putting in order in cache unit set
Next cache unit of target cache unit, and the session node quantity for being included in next cache unit is less than preset quantity
When, the session node of creation is stored into next cache unit.It should be noted that if target cache unit is cache unit
The last one cache unit in set, then next cache unit is first cache unit in cache unit set.Due to
Scheduling time needed for each cache unit is shorter, delays to storing the session node of creation to the next of target cache unit
Memory cell more can also timely safeguard the session node, and process performance is improved.
The technical solution of the present embodiment, it is not stored in detecting cache unit set to have corresponding to currently received message
Session node when, create the corresponding session node of the message, and determine the session node corresponding first absolute timeout time,
The corresponding target of the session node is determined according to the first absolute timeout time and the corresponding Schedule Start Time of cache unit set
Cache unit, so as to be stored the session node based on the first absolute timeout time into correspondingly target cache unit,
To be scheduled to the session node when reaching for the first absolute timeout time.By by the session node of all creations
Sequential storage based on the first absolute timeout time is into cache unit set, so as to based on slow in cache unit set
Memory cell puts in order, and carries out circuiting sequentially scheduling to each cache unit, can be with when reaching for the first absolute timeout time
Just the session node in the cache unit is scheduled, to delete the session node of time-out in time, and then improves meeting
Premature maintenance efficiency is talked about, and saves device resource, improves process performance.
Based on the above technical solution, in S110 " detecting not stored in cache unit set has current reception
Message corresponding to session node ", may include: in current processor by preset data plane development kit DPDK interface
When receiving message, currently received message is parsed, obtains message information;It is single to detect the corresponding caching of current processor
It whether there is the session node comprising message information in member set;If not, it is determined that not stored in cache unit set to have currently
Session node corresponding to received message.
Wherein, traditional to be can no longer meet in such a way that Linux kernel protocol stack carries out Message processing in processing sea
Measure the rate request of message.The present embodiment can use data plane development kit DPDK (Data Plane Development
Kit), driven by User space, replace the network data Message processing in traditional linux system, bypassed linux kernel association
Stack is discussed, the processing speed of message is improved.The present embodiment uses CPU (Central Processing Unit, central processing unit)
Affine mode makes each data core mutually indepedent.Wherein CPU it is affine can refer to each threads of conversation is tied to one
On CPU, so as to directly be run on the CPU of binding.Fig. 2 gives a kind of example of cache unit set.Such as Fig. 2 institute
Show, establish corresponding cache unit set on each processor, so that the scheduling of each cache unit is perCPU, i.e.,
Each CPU core independently possesses the cache unit set of oneself, so as to avoid performance caused by switching because of thread from being lost.
Specifically, user can be passed through by calling preset data plane development kit DPDK interface real-time reception message
State driving, has bypassed kernel protocol stack, has improved message processing speed.It, can be to currently received report when receiving message
Text carries out parsing and obtains message information, and the message in each session node that the message information and current processor are stored
Information is matched, if successful match, shows that this kind of message is not to receive for the first time, and the session node corresponding to it
It has created;If it fails to match, shows that this kind of message is that first time is received, may thereby determine that in cache unit set simultaneously
It is not stored to have the corresponding session node of the message, so as to create the session node in real time.
Based on the above technical solution, each cache unit is carried out to circuit sequentially scheduling according to putting in order, it can
To include: successively to be scheduled each cache unit in cache unit set as current cache unit;Work as detecting
When being stored with session node in the current cache unit of preceding scheduling, it regard the session node of storage as current sessions node one by one;
Whether detection current time is greater than or equal to the first absolute timeout time in current sessions node;If so, deleting current meeting
Talk about node;If it is not, updating current sessions node, then to carry out premature maintenance to next session node.
Specifically, in Schedule Start Time to each cache unit successively and circulation is scheduled.The present embodiment can
With putting in order based on each cache unit in cache unit set, it successively regard each cache unit as current cache list
Member is scheduled, and primary based on one cache unit of scheduling of each scheduling time, such as every millisecond of progress premature maintenance, entirely
Cache unit COLLECTION TRAVERSALSThe terminates to need 600 seconds.When dispatching current cache unit, need to detect in current cache unit whether
It is stored with session node, if so, storage order can be based on, traversal and premature maintenance successively are carried out to each session node,
It can detect whether current time is greater than or equal in current sessions node using each session node as current sessions node
The first absolute timeout time of storage can delete the session node if so, showing that the session node has timed, out at this time,
And next session node is updated to current sessions node, to carry out premature maintenance to next session node.If it is not, then showing this
Session node has not timed out, and needs to redefine caching corresponding to current sessions node based on the first absolute timeout time at this time
Unit, and the current session node is switched in the cache unit after redefining and is stored, so that current time and the
One absolute timeout time matched, and then next session node can be updated to current sessions node, continued to next session
Node carries out premature maintenance, until all session nodes in current cache unit are traversed completion.If current cache unit
In it is not stored have session node, then can carry out the traversal of next cache unit after being spaced scheduling time.
Based on the above technical solution, this method can also include: to be stored in detecting cache unit set
When session node corresponding to currently received message, updated according to the corresponding opposite time-out time of current time and session node
The the first absolute timeout time stored in session node;It is corresponding that session node is updated according to the updated first absolute timeout time
Target cache unit, and session node is switched in updated target cache unit and is stored.
Specifically, subsequent to receive this after first message based on a session establishes corresponding session node
When the message of session, without re-creating new session node, but when updating the first absolute timeout stored in session node
Between, that is, the current time for receiving the message of the session again is added with opposite time-out time, it will add up result
As the updated first absolute timeout time.Based on the method for determination of above-mentioned identical target cache unit, after update
The first absolute timeout time redefine target cache unit corresponding to the session node, and the session node is placed on
It is stored in updated target cache unit, so that the scheduling time of target cache unit is absolutely super with updated first
When the time match, to quickly and conveniently realize the renewal process of session node, reduce performance loss.
Embodiment two
Fig. 3 is a kind of flow chart of conversation processing method provided by Embodiment 2 of the present invention, and the present embodiment is in above-mentioned implementation
On the basis of example, the storage content of session node is optimized, and on this basis, the update mode of session node is carried out
It advanced optimizes.Details are not described herein for wherein same as the previously described embodiments or corresponding term explanation.
Referring to Fig. 3, conversation processing method provided in this embodiment specifically includes the following steps:
It whether is stored with session node corresponding to currently received message in S210, detection cache unit set, if it is not,
Then enter S220;If so, into S240.
S220, the corresponding session node of creation message, based on the corresponding opposite time-out time of current time and session node
Determine the first absolute timeout time and the second absolute timeout time, and by the first absolute timeout time, the second absolute timeout time
It is stored in the session node of creation with the information of message, and enters S230.
Wherein, the first absolute timeout time can be used for recording absolute corresponding to message recently received in the session
Time-out time;Second absolute timeout time can be used for allocating time corresponding to the cache unit of record storage session node.
Specifically, when session node creates, show first message for being currently received the session, at this time based on current
The first absolute timeout time that time is determined is identical with the second absolute timeout time, it can by current time and session node
The addition result of corresponding opposite time-out time is determined as the first absolute timeout time and the second absolute timeout time, and by this
Two absolute timeout times and message information are stored into session node.
S230, according to the corresponding Schedule Start Time of cache unit set and the first absolute timeout time, determine session section
The corresponding target cache unit of point, and the session node of creation is stored into target cache unit, and back into S210.
Specifically, since the first absolute timeout time at this time is identical with the second absolute timeout time, so as to be based on
First absolute timeout time determined target cache unit, can also determine target cache unit based on the second absolute timeout time.
S240, first stored in session node is updated according to the corresponding opposite time-out time of current time and session node
The absolute timeout time, and enter S250.
Specifically, when being stored with session node corresponding to currently received message in cache unit set, show this
Completion has been pre-created in the corresponding session of message, and the time-out time of the session is delayed, and can be based at this time
The current current time for receiving message updates the first absolute timeout time stored in session node, that is, by current time and
The addition result of opposite time-out time is as the updated first absolute timeout time.It should be noted that at this time without to the
Two absolute timeout times were updated.
Whether S250, detection current time were greater than or equal to for the second absolute timeout time, if so, into S260;If it is not,
Then enter S210.
Specifically, by comparing the size of the second absolute timeout time stored in current time and the session node, really
It is fixed whether the storage location of the session node to be updated.When current time is less than the second absolute timeout time, show to work as
It is preceding not reach the time that premature maintenance is carried out to the session node also, it may not need the storage position for replacing the session node at this time
It sets, directly returns to step the operation of S210, so as to after reaching for the second absolute timeout time, and receive new report
Wen Shizai carries out the update of position, so that updating the position of a session node at interval of a period of time, avoids and often receives
One message just carries out the position for once updating session node, further reduced performance loss, improves maintenance efficiency.
S260, the second absolute timeout time was updated to the updated first absolute timeout time, and according to updated
Second absolute timeout time updated the corresponding target cache unit of session node, it will it is slow that words node switches to updated target
It is stored in memory cell.
Specifically, when current time was greater than or equal to for the second absolute timeout time, show currently to need to the session section
Point carries out overtime deletion, but the session node actually and has not timed out, to need to update the storage location of the session node.
By the way that the second absolute timeout time was updated to the updated first absolute timeout time, and it is based on above-mentioned similar target cache
The method of determination of unit redefines target cache unit according to the updated second absolute timeout time, and by the session section
Point is stored in again in updated target cache unit, to avoid premature maintenance is carried out to the session node at this time.
The technical solution of the present embodiment, by storing the first absolute timeout time and the second absolute timeout in session node
Time, so that can be carried out again after the second absolute timeout time for reaching the session in the new message for receiving certain session
The update of session node position avoids and often receives the update that a message just carries out a session node position, thus into
One step reduces performance loss, improves maintenance efficiency.
It based on the above technical solution, as shown in figure 4, can be based on following steps S310-S380 to session node
Carry out premature maintenance:
S310, using first cache unit in cache unit set as current cache unit.
Specifically, putting in order based on the cache unit in cache unit set, using first cache unit as working as
Preceding cache unit, in Schedule Start Time, to start to be scheduled first cache unit.
S320, detect current scheduling current cache unit in whether be stored with session node;If so, into S330,
If it is not, then entering S380.
S330, using first session node stored in current cache unit as current sessions node.
Specifically, the storage order based on the session node stored in cache unit, using first session node as working as
Preceding session node carries out premature maintenance.
Whether S340, detection current time are greater than or equal to the first absolute timeout time in current sessions node;If so,
Then enter S350, if it is not, then entering S360.
S350, current sessions node is deleted, and enters S370.
Specifically, when current time is greater than or equal to the first absolute timeout time stored in current sessions node, table
Bright current sessions node is practical to be had timed, out, and needs to delete the current session node at this time, so as to carry out overtime dimension in time
Shield.
S360, by the second absolute timeout time in current sessions node be updated in current sessions node first absolutely
Time-out time, and the corresponding cache unit of current sessions node is redefined according to the updated second absolute timeout time, it will
Current sessions node is switched in the cache unit after redefining and is stored, and enters S370.
Specifically, when current time is less than the first absolute timeout time stored in current sessions node, show current
Session node simultaneously has not timed out, but reaches the second absolute timeout time of current sessions node storage, needs to update at this time current
The storage location of session node, i.e., first updating for the second absolute timeout time was the first absolute timeout time, and according to updated
Second absolute timeout time redefined the corresponding cache unit of current sessions node, and the current session node is delayed from current
Memory cell switching is stored in the cache unit after redefine, so as to can be right when reaching for the first absolute timeout time
The session node carries out premature maintenance.
S370, using next session node in current cache unit as current sessions node, and back into S340.
Specifically, dialogue-based node puts in order, and next session node of current sessions node can be updated
For current sessions node, and the operation of S340-S360 is returned to step, so as to carry out time-out to next session node
Maintenance, at the end of traversing all session nodes in current cache unit, can execute the operation of S380.
S380, using next cache unit in cache unit set as current cache unit, and back into S320.
Specifically, putting in order based on cache unit, using next cache unit of current cache unit as current
Cache unit, and the operation of S320-S370 is returned to step, to be scheduled to next cache unit.In current cache
When unit is the last one cache unit in cache unit set, corresponding next cache unit is cache unit set
In first cache unit substantially increase maintenance efficiency to realize to the round-robin scheduling of each cache unit.
It is the embodiment of Dialog processing device provided in an embodiment of the present invention, the meeting of the device and the various embodiments described above below
Words processing method belongs to the same inventive concept, and the detail content of not detailed description in the embodiment of Dialog processing device can
With the embodiment with reference to above-mentioned conversation processing method.
Embodiment three
Fig. 5 is a kind of structural schematic diagram for Dialog processing device that the embodiment of the present invention three provides, and the present embodiment is applicable
In when receiving message, creation is used for the session node of session node and the storage creation of stored messages information, in order to
The case where to carry out real-time premature maintenance, the device can specifically include: session node creation module 410 and session node are deposited
Store up module 420.
Wherein, session node creation module 410, in detecting cache unit set it is not stored have it is currently received
When session node corresponding to message, the corresponding session node of creation message is based on current time and the corresponding phase of session node
First absolute timeout time was determined to time-out time, and the information of the first absolute timeout time and message are stored in the meeting of creation
It talks about in node;Session node memory module 420, for absolute according to the corresponding Schedule Start Time of cache unit set and first
Time-out time determines the corresponding target cache unit of session node, and the session node of creation is stored to target cache unit
In;Wherein, cache unit set includes multiple cache units being arranged successively, and according to putting in order to each cache unit
It carries out circuiting sequentially scheduling, to carry out premature maintenance to the session node stored in each cache unit.
Optionally, device further include: session node detection module is used for: pass through preset data plane in current processor
When development kit DPDK interface is to message, currently received message is parsed, obtains message information;The current place of detection
Managing in the corresponding cache unit set of device whether there is the session node comprising message information;If not, it is determined that cache unit collection
It is not stored in conjunction to have session node corresponding to currently received message.
Optionally, session node creation module 410 includes: the first absolute timeout time determination unit, is used for: when will be current
Between opposite time-out time corresponding with session node be added, and will add up result and be determined as the first absolute timeout time.
Optionally, session node memory module 420 includes: target cache unit determination unit, is used for: absolutely super by first
When time Schedule Start Time corresponding with cache unit set between difference be determined as delay time;By delay time divided by
The corresponding cycle period of cache unit set, the remainder of acquisition is as shift time;Shift time is corresponding divided by cache unit
Scheduling time, the calculated result of acquisition is and single by the corresponding caching of target ordinal number in cache unit set as target ordinal number
Member is determined as target cache unit.
Optionally, session node memory module 420 includes: session node storage unit, for obtaining target cache unit
The session node quantity for being included;If session node quantity is less than preset quantity, the session node of creation is stored to target
In cache unit;If session node quantity is equal to preset quantity, the session node of creation is stored to target cache unit
In next cache unit.
Optionally, the device further include:
First absolute timeout time update module, for being stored with currently received report in detecting cache unit set
When session node corresponding to text, is updated in session node and deposited according to the corresponding opposite time-out time of current time and session node
The first absolute timeout time of storage;
Target cache unit update module, it is corresponding for updating session node according to the updated first absolute timeout time
Target cache unit, and session node is switched in updated target cache unit and is stored.
Optionally, session node creation module 410, also particularly useful for: it is based on current time and the corresponding phase of session node
First absolute timeout time and the second absolute timeout time are determined to time-out time, and absolutely by the first absolute timeout time, second
The information of time-out time and message is stored in the session node of creation, wherein the first absolute timeout time currently determined
It is identical with the second absolute timeout time;
Correspondingly, target cache unit update module is specifically used for: whether detection current time is greater than or equal to second absolutely
To time-out time;If so, the second absolute timeout time was updated to the updated first absolute timeout time, and according to update after
The second absolute timeout time update the corresponding target cache unit of session node, it will words node switches to updated target
It is stored in cache unit.
Optionally, device further include: cache unit scheduler module is used for:
Successively it is used as current cache unit to be scheduled each cache unit in cache unit set;
When being stored with session node in the current cache unit for detecting current scheduling, one by one by the session node of storage
As current sessions node;
Whether detection current time is greater than or equal to the first absolute timeout time in current sessions node;
If so, deleting current sessions node;
If it is not, updating current sessions node, then to carry out premature maintenance to next session node.
Optionally, the device further include:
Cache unit scheduler module, is used for:
Cache unit redefines module, for before updating current sessions node, by the in current sessions node
Two absolute timeout times were updated to the first absolute timeout time in current sessions node, and absolutely super according to updated second
When the time redefine the corresponding cache unit of current sessions node, current sessions node is switched to the caching after redefining
It is stored in unit.
Dialog processing device provided by the embodiment of the present invention can be performed at session provided by any embodiment of the invention
Reason method has and executes the corresponding functional module of conversation processing method and beneficial effect.
Example IV
Fig. 6 is a kind of structural schematic diagram for equipment that the embodiment of the present invention four provides.Fig. 6, which is shown, to be suitable for being used to realizing this
The block diagram of the example devices 12 of invention embodiment.The equipment 12 that Fig. 6 is shown is only an example, should not be to of the invention real
The function and use scope for applying example bring any restrictions.
As shown in fig. 6, equipment 12 is showed in the form of universal computing device.The component of equipment 12 may include but unlimited
In one or more processor or processing unit 16, system storage 28, connecting different system components, (including system is deposited
Reservoir 28 and processing unit 16) bus 18.
Bus 18 indicates one of a few class bus structures or a variety of, including memory bus or Memory Controller,
Peripheral bus, graphics acceleration port, processor or the local bus using any bus structures in a variety of bus structures.It lifts
For example, these architectures include but is not limited to industry standard architecture (ISA) bus, microchannel architecture (MAC)
Bus, enhanced isa bus, Video Electronics Standards Association (VESA) local bus and peripheral component interconnection (PCI) bus.
Equipment 12 typically comprises a variety of computer system readable media.These media can be it is any can be by equipment 12
The usable medium of access, including volatile and non-volatile media, moveable and immovable medium.
System storage 28 may include the computer system readable media of form of volatile memory, such as arbitrary access
Memory (RAM) 30 and/or cache memory 32.Equipment 12 may further include it is other it is removable/nonremovable,
Volatile/non-volatile computer system storage medium.Only as an example, storage system 34 can be used for reading and writing irremovable
, non-volatile magnetic media (Fig. 6 do not show, commonly referred to as " hard disk drive ").Although being not shown in Fig. 6, use can be provided
In the disc driver read and write to removable non-volatile magnetic disk (such as " floppy disk "), and to removable anonvolatile optical disk
The CD drive of (such as CD-ROM, DVD-ROM or other optical mediums) read-write.In these cases, each driver can
To be connected by one or more data media interfaces with bus 18.System storage 28 may include that at least one program produces
Product, the program product have one group of (for example, at least one) program module, these program modules are configured to perform of the invention each
The function of embodiment.
Program/utility 40 with one group of (at least one) program module 42 can store and store in such as system
In device 28, such program module 42 includes but is not limited to operating system, one or more application program, other program modules
And program data, it may include the realization of network environment in each of these examples or certain combination.Program module 42
Usually execute the function and/or method in embodiment described in the invention.
Equipment 12 can also be communicated with one or more external equipments 14 (such as keyboard, sensing equipment, display 24 etc.),
Can also be enabled a user to one or more equipment interacted with the equipment 12 communication, and/or with enable the equipment 12 with
One or more of the other any equipment (such as network interface card, modem etc.) communication for calculating equipment and being communicated.It is this logical
Letter can be carried out by input/output (I/O) interface 22.Also, equipment 12 can also by network adapter 20 and one or
The multiple networks of person (such as local area network (LAN), wide area network (WAN) and/or public network, such as internet) communication.As shown,
Network adapter 20 is communicated by bus 18 with other modules of equipment 12.It should be understood that although not shown in the drawings, can combine
Equipment 12 use other hardware and/or software module, including but not limited to: microcode, device driver, redundant processing unit,
External disk drive array, RAID system, tape drive and data backup storage system etc..
Processing unit 16 by the program that is stored in system storage 28 of operation, thereby executing various function application and
Data processing, such as realize a kind of conversation processing method step provided by this hair embodiment, this method comprises:
Not stored when having session node corresponding to currently received message, the creation report in detecting cache unit set
The corresponding session node of text, when determining the first absolute timeout based on the corresponding opposite time-out time of current time and session node
Between, and the information of the first absolute timeout time and message are stored in the session node of creation;
According to the corresponding Schedule Start Time of cache unit set and the first absolute timeout time, determine that session node is corresponding
Target cache unit, and the session node of creation is stored into target cache unit;
Wherein, cache unit set includes multiple cache units being arranged successively, and is delayed according to putting in order to each
Memory cell carries out circuiting sequentially scheduling, to carry out premature maintenance to the session node stored in each cache unit.
Certainly, it will be understood by those skilled in the art that processor can also realize it is provided by any embodiment of the invention
Retain the technical solution of inventory's method for determination of amount.
Embodiment five
The present embodiment five provides a kind of computer readable storage medium, is stored thereon with computer program, the program quilt
Such as conversation processing method step provided by any embodiment of the invention is realized when processor executes, this method comprises:
Not stored when having session node corresponding to currently received message, the creation report in detecting cache unit set
The corresponding session node of text, when determining the first absolute timeout based on the corresponding opposite time-out time of current time and session node
Between, and the information of the first absolute timeout time and message are stored in the session node of creation;
According to the corresponding Schedule Start Time of cache unit set and the first absolute timeout time, determine that session node is corresponding
Target cache unit, and the session node of creation is stored into target cache unit;
Wherein, cache unit set includes multiple cache units being arranged successively, and is delayed according to putting in order to each
Memory cell carries out circuiting sequentially scheduling, to carry out premature maintenance to the session node stored in each cache unit.
The computer storage medium of the embodiment of the present invention, can be using any of one or more computer-readable media
Combination.Computer-readable medium can be computer-readable signal media or computer readable storage medium.It is computer-readable
Storage medium can be for example but not limited to: electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or
Any above combination of person.The more specific example (non exhaustive list) of computer readable storage medium includes: with one
Or the electrical connections of multiple conducting wires, portable computer diskette, hard disk, random access memory (RAM), read-only memory (ROM),
Erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light
Memory device, magnetic memory device or above-mentioned any appropriate combination.In this document, computer readable storage medium can
With to be any include or the tangible medium of storage program, the program can be commanded execution system, device or device use or
Person is in connection.
Computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal,
Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited
In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can
Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for
By the use of instruction execution system, device or device or program in connection.
The program code for including on computer-readable medium can transmit with any suitable medium, including but not limited to:
Wirelessly, electric wire, optical cable, RF etc. or above-mentioned any appropriate combination.
The computer for executing operation of the present invention can be write with one or more programming languages or combinations thereof
Program code, described program design language include object oriented program language, such as Java, Smalltalk, C++, also
Including conventional procedural programming language-such as " C " language or similar programming language.Program code can be complete
It executes, partly executed on the user computer on the user computer entirely, being executed as an independent software package, part
Part executes on the remote computer or executes on a remote computer or server completely on the user computer.It is relating to
And in the situation of remote computer, remote computer can pass through the network of any kind, including local area network (LAN) or wide area network
(WAN), it is connected to subscriber computer, or, it may be connected to outer computer (such as led to using ISP
Cross internet connection).
Will be appreciated by those skilled in the art that each module of the above invention or each step can use general meter
Device is calculated to realize, they can be concentrated on single computing device, or be distributed in network constituted by multiple computing devices
On, optionally, they can be realized with the program code that computer installation can be performed, so as to be stored in storage
It is performed by computing device in device, perhaps they are fabricated to each integrated circuit modules or will be more in them
A module or step are fabricated to single integrated circuit module to realize.In this way, the present invention is not limited to any specific hardware and
The combination of software.
Note that the above is only a better embodiment of the present invention and the applied technical principle.It will be appreciated by those skilled in the art that
The invention is not limited to the specific embodiments described herein, be able to carry out for a person skilled in the art it is various it is apparent variation,
It readjusts and substitutes without departing from protection scope of the present invention.Therefore, although being carried out by above embodiments to the present invention
It is described in further detail, but the present invention is not limited to the above embodiments only, without departing from the inventive concept, also
It may include more other equivalent embodiments, and the scope of the invention is determined by the scope of the appended claims.