CN108287793A - The way to play for time and server of response message - Google Patents
The way to play for time and server of response message Download PDFInfo
- Publication number
- CN108287793A CN108287793A CN201810019157.7A CN201810019157A CN108287793A CN 108287793 A CN108287793 A CN 108287793A CN 201810019157 A CN201810019157 A CN 201810019157A CN 108287793 A CN108287793 A CN 108287793A
- Authority
- CN
- China
- Prior art keywords
- response message
- buffer
- store
- message
- disk
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/0223—User address space allocation, e.g. contiguous or non contiguous base addressing
- G06F12/023—Free address space management
- G06F12/0253—Garbage collection, i.e. reclamation of unreferenced memory
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/0802—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F12/0806—Multiuser, multiprocessor or multiprocessing cache systems
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
- Computer And Data Communications (AREA)
Abstract
The present embodiments relate to message processing technique fields, disclose a kind of way to play for time and server of response message.In the present invention, the way to play for time of response message includes:When in the presence of the response message for needing to buffer, judge whether the remaining space of preset core buffer can store response message;If the remaining space of core buffer can not store response message, response message is stored to preset disk buffer.The present invention also provides a kind of servers.The way to play for time and server for the response message that embodiment of the present invention provides, not only improve system response time and system stability, but also saved memory cost.
Description
Technical field
The present embodiments relate to message processing technique fields, the more particularly to way to play for time and server of response message.
Background technology
Handling capacity is sent in order to improve socket response messages, is needed by the processing message request thread in server sound
It answers message that buffering area is written, and is sent the message in buffering area by Message Processing thread, therefore, should ensure message
It is written to the response speed of buffering area, ensures that buffering area sends the response speed of message again.
Smb server at present, general buffering area are all in memory.The bandwidth of server generally 1~
Between 100M, between 0.12~12.5MB/s of network transfer speeds.And memory read-write speed is in 1G/s or more, if there is a large amount of
Memory random access causes to frequently occur and skip leaf or the page calls in the case where recalling, and memory random read-write speed can drop significantly
It is low;If the flow of response message is larger, it is easy to the response speed that server network sends message be caused not catch up with message increase
Speed causes request stacking, server without response.
Inventor has found that at least there are the following problems in the prior art:Current smb server, when there is memory
When buffering area has expired the case where (network transmission speed does not catch up with message and increases speed), it can only cut off in server or dynamic increase
Buffer size is deposited, not only influenced the response time of system in this way but also leads to the unstability of system, and memory is relatively expensive
Resource, in particular up to dilatation again, expense are quite high after a certain size.
Invention content
Embodiment of the present invention is designed to provide a kind of way to play for time and server of response message, not only improves
System response time and system stability, and saved memory cost.
In order to solve the above technical problems, embodiments of the present invention provide a kind of way to play for time of response message, including:
When in the presence of the response message for needing to buffer, judge whether the remaining space of preset core buffer can store the response
Message;If the remaining space of the core buffer can not store the response message, by the response message store to
Preset disk buffer.
Embodiments of the present invention additionally provide a kind of server, including:At least one processor;And with it is described extremely
The memory of few processor communication connection;Wherein, the memory, which is stored with, to be executed by least one processor
Instruction, described instruction executed by least one processor so that at least one processor can above-mentioned response disappear
The way to play for time of breath.
Embodiments of the present invention additionally provide a kind of computer readable storage medium, are stored with computer program, described
The way to play for time of above-mentioned response message is realized when computer program is executed by processor.
Embodiment of the present invention in terms of existing technologies, when the remaining space of core buffer can not store it is described
Response message then stores the response message to preset disk buffer;It can expire in core buffer,
Using disk buffer to response message into row buffering, increase core buffer size without cutting off server or dynamic, from
And disk space can be made full use of under the premise of maximally utilising the memory headroom of setting, not only improve system sound
Between seasonable and system stability, and memory cost is saved.
In addition, described store the response message to preset disk buffer, specifically include:It is slow to obtain the disk
Rush the Current buffer file in area;According to the file size of preset monofile size threshold value and the Current buffer file, meter
Calculate the remaining available size of the Current buffer file;Judge that the remaining available size of the Current buffer file whether can
Store the response message;It, will be described if the remaining available size of the Current buffer file can store the response message
Response message is stored to the Current buffer file;If the remaining available size of the Current buffer file can not be stored described
Response message creates another buffer culture, and another buffer culture is set as the Current buffer file, and will be described
Response message is stored to the Current buffer file of reset.The technical solution of the present embodiment, it can be ensured that single buffering
The size of file be no more than preset monofile size threshold value, so as to avoid due to single file is excessive and may caused by
The problem of read-write error.
In addition, whether the remaining space for judging preset core buffer can store the response message, specifically
Including:Obtain the Current buffer block in the core buffer;Judge whether the remaining space of the Current buffer block can be deposited
Put the response message;If the remaining space of the Current buffer block can not store the response message, the memory is judged
It whether there is another buffer stopper in buffering area, wherein the remaining space of another buffer stopper can store the response message;
If another buffer stopper is not present, judge that the remaining space of the core buffer can not store the response message.
Present embodiments provide a kind of concrete mode for judging whether the remaining space of core buffer can store the response message.
In addition, described store the response message to the disk buffer, further include:The response is obtained to disappear
The pointer of breath, and preset message queue is added in the pointer of the response message;The message queue includes multiple described
The pointer of response message;In message transmitting process, the pointer of each response message is obtained successively from the message queue;
Each response message is obtained according to the pointer of each response message, and each response message of acquisition is sent;
Wherein, it if the pointer of the response message is directed toward the disk buffer, obtains the response from the disk buffer and disappears
Breath;If the pointer of the response message is directed toward the core buffer, the response message is obtained from the core buffer.
Present embodiments provide a kind of concrete mode of response message transmission process.
In addition, it is described each response message of acquisition is sent after, further include:If the response message is
It is obtained from the disk buffer, judges all response messages in the buffer culture where the response message whether
It is sent;If being sent, the buffer culture where the response message is recycled.Technical side provided in this embodiment
Case can recycle the buffer culture of disk buffer in time, when response message is sent consequently facilitating quickly following
Ring utilizes.
In addition, the buffer culture where the recycling response message, specifically includes:It will be where the response message
Buffer culture is labeled as state to be recycled;Timing recycling is marked as the buffer culture of state to be recycled.The present embodiment carries
A kind of concrete methods of realizing of recycling disk buffering file is supplied.
Description of the drawings
One or more embodiments are illustrated by the picture in corresponding attached drawing, these exemplary theorys
The bright restriction not constituted to embodiment, the element with same reference numbers label is expressed as similar element in attached drawing, removes
Non- to have special statement, composition does not limit the figure in attached drawing.
Fig. 1 is the flow chart of the way to play for time of response message according to a first embodiment of the present invention;
Fig. 2 is the particular flow sheet of the way to play for time of response message according to a first embodiment of the present invention;
Fig. 3 is the flow chart of the way to play for time of response message according to a second embodiment of the present invention;
Fig. 4 is the flow chart of the way to play for time of response message according to a third embodiment of the present invention;.
Fig. 5 is the particular flow sheet of server according to a fourth embodiment of the present invention.
Specific implementation mode
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with attached drawing to the present invention
Each embodiment be explained in detail.However, it will be understood by those skilled in the art that in each embodiment party of the present invention
In formula, in order to make the reader understand this application better, many technical details are proposed.But even if without these technical details
And various changes and modifications based on the following respective embodiments, it can also realize the application technical solution claimed.
The first embodiment of the present invention is related to a kind of ways to play for time of response message, including:When what is buffered in the presence of needs
When response message, judge whether the remaining space of preset core buffer can store response message;If core buffer
Remaining space can not store response message, then store response message to preset disk buffer.
Present embodiment compared with prior art, disappears when the remaining space of core buffer can not store the response
Breath, then store the response message to preset disk buffer;It can expire in core buffer, utilize magnetic
Disk buffering area, into row buffering, increases core buffer size to response message without cutting off server or dynamic, so as to
Under the premise of maximally utilising the memory headroom of setting, disk space is made full use of, system response time is not only improved
And system stability, and saved memory cost.
The realization details of the way to play for time of the response message of present embodiment is specifically described below, the following contents
Only for convenience of the realization details provided is understood, not implement the necessary of this programme.
The way to play for time of response message in present embodiment is applied to server, referring to FIG. 1, specifically including:
Step 101, the response message for needing to cache is judged whether.If so, 102 are entered step, if it is not, then returning
Step 101.
Specifically, when server receives the solicited message of client, response message can be generated according to solicited message,
Server judgement at this time is in the presence of the response message for needing to cache, subsequently into step 102;Otherwise, step 101 is repeated;I.e.
It is to be understood that server can detect whether to exist in real time needs the response message that caches, whenever having detected newly-generated one
When response message, it will judge there is the response message for needing to cache.
Step 102, judge whether the remaining space of preset core buffer can store response message.If so, into
Enter step 104;If it is not, then entering step 103.
Specifically, server internal has preset core buffer, for cache responses message.Server can judge memory
The magnitude relationship of the remaining space and the parking space needed for response message of buffering area, to judge the residue of core buffer
Whether space can store response message.As shown in Fig. 2, the step 102 in the present embodiment includes multiple sub-steps, wherein Fig. 2
It is the particular flow sheet that the present embodiment more refines, please also refer to Fig. 1 and Fig. 2.
Sub-step 1021 obtains the Current buffer block in core buffer.
In the present embodiment, core buffer is divided into multiple buffer stoppers in advance, and has preset each buffer stopper
Pre-set space.Server can write multiple buffer stoppers successively full when carrying out write operation to core buffer;That is, server
It first obtains a buffer stopper and allows to execute write operation to the buffer stopper, several response messages are then stored in the buffering
In block, only after the buffer stopper is filled with, server just obtains another buffer stopper and allows to execute another buffer stopper
Then write operation stores several response messages into another buffer stopper, and so on.
Wherein, Current buffer block refers to the buffer stopper for being currently allowed to execute write operation;Therefore, memory buffer is obtained
Current buffer block in area as obtains the buffer stopper for being currently allowed to execute write operation in core buffer.
It should be noted that in the present embodiment, the pre-set space of each buffer stopper be it is equal, so in other examples,
The pre-set space of each buffer stopper can not also be equal;In addition, the present embodiment is to be divided into multiple bufferings with core buffer
The form of block stores response message, so without being limited thereto, and all modes for being that by response message storage can be with.
Sub-step 1022, judges whether the remaining space of Current buffer block can store response message.If so, entering step
Rapid 104;If it is not, then entering sub-step 1023.
Wherein, the remaining space of Current buffer block is the pre-set space of Current buffer block and the use of Current buffer block
The difference in space.Server internal is to automatically recording the use space and remaining space of each buffer stopper, when it is desired to be used, i.e.,
The use space and remaining space of each buffer stopper can be obtained.
Specifically, server can judge that the storage whether remaining space of Current buffer block is less than needed for response message is empty
Between;If the remaining space of Current buffer block is less than the memory space needed for response message, indicate that Current buffer block can not be stored
The response message then needs to judge whether that another buffer stopper, the wherein remaining space of another buffer stopper can store sound
Answer message (entering sub-step 1023);If it is empty that the remaining space of Current buffer block is greater than or equal to the storage needed for response message
Between, then judge that the remaining space of Current buffer block can store response message, and response message is stored to Current buffer block (i.e.
It enters step 104).
Sub-step 1023 judges to whether there is another buffer stopper, the wherein residue of another buffer stopper in core buffer
Space can store response message.If so, entering step 104;If it is not, then entering sub-step 103.
That is, searching whether that there are another buffer stoppers from core buffer, the remaining space of wherein another buffer stopper can
Store response message.If there are another buffer stopper, judge that the remaining space of core buffer can store response message;And
Another buffer stopper is set as Current buffer block (being reset to Current buffer block), that is, enters sub-step 1024,
Then response message is stored into the current buffer stopper of reset, that is, enters step 104.
If another buffer stopper is not present, i.e. the remaining space of no one of core buffer buffer stopper can store sound
Answer message, then judge that the remaining space of core buffer can not store response message, at this point, by the response message store to
Preset disk buffer, that is, enter step 103.
Another buffer stopper is set as Current buffer block by sub-step 1024.
It is the specific implementation of the step 102 above, is intended only as an example and illustrates, the present embodiment is simultaneously
It is not limited.
Step 103, response message is stored to preset disk buffer.
Specifically, server internal has been pre-configured with disk buffer.In the prior art, disk buffer typically exists
When hard disk is written in the data that outside is obtained, cushioning effect is played;And in the embodiment of the present invention, response message can be stored
To disk buffer, i.e. disk buffer can also play cushioning effect to response message.
Step 104, response message is stored to core buffer.
That is, server stores response message to the Current buffer block of core buffer.
It should be noted that there is no set in advance to the total space of disk buffer in the present embodiment;It can recognize
For as long as there is storage demand, so that it may storing response message to disk buffer.It should be noted that in practical applications,
Only at memory buffer overflow (i.e. the remaining space of core buffer is insufficient), response message can just be stored to disk and be delayed
Rush area;Also, since the response message in core buffer is when being sent, shared by memory headroom can be returned in time
It receives, therefore, the amount that core buffer overflows especially greatly, therefore may will not can't occupy the too big space of disk buffer.
Preferably, in the realization details of the way to play for time of the response message of the present embodiment, it is further comprising the steps of, such as Fig. 2
Shown in.
Step 105, the pointer of response message is obtained, and preset message queue is added in the pointer of response message;Message
Queue includes the pointer of multiple response messages.
Specifically, server can pre-set message queue, the quantity of message queue can be set as needed.Service
Device is storing response message to core buffer or disk buffer, also to obtain the pointer of response message, and sound
It answers the pointer (specific address that response message is stored at present) of message to be put into preset message queue, waits until to send out to be lined up
It send;Wherein, each message queue includes the pointer of multiple response messages, and is arranged in order.
Wherein, when the quantity of message queue is multiple, which can be put by server according to preset rules
Some message queue;The preset rules can be set as needed, and disappear comprising less response for example, being put into the response message
The message queue of breath.
Step 106, in message transmitting process, the pointer of each response message is obtained successively from message queue.
Step 107, each response message is obtained according to the pointer of each response message, and each response message of acquisition is sent out
It goes.
Specifically, server can be pre-created Message Processing thread, for sending response message;Wherein,
The quantity of Message Processing thread is equal with the quantity of message queue, i.e., a Message Processing thread is responsible in a message queue
The transmission of response message.
In message transmitting process, Message Processing thread is suitable according to arrangement of the pointer of response message in message queue
Sequence obtains the pointer of each response message, and obtains each response message according to the pointer of each response message successively, is then sent to
It goes out and (is sent to client).Wherein, if the pointer of response message is directed toward disk buffer, described in disk buffer acquisition
Response message;If the pointer of response message is directed toward core buffer, response message is obtained from core buffer.
For example, Message Processing thread obtains the pointer of a response message from message queue, if the response message
Pointer is directed toward disk buffer (indicating that the response message is stored in disk buffer), then Message Processing thread accesses disk is slow
Area is rushed, and the response message is obtained according to the pointer of the response message;If the pointer of the response message is directed toward core buffer
(indicating that the response message is stored in core buffer), then Message Processing thread accesses core buffer, and according to the response
The pointer of message obtains the response message;Then the response message of acquisition is sent;Then, Message Processing thread is from message
Queue in the pointer for obtaining next response message, and so on.
Second embodiment of the present invention is related to a kind of way to play for time of response message.Second embodiment is implemented with first
Mode is roughly the same, is in place of the main distinction:In this second embodiment, step is provided " to store response message to magnetic
Another realization method of disk buffering area ".
As shown in figure 3, be the flow chart of the way to play for time of the response message of the present embodiment, Fig. 3 in the present embodiment be
The adjustment made on the basis of Fig. 1, it is so without being limited thereto, it can also be adjusted on the basis of Fig. 2.
Wherein, step 201~202,204 respectively with the step 101 in first embodiment~102,104 roughly the same, this
Place repeats no more.The difference is that the step 203 in second embodiment, further includes following sub-step:
Sub-step 2031 obtains the Current buffer file in disk buffer.
Wherein, server can create buffer culture, and write data into buffer culture when disk buffer stores data
In.Specifically, in the present embodiment, server can be pre-created disk buffer catalogue in Installed System Memory;When will be to disk
When buffering area stores response message, server, which is inquired, whether there is cache file in the disk buffer catalogue;If in the presence of obtaining
The buffer culture for taking newest establishment, as Current buffer file;If being not present, a buffer culture is newly created, and will
It is as Current buffer file.
Wherein, Current buffer file refers to the buffer culture for being currently allowed to execute write operation;Therefore, disk is obtained
Current buffer file in buffering area as obtains the buffering text for being currently allowed to execute write operation in disk buffer
Part.
Sub-step 2032 calculates and works as according to the file size of preset monofile size threshold value and Current buffer file
The remaining available size of preceding buffer culture.
Monofile size threshold value has been preset in the present embodiment, in server system, i.e., has each delayed in disk buffer
Rush the maximum capacity of file;Wherein, which is that server is set automatically according to its system configuration;Its purpose
Be, prevent single buffer culture excessive and may caused by server read-write when malfunction the problem of.
Server calculates the difference of the file size of monofile size threshold value and Current buffer file, and using the difference as
The remaining available size of Current buffer file.
Sub-step 2033, judges whether the remaining available size of Current buffer file can store response message.If so,
It is directly entered sub-step 2035;If it is not, being then introduced into sub-step 2034, sub-step 2035 is entered back into.
Specifically, server can judge whether the remaining available size of Current buffer file is less than needed for response message
Memory space;If the remaining available size of Current buffer file is less than the memory space needed for response message, if it indicates this
Response message, which is stored, can make that the file size of the current buffer culture is more than the preset list to the current buffer culture
Another buffer culture at this time, it may be necessary to create another buffer culture, and is set as Current buffer file by file size threshold value
(entering sub-step 2034);If it is empty that the remaining available size of Current buffer file is greater than or equal to the storage needed for response message
Between, then response message is stored to the current buffer culture (entering sub-step 2035).
Sub-step 2034 creates another buffer culture, and another buffer culture is set as Current buffer file.
Specifically, server re-creates another buffer culture in disk buffer catalogue, and by another buffering
File configuration is Current buffer file;Then, the current buffer culture that response message is stored to reset (is entered into son
Step 2035).
Sub-step 2035 stores response message to Current buffer file.
For first embodiment, present embodiments provide by response message store to disk buffer it is a kind of compared with
Good realization method, therein defining the maximum storage capacity of each buffer culture, to avoid may be hard due to cannot get system
The problem of part is supported and read-write error occurs.
Third embodiment of the present invention is related to a kind of way to play for time of response message.Third embodiment is real second
The improvement on the basis of mode is applied, is mainly theed improvement is that:The transmission situation of response message in detection buffer culture in time,
The buffer culture can be recycled in time.
As shown in figure 4, the flow chart of the way to play for time for the response message of the present embodiment, Fig. 3 in the present embodiment be
The adjustment made on the basis of Fig. 2.Wherein, step 301~307 respectively with the step 201 in second embodiment~207 substantially phase
Together, details are not described herein again;The difference is that the present embodiment further includes step 308~309:
Step 308, whether identification response message obtains from disk buffer;If so, 309 are entered step, if it is not, then
Enter step 311.
Specifically, Message Processing thread can the pointer of message according to response identify whether the response message is from disk
What buffering area obtained.It is obtained if not from disk buffer, then indicating that response message is obtained from core buffer, then
311 are entered step, step 312 is then entered back into.
Step 309, judge whether all response messages in the buffer culture where response message have been sent.If
It is then to enter step 310;If it is not, then entering step 311.
If response message is obtained from disk buffer, all responses of the buffer culture where response message
Whether message has been sent.Wherein, after response message is sent, Message Processing thread can be indicated to have sent
State;Therefore, whether all response messages that Message Processing thread can be inquired in the buffer culture where the response message are equal
It has been noted as having sent state, if so, all response messages in the buffer culture where indicating the response message are
It is sent.
Step 310, the buffer culture where response message is recycled.
In the present embodiment, step 310 includes following sub-step:
Sub-step 3101:Buffer culture where response message is labeled as state to be recycled.
Specifically, (please referring to first embodiment by being pre-created disk buffer directory messages in this present embodiment
In associated description), Message Processing thread can be in disk buffer catalogue, by the buffer culture pair where the response message
The file name answered is labeled as state to be recycled.
Sub-step 3102:Timing recycling is marked as the buffer culture of state to be recycled.
Specifically, server internal further creates disk recycling timer and disk recycling module, disk recycling is fixed
When device whether can have disk buffering file to be recycled in timing scan disk buffer catalogue;If yes, then it notifies
Disk recycling module recycles the buffer culture.
The present embodiment is not intended to be limited in any the concrete mode of the buffer culture where recycling response message, above-mentioned son
Step 3101 and sub-step 3102 are a preferable example.In other examples, when Message Processing thread detect it is a certain
When all response messages in buffer culture have been sent, disk recycling module can also directly be notified to recycle buffering text
Part.
Step 311, whether buffering all response messages in the block where judging response message have been sent.
Step 312, the buffer stopper where response message is recycled.
Wherein, the way of recycling of the buffer stopper where response message with it is similar in the prior art, details are not described herein again.
For second embodiment, in the present embodiment, when all sound in some buffer culture in disk buffer
After answering message to be all sent, server can recycle the buffer culture in time, in order to recycling for disk space.It needs
Illustrate, present embodiment can also be improvement on the basis of first embodiment, and the technique effect played is identical.
The step of various methods divide above, be intended merely to describe it is clear, when realization can be merged into a step or
Certain steps are split, multiple steps are decomposed into, as long as including identical logical relation, all in the protection domain of this patent
It is interior;To either adding inessential modification in algorithm in flow or introducing inessential design, but its algorithm is not changed
Core design with flow is all in the protection domain of the patent.
The 4th embodiment of the present invention is related to a kind of server, as shown in figure 5, including:At least one processor 11;With
And the memory 12 communicated to connect at least one processor 11;Wherein, be stored with can be by least one processor for memory 12
11 execute instructions, instruction executed by least one processor 11 so that at least one processor 11 be able to carry out it is above-mentioned
First to the response message described in any embodiment in 3rd embodiment way to play for time.
Wherein, memory 12 is connected with processor 11 using bus mode, and bus may include any number of interconnection
One or more processors 11 and the various of memory 12 are electrically connected to together by bus and bridge, bus.Bus can also incite somebody to action
The various other of such as peripheral equipment, voltage-stablizer and management circuit or the like are electrically connected to together, these are all abilities
Well known to domain, therefore, it will not be further described herein.Bus interface is provided between bus and transceiver and is connect
Mouthful.Transceiver can be an element, can also be multiple element, such as multiple receivers and transmitter, provide for passing
The unit communicated with various other devices on defeated medium.The data handled through processor 11 are carried out on the radio medium by antenna
Transmission, further, antenna also receives data and transfers data to processor 11.
Processor 11 is responsible for bus and common processing, can also provide various functions, including timing, periphery connects
Mouthful, voltage adjusting, power management and other control functions.And memory 12 can be used to store processor 11 and execute behaviour
Used data when making.
Fifth embodiment of the invention is related to a kind of computer readable storage medium, is stored with computer program.Computer
Above method embodiment is realized when program is executed by processor.
That is, it will be understood by those skilled in the art that implement the method for the above embodiments be can be with
Relevant hardware is instructed to complete by program, which is stored in a storage medium, including some instructions are making
It obtains an equipment (can be microcontroller, chip etc.) or processor (processor) executes side described in each embodiment of the application
The all or part of step of method.And storage medium above-mentioned includes:USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only
Memory), random access memory (RAM, Random Access Memory), magnetic disc or CD etc. are various can store journey
The medium of sequence code.
It will be understood by those skilled in the art that the respective embodiments described above are to realize specific embodiments of the present invention,
And in practical applications, can to it, various changes can be made in the form and details, without departing from the spirit and scope of the present invention.
Claims (10)
1. a kind of way to play for time of response message, which is characterized in that including:
When in the presence of the response message for needing to buffer, it is described to judge whether the remaining space of preset core buffer can be stored
Response message;
If the remaining space of the core buffer can not store the response message, the response message is stored to pre-
If disk buffer.
2. the way to play for time of response message according to claim 1, which is characterized in that described to store the response message
To preset disk buffer, specifically include:
Obtain the Current buffer file in the disk buffer;
According to the file size of preset monofile size threshold value and the Current buffer file, the Current buffer text is calculated
The remaining available size of part;
Judge whether the remaining available size of the Current buffer file can store the response message;
If the remaining available size of the Current buffer file can store the response message, by the response message store to
The Current buffer file;
If the remaining available size of the Current buffer file can not store the response message, another buffer culture is created,
And another buffer culture is set as the Current buffer file, and the response message is stored to the institute of reset
State Current buffer file.
3. the way to play for time of response message according to claim 1, which is characterized in that described to judge preset memory buffer
Whether the remaining space in area can store the response message, specifically include:
Obtain the Current buffer block in the core buffer;
Judge whether the remaining space of the Current buffer block can store the response message;
If the remaining space of the Current buffer block can not store the response message, judge in the core buffer whether
There are another buffer stoppers, wherein the remaining space of another buffer stopper can store the response message;
If another buffer stopper is not present, judge that the remaining space of the core buffer can not store the response and disappear
Breath.
4. the way to play for time of response message according to claim 3, which is characterized in that if the residue of the Current buffer block
Space can store the response message or there are another buffer stoppers, then judges the remaining space energy of the core buffer
Enough store the response message;
After the remaining space of the judgement core buffer can store the response message, further include:By the sound
Answer message deposit to the core buffer.
5. the way to play for time of response message according to claim 1, which is characterized in that described to store the response message
After to the disk buffer, further include:
The pointer of the response message is obtained, and preset message queue is added in the pointer of the response message;The message
Queue includes the pointer of multiple response messages;
In message transmitting process, the pointer of each response message is obtained successively from the message queue;
Each response message is obtained according to the pointer of each response message, and each response message of acquisition is sent out
It goes;
Wherein, if the pointer of the response message is directed toward the disk buffer, the sound is obtained from the disk buffer
Answer message;If the pointer of the response message is directed toward the core buffer, the response is obtained from the core buffer
Message.
6. the way to play for time of response message according to claim 5, which is characterized in that in each sound by acquisition
After answering message to send, further include:If identifying, the response message is obtained from the disk buffer, judges institute
Whether all response messages stated in the buffer culture where response message have been sent;If being sent, return
Receive the buffer culture where the response message.
7. the way to play for time of response message according to claim 6, which is characterized in that the recycling response message institute
Buffer culture, specifically include:
Buffer culture where the response message is labeled as state to be recycled;
Timing recycling is marked as the buffer culture of state to be recycled.
8. the way to play for time of response message according to claim 7, which is characterized in that it is described will be where the response message
Buffer culture be labeled as state to be recycled, specially:In preconfigured disk buffer catalogue, by the response message
The corresponding file name of buffer culture at place is labeled as state to be recycled;The wherein described disk buffer catalogue includes each institute
State the file name of buffer culture;
The timing recycling is marked as the buffer culture of state to be recycled, specially:Disk buffering described in timing scan
Each file name in area's catalogue, and recycle the corresponding buffering text of the file name for being marked as state to be recycled
Part.
9. a kind of server, which is characterized in that including:
At least one processor;And
The memory being connect at least one processor communication;Wherein,
The memory is stored with the instruction that can be executed by least one processor, and described instruction is by least one place
It manages device to execute, so that at least one processor is able to carry out such as response message described in any item of the claim 1 to 8
Way to play for time.
10. a kind of computer readable storage medium, is stored with computer program, which is characterized in that the computer program is located
Reason device realizes the way to play for time of response message described in any item of the claim 1 to 8 when executing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810019157.7A CN108287793B (en) | 2018-01-09 | 2018-01-09 | Response message buffering method and server |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810019157.7A CN108287793B (en) | 2018-01-09 | 2018-01-09 | Response message buffering method and server |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108287793A true CN108287793A (en) | 2018-07-17 |
CN108287793B CN108287793B (en) | 2020-12-25 |
Family
ID=62834969
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810019157.7A Expired - Fee Related CN108287793B (en) | 2018-01-09 | 2018-01-09 | Response message buffering method and server |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108287793B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109542662A (en) * | 2018-11-23 | 2019-03-29 | 北京锐安科技有限公司 | A kind of EMS memory management process, device, server and storage medium |
CN117295118A (en) * | 2023-10-08 | 2023-12-26 | 广州市玄武无线科技股份有限公司 | Method for buffering short message data and controlling flow with strong stability |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101276296A (en) * | 2007-03-29 | 2008-10-01 | 上海新跃仪表厂 | Method for realizing message response mechanism on embedded computer system |
CN101504617A (en) * | 2009-03-23 | 2009-08-12 | 华为技术有限公司 | Data transmitting and receiving method and device based on processor sharing internal memory |
US20120110247A1 (en) * | 2010-10-27 | 2012-05-03 | International Business Machines Corporation | Management of cache memory in a flash cache architecture |
CN102521347A (en) * | 2011-12-11 | 2012-06-27 | 西北工业大学 | Pattern matching intermediate result management method based on priority |
CN103858112A (en) * | 2013-12-31 | 2014-06-11 | 华为技术有限公司 | Data-caching method, device and system |
CN103914399A (en) * | 2012-12-31 | 2014-07-09 | 中国移动通信集团公司 | Disk cache method and device in parallel computer system |
CN104092670A (en) * | 2014-06-25 | 2014-10-08 | 北京蓝汛通信技术有限责任公司 | Method for utilizing network cache server to process files and device for processing cache files |
CN104965793A (en) * | 2014-09-26 | 2015-10-07 | 浙江大华技术股份有限公司 | Cloud storage data node apparatus |
CN105677746A (en) * | 2015-12-29 | 2016-06-15 | 上海爱数信息技术股份有限公司 | Database transaction operation based duplicate files merging system and method |
CN106776368A (en) * | 2016-11-29 | 2017-05-31 | 郑州云海信息技术有限公司 | Buffer memory management method, apparatus and system during a kind of digital independent |
CN106815338A (en) * | 2016-12-25 | 2017-06-09 | 北京中海投资管理有限公司 | A kind of real-time storage of big data, treatment and inquiry system |
-
2018
- 2018-01-09 CN CN201810019157.7A patent/CN108287793B/en not_active Expired - Fee Related
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101276296A (en) * | 2007-03-29 | 2008-10-01 | 上海新跃仪表厂 | Method for realizing message response mechanism on embedded computer system |
CN101504617A (en) * | 2009-03-23 | 2009-08-12 | 华为技术有限公司 | Data transmitting and receiving method and device based on processor sharing internal memory |
US20120110247A1 (en) * | 2010-10-27 | 2012-05-03 | International Business Machines Corporation | Management of cache memory in a flash cache architecture |
CN102521347A (en) * | 2011-12-11 | 2012-06-27 | 西北工业大学 | Pattern matching intermediate result management method based on priority |
CN103914399A (en) * | 2012-12-31 | 2014-07-09 | 中国移动通信集团公司 | Disk cache method and device in parallel computer system |
CN103858112A (en) * | 2013-12-31 | 2014-06-11 | 华为技术有限公司 | Data-caching method, device and system |
CN104092670A (en) * | 2014-06-25 | 2014-10-08 | 北京蓝汛通信技术有限责任公司 | Method for utilizing network cache server to process files and device for processing cache files |
CN104965793A (en) * | 2014-09-26 | 2015-10-07 | 浙江大华技术股份有限公司 | Cloud storage data node apparatus |
CN105677746A (en) * | 2015-12-29 | 2016-06-15 | 上海爱数信息技术股份有限公司 | Database transaction operation based duplicate files merging system and method |
CN106776368A (en) * | 2016-11-29 | 2017-05-31 | 郑州云海信息技术有限公司 | Buffer memory management method, apparatus and system during a kind of digital independent |
CN106815338A (en) * | 2016-12-25 | 2017-06-09 | 北京中海投资管理有限公司 | A kind of real-time storage of big data, treatment and inquiry system |
Non-Patent Citations (2)
Title |
---|
(美)MICROSOFT公司著;前导工作室译: "《WINDOWS 2000 SERVER资源大全 第6卷 深入开发IIS 5》", 31 January 2001 * |
王晓勤: "基于云存储的网盘客户端的设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109542662A (en) * | 2018-11-23 | 2019-03-29 | 北京锐安科技有限公司 | A kind of EMS memory management process, device, server and storage medium |
CN109542662B (en) * | 2018-11-23 | 2022-04-05 | 北京锐安科技有限公司 | Memory management method, device, server and storage medium |
CN117295118A (en) * | 2023-10-08 | 2023-12-26 | 广州市玄武无线科技股份有限公司 | Method for buffering short message data and controlling flow with strong stability |
Also Published As
Publication number | Publication date |
---|---|
CN108287793B (en) | 2020-12-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9832275B2 (en) | Message processing method, device and system for internet of things | |
CN101763437B (en) | Method and device for realizing high-speed buffer storage | |
US8068512B2 (en) | Efficient utilization of cache servers in mobile communication system | |
CN107613529B (en) | Message processing method and base station | |
CN110018788A (en) | It is classified storage method, device, electronic equipment and computer readable storage medium | |
CN109151512A (en) | The method and device of content is obtained in CDN network | |
CN103491152A (en) | Metadata obtaining method, device and system in distributed file system | |
US20160070475A1 (en) | Memory Management Method, Apparatus, and System | |
US20170153909A1 (en) | Methods and Devices for Acquiring Data Using Virtual Machine and Host Machine | |
US20120158884A1 (en) | Content distribution device, content distribution method, and program | |
US11922059B2 (en) | Method and device for distributed data storage | |
CN110677684B (en) | Video processing method, video access method, distributed storage method and distributed video access system | |
CN110781149A (en) | Method, device, equipment and storage medium for managing live broadcast room information | |
CN102075581A (en) | Data transmission method and device oriented to distributed file system | |
CN104683459A (en) | Method for transmitting service data, and storage system | |
CN103389945A (en) | Memory management method and device | |
CN108287793A (en) | The way to play for time and server of response message | |
CN101483668A (en) | Network storage and access method, device and system for hot spot data | |
CN107819754B (en) | Anti-hijacking method, monitoring server, terminal and system | |
CN111562883B (en) | Cache management system, method and device for solid state disk | |
CN101951361B (en) | Method for accessing intelligent card and server | |
CN108228476B (en) | Data acquisition method and device | |
RU2009145958A (en) | PROTECTION OF REAL-TIME CONTENT IN THE NETWORK | |
CN109766462B (en) | Image file reading method, device and system in power transmission line monitoring system | |
CN111859225B (en) | Program file access method, apparatus, computing device and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20201225 Termination date: 20220109 |