Method for setting capacity of buffer
09742706 · 2017-08-22
Assignee
Inventors
Cpc classification
International classification
Abstract
The present invention is directed to method for setting capacity of a buffer, the method including an initializing step of initializing a plurality of sub-buffers forming a main buffer, a comparison data reception step of receiving a storage frequency and a remaining capacity from the plurality of sub-buffers and comparing the storage frequency with the remaining capacity, a data comparison step of determining whether a current storage frequency of the plurality of sub-buffers and a past storage frequency are equal, a set capacity calculation step of calculating an allocation capacity of the plurality of sub-buffers, and a capacity re-setting step of re-setting the capacity of the plurality of sub-buffers using the calculated allocation capacity.
Claims
1. A method for setting capacity of a buffer configured to store a transmission message or a reception message in a communication system, the method comprising: determining whether a capacity setting program is implemented; initializing a plurality of sub-buffers forming a main buffer when it is determined that the capacity setting program is implemented; receiving a storage frequency and a remaining capacity from the plurality of sub-buffers when it is determined that the capacity setting program is not implemented; determining whether a current storage frequency of the plurality of sub-buffers is equal to a previous storage frequency of the plurality of sub-buffers by comparing the current storage frequency to the previous storage frequency; calculating an allocation capacity of the plurality of sub-buffers when the current storage frequency is not equal to the previous storage frequency and re-setting the capacity of the plurality of sub-buffers using the calculated allocation capacity.
2. The method of claim 1, wherein initializing the plurality of sub-buffers comprises setting a capacity of each of the plurality of sub-buffers equal.
3. The method of claim 1, further comprising initializing the plurality of sub-buffers before determining whether the capacity setting program is implemented.
4. The method of claim 1, further comprising setting the current storage frequency equal to the previous storage frequency after calculating the allocation capacity.
5. The method of claim 1, wherein calculating the allocation capacity comprises: calculating a current utilization of the plurality of sub-buffers; calculating an accumulated utilization of the plurality of sub buffers; calculating an expected use capacity and an expected remaining capacity of the main buffer; and calculating a new capacity of the plurality of sub-buffers.
6. The method of claim 1, wherein determining whether the capacity setting program is implemented comprises ending a buffer capacity setting operation by determining that there is no change in data when the current storage frequency is equal to the previous storage frequency.
7. The method of claim 1, wherein: the main buffer is a communication buffer for the communication system; and each of the plurality of sub-buffers includes a transmission buffer used for transmitting a message and a reception buffer used for receiving a message.
Description
BRIEF DESCRIPTION OF DRAWINGS
(1)
(2)
(3)
(4)
DETAILED DESCRIPTION OF THE DISCLOSURE
(5) Features and advantages of the exemplary embodiments will be or will become apparent to one of ordinary skill in the art upon examination of the following figures and detailed description. In describing the present disclosure, certain layers, sizes, shapes, components or features may be exaggerated for clarity and convenience. Accordingly, the meaning of specific terms or words used in the specification and claims should not be limited to the literal or commonly employed sense, but should be construed or may be different in accordance with the intention of a user or an operator and customary usages. Therefore, the definition of the specific terms or words should be based on the contents across the specification.
(6) Although the method for setting capacity of buffer according to an exemplary embodiment of the present disclosure has been explained using a case applied for setting a transmission buffer capacity and a reception buffer capacity for transmission/reception in a communication system, the present disclosure may be used for all devices using a buffer in addition to a communication system, and even if the number of buffers increases, the method can be used by partially correcting the below-explained following Equations.
(7)
(8) Hereinafter, a message transmission/reception operation in a communication system according to an exemplary embodiment of the present disclosure will be described with reference to
(9) When a processor (110) of a communication system (100), e.g., a CPU, instructs an operation manager (120) to make a transmission message in order to transmit a data to another communication system (200), the operation manager (120) generates the transmission message using a message generator (130) in response to a command of the processor (110). At this time, the message generator (130) is stored with a transmission message generation function.
(10) The transmission message generated by the message generator (130) is stored in a transmission buffer (140), and the operation manager (120) transmits the transmission message stored in the transmission buffer (140) to another communication system (200) through a transmitter (150). At this time, the transmitter (150), which is a communication module for transmission and reception with the another communication system (200), processes the transmission message in compliance with communication protocol, and transmits the transmission message to the another communication system (200).
(11) Furthermore, the communication system (100) according to an exemplary embodiment of the present disclosure may include a buffer capacity setting unit (160) configured to change the capacity of the transmission buffer (140) in response to quantity of transmission message stored in the transmission buffer (140). The transmission buffer (140) accumulates a storage frequency whenever the transmission messages are stored.
(12) Next, the message reception in the communication system according to an exemplary embodiment of the present disclosure is realized through the following processes.
(13) The communication system (100) receives a message transmitted from another communication system (200) through a receiver (170), and the operation manager (120) stores the received message (‘reception message’) in a reception buffer (180). The reception message stored in the reception buffer (180) is transmitted to a message analyzer (190), where the message analyzer (190) classifies only the essential data using an analysis function for analyzing the reception message, and the classified message is transmitted to the processor (110) through the operation manager (120). Furthermore, the buffer capacity setting unit (160) may change the capacity of the reception buffer (180) in response to quantity of reception message stored in the reception buffer (180). Furthermore, the reception buffer (180) may accumulate the storage frequency whenever the reception messages are stored.
(14) That is, the buffer capacity setting unit (160) of the communication system (100) according to an exemplary embodiment of the present disclosure can change the capacity of the transmission buffer (140) and the capacity of the reception buffer (180) in response to the quantity of transmission message stored in the transmission buffer (140) and the reception message stored in the reception buffer (180).
(15)
(16) Referring to
(17) At this time, the initialization step (S100) may include a determination step (S110) checking if a setting program is first implemented, and a capacity allocating step (S120) allocating 50% of a total buffer capacity to the transmission buffer and the reception buffer respectively when the set program is first implemented (S100—Yes).
(18) When the capacity allocation step (S120) is finished, flow returns to the determination step S110 to check if the set program has been first implemented. Thus, the transmission buffer (140) and the reception buffer (180) may be set to have a same capacity in order to occupy 50% of the total buffer capacity respectively.
(19) Successively, if it is determined at S100 that the set program has not been first implemented, a comparison data reception step (S200) is realized that receives a remaining capacity and storage frequency from the transmission buffer (140) and the reception buffer (180). Next, a data comparison step (S300) is realized by comparing and determining if the currently received storage frequency of the transmission buffer (140) and the reception buffer (180) is same as the previously received storage frequency of the transmission buffer (140) and the reception buffer (140).
(20) Thus, the buffer capacity setting unit (160) may include a controller (161) for comparing the currently received storage frequency of the transmission buffer (140) and the reception buffer (180) with the previously received storage frequency of the transmission buffer (140) and the reception buffer (140). The buffer capacity setting unit (160) may include storage unit (163) for storing the remaining capacity and the storage frequency received from the transmission buffer (140) and the reception buffer (180).
(21) At this time, the controller (161) may receive the remaining capacity and the storage frequency from the transmission buffer (140) and the reception buffer (180) by transmitting a data request signal to the transmission buffer (140) and the reception buffer (180). The controller (161) may also receive, from the storage unit (163), the previous storage frequency of the transmission buffer (140) and the reception buffer (180) stored in the storage unit (163) by transmitting the data request signal to the storage unit (163).
(22) If it is determined at the data comparison step S300 that the currently received storage frequency of the transmission buffer (140) and the reception buffer (180) is same as the previously received storage frequency of the transmission buffer (140) and the reception buffer (140), it is determined that there is no change in data, and the setting operation relative to the capacity of communication capacity is finished.
(23) If it is determined at the data comparison step S300 that the currently received storage frequency of the transmission buffer (140) and the reception buffer (180) is different from the previously received storage frequency of the transmission buffer (140) and the reception buffer (140), a set capacity calculation step (S400) is realized to calculate the allocation capacity of the transmission buffer (140) and the reception buffer (180). At this time, when the set capacity calculation step S400 is finished, the storage frequency of the currently stored transmission buffer and reception buffer is converted to the previous value, which is utilized when a program is re-started.
(24) Successively, when the set capacity calculation step (S400) is finished, a capacity re-setting step S500 is realized to re-set the capacity of the transmission buffer (140) and the reception buffer (180) using the allocation capacity of the transmission buffer (140) and the reception buffer (180) calculated at the set capacity calculation step S400. At this time, a new allocation capacity of the transmission buffer (140) and the reception buffer (180) at the set capacity calculation step S400 may be determined by the following Equation 1. The Equation 1 is an equation to calculate a newly set capacity of the transmission buffer and the reception buffer, and Equations 2 to 5, which are calculated in percentage value, are equations for converting to buffer capacity value of actually used unit.
(25)
where, Sb.sub.TX is a transmission buffer capacity to be newly set, Tb.sub.TX is a total transmission buffer capacity, Rb.sub.Tx is a remaining transmission buffer capacity, NRr.sub.Tb is an accumulated transmission/reception buffer sum average remaining amount, Ar.sub.TX is an accumulated transmission buffer use rate, Ar.sub.RX is an accumulated reception buffer use rate, Sb.sub.RX is a reception buffer capacity to be newly set, Tb.sub.RX is a total reception buffer capacity and Rb.sub.Rx is a remaining reception buffer capacity.
(26) Meantime, the accumulated transmission/reception buffer sum average remaining amount (NRr.sub.Tb) of Equation 1 may be determined by the following Equation 2.
NRr.sub.Tb=Tb.sub.TRx−(NR.sub.Tx+NR.sub.Rx) <Equation 2>
where, Tb.sub.TRX is a total transmission/reception buffer capacity, NR.sub.TX is an accumulated transmission buffer average use amount, NR.sub.RX is an accumulated reception buffer average use amount, where the accumulated transmission buffer average use amount (NR.sub.TX) and the accumulated reception buffer average use amount (NR.sub.RX) may be obtained by the following Equation 3.
NR.sub.Tx=Tb.sub.Tx−(Tb.sub.Tx×Ar.sub.Tx)
NR.sub.Rx=Tb.sub.Rx−(Tb.sub.Rx×Ar.sub.Rx) <Equation 3>
where, Tb.sub.TX is a total transmission buffer capacity, Ar.sub.TX is an accumulated transmission buffer use rate, Tb.sub.RX is a total reception buffer capacity, and Ar.sub.RX is an accumulated reception buffer use rate.
(27) The Equations 2 and 3 are used to make information for setting transmission/reception buffer capacity, where an estimated use capacity of buffer is calculated by accumulated use rate of transmission/reception buffers, and a capacity expected to remain is calculated less the buffer use capacity expected from a total buffer size.
(28) Meantime, the accumulated transmission buffer use rate (Ar.sub.TX) and the accumulated reception buffer use rate (Ar.sub.RX) may be determined by the following Equation 4. The Equation 4 is to calculate a transmission/reception buffer accumulated use rate, where accumulation is made by adding use capacity percentage conversion value of transmission/reception buffers calculated by Equation 5, and the accumulated value is divided by average accumulation frequency.
(29) Equation 4 obtains a value divided by 2 because one previous use capacity percentage conversion value and a currently used capacity percentage conversion value are used, where the divided value is determined by how many previous use capacity percentage conversion values are used.
(30) If the divided value increases, response to buffer capacity change becomes delayed when transmission buffer and reception buffer use rates are reversed. However, when data temporarily increases, capacity allocated to each buffer is made to change little by little.
(31) Conversely, if the divided value decreases, response to buffer capacity change becomes quickened when use rate of the transmission/reception buffers reverse. However, when data temporarily increases, capacity allocated to each buffer is made to change rapidly.
(32)
where, R.sub.TX is a transmission buffer use rate, R.sub.RX is a reception buffer use rate, k is a frequency of implementing algorithm, where the transmission buffer use rate (R.sub.TX) and the reception buffer use rate (R.sub.RX) may be obtained from the following Equation 5.
(33) The Equation 5 is to calculate a current transmission/buffer use rate where a use capacity of transmission/reception buffers is converted to percentage.
(34)
where, Tb.sub.TX is a total transmission buffer capacity, Rb.sub.TX is a remaining capacity of transmission buffer, Tb.sub.RX is a total capacity of reception buffer, Rb.sub.RX is a remaining capacity of reception buffer, and n is an implementing frequency of algorithm (n=1, 2, 3, . . . ∞).
(35)
(36) Referring to
(37) According to the present disclosure, a buffer can be efficiently managed by proactively setting capacity of transmission buffer and capacity of reception buffer using transmission buffer capacity and reception buffer capacity of the communication system in response to a current transmission buffer capacity, a current reception buffer use capacity, and use frequency.
(38) Thus, the proactive setting of buffers in response to use capacity and use frequency can prevent data loss that may be generated when a fixed buffer capacity is used. The buffer capacity setting method is not limited to the communication system, but can be usefully applicable to seeing a main buffer comprised of plurality of sub-buffers.
(39) Although the method for setting capacity of buffer has been described and explained according to exemplary embodiments, the present disclosure is not limited to a particular exemplary embodiment but many alternatives, modifications, and variations will be apparent to those skilled in the art within the metes and bounds of the claims.
(40) Therefore, it should be understood that the above-described embodiments are not limited by any of the details of the foregoing description, unless otherwise specified, but rather should be construed broadly within the scope as defined in the appended claims