CN103870206A - Caching data receiving and reading method and device and router cache device - Google Patents

Caching data receiving and reading method and device and router cache device Download PDF

Info

Publication number
CN103870206A
CN103870206A CN201210539030.0A CN201210539030A CN103870206A CN 103870206 A CN103870206 A CN 103870206A CN 201210539030 A CN201210539030 A CN 201210539030A CN 103870206 A CN103870206 A CN 103870206A
Authority
CN
China
Prior art keywords
storage unit
state
activation
data cached
activated
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201210539030.0A
Other languages
Chinese (zh)
Inventor
杨雪仁
韵江
周建华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201210539030.0A priority Critical patent/CN103870206A/en
Publication of CN103870206A publication Critical patent/CN103870206A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The invention discloses a caching data receiving method. The caching data receiving method includes that caching data are received, and data storage is performed on at least two storing units which are already in an activated state according to priority from high to low; if the storage capacity of one storing unit with the lowest priority among the storing units which are already in the activated state reaches a preset activating waterline, storing units which are in a to-be-activated state are changed to the already activated state, and one storing unit with the highest priority among the storing units which are in a de-activated state is changed to the to-be-activated state. The invention further discloses a caching data reading method, a caching data receiving or reading device and a router cache device. By means of the caching data receiving and reading method and device and the router cache device, hardware capacity waste of router cache capacity can be reduced, energy saving and consumption reducing can be achieved, meanwhile, the data overflow phenomenon due to insufficient storage capacity can be effectively avoided, and business service qualities are guaranteed.

Description

A kind of data cached reception and read method and device and router cache device
Technical field
The present invention relates to router technology field, particularly relate to a kind of data cached reception and the method reading and device and router cache device.
Background technology
Communication network has been deep into the every nook and cranny of people's life, and router is huge as nucleus equipment consumption in network of communication network.Along with the increase day by day of bandwidth demand, the bandwidth capacity of equipment increases rapidly, has also brought thus the high problem of power consumption of equipment.
Quality of service when ensureing bursts of traffic, router device has designed jumbo flow buffering unit, and ensureing has the flow buffering ability of up to a hundred milliseconds in situation at full speed.But in actual applications, the scene of bursts of traffic is few, its average discharge less than 50%, is easy to cause the waste of hardware capabilities.
With reference to Fig. 1, it is the buffer structure schematic diagram of typical router.As shown in Figure 1, the buffer structure of router generally can comprise: a cache controller 1a and n buffer unit 2a.
Existing route device generally adopts load balancing pattern to carry out flow buffering.In the time that router need to carry out flow buffering, no matter need the data of buffer memory to have how many, n buffer unit 2a is occupied, and each buffer unit 2a divides equally the data that need buffer memory.Therefore, in the time needing the data of buffer memory little, each buffer unit 2a is occupied little space only, and this has just caused the significant wastage of hardware capabilities.
In prior art, can arrive by monitoring flow the speed of router, determine the size that needs reserved flow buffering ability, realize thus the effect that dynamically reduces buffer memory capacity, reduces buffer memory power consumption.
But, for existing scheme, there are following two defects:
The first, the function that realizes monitoring flow rate need to take larger hardware resource, and the burst of flow is changed and can not accomplish effective anticipation action; Second, the state that changes buffer unit needs certain activationary time, for example buffer unit is transformed into duty from power save mode, is easy to thus cause, because inadequate buffer space causes data from overflow, QoS being impacted because buffer unit has little time conversion.
Summary of the invention
The invention provides the buffer storage of a kind of data cached reception and the method reading and device and router, can reduce the hardware capabilities waste of router cache capacity, reach energy-saving and cost-reducing object; Can also effectively avoid, because of the not enough data from overflow phenomenon occurring of memory space, ensureing QoS simultaneously.
First aspect, provides a kind of data cached method of reseptance, and described method comprises: receive data cached, to carrying out data storage at least two storage unit of state of activation according to priority order from high to low; If the memory space of the storage unit that the described storage unit medium priority in state of activation is minimum reaches default activation waterline, will transfer state of activation in the storage unit of state to be activated, and transfer the highest storage unit of storage unit medium priority in deactivation status to state to be activated; Wherein, describedly can receive data cached in the storage unit of state of activation; The described storage unit in state to be activated cannot receive data cached, need to be converted into state of activation and could receive data cached; The described storage unit in deactivation status cannot receive data cached; The preset rules of described activation waterline is: storage unit activates supernatant storage space and is buffered data and takes the required time and be more than or equal to described state of memory cells and change the needed time.
In the possible implementation of the first of first aspect, before described reception is data cached, described method also comprises: each storage unit is carried out to priority demarcation; The preferential memory buffers data of storage unit that priority is high.
In the possible implementation of the second of first aspect, before described reception is data cached, described method also comprises: each storage unit is carried out to status indicator; The state of described storage unit comprises: state of activation, state to be activated, deactivation status.
Second aspect, provides a kind of data cached read method, and described method comprises: reading cache data; If got sky in the minimum storage unit of storage unit medium priority of state of activation, and also do not reach default activation waterline than described memory space of being got the empty higher leveled storage unit of storage unit priority, got empty storage unit and be converted into state to be activated described; Wherein, describedly can receive data cached in the storage unit of state of activation; The described storage unit in state to be activated cannot receive data cached, need to be converted into state of activation and could receive data cached; The preset rules of described activation waterline is: storage unit activates supernatant storage space and is buffered data and takes the required time and be more than or equal to described state of memory cells and change the needed time.
In the possible implementation of the first of second aspect, got after empty storage unit is converted into unit to be activated described described, described method also comprises: in the time that the quantity of the storage unit in state to be activated is greater than 1, be converted into deactivation status by described in the minimum storage unit of the storage unit medium priority of state to be activated; Wherein, the described storage unit in deactivation status cannot receive data cached.
In conjunction with the possible implementation of the first of second aspect, in the possible implementation of the second of second aspect, before described reading cache data, described method also comprises: each storage unit is carried out to priority demarcation; The preferential memory buffers data of storage unit that priority is high.
In conjunction with the possible implementation of the first of second aspect, in the third possible implementation of second aspect, before described reading cache data, described method also comprises: each storage unit is carried out to status indicator; The state of described storage unit comprises: state of activation, state to be activated, deactivation status.
The third aspect, provides a kind of data cached receiving trap, and described device comprises: receiving element, and data cached for receiving, to carrying out data storage at least two storage unit of state of activation according to priority order from high to low; The first processing unit, if the memory space for the minimum storage unit of the described storage unit medium priority in state of activation reaches default activation waterline, will transfer state of activation in the storage unit of state to be activated, and transfer the highest storage unit of storage unit medium priority in deactivation status to state to be activated; Wherein, describedly can receive data cached in the storage unit of state of activation; The described storage unit in state to be activated cannot receive data cached, need to be converted into state of activation and could receive data cached; The described storage unit in deactivation status cannot receive data cached; The preset rules of described activation waterline is: storage unit activates supernatant storage space and is buffered data and takes the required time and be more than or equal to described state of memory cells and change the needed time.
In the possible implementation of the first of the third aspect, described device also comprises: priority is demarcated unit, for each storage unit is carried out to priority demarcation, and the preferential memory buffers data of storage unit that priority is high.
In the possible implementation of the second of the third aspect, described device also comprises: state is demarcated unit, for each storage unit is carried out to status indicator; The state of described storage unit comprises: state of activation, state to be activated, deactivation status.
Fourth aspect, provides a kind of data cached reading device, and described device comprises: reading unit, for reading cache data; The second processing unit, if for being got sky in the minimum storage unit of storage unit medium priority of state of activation, and also do not reach default activation waterline than described memory space of being got the empty higher leveled storage unit of storage unit priority, got empty storage unit and be converted into state to be activated described; Wherein, describedly can receive data cached in the storage unit of state of activation; The described storage unit in state to be activated cannot receive data cached, need to be converted into state of activation and could receive data cached; The described storage unit in deactivation status cannot receive data cached; The preset rules of described activation waterline is: storage unit activates supernatant storage space and is buffered data and takes the required time and be more than or equal to described state of memory cells and change the needed time.
In the possible implementation of the first of fourth aspect, described the second processing unit, also, in the time that the quantity of the storage unit in state to be activated is greater than 1, be converted into deactivation status by described in the minimum storage unit of the storage unit medium priority of state to be activated; Wherein, the described storage unit in deactivation status cannot receive data cached.
In conjunction with the possible implementation of the first of fourth aspect, in the possible implementation of the second of fourth aspect, described device also comprises: priority is demarcated unit, for each storage unit is carried out to priority demarcation, and the preferential memory buffers data of storage unit that priority is high.
In conjunction with the possible implementation of the first of fourth aspect, in the third possible implementation of fourth aspect, described device also comprises: state is demarcated unit, for each storage unit is carried out to status indicator; The state of described storage unit comprises: state of activation, state to be activated, deactivation status.
The 5th aspect, provides a kind of buffer storage of router, and described buffer storage comprises cache controller and at least two storage unit; Described buffer storage also comprises in the third aspect the data cached reading device described in any possible implementation in the data cached receiving trap described in any possible implementation and fourth aspect.
In the possible implementation of the first aspect the 5th, described data cached receiving trap and data cached reading device are independent of described cache controller setting; Or described data cached receiving trap and data cached reading device are integrated into two functional module settings of described cache controller.
On the one hand, method described in the embodiment of the present invention, to carrying out data storage in the storage unit of state of activation according to priority order from high to low, can avoid data cached less in the situation that, all storage unit are occupied and occupied less storage space only all, can save thus the hardware capabilities of router cache capacity, realize energy-saving and cost-reducing.
On the other hand, for the storage unit of router, it being carried out to state change, for example, storage unit is converted into state of activation, is converted into state to be activated from deactivation status from state to be activated, is all to need certain activationary time.If wait until to be allly all filled with and again the storage unit in state to be activated to have been carried out to state change in the storage unit of state of activation, will cause, because of the not enough phenomenon that data from overflow occurs of memory space, affecting QoS.Therefore, described in the embodiment of the present invention, in method, activate waterline by setting, in advance the storage unit in state to be activated and deactivation status is carried out to state change, can effectively avoid thus, because of the not enough data from overflow phenomenon occurring of memory space, ensureing QoS.
Brief description of the drawings
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, to the accompanying drawing of required use in embodiment be briefly described below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is the buffer structure schematic diagram of typical router;
Fig. 2 is data cached method of reseptance described in the embodiment of the present invention and a kind of application scenarios schematic diagram of read method;
Fig. 3 is the data cached method of reseptance process flow diagram of the embodiment of the present invention one;
Fig. 4 is the data cached method of reseptance process flow diagram of the embodiment of the present invention two;
Fig. 5 is the data cached read method process flow diagram of the embodiment of the present invention one;
Fig. 6 is the data cached read method process flow diagram of the embodiment of the present invention two;
Fig. 7 is the structural representation of the router cache device described in the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out to clear, complete description, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiment.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
The invention provides a kind of data cached reception and the method reading and device and router cache device, can reduce the hardware capabilities waste of router cache capacity, reach energy-saving and cost-reducing object; Can also effectively avoid, because of the not enough data from overflow phenomenon occurring of memory space, ensureing QoS simultaneously.
With reference to Fig. 2, it is a kind of application scenarios schematic diagram of the data cached method of reseptance described in the embodiment of the present invention and read method.As shown in Figure 2, router cache device can comprise: a cache controller 10 and n storage unit 20; Described n is positive integer.Described cache controller 10 is connected with external device by high-speed bus, receives and needs the data of buffer memory, and by data & address wire, the data that receive are sent to each storage unit 20.
Described in the embodiment of the present invention, the buffer storage of router also comprises a data sink and data fetch device, realize the dynamic management of the buffer memory capacity to router by described data sink and data fetch device, reduce the hardware capabilities waste of router cache capacity, reach energy-saving and cost-reducing object; Can also effectively avoid, because of the not enough data from overflow phenomenon occurring of memory space, ensureing QoS simultaneously.
With reference to Fig. 3, it is the data cached method of reseptance process flow diagram of the embodiment of the present invention one.As shown in Figure 3, described method can comprise the following steps:
Step S301: receive data cached, to carrying out data storage in the storage unit of state of activation according to priority order from high to low.
Step S302: if the memory space of the minimum storage unit of described storage unit medium priority in state of activation reaches default activation waterline, will transfer state of activation in the storage unit of state to be activated, and transfer the highest storage unit of storage unit medium priority in deactivation status to state to be activated.
Wherein, describedly can receive data cached in the storage unit of state of activation; The described storage unit in state to be activated cannot receive data cached, need to be converted into state of activation and could receive data cached; The described storage unit in deactivation status cannot receive data cached.
The preset rules of described activation waterline is: storage unit activates supernatant storage space and is buffered data and takes the required time and be more than or equal to described state of memory cells and change the needed time.
On the one hand, method described in the embodiment of the present invention, to carrying out data storage in the storage unit of state of activation according to priority order from high to low, can avoid data cached less in the situation that, all storage unit are occupied and occupied less storage space only all, can save thus the hardware capabilities of router cache capacity, realize energy-saving and cost-reducing.
On the other hand, for the storage unit of router, it being carried out to state change, for example, storage unit is converted into state of activation, is converted into state to be activated from deactivation status from state to be activated, is all to need certain activationary time.If wait until to be allly all filled with and again the storage unit in state to be activated to have been carried out to state change in the storage unit of state of activation, will cause, because of the not enough phenomenon that data from overflow occurs of memory space, affecting QoS.Therefore, described in the embodiment of the present invention, in method, activate waterline by setting, in advance the storage unit in state to be activated and deactivation status is carried out to state change, can effectively avoid thus, because of the not enough data from overflow phenomenon occurring of memory space, ensureing QoS.
It should be noted that, for the data cached method of reseptance described in the embodiment of the present invention, before reception is data cached, need to first carry out priority demarcation and state demarcation to each storage unit.
Concrete, before reception is data cached, described method also comprises: the n of a router storage unit is carried out to priority demarcation, and the preferential memory buffers data of storage unit that priority is high, n is more than or equal to 2 integer.
In actual applications, can independently carry out respectively priority demarcation to n storage unit; Also can first divide into groups to n storage unit, more each group of storage unit carried out respectively to priority demarcation.
In the time that reception is data cached, the preferential storage unit stores data to high priority, in the time that the storage unit of high priority is all filled with, to the storage unit stores data of the low one-level of priority; By that analogy, the minimum storage unit stores data of the most backward priority.
For example, n storage unit can be divided into three groups, be demarcated as respectively high priority, medium priority and low priority.In the time that needs carry out data buffer storage, preferential data cached to the storage unit that is demarcated as high priority.Only have after the storage unit of all high priorities is all filled with, more data cached to the storage unit of medium priority; By that analogy, after the storage unit of all medium priorities is filled with, more data cached to the storage unit of low priority.
It should be added that, receiving when data cached, for one group of storage unit of equal priority, can the equal-opportunity data of memory buffers in turn; Also can while memory buffers data.
Concrete, before reception is data cached, described method also comprises: the n of a router storage unit is carried out to state demarcation, indicate by described state the state that each storage unit is current.
Concrete, the state of described storage unit can comprise state of activation, state to be activated, deactivation status.
Wherein, possess the ability of direct storage data in the storage unit of state of activation, can be directly used in and receive and reading cache data.
Storage unit in state to be activated belongs to spare memory cell, does not possess the ability of direct storage data, can be used for receiving and reading cache data need to be converted into state of activation time.Fast cache space in the time that the storage unit of state to be activated is mainly used in storage size variation, be when all in the time that the storage unit of state of activation is all filled with, need to will be converted into state of activation in the storage unit of state to be activated, carry out memory buffers data.
The described storage unit in deactivation status refers to the storage unit in dormancy, cannot directly receive data cached.Only have in the time that all storage unit in state to be activated are all converted to state of activation, just part need to be converted into state to be activated in the storage unit of deactivation status, in order to using.
With reference to Fig. 4, it is the data cached method of reseptance process flow diagram of the embodiment of the present invention two.As shown in Figure 4, described method can comprise the following steps:
Step S401: receive data cached, to carrying out data storage in the storage unit of state of activation according to priority order from high to low.
Concrete, carry out priority judgement to current in the storage unit of state of activation, preferentially select the cell stores that its medium priority is the highest data cached, after the highest storage unit of priority is all filled with, select priority time high storage element memory buffers data, the rest may be inferred.
Step S402: whether the memory space of the storage unit that the described storage unit medium priority in state of activation of judgement is minimum reaches default activation waterline, if so, enters step S403; If not, enter step S404.
Step S403: will transfer state of activation in the storage unit of state to be activated; Transfer the highest storage unit of storage unit medium priority in deactivation status to state to be activated.
Concrete, according to the needs of practical application, can preset described activation waterline.When the memory space of the minimum storage unit of the storage unit medium priority in state of activation has reached described activation waterline, the memory space that the current storage unit that is directly used in storage data is described is little, need to will transfer state of activation in the storage unit of state to be activated as early as possible, increase more storage available with this.Meanwhile, transfer the highest storage unit of storage unit medium priority in deactivation status to state to be activated, increase the quantity of spare memory cell with this.Avoid thus occurring the phenomenon of data from overflow, ensure QoS.Otherwise, the memory space that is the storage unit that storage unit medium priority in state of activation is minimum does not also reach described activation waterline, the memory space that the current storage unit that is directly used in storage data is described is also more abundant, does not worry occurring the problem of data from overflow.
It should be added that, while setting described activation waterline, speed and the state of memory cells that can consider router reception data change the needed time.In other words, only need to ensure that a described storage unit activates supernatant storage space and is buffered data and takes the required time and be more than or equal to described state of memory cells and change the needed time.
Concrete, method described in the embodiment of the present invention, can also comprise: storage pointer is set, is used to indicate the situation that takies of each storage unit, be memory space.
By described storage pointer, determine the memory space of the storage unit that the described storage unit medium priority in state of activation is minimum, and then judge whether the memory space of this storage unit reaches activation waterline.
Step S404: receive and treat that data cached flow process finishes.
On the one hand, method described in the embodiment of the present invention, to carrying out data storage in the storage unit of state of activation according to priority order from high to low, can avoid data cached less in the situation that, all storage unit are occupied and occupied less storage space only all, can save thus the hardware capabilities of router cache capacity, realize energy-saving and cost-reducing.
On the other hand, for the storage unit of router, it being carried out to state change, for example, storage unit is converted into state of activation, is converted into state to be activated from deactivation status from state to be activated, is all to need certain activationary time.If wait until to be allly all filled with and again the storage unit in state to be activated to have been carried out to state change in the storage unit of state of activation, will cause, because of the not enough phenomenon that data from overflow occurs of memory space, affecting QoS.Therefore, described in the embodiment of the present invention, in method, by setting this activation waterline, in advance the storage unit in state to be activated and deactivation status is carried out to state change, can effectively avoid thus, because of the not enough data from overflow phenomenon occurring of memory space, ensureing QoS.
Simultaneously, in the embodiment of the present invention, by setting described activation waterline, when the memory space of the minimum storage unit of the storage unit medium priority in state of activation does not also reach described activation waterline, the memory space that the current storage unit that is directly used in storage data is described is also more abundant, do not worry occurring the problem of data from overflow, now any storage unit in state to be activated and deactivation status is not carried out to state change, can realize thus the maximum utilization of the memory space of the storage element to having activated, reduce the hardware capabilities waste of router cache capacity, reach energy-saving and cost-reducing object.
With reference to Fig. 5, it is the data cached read method process flow diagram of the embodiment of the present invention one.As shown in Figure 5, described method can comprise the following steps:
Step S501: reading cache data.
Step S502: if got sky in the minimum storage unit of storage unit medium priority of state of activation, and also do not reach default activation waterline than described memory space of being got the empty higher leveled storage unit of storage unit priority, got empty storage unit and be converted into state to be activated described.
Wherein, describedly can receive data cached in the storage unit of state of activation; The described storage unit in state to be activated cannot receive data cached, need to be converted into state of activation and could receive data cached.
The preset rules of described activation waterline is: storage unit activates supernatant storage space and is buffered data and takes the required time and be more than or equal to described state of memory cells and change the needed time.
Described in the embodiment of the present invention in method, activate waterline by setting, when being got sky in the minimum storage unit of storage unit medium priority of state of activation, and also do not reach activation waterline than described memory space of being got the empty higher leveled storage unit of storage unit priority, illustrate that the current storage unit in state of activation is too many, exist rich.Now got empty storage unit and be converted into state to be activated described, can effectively be saved thus the hardware capabilities of router cache capacity, realized energy-saving and cost-reducing.
It should be noted that, for the data cached read method described in the embodiment of the present invention, before reading cache data, need to first carry out priority demarcation and state demarcation to each storage unit.
Concrete, before reading cache data, described method also comprises: the n of a router storage unit is carried out to priority demarcation, the preferential memory buffers data of storage unit that priority is high.
Concrete, before reading cache data, described method also comprises: the n of a router storage unit is carried out to state demarcation, indicate by described state the state that each storage unit is current.
Each storage unit is carried out to priority demarcation herein identical with previous embodiment with the method for state demarcation, do not repeat them here.
For the data cached read method described in the embodiment of the present invention, being got after empty storage unit is converted into state to be activated described, can also comprise: in the time that the quantity of the storage unit in state to be activated is greater than 1, be converted into deactivation status by described in the minimum storage unit of the storage unit medium priority of state to be activated; Wherein, the described storage unit in deactivation status cannot receive data cached.
With reference to Fig. 6, it is the data cached read method process flow diagram of the embodiment of the present invention two.As described in Figure 6, described method can comprise the following steps:
Step S601: reading cache data.
Step S602: whether the storage unit that judges current reading cache data is empty, if so, enters step S:603; If not, enter step S608.
Step S603: whether the storage unit that judges described current reading cache data is minimum in the storage unit medium priority of state of activation, if so, enters step S604; If not, enter step S608.
Step S604: judge than the memory space of the higher leveled storage unit of storage unit priority of described current reading cache data whether reach default activation waterline, if not, enter step S605; If so, enter step S608.
Step S605: the storage unit of described current reading cache data is converted into state to be activated.
Step S606: whether the quantity that judges the storage unit in state to be activated is greater than 1, if so, enters step S607; If not, enter step S608.
Step S607: the minimum storage unit of storage unit medium priority in state to be activated is converted into deactivation status.
Step S608: reading cache data flow process finishes.
In data cached read method described in the embodiment of the present invention two, read data cached, in the time that a certain storage unit is got sky, priority to this storage unit judges, to be got empty storage unit be minimum in the storage unit medium priority of state of activation when described, further judge than the memory space of the higher leveled storage unit of its priority whether reach activation waterline, if, illustrate than described and got storage unit that empty storage unit priority is high and all exist storage space more than needed, this is got empty storage unit does not temporarily need for memory buffers data, it can be converted into state to be activated from state of activation, as for subsequent use, save thus the hardware capabilities of router cache capacity, realize energy-saving and cost-reducing.
Further, in the time that whether the quantity of the storage unit in state to be activated is greater than 1, storage unit minimum its medium priority can be converted into deactivation status, reduce in running order storage unit, save thus the hardware capabilities of router cache capacity, realize energy-saving and cost-reducing.
Corresponding to data cached method of reseptance and read method described in the embodiment of the present invention, the embodiment of the present invention also provides a kind of router.With reference to Fig. 7, it is the structural representation of the router cache device described in the embodiment of the present invention.
As shown in Figure 7, described router cache device can comprise: a cache controller 10 and n storage unit 20.
Described router is paid device and can also be comprised: a data cached receiving trap 30 and a data cached reading device 40.
Wherein, described data cached receiving trap 30 comprises: receiving element and the first processing unit.
Described receiving element, data cached for receiving, to carrying out data storage in the storage unit of state of activation according to priority order from high to low.
Described the first processing unit, if the memory space for the minimum storage unit of the described storage unit medium priority in state of activation reaches default activation waterline, will transfer state of activation in the storage unit of state to be activated, and transfer the highest storage unit of storage unit medium priority in deactivation status to state to be activated.
Described data cached reading device 40 can comprise: reading unit and the second processing unit.
Described reading unit, for reading cache data.
Described the second processing unit, if for being got sky in the minimum storage unit of storage unit medium priority of state of activation, and also do not reach default activation waterline than described memory space of being got the empty higher leveled storage unit of storage unit priority, got empty storage unit and be converted into state to be activated described.
Wherein, describedly can receive data cached in the storage unit of state of activation; The described storage unit in state to be activated cannot receive data cached, need to be converted into state of activation and could receive data cached; The described storage unit in deactivation status cannot receive data cached.
The preset rules of described activation waterline is: storage unit activates supernatant storage space and is buffered data and takes the required time and be more than or equal to described state of memory cells and change the needed time.
It should be noted that, described the second processing unit, can also be used in the time that the quantity of the storage unit in state to be activated is greater than 1, is converted into deactivation status by described in the minimum storage unit of the storage unit medium priority of state to be activated.
Described in the embodiment of the present invention, router cache device can also comprise: priority is demarcated unit.
Concrete, described priority is demarcated unit, for each storage unit is carried out to priority demarcation, and the preferential memory buffers data of storage unit that priority is high.
In actual applications, can independently carry out respectively priority demarcation to each storage unit; Also can first divide into groups to n storage unit, more each group of storage unit carried out respectively to priority demarcation.
It should be added that, in the time that reception is data cached, for one group of storage unit of equal priority, equal-opportunity memory buffers data.
Further, described buffer storage can also comprise: state is demarcated unit.
Concrete, described state is demarcated unit, for each storage unit is carried out to state demarcation, indicates by described state the state that each storage unit is current.
Concrete, the state of described storage unit can comprise state of activation, state to be activated, deactivation status.
Wherein, can be directly used in memory buffers data in the storage unit of state of activation; And belong to spare memory cell in the storage unit of state to be activated, and in the time that the storage unit of state of activation is all filled with, need to will be converted into state of activation in the storage unit of state to be activated when all, carry out memory buffers data; The described storage unit in deactivation status refers to the storage unit in dormancy, only have in the time that all storage unit in state to be activated are all converted to state of activation, just part need to be converted into state to be activated in the storage unit of deactivation status, in order to using.
Need to further illustrate, described cache controller 10 can be an independently physical device; Also can be a logic function module integrated in certain device of router.
Certainly, described data cached receiving trap 30 and data cached reading device 40 can be to be independent of the physical device that cache controller arranges; Also can be two logic function modules that are integrated in described cache controller 10.
It should be noted that, each described storage unit can be an independently physical memory devices, for example memory device of a minimal physical structure; A memory grain.
Certainly, each described storage unit also can be made up of storage stack part.In this case, when receiving when data cached, these memory devices are equal-opportunity write in turn data cached.
On the one hand, router cache device described in the embodiment of the present invention, to carrying out data storage in the storage unit of state of activation according to priority order from high to low, can avoid data cached less in the situation that, all storage unit are occupied and occupied less storage space only all, can save thus the hardware capabilities of router cache capacity, realize energy-saving and cost-reducing.
On the other hand, for the storage unit of router, it being carried out to state change, for example, storage unit is converted into state of activation, is converted into state to be activated from deactivation status from state to be activated, is all to need certain activationary time.If wait until to be allly all filled with and again the storage unit in state to be activated to have been carried out to state change in the storage unit of state of activation, will cause, because of the not enough phenomenon that data from overflow occurs of memory space, affecting QoS.Therefore, described in the embodiment of the present invention, in method, activate waterline by setting, in advance the storage unit in state to be activated and deactivation status is carried out to state change, can effectively avoid thus, because of the not enough data from overflow phenomenon occurring of memory space, ensureing QoS.
Above to the data cached reception of one provided by the present invention and read method and device, router cache device, be described in detail, applied specific case herein principle of the present invention and embodiment are set forth, the explanation of above embodiment is just for helping to understand method of the present invention and core concept thereof; Meanwhile, for one of ordinary skill in the art, according to thought of the present invention, all will change in specific embodiments and applications.In sum, this description should not be construed as limitation of the present invention.
The possible implementation that one of ordinary skill in the art will appreciate that various aspects of the present invention or various aspects can be embodied as system, method or computer program.Therefore, the possible implementation of each aspect of the present invention or various aspects can adopt complete hardware implementation example, complete implement software example (comprising firmware, resident software etc.), or the form of the embodiment of integration software and hardware aspect, is all referred to as " circuit ", " module " or " system " here.In addition, the possible implementation of each aspect of the present invention or various aspects can adopt the form of computer program, and computer program refers to the computer readable program code being stored in computer-readable medium.
Computer-readable medium can be computer-readable signal media or computer-readable recording medium.Computer-readable recording medium is including but not limited to electronics, magnetic, optics, electromagnetism, infrared or semiconductor system, equipment or device, or aforesaid appropriately combined arbitrarily, as random access memory (RAM), ROM (read-only memory) (ROM), Erasable Programmable Read Only Memory EPROM (EPROM or flash memory), optical fiber, portable ROM (read-only memory) (CD-ROM).
Processor in computing machine reads the computer readable program code being stored in computer-readable medium, makes processor can carry out the function action specifying in the combination of in process flow diagram each step or each step; Generation is implemented in the device of the function action specifying in each piece of block diagram or each combination.

Claims (16)

1. a data cached method of reseptance, is characterized in that, described method comprises:
Receive data cached, to carrying out data storage at least two storage unit of state of activation according to priority order from high to low;
If the memory space of the storage unit that the described storage unit medium priority in state of activation is minimum reaches default activation waterline; will transfer state of activation in the storage unit of state to be activated, and transfer the highest storage unit of storage unit medium priority in deactivation status to state to be activated;
Wherein, describedly can receive data cached in the storage unit of state of activation; The described storage unit in state to be activated cannot receive data cached, need to be converted into state of activation and could receive data cached; The described storage unit in deactivation status cannot receive data cached;
The preset rules of described activation waterline is: storage unit activates supernatant storage space and is buffered data and takes the required time and be more than or equal to described state of memory cells and change the needed time.
2. method according to claim 1, is characterized in that, before described reception is data cached, described method also comprises:
Each storage unit is carried out to priority demarcation; The preferential memory buffers data of storage unit that priority is high.
3. method according to claim 1, is characterized in that, before described reception is data cached, described method also comprises:
Each storage unit is carried out to status indicator;
The state of described storage unit comprises: state of activation, state to be activated, deactivation status.
4. a data cached read method, is characterized in that, described method comprises:
Reading cache data;
If got sky in the minimum storage unit of storage unit medium priority of state of activation, and also do not reach default activation waterline than described memory space of being got the empty higher leveled storage unit of storage unit priority, got empty storage unit and be converted into state to be activated described;
Wherein, describedly can receive data cached in the storage unit of state of activation; The described storage unit in state to be activated cannot receive data cached, need to be converted into state of activation and could receive data cached;
The preset rules of described activation waterline is: storage unit activates supernatant storage space and is buffered data and takes the required time and be more than or equal to described state of memory cells and change the needed time.
5. method according to claim 4, is characterized in that, is got after empty storage unit is converted into unit to be activated described described, and described method also comprises:
In the time that the quantity of the storage unit in state to be activated is greater than 1, be converted into deactivation status by described in the minimum storage unit of the storage unit medium priority of state to be activated;
Wherein, the described storage unit in deactivation status cannot receive data cached.
6. according to the method described in claim 4 or 5, it is characterized in that, before described reading cache data, described method also comprises:
Each storage unit is carried out to priority demarcation; The preferential memory buffers data of storage unit that priority is high.
7. according to the method described in claim 4 or 5, it is characterized in that, before described reading cache data, described method also comprises:
Each storage unit is carried out to status indicator;
The state of described storage unit comprises: state of activation, state to be activated, deactivation status.
8. a data cached receiving trap, is characterized in that, described device comprises:
Receiving element, data cached for receiving, to carrying out data storage at least two storage unit of state of activation according to priority order from high to low;
The first processing unit, if the memory space for the minimum storage unit of the described storage unit medium priority in state of activation reaches default activation waterline, will transfer state of activation in the storage unit of state to be activated, and transfer the highest storage unit of storage unit medium priority in deactivation status to state to be activated;
Wherein, describedly can receive data cached in the storage unit of state of activation; The described storage unit in state to be activated cannot receive data cached, need to be converted into state of activation and could receive data cached; The described storage unit in deactivation status cannot receive data cached;
The preset rules of described activation waterline is: storage unit activates supernatant storage space and is buffered data and takes the required time and be more than or equal to described state of memory cells and change the needed time.
9. data cached receiving trap according to claim 8, is characterized in that, described device also comprises:
Priority is demarcated unit, for each storage unit is carried out to priority demarcation, and the preferential memory buffers data of storage unit that priority is high.
10. data cached receiving trap according to claim 8, is characterized in that, described device also comprises:
State is demarcated unit, for each storage unit is carried out to status indicator;
The state of described storage unit comprises: state of activation, state to be activated, deactivation status.
11. 1 kinds of data cached reading devices, is characterized in that, described device comprises:
Reading unit, for reading cache data;
The second processing unit, if for being got sky in the minimum storage unit of storage unit medium priority of state of activation, and also do not reach default activation waterline than described memory space of being got the empty higher leveled storage unit of storage unit priority, got empty storage unit and be converted into state to be activated described;
Wherein, describedly can receive data cached in the storage unit of state of activation; The described storage unit in state to be activated cannot receive data cached, need to be converted into state of activation and could receive data cached; The described storage unit in deactivation status cannot receive data cached;
The preset rules of described activation waterline is: storage unit activates supernatant storage space and is buffered data and takes the required time and be more than or equal to described state of memory cells and change the needed time.
12. data cached reading devices according to claim 11, it is characterized in that, described the second processing unit, also, in the time that the quantity of the storage unit in state to be activated is greater than 1, be converted into deactivation status by described in the minimum storage unit of the storage unit medium priority of state to be activated;
Wherein, the described storage unit in deactivation status cannot receive data cached.
13. according to the data cached reading device described in claim 11 or 12, it is characterized in that, described device also comprises:
Priority is demarcated unit, for each storage unit is carried out to priority demarcation, and the preferential memory buffers data of storage unit that priority is high.
14. according to the data cached reading device described in claim 11 or 12, it is characterized in that, described device also comprises:
State is demarcated unit, for each storage unit is carried out to status indicator;
The state of described storage unit comprises: state of activation, state to be activated, deactivation status.
The buffer storage of 15. 1 kinds of routers, is characterized in that, described buffer storage comprises cache controller and at least two storage unit;
Described buffer storage also comprises the data cached receiving trap as described in claim 8 to 10 any one and the data cached reading device as described in claim 11 to 14 any one.
The buffer storage of 16. routers according to claim 15, is characterized in that, described data cached receiving trap and data cached reading device are independent of described cache controller setting; Or,
Described data cached receiving trap and data cached reading device are integrated into two functional module settings of described cache controller.
CN201210539030.0A 2012-12-13 2012-12-13 Caching data receiving and reading method and device and router cache device Pending CN103870206A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210539030.0A CN103870206A (en) 2012-12-13 2012-12-13 Caching data receiving and reading method and device and router cache device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210539030.0A CN103870206A (en) 2012-12-13 2012-12-13 Caching data receiving and reading method and device and router cache device

Publications (1)

Publication Number Publication Date
CN103870206A true CN103870206A (en) 2014-06-18

Family

ID=50908794

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210539030.0A Pending CN103870206A (en) 2012-12-13 2012-12-13 Caching data receiving and reading method and device and router cache device

Country Status (1)

Country Link
CN (1) CN103870206A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108605039A (en) * 2016-01-27 2018-09-28 安移通网络公司 Malware is detected in SPDY connections
CN108932108A (en) * 2017-05-26 2018-12-04 慧荣科技股份有限公司 Method for scheduling and executing commands of flash memory and device using the same
CN109413122A (en) * 2017-08-16 2019-03-01 深圳市中兴微电子技术有限公司 Data processing method, network processor and computer storage medium
CN113448970A (en) * 2021-08-31 2021-09-28 深圳市一号互联科技有限公司 Graph data storage method and system
CN113590658A (en) * 2021-07-06 2021-11-02 广州汇思信息科技股份有限公司 Cache data processing method and device, computer equipment and storage medium

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108605039A (en) * 2016-01-27 2018-09-28 安移通网络公司 Malware is detected in SPDY connections
US10992702B2 (en) 2016-01-27 2021-04-27 Hewlett Packard Enterprise Development Lp Detecting malware on SPDY connections
CN108932108A (en) * 2017-05-26 2018-12-04 慧荣科技股份有限公司 Method for scheduling and executing commands of flash memory and device using the same
CN108932108B (en) * 2017-05-26 2021-07-06 慧荣科技股份有限公司 Method for scheduling and executing commands of flash memory and device using the same
CN109413122A (en) * 2017-08-16 2019-03-01 深圳市中兴微电子技术有限公司 Data processing method, network processor and computer storage medium
CN113590658A (en) * 2021-07-06 2021-11-02 广州汇思信息科技股份有限公司 Cache data processing method and device, computer equipment and storage medium
CN113448970A (en) * 2021-08-31 2021-09-28 深圳市一号互联科技有限公司 Graph data storage method and system
CN113448970B (en) * 2021-08-31 2022-07-12 深圳市一号互联科技有限公司 Graph data storage method and system

Similar Documents

Publication Publication Date Title
CN101403982B (en) Task distribution method, system for multi-core processor
US7971074B2 (en) Method, system, and apparatus for a core activity detector to facilitate dynamic power management in a distributed system
RU2566330C2 (en) Performance and traffic aware heterogeneous interconnection network
CN104090847B (en) Address distribution method of solid-state storage device
CN103870206A (en) Caching data receiving and reading method and device and router cache device
US10216668B2 (en) Technologies for a distributed hardware queue manager
US20190379610A1 (en) On-demand packet queuing in a network device
US8626955B2 (en) Directing packets to a processor unit
CN103701710A (en) Data transmission method, core forwarding equipment and endpoint forwarding equipment
WO2014022492A1 (en) A method to allocate packet buffers in a packet transferring system
CN104572498B (en) The buffer memory management method and device of message
CN102193874A (en) Buffer manager and method for managing memory
US10038652B2 (en) Self tuning buffer allocation in a shared-memory switch
CN102111327A (en) Method and system for cell dispatching
CN101465810B (en) Method, device and system for controlling chip energy consumption
US11722438B2 (en) Maintaining bandwidth utilization in the presence of packet drops
EP3326347A1 (en) Method and system for usb 2.0 bandwidth reservation
CN104899105A (en) Interprocess communication method
CN104750425A (en) Storage system and control method for nonvolatile memory of storage system
CN102541506B (en) First-in-first-out (FIFO) data register, chip and equipment
CN103401806B (en) Message processing method and device
JP5243351B2 (en) Buffer management method and buffer management device
CN102347891A (en) Method for using shared cache
CN102831077B (en) A kind of flow management device and method for saving cache resources
JP5631850B2 (en) Switch device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20140618