WO2013189324A2 - Storage method and read-write storage device which are applied to wireless communications - Google Patents

Storage method and read-write storage device which are applied to wireless communications Download PDF

Info

Publication number
WO2013189324A2
WO2013189324A2 PCT/CN2013/081020 CN2013081020W WO2013189324A2 WO 2013189324 A2 WO2013189324 A2 WO 2013189324A2 CN 2013081020 W CN2013081020 W CN 2013081020W WO 2013189324 A2 WO2013189324 A2 WO 2013189324A2
Authority
WO
WIPO (PCT)
Prior art keywords
pointer
space
odd
read
storage
Prior art date
Application number
PCT/CN2013/081020
Other languages
French (fr)
Chinese (zh)
Other versions
WO2013189324A3 (en
Inventor
洪思华
冯立国
徐心明
邹飞
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2013189324A2 publication Critical patent/WO2013189324A2/en
Publication of WO2013189324A3 publication Critical patent/WO2013189324A3/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management

Definitions

  • the present invention relates to storage technology, and more particularly to a storage method and a read/write storage device for wireless communication. Background technique
  • a storage space is fixedly allocated to each queue.
  • Each queue has exclusive storage space allocated, does not interact with the storage space of other queues, and has simple system control, but low storage space utilization. Due to the uncertainty of communication, it is possible that a queue has only a small amount of data, a large amount of storage space is idle, and another queue has a large amount of data, and the storage space is not suitable. However, due to the fixed allocation method, the storage space between the queues cannot be exchanged. Therefore, the storage space is unevenly distributed, resulting in low storage space utilization.
  • linked list shared storage method For the second method above, it is not easy to find a space that is long enough for a long time, using a linked list method. ⁇ Use the linked list method to put discontinuous free space Linked up for use in large data packets. Using a linked list approach, after a period of data processing, the free storage space fragmentation will become small enough, but the length of the linked list will be long enough, which will result in a sharp decline in storage performance and a significant reduction in storage space utilization.
  • the main purpose of the embodiments of the present invention is to provide a storage method and a read/write storage device for wireless communication, which improves the comprehensive performance of the storage space and the utilization rate of the storage space.
  • a storage method applied to wireless communication comprising:
  • the service type of the data select the migration of the corresponding pointer to adjust the storage structure, adaptively allocate the storage space, read the corresponding pointer in the case of the write operation, and determine whether the state of the storage space is a non-spatial upward merge state according to the status indication, such as Then, the corresponding storage space is found according to the read pointer and the data write operation is performed. If not, the pointer parity judgment is performed.
  • performing the pointer parity determination specifically includes: if the read pointer is an odd pointer, finding a corresponding storage space according to the read odd pointer and performing a data write operation; if the read pointer is an even pointer, then reading The even-numbered pointer is sent to the parity state space for updating, and the state identifier corresponding to the even pointer is set to high.
  • the even-numbered pointer is only stored in the parity state space, and when the state identifier corresponding to the even-numbered pointer is set to be high, the space corresponding to the even-numbered pointer is idle;
  • Each even pointer and its corresponding odd pointer form a parity pair.
  • a storage method applied to wireless communication comprises: selecting a migration of a corresponding pointer according to a service type of the data to adjust a storage structure, adaptively allocating a storage space, reading a corresponding pointer in a read operation condition, finding a corresponding storage space, and executing The data read operation releases the corresponding space of the read pointer after the reading is completed. If the state of the storage space is determined to be the spatial upward merge state according to the state indication, the pointer parity judgment is performed.
  • the performing the pointer parity determination specifically includes: if the read pointer is an even pointer, it does not process; if the read pointer is an odd pointer, whether the parity state space query exists and matches the odd pointer.
  • the even pointer if there is a matching even pointer and the state identifier corresponding to the even pointer is set to high, the parity pointer is merged.
  • the even-numbered pointer is only stored in the parity state space, and when the state identifier corresponding to the even-numbered pointer is set to be high, the space corresponding to the even-numbered pointer is idle;
  • Each even pointer and its corresponding odd pointer form a parity pair.
  • the method further includes: if the odd space corresponding to the odd pointer in the parity pair is released, the even space corresponding to the even pointer in the parity pair is released together with the odd space, and the two storage spaces are simultaneously Merged up into a contiguous storage space.
  • the size of the parity space corresponding to the new pointer merged by the parity pointer is: the sum of the original odd space corresponding to the odd pointer and the original even space corresponding to the even pointer.
  • the method further includes: if the state of the storage space is determined to be a spatial downward decomposition state according to the state indication, the read pointer is decomposed into an odd pointer and an even pointer corresponding thereto, thereby realizing spatial downward decomposition;
  • the size of the original space corresponding to the read pointer is divided into two parts, and the odd pointer corresponds to The even spaces corresponding to the odd spaces and the even pointers each account for half of the original space.
  • a read/write storage device comprising: a total control unit, a multiplexing unit, and a parity determining unit; wherein
  • the control unit is configured to control the multiplex selection unit to select a migration of the corresponding pointer according to the service type of the data to adjust the storage structure of the storage space, and adaptively allocate the storage space;
  • the original idle pointer queue is selected correspondingly; when the service type is a large data packet that exceeds the existing storage structure, the merged idle pointer queue is selected correspondingly; When the service type is a small data packet lower than the existing storage structure, the pointer is decomposed and correspondingly decomposes the idle pointer queue;
  • the parity decision unit is configured to perform a pointer parity judgment when the working state of the storage space controlled by the master control unit is a spatial upward merge state.
  • the working state of the storage space specifically includes: a normal state, a spatial downward decomposition state, or a spatial upward merge state.
  • the device further includes: an address decoding unit configured to determine whether the address indicated by the read pointer belongs to a spatial merged area when the working state is a spatial upward merged state, and when the spatial merged area belongs to the spatial merged area, the device reads The fetched pointer is sent to the parity decision unit.
  • the parity decision unit is further configured to, when a parity operation is performed on a pointer acquired from the address decoding unit in a write operation, the read pointer is an odd pointer, and the corresponding pointer is found according to the read odd pointer. Stores the space and performs a data write operation; if the read pointer is an even pointer, the read even pointer is sent to the parity state space for updating, and the state identifier corresponding to the even pointer is set to high.
  • the parity decision unit is further configured to: in the case of a read operation, the read pointer is an even pointer, and no processing is performed; if the read pointer is an odd pointer, whether the parity state space exists and the odd number is queried The even pointer of the pointer match, if there is a matching even pointer and the state identifier corresponding to the even pointer is set to high, the merge pointer unit is notified to perform the parity index The needle merges.
  • the even-numbered pointer is only stored in the parity state space, and when the state identifier corresponding to the even-numbered pointer is set to be high, the space corresponding to the even-numbered pointer is idle; each even-numbered pointer and its corresponding odd-numbered pointer constitute a parity Correct.
  • the device further includes: a pointer decomposition unit configured to decompose the read pointer into an odd pointer and an even pointer corresponding thereto when the working state is a spatial downward decomposition state, to implement space down decomposition.
  • a pointer decomposition unit configured to decompose the read pointer into an odd pointer and an even pointer corresponding thereto when the working state is a spatial downward decomposition state, to implement space down decomposition.
  • the storage structure is adjusted according to the service type of the data, the storage structure is adjusted, the storage space is adaptively allocated, the corresponding pointer is read in the case of a write operation, and the state of the storage space is determined to be a non-spatial upward merge state according to the status indication. If yes, the corresponding storage space is found according to the read pointer and the data write operation is performed. If not, the pointer parity judgment is performed.
  • the prior art is to pre-set the storage structure according to the fixed data service type, and cannot be dynamically adjusted later.
  • the storage space can be adaptively allocated, the overall performance of the storage space is improved compared with the prior art. And storage space utilization.
  • FIG. 1 is a flowchart of an implementation of a method in a write operation according to an embodiment of the method of the present invention
  • FIG. 2 is a flow chart showing an implementation of a method in a read operation according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of an embodiment of a device according to the present invention. detailed description
  • the storage structure is adjusted according to the service type of the data, the storage structure is adjusted, the storage space is adaptively allocated, and the corresponding pointer is read in the case of a write operation, and the status of the storage space is determined according to the status indication.
  • Non-spatial up state if ⁇ , then find the corresponding storage space according to the read pointer and perform data write operation, if not, then perform pointer Parity judgment.
  • the embodiment of the invention is a storage scheme applied to a multi-data source read/write operation of a wireless communication, and mainly relates to pointer classification management.
  • the total pointers are divided into three categories, a merge pointer, a raw pointer, and a decomposition pointer. After each space is read, the corresponding space needs to be released, and the pointer corresponding to the space is delivered to the pointer management center. Through the migration of three types of pointers, the dynamic adjustment of the storage space is realized.
  • the method implementation of the storage method in the embodiment of the present invention is as shown in FIG. 1, and includes the following contents:
  • Step 1 Get a write request from the write queue and initiate a write request to the storage space.
  • Step 2 According to the packet length of the application, select the most suitable storage unit for the current data packet.
  • the selection of the storage unit in this step uses a comparison method, selecting two types of storage units closest to the packet length, and rounding down. For example, there are four types of storage units, respectively, size, 64, 128, 256, 512.
  • the current packet length is 384, and the closest memory location is 256 and 512, then rounded down, and finally 256 memory cells are selected for the first memory operation.
  • Step 3 If there is no free space in the allocated storage unit, return to the second step to reassign the storage unit.
  • Step 4 Access the free pointer queue corresponding to the storage unit and read the corresponding pointer.
  • the idle pointer queue includes: a decomposed idle address pointer queue, a merged free address pointer queue, and an original free address pointer queue.
  • Step 5 According to the status indication, determine whether the current state is a spatial upward merge state (the current largest basic storage unit is expanded).
  • the upward merged state of this step is judged according to the distribution of the packet length. If the majority (configurable) maximum packet is larger than the largest storage unit, the maximum storage unit is merged upward; or, the majority of the minimum packet is smaller than the minimum storage unit. Large, then the minimum storage unit is merged upwards.
  • Step 6 If the state is merged in a non-spatial direction, the corresponding storage space is found according to the pointer.
  • Step 7 If the space is merged upward, the pointer parity is judged. If the pointer is an odd number, the corresponding storage space is found according to the pointer. If the pointer is even, update the parity state space and discard the pointer.
  • the parity state space of this step indicates that the upwardly merged storage unit class is an empty state of all even pointer corresponding spaces. If the obtained pointer is an even number when reading such a storage unit, the space corresponding to the pointer is marked as an idle state in the parity space. When a read operation is performed, if the odd space in the parity pair is released, it can be released together with the even space, and the jointly released spaces are merged together.
  • Step 8 Data storage in the corresponding storage space, update the packet length.
  • Step 9 Determine the updated packet length. If it is zero, end the write operation. Otherwise, skip to the second step to store the remaining packets.
  • the method implementation of the storage method in the embodiment of the present invention is as shown in FIG. 2, and includes the following contents:
  • the first step from the read queue, get the read pointer, initiate a read request to the storage space.
  • the second step According to the read pointer, find the corresponding storage space and linked list, and read the data. After the data is read, the release management of the space corresponding to the read pointer is performed.
  • Step 3 According to the status indication, determine whether the current state is a spatial upward merge state, if yes, and the current pointer is an odd pointer, and the corresponding even pointer in the parity state space corresponds If the space is idle, then the parity pointer is merged.
  • the new pointer corresponds to the parity space, which is twice the size, and achieves spatial up-combination.
  • Step 4 Select the corresponding free pointer queue according to the address corresponding to the pointer and the total control state.
  • the idle pointer queue includes: a decomposed idle address pointer queue, a merged free address pointer queue, and an original free address pointer queue.
  • Step 5 If the selected current pointer queue is the processing space decomposition area, the pointer decomposition is performed, and a pointer is decomposed into parity pointers, and the space corresponding to each pointer is half of the original space, and the completion space is decomposed downward.
  • Part 6 Perform pointer storage, and judge whether it is the end of the linked list according to the linked list information obtained in the second step. If yes, it ends. If it is not, if it is not finished, it jumps to the second step.
  • each of the pointer queues in the fifth step described above has its own address space mapping.
  • the overall space is set to 1-1000. At the beginning, there is only one pointer queue. Each pointer is set to 10 address spaces, and all pointers are stored in this pointer queue.
  • the first queue corresponds to a pointer of 1-500, and each pointer corresponds to space 10.
  • the second pointer queue corresponds to a pointer of 501-1000, and each pointer is to a space of 20.
  • the first pointer queue corresponds to 1 - 255, and no pointer corresponds to space 5.
  • the second pointer queue is 256-500, and each pointer has a corresponding space of 10.
  • the third pointer queue is 501-1000, and each pointer has a space of 20.
  • FIG. 3 a schematic structural diagram of an embodiment of the read-write storage device according to the embodiment of the present invention is shown in FIG. 3, and includes:
  • the storage space 101 is a main space for storing data, and may use a double data rate DDR memory, or may use various storage devices such as an on-chip SRAM, wherein the SRAM has a static The memory of the access function.
  • the main control unit 102 is used for the overall control unit of the storage control, and is used for overall scheduling control of the storage space. For example, it is used to control the working state of the storage space, the space is merged upward (the spatial size of the basic storage unit before and after the merge is recorded), and the space is decomposed downward (the spatial size of the basic storage unit before and after the spatial decomposition is recorded), 4 ⁇ According to the status indication, the control for pointer merging and decomposing when the pointer is released; multi-way gating control; storage space allocation selection; recording the address space range of each pointer queue, storing the released space pointer in the corresponding queue .
  • each storage area of the storage space has a corresponding pointer queue, but the address range of the area is constantly changing as the space is merged downwardly, so the master control unit needs to record the current pointer queues.
  • the address range in order to facilitate the space # put, the pointer into the team operation.
  • Read-Write Queue 103 Stores the read and write request queue of the external operation source to the storage space.
  • Write Control Unit 104 A write control unit that is a storage space configured to write data to the storage space 101.
  • the free address pointer queue 105 is decomposed, and the free address pointer queue 107 is merged.
  • the original idle address pointer queue 108 is a pointer queue corresponding to each type of free storage space, wherein the number of queues is dynamically adjusted, and may be increased or decreased. It should be pointed out here:
  • the working state of the corresponding storage space is spatially decomposed downward, and the pointer decomposition operation is performed.
  • the service type applicable to this operation is small packet storage; the combined free address pointer is adopted.
  • queue 107 the working state of the corresponding storage space is spatially merged, and the pointer merge operation is performed.
  • the service type applicable to this operation is large data packet storage.
  • the working state of the corresponding storage space is normal.
  • the original pointer operation is performed, and the service type applicable to this operation is the current data packet that does not need to be dynamically adjusted and adapted to the current storage structure.
  • the pointer decomposition unit 106 in order to perform a pointer decomposition operation, that is, when the execution space is decomposed downward, the pointer corresponding to the original storage space is decomposed into odd and even two pointers, respectively corresponding to the original storage.
  • the original pointer queue contains a pointer in the merged address area and a pointer to the non-merged address area. If the currently read pointer belongs to the merged address area, the read current pointer is sent to the parity decision unit 110 for subsequent spatial up-consolidation processing, otherwise it is directly sent to the write control unit 104 to configure the address calculation at the time of the write operation.
  • the parity decision unit is: the more and more basic memory cells in the storage space that become smaller and smaller in the storage space due to storage are released first, and then released by parity judgment.
  • the address addresses of consecutive consecutively qualified addresses are merged, that is, the adjacent space base unit addresses pointed to by the pointers in the storage space are consecutively allowed to be merged.
  • Parity decision unit 110 The pointers sent to the parity decision unit are all to participate in the spatial up-combination. Since the system runs after a period of time, because the free space addresses in the original storage space are not arbitrarily random, it is very difficult to complete the spatial upward merge write during the write operation. Therefore, further consideration is given to the space read release. Merge up. If it is an odd pointer, the pointer is sent to the write control unit 104 for a normal write operation. If it is an even pointer, the pointer is sent to the parity state space 111 to control the state space for updating.
  • Parity state space 111 Used to record the idle state of the even pointer of the corresponding queue. If the parity decision unit 110 delivers an even pointer, the state identifier corresponding to the pointer will be set to high, indicating that the space corresponding to the pointer is idle. When the state space is initialized, it is all low. There is only a corresponding odd state space for the large memory unit pointer queue and its minimum memory unit pointer queue space. Therefore, no matter how many pointer queues are generated after the storage space is decomposed and merged, there are at most two parity state spaces, and each pointer state has only one bit, and the total overhead is not large, and can be constructed by using registers.
  • Multiplex selection unit 112 According to the control of the master control unit, the released pointer is sent to the corresponding queue.
  • the merge pointer unit 113 if the pointer corresponding to the currently released space is spatially merged to the corresponding address range, and the current pointer is an odd pointer, the pointer merge operation is performed, and the even pointer state corresponding to the parity state space 111 is read, if the even pointer If the state is high, the pointer merges successfully, and the merged pointer is sent to the merged free address pointer queue 107; if the even pointer state is low, the pointer merge fails, and the current pointer is delivered to the original free address pointer queue 108.
  • Read control unit 114 A write control unit for the storage space, configured to read data to the storage space 101.
  • the storage space 101, the read/write queue 103, the write control unit 104, and the read control unit 114 are devices commonly used in the prior art, and other devices are devices added to implement the embodiments of the present invention.
  • the embodiment of the invention overcomes the characteristics of low utilization rate of fixed partition space, high link fragmentation and low performance in the prior art, and is an adaptive storage space allocation scheme, which can be automatically adjusted according to the actual service type.
  • the storage structure greatly improves space utilization and storage performance. And layering to make sure that the complexity does not divergence due to adjustments.
  • the adjustment refers to: 1): merging and down-decomposing for storage granularity only for maximum and minimum storage units, regardless of storage granularity adjustment between the largest and smallest storage units, that is, not requiring all storage granularities Freely change, so that the complexity is reduced relative to the change of all storage granularity, and the final effect is the same as that of all storage granularity; 2): When combining decomposition, use 2 (odd) , even) storage granularity for merging and decomposition, but not limited to this way, it is also possible to consider the case of merging and decomposing with storage granularity of other values such as 3, 4, 5 and so on.
  • the embodiment of the present invention selects to merge and decompose with 2 (odd, even) storage granularity, which is an optimal implementation manner, and is combined and decomposed with respect to the storage granularity of other values such as 3, 4, 5, etc.
  • 2 (odd, even) storage granularity which is an optimal implementation manner, and is combined and decomposed with respect to the storage granularity of other values such as 3, 4, 5, etc.
  • the speed of adjustment on the surface is much faster, in fact, the complexity index increases, and after the system runs for a certain period of time, after the random storage units are randomly distributed, the efficiency of combining and decomposing other granularities is drastically reduced, and the efficiency of the combined decomposition is finally Storage
  • An application example of the method in the embodiment of the present invention in the case of performing a write operation includes the following steps: Step 201: Issue a write request, and register and write a request in the read/write queue.
  • Step 202 The write control unit reads the application of the read/write queue, obtains the header information of the data packet, and simultaneously reads the spatial division information, the type and number of the idle pointer queue, and the basic storage in each type of pointer queue through the total control unit.
  • the size of the unit based on the packet length calculation, selects the basic storage unit in the storage space.
  • Step 203 Select a pointer queue that is similar to the packet length, and determine whether the storage space is idle. If idle, apply for a pointer of the pointer queue. If the pointer queue is not idle, update the other pointer queue to determine whether it is idle. If the pointer queue is not free, the write operation is suspended.
  • Step 204 Obtain the earliest idle pointer from the original idle address pointer queue. If the current state is normal, or the space is down-decomposed, the pointer is sent to the write control unit, and the write control unit calculates the storage address according to the pointer, and executes Counting write operations. Then, the length of the packet header is subtracted from the size of the storage space indicated by the current pointer. If the result is a positive number, the length of the packet header is updated, and the process proceeds to step 203 until the length of the updated header is non-positive.
  • Step 205 If the current space is merged up, the pointer obtained from the original free address pointer queue is first decoded by the address decoding unit to determine whether the address indicated by the current pointer belongs to the spatial merged area. If not, Then, the normal operation of step 204 is performed, otherwise, it is sent to the parity decision unit for parity determination. If the pointer is odd, it is sent to the write control unit for normal write operation. If it is even, it is sent to the parity state space, and the state of the corresponding space of the current pointer is updated. The status flag is idle.
  • Step 206 After a data packet is stored, the packet first address pointer is registered in the read/write queue 103 for subsequent read indexing.
  • Step 207 after the data packet is stored, after a period of time, the external sends the message to the read/write queue. After reading the application, the read/write queue inputs the first address of the stored data packet to the read control unit for subsequent processing.
  • Step 301 The read control unit directly calculates the data space stored by the data packet through the pointer, and reads the corresponding header data and the linked list information.
  • Step 302 After the reading operation is completed in step 301, the storage space corresponding to the original storage package data needs to be released, and the registration is performed in the idle pointer queue, and other subsequent data packets are used later.
  • Step 303 After a period of time, the data packet has a read requirement.
  • the external operation source registers the read datagram request with the read/write queue.
  • the read/write queue spits out the pointer stored in step 302 and sends it to the read control unit to assist in the read operation.
  • Step 304 The read control unit calculates an address of the data storage according to the obtained pointer, and performs an operation of reading the data and the linked list header. After all the data has been read, the current pointer is sent to the merge pointer unit for subsequent operations.
  • Step 305 The step header information obtained by the step 304 is parsed to determine whether the data packet is read. If the data packet is not read, the new pointer information is raised according to the link header, and step 304 is repeated.
  • Step 306 The merge pointer unit receives the pointer of the space to be released sent by the read control unit, and determines whether the current pointer belongs to the spatial upward merge range. If not, the pointer does not process the direct output. It belongs to the scope of consolidation. According to the size of the storage space corresponding to the current pointer, it is judged whether the current pointer is a pre-merger pointer or a merged pointer, and the merged pointer is directly output. The pointer before the combination determines whether the pointer is an odd pointer or an even pointer. The even pointer does not process the direct output. The odd pointer reads the parity state space and checks the matching even pointer state. If the matched even pointer is idle, the merge pointer succeeds. Otherwise, the merge pointer succeeds. unsuccessful.
  • Step 307 Receive the idle pointer sent by the merge pointer unit, and send the pointer to the corresponding pointer queue according to the master control unit.
  • Each of the pointer queues has its own corresponding address range. Except for the failed merge pointer, all pointers are stored in the respective pointer queues by address range. Merger The failed pointer is stored in the original pointer queue, and the merged successful pointer is stored in the merge pointer queue.
  • the embodiments of the present invention belong to the field of digital storage, and are applicable to various electronic storage devices, and are particularly suitable for data storage processing in the field of communications.
  • the embodiment of the present invention has the following beneficial effects:
  • the utilization of the storage space is high, and since it can be dynamically adjusted, the storage space sharing scheme of the existing fixed basic unit, for example, the maximum packet minimum packet in the data stream is different by several orders of magnitude, then the implementation of the present invention is adopted. For example, space utilization has several orders of magnitude improvement over existing solutions, while performance remains essentially unchanged.
  • the comprehensive storage performance of the storage space is high. Compared with the existing linked list sharing method, as the processing time is lengthened, the higher the performance improvement ratio, the final performance can be improved by several tens of times, and the space utilization ratio is also slightly smaller than the existing scheme. high.
  • the migration of the corresponding pointer is selected according to the service type of the data to adjust the storage junction. Constructing, adaptively allocating storage space, reading the corresponding pointer in the case of a write operation, determining whether the state of the storage space is a non-spatial upward merge state according to the status indication, and if so, finding a corresponding storage space according to the read pointer and executing Data write operation, if no, perform pointer parity judgment. According to the embodiment of the present invention, since the storage space can be adaptively allocated, the comprehensive performance of the storage space and the utilization ratio of the storage space are improved compared with the prior art.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

Disclosed are a storage method and a read-write storage device which are applied to wireless communications. The method comprises: according to the type of service of data, selecting the migration of a corresponding pointer to adjust a storage structure; adaptively allocating a storage space, reading the corresponding pointer in the case of a write operation; according to a state indication, judging whether the state of the storage space is a non-spatial upward merge state; and if yes, finding a corresponding storage space according to the read pointer and executing a data write operation; otherwise conducting pointer parity judgment. The present invention is applied to improve the comprehensive performance of a storage space and the utilization rate of the storage space.

Description

一种应用于无线通讯的存储方法及读写存储装置 技术领域  Storage method and read/write storage device applied to wireless communication
本发明涉及存储技术, 尤其涉及一种应用于无线通讯的存储方法及读 写存储装置。 背景技术  The present invention relates to storage technology, and more particularly to a storage method and a read/write storage device for wireless communication. Background technique
在通信领域, 常常有多个数据端口要发送、 接收处理数据包, 涉及多 个操作源与存储装置的交互。 常见的处理方式是把这些操作源的读写操作, 细分成多个读写队列与存储装置进行交互。  In the field of communications, there are often multiple data ports to send and receive processing packets, involving multiple sources of operation and storage device interaction. A common way of processing is to subdivide the read and write operations of these operating sources into multiple read and write queues to interact with the storage device.
存储中数据空间如何分配涉及到整个存储装置的性能, 成本等多方面 因素。 常见的现有的存储分配方案有如下几种:  How the data space is allocated in the storage involves many factors such as the performance and cost of the entire storage device. Common existing storage allocation schemes are as follows:
一: 固定分配法。 对每个队列固定分配一片存储空间。 每个队列独享 所分配的存储空间, 不与其它队列的存储空间交互, ***控制简单, 但是 存储空间利用率低。 由于通讯的不确定性, 有可能某个队列只有少量数据, 存储空间大量空闲, 另外一个队列有大量的数据, 存储空间不够适用, 但 是由于采用固定的分配方式, 队列之间的存储空间不能交互, 因此存储空 间承载不均, 导致存储空间利用率较低。  One: Fixed distribution method. A storage space is fixedly allocated to each queue. Each queue has exclusive storage space allocated, does not interact with the storage space of other queues, and has simple system control, but low storage space utilization. Due to the uncertainty of communication, it is possible that a queue has only a small amount of data, a large amount of storage space is idle, and another queue has a large amount of data, and the storage space is not suitable. However, due to the fixed allocation method, the storage space between the queues cannot be exchanged. Therefore, the storage space is unevenly distributed, resulting in low storage space utilization.
二: 直接共享存储法。 所有队列共享一片、 大的存储空间, 所有的队 列对这片空间都有读写权限。 由于各个队列, 队列的到达时间是不一样的, 每个队列的读取时间也是不确定的, 因此过一段时间后, 整个存储空间空 闲空间不连续, 不容易找到一段连续足够长的存储空间给新的队列分配任 务, 导致存储空间利用率也不高。  Two: Direct shared storage method. All queues share a large, large storage space, and all queues have read and write access to this space. Due to the different queues, the arrival time of the queue is different. The read time of each queue is also uncertain. Therefore, after a period of time, the entire storage space is not continuous, and it is not easy to find a storage space that is long enough for the storage space. The new queue allocation task results in low storage space utilization.
三: 链表共享存储方法。 针对以上第二种方式, 不容易找到一片连续 足够长的空间, 采用链表方式。 釆用链表方式, 可以把不连续的空闲空间 链接起来提供给大数据包进行使用。 使用链表方式, 经过一段时间的数据 处理后, 空闲存储空间碎片将变得足够小, 但是链表的长度将变得足够长, 这将导致存储装置性能急剧下降, 存储空间利用率也会大幅下降。 Three: linked list shared storage method. For the second method above, it is not easy to find a space that is long enough for a long time, using a linked list method.釆Use the linked list method to put discontinuous free space Linked up for use in large data packets. Using a linked list approach, after a period of data processing, the free storage space fragmentation will become small enough, but the length of the linked list will be long enough, which will result in a sharp decline in storage performance and a significant reduction in storage space utilization.
四: 固定基本单元共享法。 在共享空间内, 按最大包的长度开辟基本 存储单元, 每个数据包占用一个基本存储单元。 此种方法性能高, 但是空 间利用率也低。  Four: Fixed basic unit sharing method. In the shared space, basic storage units are opened according to the maximum packet length, and each data packet occupies one basic storage unit. This method has high performance but low space utilization.
综上所述, 釆用现有的存储技术, 针对多源共享技术, 虽然每个方案 都各有局部优势, 但是, 综合起来都有明显的限制, 不能兼顾各方面的优 势, 例如有的存储空间利用率极其低下, 有的在存储性能上很难接受。 并 且都只适应指定的固定业务类型, 从而一旦业务类型发送变化, 综合性能 存储空间利用率就可能发生不可控的指数下降。 发明内容  In summary, using existing storage technologies, for multi-source sharing technologies, although each solution has its own local advantages, there are obvious limitations in combination, and it is impossible to take into account various advantages, such as some storage. Space utilization is extremely low, and some are difficult to accept in terms of storage performance. And they only adapt to the specified fixed service type, so that once the service type changes, the comprehensive performance storage space utilization may experience an uncontrollable exponential decline. Summary of the invention
有鉴于此, 本发明实施例的主要目的在于提供一种应用于无线通讯的 存储方法及读写存储装置, 提高了存储空间的综合性能和存储空间的利用 率。  In view of this, the main purpose of the embodiments of the present invention is to provide a storage method and a read/write storage device for wireless communication, which improves the comprehensive performance of the storage space and the utilization rate of the storage space.
为达到上述目的, 本发明实施例的技术方案是这样实现的:  To achieve the above objective, the technical solution of the embodiment of the present invention is implemented as follows:
一种应用于无线通讯的存储方法, 该方法包括:  A storage method applied to wireless communication, the method comprising:
根据数据的业务类型选择对应指针的迁移来调整存储结构, 自适应分 配存储空间, 在写操作情况下读取对应指针, 根据状态指示判断存储空间 的状态是否为非空间向上合并状态, 如杲是, 则根据读取的指针找到对应 的存储空间并执行数据写操作, 如果否, 则进行指针奇偶判断。  According to the service type of the data, select the migration of the corresponding pointer to adjust the storage structure, adaptively allocate the storage space, read the corresponding pointer in the case of the write operation, and determine whether the state of the storage space is a non-spatial upward merge state according to the status indication, such as Then, the corresponding storage space is found according to the read pointer and the data write operation is performed. If not, the pointer parity judgment is performed.
其中, 所述进行指针奇偶判断具体包括: 如果读取的指针是奇数指针, 则根据读取的奇数指针找到对应的存储空间并执行数据写操作; 如果读取 的指针是偶数指针, 则将读取的偶数指针送往奇偶状态空间对其进行更新, 并将偶数指针对应的状态标识设置为高。 其中, 所述奇偶状态空间中仅存储偶数指针, 所述偶数指针对应的状 态标识设置为高时, 指示所述偶数指针对应的空间为空闲; Wherein, performing the pointer parity determination specifically includes: if the read pointer is an odd pointer, finding a corresponding storage space according to the read odd pointer and performing a data write operation; if the read pointer is an even pointer, then reading The even-numbered pointer is sent to the parity state space for updating, and the state identifier corresponding to the even pointer is set to high. Wherein, the even-numbered pointer is only stored in the parity state space, and when the state identifier corresponding to the even-numbered pointer is set to be high, the space corresponding to the even-numbered pointer is idle;
每个偶数指针和与其对应的奇数指针构成一个奇偶对。  Each even pointer and its corresponding odd pointer form a parity pair.
一种应用于无线通讯的存储方法, 该方法包括: 根据数据的业务类型 选择对应指针的迁移来调整存储结构, 自适应分配存储空间, 在读操作情 况下读取对应指针找到对应的存储空间并执行数据读操作, 读取完毕后对 读取的指针对应空间进行释放, 如果根据状态指示判断存储空间的状态为 空间向上合并状态, 则进行指针奇偶判断。  A storage method applied to wireless communication, the method comprises: selecting a migration of a corresponding pointer according to a service type of the data to adjust a storage structure, adaptively allocating a storage space, reading a corresponding pointer in a read operation condition, finding a corresponding storage space, and executing The data read operation releases the corresponding space of the read pointer after the reading is completed. If the state of the storage space is determined to be the spatial upward merge state according to the state indication, the pointer parity judgment is performed.
其中, 所述进行指针奇偶判断具体包括: 如果读取的指针是偶数指针, 则对其不做处理; 如果读取的指针是奇数指针, 则在奇偶状态空间查询是 否存在与所述奇数指针匹配的偶数指针, 如果存在匹配的偶数指针且偶数 指针对应的状态标识设置为高, 则进行奇偶指针合并。  The performing the pointer parity determination specifically includes: if the read pointer is an even pointer, it does not process; if the read pointer is an odd pointer, whether the parity state space query exists and matches the odd pointer The even pointer, if there is a matching even pointer and the state identifier corresponding to the even pointer is set to high, the parity pointer is merged.
其中, 所述奇偶状态空间中仅存储偶数指针, 所述偶数指针对应的状 态标识设置为高时, 指示所述偶数指针对应的空间为空闲;  Wherein, the even-numbered pointer is only stored in the parity state space, and when the state identifier corresponding to the even-numbered pointer is set to be high, the space corresponding to the even-numbered pointer is idle;
每个偶数指针和与其对应的奇数指针构成一个奇偶对。  Each even pointer and its corresponding odd pointer form a parity pair.
其中, 该方法还包括: 如果释放的是所述奇偶对中奇数指针对应的奇 空间, 则所述奇偶对中偶数指针对应的偶空间与所述奇空间一起共同释放, 将两个存储空间同时向上合并为一个地址连续的存储空间。  The method further includes: if the odd space corresponding to the odd pointer in the parity pair is released, the even space corresponding to the even pointer in the parity pair is released together with the odd space, and the two storage spaces are simultaneously Merged up into a contiguous storage space.
其中, 进行奇偶指针合并后, 奇偶指针合并后的新指针对应奇偶空间 的大小为: 奇偶对中奇数指针对应的原奇空间与偶数指针对应的原偶空间 之和。  After the parity pointer is merged, the size of the parity space corresponding to the new pointer merged by the parity pointer is: the sum of the original odd space corresponding to the odd pointer and the original even space corresponding to the even pointer.
其中, 该方法还包括: 如果根据状态指示判断存储空间的状态为空间 向下分解状态, 则将读取的一个指针分解为奇数指针和与其对应的偶数指 针, 实现空间向下分解;  The method further includes: if the state of the storage space is determined to be a spatial downward decomposition state according to the state indication, the read pointer is decomposed into an odd pointer and an even pointer corresponding thereto, thereby realizing spatial downward decomposition;
相应的, 读取的指针对应的原空间的大小分为两部分, 奇数指针对应 的奇空间与偶数指针对应的偶空间各占原空间大小的一半。 Correspondingly, the size of the original space corresponding to the read pointer is divided into two parts, and the odd pointer corresponds to The even spaces corresponding to the odd spaces and the even pointers each account for half of the original space.
一种读写存储装置, 该装置包括: 总控单元、 多路选择单元、 奇偶判 决单元; 其中,  A read/write storage device, comprising: a total control unit, a multiplexing unit, and a parity determining unit; wherein
总控单元, 配置为控制多路选择单元根据数据的业务类型选择对应指 针的迁移来调整存储空间的存储结构, 自适应分配存储空间;  The control unit is configured to control the multiplex selection unit to select a migration of the corresponding pointer according to the service type of the data to adjust the storage structure of the storage space, and adaptively allocate the storage space;
多路选择单元, 配置为业务类型为与已有存储结构相适应的数据包时, 对应选择原始空闲指针队列; 业务类型为超出已有存储结构的大数据包时, 对应选择合并空闲指针队列; 业务类型为低于已有存储结构的小数据包时, 指针分解后对应选择分解空闲指针队列;  When the service type is a data packet that is compatible with the existing storage structure, the original idle pointer queue is selected correspondingly; when the service type is a large data packet that exceeds the existing storage structure, the merged idle pointer queue is selected correspondingly; When the service type is a small data packet lower than the existing storage structure, the pointer is decomposed and correspondingly decomposes the idle pointer queue;
奇偶判决单元, 配置为在所述总控单元控制的存储空间的工作状态为 空间向上合并状态时, 进行指针奇偶判断。  The parity decision unit is configured to perform a pointer parity judgment when the working state of the storage space controlled by the master control unit is a spatial upward merge state.
其中, 所述存储空间的工作状态具体包括: 正常状态、 空间向下分解 状态或空间向上合并状态。  The working state of the storage space specifically includes: a normal state, a spatial downward decomposition state, or a spatial upward merge state.
其中, 该装置还包括: 地址译码单元, 配置为所述工作状态为空间向 上合并状态时, 判断读取的指针所指示的地址是否属于空间合并的区域, 属于空间合并的区域时, 将读取的指针发往所述奇偶判决单元。  The device further includes: an address decoding unit configured to determine whether the address indicated by the read pointer belongs to a spatial merged area when the working state is a spatial upward merged state, and when the spatial merged area belongs to the spatial merged area, the device reads The fetched pointer is sent to the parity decision unit.
其中, 所述奇偶判决单元, 进一步配置为在写操作情况下, 对从所述 地址译码单元获取的指针进行奇偶判断时, 读取的指针是奇数指针, 根据 读取的奇数指针找到对应的存储空间并执行数据写操作; 如果读取的指针 是偶数指针, 将读取的偶数指针送往奇偶状态空间对其进行更新, 并将偶 数指针对应的状态标识设置为高。  The parity decision unit is further configured to, when a parity operation is performed on a pointer acquired from the address decoding unit in a write operation, the read pointer is an odd pointer, and the corresponding pointer is found according to the read odd pointer. Stores the space and performs a data write operation; if the read pointer is an even pointer, the read even pointer is sent to the parity state space for updating, and the state identifier corresponding to the even pointer is set to high.
其中, 所述奇偶判决单元, 进一步配置为在读操作情况下, 读取的指 针是偶数指针, 对其不做处理; 读取的指针是奇数指针, 则在奇偶状态空 间查询是否存在与所述奇数指针匹配的偶数指针, 如果存在匹配的偶数指 针且偶数指针对应的状态标识设置为高, 则通知合并指针单元进行奇偶指 针合并。 The parity decision unit is further configured to: in the case of a read operation, the read pointer is an even pointer, and no processing is performed; if the read pointer is an odd pointer, whether the parity state space exists and the odd number is queried The even pointer of the pointer match, if there is a matching even pointer and the state identifier corresponding to the even pointer is set to high, the merge pointer unit is notified to perform the parity index The needle merges.
其中, 所述奇偶状态空间中仅存储偶数指针, 所述偶数指针对应的状 态标识设置为高时, 指示所述偶数指针对应的空间为空闲; 每个偶数指针 和与其对应的奇数指针构成一个奇偶对。  Wherein, the even-numbered pointer is only stored in the parity state space, and when the state identifier corresponding to the even-numbered pointer is set to be high, the space corresponding to the even-numbered pointer is idle; each even-numbered pointer and its corresponding odd-numbered pointer constitute a parity Correct.
其中, 该装置还包括: 指针分解单元, 配置为所述工作状态为空间向 下分解状态时, 将读取的一个指针分解为奇数指针和与其对应的偶数指针, 实现空间向下分解。  The device further includes: a pointer decomposition unit configured to decompose the read pointer into an odd pointer and an even pointer corresponding thereto when the working state is a spatial downward decomposition state, to implement space down decomposition.
本发明实施例根据数据的业务类型选择对应指针的迁移来调整存储结 构, 自适应分配存储空间, 在写操作情况下读取对应指针, 根据状态指示 判断存储空间的状态是否为非空间向上合并状态, 如果是, 则根据读取的 指针找到对应的存储空间并执行数据写操作, 如果否, 则进行指针奇偶判 断。  In the embodiment of the present invention, the storage structure is adjusted according to the service type of the data, the storage structure is adjusted, the storage space is adaptively allocated, the corresponding pointer is read in the case of a write operation, and the state of the storage space is determined to be a non-spatial upward merge state according to the status indication. If yes, the corresponding storage space is found according to the read pointer and the data write operation is performed. If not, the pointer parity judgment is performed.
现有技术是根据固定的数据业务类型预先设置存储结构, 无法后续动 态调整, 而釆用本发明实施例, 由于能自适应分配存储空间, 因此, 对比 现有技术, 提高了存储空间的综合性能和存储空间的利用率。 附图说明  The prior art is to pre-set the storage structure according to the fixed data service type, and cannot be dynamically adjusted later. However, according to the embodiment of the present invention, since the storage space can be adaptively allocated, the overall performance of the storage space is improved compared with the prior art. And storage space utilization. DRAWINGS
图 1为本发明方法实施例在写操作情况下的实现流程图;  1 is a flowchart of an implementation of a method in a write operation according to an embodiment of the method of the present invention;
图 2为本发明方法实施例在读操作情况下的实现流程图;  2 is a flow chart showing an implementation of a method in a read operation according to an embodiment of the present invention;
图 3为本发明装置实施例的组成结构示意图。 具体实施方式  FIG. 3 is a schematic structural diagram of an embodiment of a device according to the present invention. detailed description
在本发明实施例中: 根据数据的业务类型选择对应指针的迁移来调整 存储结构, 自适应分配存储空间, 在写操作情况下读取对应指针, 4艮据状 态指示判断存储空间的状态是否为非空间向上合并状态, 如杲是, 则根据 读取的指针找到对应的存储空间并执行数据写操作, 如果否, 则进行指针 奇偶判断。 In the embodiment of the present invention, the storage structure is adjusted according to the service type of the data, the storage structure is adjusted, the storage space is adaptively allocated, and the corresponding pointer is read in the case of a write operation, and the status of the storage space is determined according to the status indication. Non-spatial up state, if 杲, then find the corresponding storage space according to the read pointer and perform data write operation, if not, then perform pointer Parity judgment.
本发明实施例是应用于无线通讯多数据源读写操作的存储方案, 主要 涉及指针分类管理, 总共指针分为三类, 合并指针, 原始指针, 分解指针。 每个空间在读取完毕后, 需要把对应的空间释放, 把空间对应的指针递交 到指针管理中心。 通过三类指针的迁移, 实现存储空间的动态调整, 当大 量的指针往合并指针区域迁移时, 需要进行指针合并操作, 存储空间基本 单元变大, 大单元变多, 适应于大数据包存储; 当大量指针往分解指针区 域迁移, 需要进行指针分解操作, 存储空间基本单元变小, 小单元变多, 适应小数据包存储; 当指针大量往原始指针迁移, 不需要额外对指针进行 处理, 当前存储结构适应当前数据包结构, 数据存储不需要变化。  The embodiment of the invention is a storage scheme applied to a multi-data source read/write operation of a wireless communication, and mainly relates to pointer classification management. The total pointers are divided into three categories, a merge pointer, a raw pointer, and a decomposition pointer. After each space is read, the corresponding space needs to be released, and the pointer corresponding to the space is delivered to the pointer management center. Through the migration of three types of pointers, the dynamic adjustment of the storage space is realized. When a large number of pointers migrate to the merged pointer area, a pointer merge operation is required, the basic unit of the storage space becomes large, and the large unit becomes large, which is suitable for large data packet storage; When a large number of pointers migrate to the decomposition pointer area, a pointer decomposition operation is required, the basic unit of the storage space becomes smaller, the small unit becomes larger, and the small data packet is accommodated. When the pointer migrates to the original pointer, no additional pointer processing is required. The storage structure adapts to the current packet structure and the data store does not need to change.
下面结合附图对技术方案的实施作进一步的详细描述。  The implementation of the technical solution will be further described in detail below with reference to the accompanying drawings.
本发明实施例方法的技术方案如下, 主要分读、 写两个方面:  The technical solution of the method of the embodiment of the present invention is as follows, and mainly reads and writes two aspects:
一、 写操作情况下, 本发明实施例存储方法的方法实施例如图 1所示, 包括以下内容:  1. In the case of a write operation, the method implementation of the storage method in the embodiment of the present invention is as shown in FIG. 1, and includes the following contents:
第一步: 从写队列里获取写请求, 发起对存储空间的写请求申请。 第二步: 根据申请的包长, 选择一种最适应的存储单元给当前数据包。 这里, 本步驟进行存储单元的选择采用的是比较法, 选择跟包长最接 近的两类存储单元, 并向下取整。 比如有四类存储单元, 大小分别, 64, 128, 256, 512。 当前包长为 384, 则最接近的存储单元为 256和 512, 然 后向下取整, 最后选择 256的存储单元, 进行第一次存储操作。  Step 1: Get a write request from the write queue and initiate a write request to the storage space. Step 2: According to the packet length of the application, select the most suitable storage unit for the current data packet. Here, the selection of the storage unit in this step uses a comparison method, selecting two types of storage units closest to the packet length, and rounding down. For example, there are four types of storage units, respectively, size, 64, 128, 256, 512. The current packet length is 384, and the closest memory location is 256 and 512, then rounded down, and finally 256 memory cells are selected for the first memory operation.
第三步: 如果分配的存储单元没有空闲空间, 则返回第二步, 重新分 配存储单元。  Step 3: If there is no free space in the allocated storage unit, return to the second step to reassign the storage unit.
第四步: 访问存储单元对应的空闲指针队列, 读取对应指针。 这里, 所述空闲指针队列包括: 分解空闲地址指针队列、 合并空闲地址指针队列 及原始空闲地址指针队列。 第五步: 根据状态指示,判断当前的状态是否为空间向上合并状态(当 前最大的基本存储单元扩大)。 Step 4: Access the free pointer queue corresponding to the storage unit and read the corresponding pointer. Here, the idle pointer queue includes: a decomposed idle address pointer queue, a merged free address pointer queue, and an original free address pointer queue. Step 5: According to the status indication, determine whether the current state is a spatial upward merge state (the current largest basic storage unit is expanded).
这里,本步骤的向上合并状态根据包长的分布来判断,如果大部分(可 配置)最大包比最大存储单元大, 则进行最大存储单元向上合并操作; 或 者, 大部分最小包比最小存储单元大, 则进行最小存储单元向上合并。  Here, the upward merged state of this step is judged according to the distribution of the packet length. If the majority (configurable) maximum packet is larger than the largest storage unit, the maximum storage unit is merged upward; or, the majority of the minimum packet is smaller than the minimum storage unit. Large, then the minimum storage unit is merged upwards.
第六步: 如果为非空间向上合并状态, 则根据指针找到对应的存储空 间。  Step 6: If the state is merged in a non-spatial direction, the corresponding storage space is found according to the pointer.
第七步: 如果为空间向上合并状态, 则判断指针奇偶, 如果指针是奇 数, 则根据指针, 找到对应的存储空间。 如果指针是偶数, 则更新奇偶状 态空间, 抛弃此指针。  Step 7: If the space is merged upward, the pointer parity is judged. If the pointer is an odd number, the corresponding storage space is found according to the pointer. If the pointer is even, update the parity state space and discard the pointer.
这里, 本步骤的奇偶状态空间, 表示的是向上合并的存储单元类别为 所有偶指针对应空间的空满状态。 如果读取此类存储单元的时候, 所获取 的指针为偶数, 则在奇偶空间中, 把这个指针对应的空间标注为空闲状态。 当在执行读操作的时候, 如果释放的是这个奇偶对中的奇空间时候, 可以 跟偶空间一起共同释放, 同时将共同释放的空间一起向上合并。  Here, the parity state space of this step indicates that the upwardly merged storage unit class is an empty state of all even pointer corresponding spaces. If the obtained pointer is an even number when reading such a storage unit, the space corresponding to the pointer is marked as an idle state in the parity space. When a read operation is performed, if the odd space in the parity pair is released, it can be released together with the even space, and the jointly released spaces are merged together.
第八步: 在对应存储空间内进行数据存储, 更新包长。  Step 8: Data storage in the corresponding storage space, update the packet length.
第九步: 对更新的包长进行判断, 如果是零, 则结束写操作, 否则跳 转到第二步, 进行剩余数据包的存储。  Step 9: Determine the updated packet length. If it is zero, end the write operation. Otherwise, skip to the second step to store the remaining packets.
二、 读操作情况下, 本发明实施例存储方法的方法实施例如图 2所示, 包括以下内容:  2. In the case of a read operation, the method implementation of the storage method in the embodiment of the present invention is as shown in FIG. 2, and includes the following contents:
第一步: 从读队列, 获取读指针, 发起对存储空间的读请求。  The first step: from the read queue, get the read pointer, initiate a read request to the storage space.
第二步: 根据读指针, 寻找到对应的存储空间和链表, 进行数据读取。 读取数据完毕后, 进行读指针对应空间的释放管理。  The second step: According to the read pointer, find the corresponding storage space and linked list, and read the data. After the data is read, the release management of the space corresponding to the read pointer is performed.
第三步: 根据状态指示, 判断当前的状态是否为空间向上合并状态, 如果是, 并且当前指针是奇指针, 并且奇偶状态空间中对应的偶指针对应 空间是空闲, 则进行奇偶指针合并。 新指针对应奇偶空间, 大小为原来的 两倍, 实现了空间向上合并。 Step 3: According to the status indication, determine whether the current state is a spatial upward merge state, if yes, and the current pointer is an odd pointer, and the corresponding even pointer in the parity state space corresponds If the space is idle, then the parity pointer is merged. The new pointer corresponds to the parity space, which is twice the size, and achieves spatial up-combination.
第四步: 根据指针对应的地址和总控状态, 选择对应的空闲指针队列。 这里, 所述空闲指针队列包括: 分解空闲地址指针队列、 合并空闲地址指 针队列及原始空闲地址指针队列。  Step 4: Select the corresponding free pointer queue according to the address corresponding to the pointer and the total control state. Here, the idle pointer queue includes: a decomposed idle address pointer queue, a merged free address pointer queue, and an original free address pointer queue.
第五步: 如果选择的当前指针队列是处理空间分解区域, 则执行指针 分解, 把一个指针分解成奇偶指针, 每个指针对应的空间为原来空间的一 半, 完成空间向下分解。  Step 5: If the selected current pointer queue is the processing space decomposition area, the pointer decomposition is performed, and a pointer is decomposed into parity pointers, and the space corresponding to each pointer is half of the original space, and the completion space is decomposed downward.
第六部: 进行指针存储, 并根据第二步获取的链表信息, 判断是否是 链表結束, 如果为是, 则结束, 如果为否, 还没结束, 则跳转到第二步执 行。  Part 6: Perform pointer storage, and judge whether it is the end of the linked list according to the linked list information obtained in the second step. If yes, it ends. If it is not, if it is not finished, it jumps to the second step.
这里, 上述第五步各个指针队列有各自自己的地址空间映射。  Here, each of the pointer queues in the fifth step described above has its own address space mapping.
例如设置整体空间是 1-1000。 刚开始时候只有一个指针队列, 设置每 个指针对应 10个地址空间, 所有指针都存储到这个指针队列。  For example, the overall space is set to 1-1000. At the beginning, there is only one pointer queue. Each pointer is set to 10 address spaces, and all pointers are stored in this pointer queue.
如果 500-1000执行空间向上合并, 那么整体将变成 2个指针队列。 第 一个队列对应指针 1-500的指针, 每个指针对应空间 10。 第二个指针队列 对应 501-1000的指针, 每个指针对一个空间 20。  If the 500-1000 execution space is merged upwards, then the whole will become 2 pointer queues. The first queue corresponds to a pointer of 1-500, and each pointer corresponds to space 10. The second pointer queue corresponds to a pointer of 501-1000, and each pointer is to a space of 20.
接着 1-255执行空间向下分解,那么整体将变成 3个指针队列。第一个 指针队列对应 1 -255的, 没个指针对应空间为 5。 第二指针队列为 256-500, 每个指针对应空间为 10。 第三个指针队列位 501-1000, 每个指针对应空间 为 20。  Following 1-255 execution space down decomposition, the whole will become 3 pointer queues. The first pointer queue corresponds to 1 - 255, and no pointer corresponds to space 5. The second pointer queue is 256-500, and each pointer has a corresponding space of 10. The third pointer queue is 501-1000, and each pointer has a space of 20.
对应于上述读 /写操作, 本发明实施例读写存储装置实施例的组成结构 示意图如图 3所示, 包括:  Corresponding to the above-mentioned read/write operation, a schematic structural diagram of an embodiment of the read-write storage device according to the embodiment of the present invention is shown in FIG. 3, and includes:
存储空间 101 : 为存储数据的主空间, 可以使用双数据速率 DDR存储 器, 也可以使用片内 SRAM等各种存储器件, 其中, 所述 SRAM为具有静 止存取功能的内存。 The storage space 101: is a main space for storing data, and may use a double data rate DDR memory, or may use various storage devices such as an on-chip SRAM, wherein the SRAM has a static The memory of the access function.
总控单元 102: 为进行存储控制的总控单元, 用来进行存储空间的整体 调度控制。 如用来控制存储空间的工作状态 正常状态, 空间向上合并 状态(同时记录合并前后基本存储单元的空间尺寸),空间向下分解状态(同 时记录空间分解前后基本存储单元的空间尺寸), 4艮据状态指示, 用于在指 针释放时候, 指针合并和分解的控制; 多路选通控制; 存储空间分配选择; 记录各个指针队列的地址空间范围, 把释放的空间指针存储到对应的队列 里去。 这里, 存储空间的每片存储区域都有一个对应的指针队列, 但是这 片区域的地址范围随着空间向上合并向下分解的进行也是不断变化的, 因 此需要总控单元记录当前各个指针队列的地址范围, 以方便空间#放时候, 指针的入队操作。  The main control unit 102: is used for the overall control unit of the storage control, and is used for overall scheduling control of the storage space. For example, it is used to control the working state of the storage space, the space is merged upward (the spatial size of the basic storage unit before and after the merge is recorded), and the space is decomposed downward (the spatial size of the basic storage unit before and after the spatial decomposition is recorded), 4艮According to the status indication, the control for pointer merging and decomposing when the pointer is released; multi-way gating control; storage space allocation selection; recording the address space range of each pointer queue, storing the released space pointer in the corresponding queue . Here, each storage area of the storage space has a corresponding pointer queue, but the address range of the area is constantly changing as the space is merged downwardly, so the master control unit needs to record the current pointer queues. The address range, in order to facilitate the space # put, the pointer into the team operation.
读写队列 103: 存储外部操作源对存储空间的读写请求队列。  Read-Write Queue 103: Stores the read and write request queue of the external operation source to the storage space.
写控制单元 104: 为存储空间的写控制单元, 配置为向存储空间 101写 入数据。  Write Control Unit 104: A write control unit that is a storage space configured to write data to the storage space 101.
分解空闲地址指针队列 105, 合并空闲地址指针队列 107, 原始空闲地 址指针队列 108, 分别为各类空闲存储空间对应的指针队列, 其中队列的个 数是动态调整的, 可以增加也可以减少。 这里需要指出的是: 釆用分解空 闲地址指针队列 105 时, 对应存储空间的工作状态为空间向下分解, 执行 指针分解操作, 此操作适用的业务类型为小数据包存储; 采用合并空闲地 址指针队列 107 时, 对应存储空间的工作状态为空间向上合并, 执行指针 合并操作, 此操作适用的业务类型为大数据包存储; 釆用原始空闲地址指 针队列 108 时, 对应存储空间的工作状态为正常, 执行原始指针操作, 此 操作适用的业务类型为无需动态调整、 与当前存储结构适应的当前数据包。  The free address pointer queue 105 is decomposed, and the free address pointer queue 107 is merged. The original idle address pointer queue 108 is a pointer queue corresponding to each type of free storage space, wherein the number of queues is dynamically adjusted, and may be increased or decreased. It should be pointed out here: When decomposing the free address pointer queue 105, the working state of the corresponding storage space is spatially decomposed downward, and the pointer decomposition operation is performed. The service type applicable to this operation is small packet storage; the combined free address pointer is adopted. In queue 107, the working state of the corresponding storage space is spatially merged, and the pointer merge operation is performed. The service type applicable to this operation is large data packet storage. When the original free address pointer queue 108 is used, the working state of the corresponding storage space is normal. , the original pointer operation is performed, and the service type applicable to this operation is the current data packet that does not need to be dynamically adjusted and adapted to the current storage structure.
指针分解单元 106: 为需执行指针分解操作, 即当执行空间向下分解的 时候, 将原存储空间对应的指针分解成奇、 偶两个指针, 分别对应原存储 空间的前半部的存储空间和后半部的存储空间。 The pointer decomposition unit 106: in order to perform a pointer decomposition operation, that is, when the execution space is decomposed downward, the pointer corresponding to the original storage space is decomposed into odd and even two pointers, respectively corresponding to the original storage. The storage space of the first half of the space and the storage space of the second half.
地址译码单元 109: 为需执行指针合并操作, 即当执行空间向上合并的 时候, 原指针队列包含处于合并地址区域的指针和非合并地址区域的指针。 如果当前读取的指针属于合并地址区域, 则将读取的当前指针送往奇偶判 决单元 110进行后续空间向上合并处理, 否则直接送往写控制单元 104配 置为写操作时候的地址计算。 其中, 采用奇偶判决单元的好处是: 将存储 空间中越来越多的、 由于存储导致存储空间中变得越来越小的基本存储单 元在进行读操作时先释放, 再通过奇偶判断将释放后地址连续符合条件的 指针地址合并, 即确保存储空间中指针指向的相邻的空间基本单元地址连 续才允许合并。  Address Decoding Unit 109: In order to perform a pointer merge operation, that is, when the execution space is merged upward, the original pointer queue contains a pointer in the merged address area and a pointer to the non-merged address area. If the currently read pointer belongs to the merged address area, the read current pointer is sent to the parity decision unit 110 for subsequent spatial up-consolidation processing, otherwise it is directly sent to the write control unit 104 to configure the address calculation at the time of the write operation. Among them, the advantage of using the parity decision unit is: the more and more basic memory cells in the storage space that become smaller and smaller in the storage space due to storage are released first, and then released by parity judgment. The address addresses of consecutive consecutively qualified addresses are merged, that is, the adjacent space base unit addresses pointed to by the pointers in the storage space are consecutively allowed to be merged.
奇偶判决单元 110:送到奇偶判决单元的指针都是要参与空间向上合并 的。 由于***经过一段时间运行后, 由于原存储空间中的空闲空间地址分 别不连续的随意性, 因此在写操作时要完成空间向上合并写是很困难的, 因此进一步考虑在空间读释放的时候实现向上合并。 如果是奇指针, 则将 指针送往写控制单元 104进行正常写操作, 如果是偶指针, 则将指针送往 奇偶状态空间 111, 控制状态空间进行更新。  Parity decision unit 110: The pointers sent to the parity decision unit are all to participate in the spatial up-combination. Since the system runs after a period of time, because the free space addresses in the original storage space are not arbitrarily random, it is very difficult to complete the spatial upward merge write during the write operation. Therefore, further consideration is given to the space read release. Merge up. If it is an odd pointer, the pointer is sent to the write control unit 104 for a normal write operation. If it is an even pointer, the pointer is sent to the parity state space 111 to control the state space for updating.
奇偶状态空间 111 : 用来记录对应队列的偶指针的空闲状态。 如果奇偶 判决单元 110 输送过来一个偶指针,则此指针对应的状态标识将设置为高, 表示此指针对应的空间为空闲。 其中状态空间初始化的时候全为低。 其中 只有对大存储单元指针队列, 及其最小存储单元指针队列空间有对应的奇 数状态空间。 因此, 不管存储空间经过分解合并后, 产生多少指针队列, 最终最多有两个奇偶状态空间, 并且每个指针状态只有一比特, 总的开销 不大, 可以用寄存器搭建。  Parity state space 111 : Used to record the idle state of the even pointer of the corresponding queue. If the parity decision unit 110 delivers an even pointer, the state identifier corresponding to the pointer will be set to high, indicating that the space corresponding to the pointer is idle. When the state space is initialized, it is all low. There is only a corresponding odd state space for the large memory unit pointer queue and its minimum memory unit pointer queue space. Therefore, no matter how many pointer queues are generated after the storage space is decomposed and merged, there are at most two parity state spaces, and each pointer state has only one bit, and the total overhead is not large, and can be constructed by using registers.
多路选择单元 112: 根据总控单元的控制, 把释放的指针送往对应的队 列中去。 合并指针单元 113 :如果当前释放的空间对应的指针处于空间向上合并 对应的地址范围, 并且当前指针是奇指针, 则执行指针合并操作, 读取奇 偶状态空间 111 对应的偶指针状态, 如果偶指针状态为高, 则指针合并成 功, 合并后的指针送往合并空闲地址指针队列 107; 如果偶指针状态为低, 则指针合并失败, 当前指针输送到原始空闲地址指针队列 108。 Multiplex selection unit 112: According to the control of the master control unit, the released pointer is sent to the corresponding queue. The merge pointer unit 113: if the pointer corresponding to the currently released space is spatially merged to the corresponding address range, and the current pointer is an odd pointer, the pointer merge operation is performed, and the even pointer state corresponding to the parity state space 111 is read, if the even pointer If the state is high, the pointer merges successfully, and the merged pointer is sent to the merged free address pointer queue 107; if the even pointer state is low, the pointer merge fails, and the current pointer is delivered to the original free address pointer queue 108.
读控制单元 114: 为存储空间的写控制单元, 配置为向存储空间 101读 出数据。  Read control unit 114: A write control unit for the storage space, configured to read data to the storage space 101.
这里需要指出的是:上述存储空间 101,读写队列 103,写控制单元 104, 读控制单元 114, 为现有技术中常采用的设备, 其它设备为实现本发明实施 例而增设的设备。  It should be noted here that the storage space 101, the read/write queue 103, the write control unit 104, and the read control unit 114 are devices commonly used in the prior art, and other devices are devices added to implement the embodiments of the present invention.
采用本发明实施例, 克服了现有技术中固定划分空间利用率低, 链表 连接碎片多, 性能低的特点, 是一种自适应的存储空间分配方案, 能根据 实际业务类型的情况, 自动调整存储结构, 极大地提高了空间利用率和存 储性能。 并且分层进行调整, 确保不因调整而导致复杂度发散。 这里, 所 述调整指: 1 ): 只针对最大和最小存储单元为存储粒度向上合并和向下分 解, 不考虑最大和最小存储单元中间的存储粒度调整, 也就是说, 不需要 所有存储粒度都自由进行变化, 从而相对于所有存储粒度都自由进行变化 而言, 減少了复杂度, 并且最终达到的效果与所有存储粒度都自由进行变 化一样; 2 ): 合并分解的时候, 采用以 2 (奇, 偶)存储粒度进行合并和分 解, 但不限于这种方式, 也可以考虑以 3, 4, 5 等其他值的存储粒度进行 合并和分解的情况。 本发明实施例选择以 2 (奇, 偶)存储粒度进行合并和 分解, 是一种最佳实现方式, 相对于以 3, 4, 5 等其他值的存储粒度进行 合并和分解的情况而言, 虽然在表面上调整的速度迅速很多, 但实际上复 杂度指数上升, 并且***经过一定时间的运行后, 空闲存储单元随机分布 后, 其他粒度进行合并分解的效率急剧降低, 最终合并分解的效率及存储 效果都不如本发明实施例选用的以 2 (奇,偶)粒度进行合并和分解的方式。 本发明实施例方法在执行写操作情况下的应用实例, 包括以下步骤: 步骤 201 : 发出写申请, 并在读写队列中登记进行写申请。 The embodiment of the invention overcomes the characteristics of low utilization rate of fixed partition space, high link fragmentation and low performance in the prior art, and is an adaptive storage space allocation scheme, which can be automatically adjusted according to the actual service type. The storage structure greatly improves space utilization and storage performance. And layering to make sure that the complexity does not divergence due to adjustments. Here, the adjustment refers to: 1): merging and down-decomposing for storage granularity only for maximum and minimum storage units, regardless of storage granularity adjustment between the largest and smallest storage units, that is, not requiring all storage granularities Freely change, so that the complexity is reduced relative to the change of all storage granularity, and the final effect is the same as that of all storage granularity; 2): When combining decomposition, use 2 (odd) , even) storage granularity for merging and decomposition, but not limited to this way, it is also possible to consider the case of merging and decomposing with storage granularity of other values such as 3, 4, 5 and so on. The embodiment of the present invention selects to merge and decompose with 2 (odd, even) storage granularity, which is an optimal implementation manner, and is combined and decomposed with respect to the storage granularity of other values such as 3, 4, 5, etc. Although the speed of adjustment on the surface is much faster, in fact, the complexity index increases, and after the system runs for a certain period of time, after the random storage units are randomly distributed, the efficiency of combining and decomposing other granularities is drastically reduced, and the efficiency of the combined decomposition is finally Storage The effect is not as combined and decomposed by 2 (odd, even) granularity as selected by the embodiment of the present invention. An application example of the method in the embodiment of the present invention in the case of performing a write operation includes the following steps: Step 201: Issue a write request, and register and write a request in the read/write queue.
步骤 202: 写控制单元读取读写队列的申请, 获取数据包的包头信息, 同时通过总控单元读取空间划分信息, 空闲指针队列的种类和个数, 及其 每类指针队列中基本存储单元的大小, 根据包长计算选择存储空间中的基 本存储单元。  Step 202: The write control unit reads the application of the read/write queue, obtains the header information of the data packet, and simultaneously reads the spatial division information, the type and number of the idle pointer queue, and the basic storage in each type of pointer queue through the total control unit. The size of the unit, based on the packet length calculation, selects the basic storage unit in the storage space.
步骤 203 :选择与包长比较相近的指针队列,并判断存储空间是否空闲, 如果空闲, 则申请使用此指针队列的指针, 如果此指针队列不空闲, 则更 新采用其它指针队列, 再判断是否空闲, 如果所有指针队列都不空闲, 则 写操作暂停。  Step 203: Select a pointer queue that is similar to the packet length, and determine whether the storage space is idle. If idle, apply for a pointer of the pointer queue. If the pointer queue is not idle, update the other pointer queue to determine whether it is idle. If the pointer queue is not free, the write operation is suspended.
步骤 204: 从原始空闲地址指针队列中获取空闲最久的指针,如果当前 是正常状态, 或空间向下分解状态, 则此指针送往写控制单元, 在写控制 单元根据指针计算存储地址, 执行数椐写操作。 然后把包头长度减去当前 指针指示的存储空间的大小, 如果结果为正数, 那么更新包头长度, 跳转 到第 203步骤, 直至更新的包头长度为非正数。  Step 204: Obtain the earliest idle pointer from the original idle address pointer queue. If the current state is normal, or the space is down-decomposed, the pointer is sent to the write control unit, and the write control unit calculates the storage address according to the pointer, and executes Counting write operations. Then, the length of the packet header is subtracted from the size of the storage space indicated by the current pointer. If the result is a positive number, the length of the packet header is updated, and the process proceeds to step 203 until the length of the updated header is non-positive.
步骤 205: 如果当前为空间向上合并状态时,从原始空闲地址指针队列 获取的指针先经过地址译码单元进行地址译码, 判断当前指针所指示的地 址是否属于空间合并的区域, 如果不属于, 则执行步骤 204的正常操作, 否则输送到奇偶判决单元进行奇偶判断, 指针是奇, 则送往写控制单元进 行正常写操作, 是偶数, 则送往奇偶状态空间, 更新当前指针对应空间的 状态, 态标识为空闲。  Step 205: If the current space is merged up, the pointer obtained from the original free address pointer queue is first decoded by the address decoding unit to determine whether the address indicated by the current pointer belongs to the spatial merged area. If not, Then, the normal operation of step 204 is performed, otherwise, it is sent to the parity decision unit for parity determination. If the pointer is odd, it is sent to the write control unit for normal write operation. If it is even, it is sent to the parity state space, and the state of the corresponding space of the current pointer is updated. The status flag is idle.
步骤 206, 当一个数据包存储完毕后, 会在读写队列 103登记此数据包 首地址指针, 以供后续进行读索引。  Step 206: After a data packet is stored, the packet first address pointer is registered in the read/write queue 103 for subsequent read indexing.
步骤 207, 数据包存储完毕后, 经过一段时间后, 外部发向读写队列发 出读申请, 读写队列把之间存储的数据包首地址输入到读控制单元进行后 续处理。 Step 207, after the data packet is stored, after a period of time, the external sends the message to the read/write queue. After reading the application, the read/write queue inputs the first address of the stored data packet to the read control unit for subsequent processing.
本发明实施例方法在执行读操作情况下的应用实例, 包括以下步骤: 步骤 301 : 读控制单元直接通过指针, 计算数据包存储的数据空间, 读 取对应的包头数据及其链表信息。  The application example of the method in the embodiment of the present invention includes the following steps: Step 301: The read control unit directly calculates the data space stored by the data packet through the pointer, and reads the corresponding header data and the linked list information.
步骤 302: 在步骤 301读取操作完毕后, 需要把原存储包数据对应的存 储空间进行释放, 在空闲指针队列里进行登记, 以后后续其它数据包使用。  Step 302: After the reading operation is completed in step 301, the storage space corresponding to the original storage package data needs to be released, and the registration is performed in the idle pointer queue, and other subsequent data packets are used later.
步骤 303 : 经过一段时间后, 数据包有读需求。 外部操作源, 向读写队 列登记读数据报请求。 读写队列把步骤 302存储的指针吐出, 送往读控制 单元协助进行读操作。  Step 303: After a period of time, the data packet has a read requirement. The external operation source registers the read datagram request with the read/write queue. The read/write queue spits out the pointer stored in step 302 and sends it to the read control unit to assist in the read operation.
步骤 304: 读控制单元根据获取的指针, 计算数据存储的地址, 并进行 读取数据和链表头的操作。 在所有数据都读取完毕后, 把当前用的指针送 往合并指针单元进行后续操作。  Step 304: The read control unit calculates an address of the data storage according to the obtained pointer, and performs an operation of reading the data and the linked list header. After all the data has been read, the current pointer is sent to the merge pointer unit for subsequent operations.
步骤 305:解析步骤 304获取的链表头信息,判断数据包是否读取完毕, 如未读取完毕则根据链表头, 提起新的指针信息, 重复步骤 304。  Step 305: The step header information obtained by the step 304 is parsed to determine whether the data packet is read. If the data packet is not read, the new pointer information is raised according to the link header, and step 304 is repeated.
步骤 306: 合并指针单元接收读控制单元送过来的待释放空间的指针, 并判断当前指针是否属于空间向上合并范围, 不属于则指针不处理直接输 出。 属于合并范围, 根据当前指针对应存储空间的大小, 判断当前指针是 合并前指针, 还是合并后指针, 合并后指针则直接输出。 合并前的指针则 判断指针是奇指针还是偶指针, 偶指针不处理直接输出, 奇指针则读取奇 偶状态空间, 查看匹配的偶指针状态, 如果匹配的偶指针为空闲则合并指 针成功, 否则不成功。  Step 306: The merge pointer unit receives the pointer of the space to be released sent by the read control unit, and determines whether the current pointer belongs to the spatial upward merge range. If not, the pointer does not process the direct output. It belongs to the scope of consolidation. According to the size of the storage space corresponding to the current pointer, it is judged whether the current pointer is a pre-merger pointer or a merged pointer, and the merged pointer is directly output. The pointer before the combination determines whether the pointer is an odd pointer or an even pointer. The even pointer does not process the direct output. The odd pointer reads the parity state space and checks the matching even pointer state. If the matched even pointer is idle, the merge pointer succeeds. Otherwise, the merge pointer succeeds. unsuccessful.
步骤 307: 接收合并指针单元输送过来的空闲指针, 根据总控单元, 把 指针送到对应的指针队列。 其中每个指针队列都有各自对应的地址范围, 除合并失败的指针, 所有的指针按地址范围存储到各自的指针队列。 合并 失败的指针存储到原始指针队列, 合并成功的指针存储到合并指针队列。 步骤 308: 输送往分解指针队列的指针,根据当前指针对应存储空间的 大小, 判断当前指针是分解前指针, 还是分解后指针。 分解后的指针直接 存入指针队列, 分解前的指针, 则经过指针分解单元分解成奇偶两个指针, 再存储到指针队列里去。 Step 307: Receive the idle pointer sent by the merge pointer unit, and send the pointer to the corresponding pointer queue according to the master control unit. Each of the pointer queues has its own corresponding address range. Except for the failed merge pointer, all pointers are stored in the respective pointer queues by address range. Merger The failed pointer is stored in the original pointer queue, and the merged successful pointer is stored in the merge pointer queue. Step 308: Deliver a pointer to the decomposition pointer queue, and determine whether the current pointer is a pre-decomposition pointer or a decomposed pointer according to the size of the storage space corresponding to the current pointer. The decomposed pointer is directly stored in the pointer queue. The pointer before the decomposition is decomposed into two pointers by the pointer decomposition unit and stored in the pointer queue.
本发明实施例属于数字存储领域, 适应于各种电子存储装置, 尤其适 用于在通信领域中的数据存储处理。  The embodiments of the present invention belong to the field of digital storage, and are applicable to various electronic storage devices, and are particularly suitable for data storage processing in the field of communications.
综上所述, 采用本发明实施例, 具有以下有益效果:  In summary, the embodiment of the present invention has the following beneficial effects:
1、 具有自适应功能, 能根据数据的业务类型, 调整存储空间的使用。 分为针对业务类型为大数据包、 小数据包和与分配存储结构一致的当前数 据包三种情况下的动态调整。  1. With adaptive function, it can adjust the use of storage space according to the type of data service. It is divided into dynamic adjustments for three cases where the service type is big data packet, small data packet, and current data packet consistent with the allocated storage structure.
2、 存储空间的利用率高, 由于能动态调整, 因此相对现有的固定基本 单元的存储空间共享方案而言, 如杲数据流中最大包最小包相差数个量级, 那么采用本发明实施例, 空间利用率相对现有方案就有数个量级的提升, 同时性能基本保持不变。  2. The utilization of the storage space is high, and since it can be dynamically adjusted, the storage space sharing scheme of the existing fixed basic unit, for example, the maximum packet minimum packet in the data stream is different by several orders of magnitude, then the implementation of the present invention is adopted. For example, space utilization has several orders of magnitude improvement over existing solutions, while performance remains essentially unchanged.
3、 存储空间的综合存储性能高, 相对于现有链表共享方法, 随着处理 时间的加长, 性能提升比例越高, 最终性能可以提升几十倍, 同时保持空 间利用率也比现有方案稍高。  3. The comprehensive storage performance of the storage space is high. Compared with the existing linked list sharing method, as the processing time is lengthened, the higher the performance improvement ratio, the final performance can be improved by several tens of times, and the space utilization ratio is also slightly smaller than the existing scheme. high.
4、 功耗低: 采用本发明实施例, 在进行存储结构调整的时候, 不涉及 数据搬移, 不涉及指针搬移, 没有额外操作, 不影响正常的数据存储, 基 本不额外增加功耗开销。  4. Low power consumption: In the embodiment of the present invention, when the storage structure is adjusted, no data movement is involved, no pointer movement is involved, no additional operations are performed, and normal data storage is not affected, and the power consumption overhead is not substantially increased.
以上所述, 仅为本发明的较佳实施例而已, 并非用于限定本发明的保 护范围。 工业实用性  The above is only the preferred embodiment of the present invention and is not intended to limit the scope of the present invention. Industrial applicability
本发明实施例根据数据的业务类型选择对应指针的迁移来调整存储结 构, 自适应分配存储空间, 在写操作情况下读取对应指针, 根据状态指示 判断存储空间的状态是否为非空间向上合并状态, 如果是, 则根据读取的 指针找到对应的存储空间并执行数据写操作, 如果否, 则进行指针奇偶判 断。 釆用本发明实施例, 由于能自适应分配存储空间, 因此, 对比现有技 术, 提高了存储空间的综合性能和存储空间的利用率。 In the embodiment of the present invention, the migration of the corresponding pointer is selected according to the service type of the data to adjust the storage junction. Constructing, adaptively allocating storage space, reading the corresponding pointer in the case of a write operation, determining whether the state of the storage space is a non-spatial upward merge state according to the status indication, and if so, finding a corresponding storage space according to the read pointer and executing Data write operation, if no, perform pointer parity judgment. According to the embodiment of the present invention, since the storage space can be adaptively allocated, the comprehensive performance of the storage space and the utilization ratio of the storage space are improved compared with the prior art.

Claims

权利要求书 claims
1、 一种应用于无线通讯的存储方法, 该方法包括: 1. A storage method applied to wireless communication. The method includes:
根据数据的业务类型选择对应指针的迁移来调整存储结构, 自适应分 配存储空间, 在写操作情况下读取对应指针, 根据状态指示判断存储空间 的状态是否为非空间向上合并状态, 如杲是, 则根据读取的指针找到对应 的存储空间并执行数据写操作, 如果否, 则进行指针奇偶判断。 Select the migration of the corresponding pointer according to the business type of the data to adjust the storage structure, adaptively allocate storage space, read the corresponding pointer in the case of a write operation, and determine whether the status of the storage space is a non-space upward merge state according to the status indication. If yes , then find the corresponding storage space according to the read pointer and perform the data write operation. If not, perform pointer parity judgment.
2、 根据权利要求 1所述的方法, 其中, 所述进行指针奇偶判断具体包 括: 如果读取的指针是奇数指针, 则根据读取的奇数指针找到对应的存储 空间并执行数据写操作; 如果读取的指针是偶数指针, 则将读取的偶数指 针送往奇偶状态空间对其进行更新, 并将偶数指针对应的状态标识设置为 高。 2. The method according to claim 1, wherein the pointer parity judgment specifically includes: if the read pointer is an odd pointer, find the corresponding storage space according to the read odd pointer and perform a data write operation; if If the read pointer is an even pointer, the read even pointer is sent to the odd-even state space to update it, and the state flag corresponding to the even pointer is set to high.
3、 根据权利要求 2所述的方法, 其中, 所述奇偶状态空间中仅存储偶 数指针, 所述偶数指针对应的状态标识设置为高时, 指示所述偶数指针对 应的空间为空闲; 3. The method according to claim 2, wherein only even pointers are stored in the odd and even state space, and when the state flag corresponding to the even pointer is set to high, it indicates that the space corresponding to the even pointer is free;
每个偶数指针和与其对应的奇数指针构成一个奇偶对。 Each even pointer and its corresponding odd pointer form an odd-even pair.
4、 一种应用于无线通讯的存储方法, 该方法包括: 根据数据的业务类 型选择对应指针的迁移来调整存储结构, 自适应分配存储空间, 在读操作 情况下读取对应指针找到对应的存储空间并执行数据读操作, 读取完毕后 对读取的指针对应空间进行释放, 如果根据状态指示判断存储空间的状态 为空间向上合并状态, 则进行指针奇偶判断。 4. A storage method applied to wireless communications. The method includes: selecting the migration of the corresponding pointer according to the business type of the data to adjust the storage structure, adaptively allocating storage space, and reading the corresponding pointer to find the corresponding storage space in the case of a read operation. And execute the data read operation. After the reading is completed, the space corresponding to the read pointer is released. If the state of the storage space is judged to be the space upward merging state according to the status indication, the pointer parity judgment is performed.
5、 根据权利要求 4所述的方法, 其中, 所述进行指针奇偶判断具体包 括: 如果读取的指针是偶数指针, 则对其不做处理; 如果读取的指针是奇 数指针, 则在奇偶状态空间查询是否存在与所述奇数指针匹配的偶数指针, 如杲存在匹配的偶数指针且偶数指针对应的状态标识设置为高, 则进行奇 偶指针合并。 5. The method according to claim 4, wherein the judgment of pointer parity specifically includes: if the read pointer is an even pointer, no processing is performed on it; if the read pointer is an odd pointer, then the parity The state space queries whether there is an even pointer matching the odd pointer. If there is a matching even pointer and the state flag corresponding to the even pointer is set to high, the odd and even pointers are merged.
6、 根据权利要求 5所述的方法, 其中, 所述奇偶状态空间中仅存储偶 数指针, 所述偶数指针对应的状态标识设置为高时, 指示所述偶数指针对 应的空间为空闲; 6. The method according to claim 5, wherein only even pointers are stored in the odd and even state space, and when the state flag corresponding to the even pointer is set to high, it indicates that the space corresponding to the even pointer is free;
每个偶数指针和与其对应的奇数指针构成一个奇偶对。 Each even pointer and its corresponding odd pointer form an odd-even pair.
7、 根据权利要求 6所述的方法, 其中, 该方法还包括: 如果幹放的 是所述奇偶对中奇数指针对应的奇空间, 则所述奇偶对中偶数指针对应的 偶空间与所述奇空间一起共同幹放, 将两个存储空间同时向上合并为一个 地址连续的存储空间。 7. The method according to claim 6, wherein the method further includes: if the odd space corresponding to the odd pointer in the odd-even pair is placed, then the even space corresponding to the even pointer in the odd-even pair is the same as the even space corresponding to the even pointer in the odd-even pair. The odd spaces are put together together, and the two storage spaces are merged upward at the same time into a storage space with continuous addresses.
8、 根据权利要求 6所述的方法, 其中, 进行奇偶指针合并后, 奇偶指 针合并后的新指针对应奇偶空间的大小为: 奇偶对中奇数指针对应的原奇 空间与偶数指针对应的原偶空间之和。 8. The method according to claim 6, wherein after merging the odd and even pointers, the size of the odd and even space corresponding to the new pointer after the merging of the odd and even pointers is: the original odd space corresponding to the odd pointer in the parity pair and the original even space corresponding to the even pointer. The sum of spaces.
9、 根据权利要求 4所述的方法, 其中, 该方法还包括: 如果根据状态 指示判断存储空间的状态为空间向下分解状态, 则将读取的一个指针分解 为奇数指针和与其对应的偶数指针, 实现空间向下分解; 9. The method according to claim 4, wherein the method further includes: if the state of the storage space is determined to be a space downward decomposition state according to the status indication, decomposing a read pointer into an odd number pointer and its corresponding even number. Pointers realize downward decomposition of space;
相应的, 读取的指针对应的原空间的大小分为两部分, 奇数指针对应 的奇空间与偶数指针对应的偶空间各占原空间大小的一半。 Correspondingly, the size of the original space corresponding to the read pointer is divided into two parts. The odd space corresponding to the odd pointer and the even space corresponding to the even pointer each occupy half of the original space size.
10、 一种读写存储装置, 该装置包括: 总控单元、 多路选择单元、 奇 偶判决单元; 其中, 10. A read-write storage device, which includes: a general control unit, a multiplex selection unit, and a parity decision unit; wherein,
总控单元, 配置为控制多路选择单元根据数据的业务类型选择对应指 针的迁移来调整存储空间的存储结构, 自适应分配存储空间; The overall control unit is configured to control the multiplexing unit to select the migration of corresponding pointers according to the business type of the data to adjust the storage structure of the storage space and adaptively allocate storage space;
多路选择单元, 配置为业务类型为与已有存储结构相适应的数据包时, 对应选择原始空闲指针队列; 业务类型为超出已有存储结构的大数据包时, 对应选择合并空闲指针队列; 业务类型为低于已有存储结构的小数据包时, 指针分解后对应选择分解空闲指针队列; The multi-path selection unit is configured to select the original idle pointer queue when the service type is a data packet that is suitable for the existing storage structure; when the service type is a large data packet that exceeds the existing storage structure, the merged idle pointer queue is selected accordingly; When the service type is a small data packet that is lower than the existing storage structure, the free pointer queue will be selected to be decomposed after pointer decomposition;
奇偶判决单元, 配置为在所述总控单元控制的存储空间的工作状态为 空间向上合并状态时, 进行指针奇偶判断。 The parity decision unit is configured such that the working state of the storage space controlled by the general control unit is When the space merges upward, pointer parity judgment is performed.
11、 根据权利要求 10所述的装置, 其中, 所述存储空间的工作状态具 体包括: 正常状态、 空间向下分解状态或空间向上合并状态。 11. The device according to claim 10, wherein the working state of the storage space specifically includes: a normal state, a space downward decomposition state or a space upward merging state.
12、 根据权利要求 10所述的装置, 其中, 该装置还包括: 地址译码单 元, 配置为所述工作状态为空间向上合并状态时, 判断读取的指针所指示 的地址是否属于空间合并的区域, 属于空间合并的区域时, 将读取的指针 发往所述奇偶判决单元。 12. The device according to claim 10, wherein the device further includes: an address decoding unit configured to determine whether the address indicated by the read pointer belongs to space merging when the working state is the space upward merging state. When the area belongs to the space merging area, the read pointer is sent to the parity decision unit.
13、 根据权利要求 12所述的装置, 其中, 所述奇偶判决单元, 进一步 配置为在写操作情况下, 对从所述地址译码单元获取的指针进行奇偶判断 时, 读取的指针是奇数指针, 根据读取的奇数指针找到对应的存储空间并 执行数据写操作; 如果读取的指针是偶数指针, 将读取的偶数指针送往奇 偶状态空间对其进行更新, 并将偶数指针对应的状态标识设置为高。 13. The device according to claim 12, wherein the parity judgment unit is further configured to perform parity judgment on the pointer obtained from the address decoding unit in the case of a write operation, and the read pointer is an odd number. pointer, find the corresponding storage space based on the read odd pointer and perform the data write operation; if the read pointer is an even pointer, send the read even pointer to the odd-even state space to update it, and update the even pointer corresponding to The status flag is set to high.
14、 根据权利要求 12所述的装置, 其中, 所述奇偶判决单元, 进一步 配置为在读操作情况下, 读取的指针是偶数指针, 对其不做处理; 读取的 指针是奇数指针, 则在奇偶状态空间查询是否存在与所述奇数指针匹配的 偶数指针, 如果存在匹配的偶数指针且偶数指针对应的状态标识设置为高, 则通知合并指针单元进行奇偶指针合并。 14. The device according to claim 12, wherein the parity decision unit is further configured to, in the case of a read operation, if the pointer read is an even pointer, no processing will be performed on it; if the pointer read is an odd pointer, then Query in the odd-even state space whether there is an even pointer matching the odd pointer. If there is a matching even pointer and the state flag corresponding to the even pointer is set to high, the merging pointer unit is notified to perform odd and even pointer merging.
15、 根据权利要求 13或 14所述的装置, 其中, 所述奇偶状态空间中 仅存储偶数指针, 所述偶数指针对应的状态标识设置为高时, 指示所述偶 数指针对应的空间为空闲; 每个偶数指针和与其对应的奇数指针构成一个 奇偶对。 15. The device according to claim 13 or 14, wherein only even pointers are stored in the odd and even state space, and when the state flag corresponding to the even pointer is set to high, it indicates that the space corresponding to the even pointer is free; Each even pointer and its corresponding odd pointer form an odd-even pair.
16、 根据权利要求 13或 14所述的装置, 其中, 该装置还包括: 指针 分解单元, 配置为所述工作状态为空间向下分解状态时, 将读取的一个指 针分解为奇数指针和与其对应的偶数指针, 实现空间向下分解。 16. The device according to claim 13 or 14, wherein the device further includes: a pointer decomposition unit configured to decompose a read pointer into an odd pointer and its corresponding pointer when the working state is a space downward decomposition state. The corresponding even pointer realizes downward decomposition of space.
PCT/CN2013/081020 2013-03-21 2013-08-07 Storage method and read-write storage device which are applied to wireless communications WO2013189324A2 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310092388.8 2013-03-21
CN201310092388.8A CN104063327B (en) 2013-03-21 2013-03-21 A kind of storage method and read-write storage device applied to wireless telecommunications

Publications (2)

Publication Number Publication Date
WO2013189324A2 true WO2013189324A2 (en) 2013-12-27
WO2013189324A3 WO2013189324A3 (en) 2014-02-20

Family

ID=49769494

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/081020 WO2013189324A2 (en) 2013-03-21 2013-08-07 Storage method and read-write storage device which are applied to wireless communications

Country Status (2)

Country Link
CN (1) CN104063327B (en)
WO (1) WO2013189324A2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107391388B (en) * 2016-05-17 2021-06-11 阿里巴巴集团控股有限公司 Method and equipment for storing data based on instant messaging

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1677946A (en) * 2004-04-02 2005-10-05 华为技术有限公司 Buffer distribution method and apparatus
CN101175228A (en) * 2006-11-03 2008-05-07 中兴通讯股份有限公司 Implementing method for supporting variable length data structure in intelligent network
CN101221536A (en) * 2008-01-25 2008-07-16 中兴通讯股份有限公司 Internal memory managing method and device of embedded system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1677946A (en) * 2004-04-02 2005-10-05 华为技术有限公司 Buffer distribution method and apparatus
CN101175228A (en) * 2006-11-03 2008-05-07 中兴通讯股份有限公司 Implementing method for supporting variable length data structure in intelligent network
CN101221536A (en) * 2008-01-25 2008-07-16 中兴通讯股份有限公司 Internal memory managing method and device of embedded system

Also Published As

Publication number Publication date
WO2013189324A3 (en) 2014-02-20
CN104063327B (en) 2017-09-12
CN104063327A (en) 2014-09-24

Similar Documents

Publication Publication Date Title
US9426099B2 (en) Router, method for controlling router, and program
US10740006B2 (en) System and method for enabling high read rates to data element lists
US11297012B2 (en) Packet processing system, method and device having reduced static power consumption
US8930593B2 (en) Method for setting parameters and determining latency in a chained device system
CN103914399B (en) Disk buffering method and device in a kind of concurrent computational system
CN108369562B (en) Intelligent coded memory architecture with enhanced access scheduler
US20120209943A1 (en) Apparatus and method for controlling distributed memory cluster
US9753660B2 (en) System and method for implementing hierarchical distributed-linked lists for network devices
CN107122244A (en) A kind of diagram data processing system and method based on many GPU
US9785367B2 (en) System and method for enabling high read rates to data element lists
CN105094751A (en) Memory management method used for parallel processing of streaming data
CN108984280A (en) A kind of management method and device, computer readable storage medium of chip external memory
US10601723B2 (en) Bandwidth matched scheduler
CN107025184B (en) Data management method and device
CN103220230A (en) Dynamic sharing buffering method supporting message across storage
WO2013189324A2 (en) Storage method and read-write storage device which are applied to wireless communications
CN102780620B (en) A kind of network processes device and message processing method
CN104899105A (en) Interprocess communication method
CN102118304B (en) Cell switching method and cell switching device
US9767014B2 (en) System and method for implementing distributed-linked lists for network devices
US10067690B1 (en) System and methods for flexible data access containers
CN107257550B (en) Signal processing method, base station and computer storage medium
Lu et al. Local resource shaper for mapreduce
JP2016504665A (en) Buffer processing method and apparatus
CN107483362A (en) A kind of method for dispatching message based on shift register

Legal Events

Date Code Title Description
122 Ep: pct application non-entry in european phase

Ref document number: 13807503

Country of ref document: EP

Kind code of ref document: A2