KR100656762B1 - Method for searching a position to be recorded with data in a memory - Google Patents

Method for searching a position to be recorded with data in a memory Download PDF

Info

Publication number
KR100656762B1
KR100656762B1 KR1020060015533A KR20060015533A KR100656762B1 KR 100656762 B1 KR100656762 B1 KR 100656762B1 KR 1020060015533 A KR1020060015533 A KR 1020060015533A KR 20060015533 A KR20060015533 A KR 20060015533A KR 100656762 B1 KR100656762 B1 KR 100656762B1
Authority
KR
South Korea
Prior art keywords
data
sectors
recorded
recording
data bank
Prior art date
Application number
KR1020060015533A
Other languages
Korean (ko)
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 (주) 버추얼다임
Priority to KR1020060015533A priority Critical patent/KR100656762B1/en
Application granted granted Critical
Publication of KR100656762B1 publication Critical patent/KR100656762B1/en

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A45HAND OR TRAVELLING ARTICLES
    • A45CPURSES; LUGGAGE; HAND CARRIED BAGS
    • A45C11/00Receptacles for purposes not provided for in groups A45C1/00-A45C9/00
    • A45C11/20Lunch or picnic boxes or the like
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B65CONVEYING; PACKING; STORING; HANDLING THIN OR FILAMENTARY MATERIAL
    • B65DCONTAINERS FOR STORAGE OR TRANSPORT OF ARTICLES OR MATERIALS, e.g. BAGS, BARRELS, BOTTLES, BOXES, CANS, CARTONS, CRATES, DRUMS, JARS, TANKS, HOPPERS, FORWARDING CONTAINERS; ACCESSORIES, CLOSURES, OR FITTINGS THEREFOR; PACKAGING ELEMENTS; PACKAGES
    • B65D25/00Details of other kinds or types of rigid or semi-rigid containers
    • B65D25/02Internal fittings
    • B65D25/04Partitions

Landscapes

  • Engineering & Computer Science (AREA)
  • Mechanical Engineering (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A method for searching a new position to write data and writing the data to the searched position in a memory is provided to realize fast database management in a small device, like a mobile terminal, having a low data processing speed and minimize a memory part not used for writing by searching the position to write the data in the shortest time. Information written in a writing area set by matching with each data bank is searched. The writing area includes the information for the maximum number of continuously arranged sectors among the sectors not including the written data. The data bank having the maximum number over the number of sectors of the data to be written is searched and determined. The position of the continuously arranged sectors is searched in the determined data bank. The data to be written is written to the searched position.

Description

메모리 내에서 데이터의 신규 기록이 가능한 위치의 검색/기록 방법 {Method for searching a position to be recorded with data in a memory}Method for searching a position to be recorded with data in a memory}

도 1 내지 도 4 는 본 발명에 따른 데이터 신규 기록 가능 위치 검색 및 데이터 기록 과정을 순차적으로 도시한 도면, 그리고1 to 4 are diagrams sequentially illustrating a process of retrieving data and a data recordable position and data recording process according to the present invention; and

도 5 는 도 1 에서 데이터뱅크 1 의 각 섹터에 대한 구체적인 검색 과정을 도시한 도면이다.FIG. 5 is a diagram illustrating a specific search process for each sector of data bank 1 in FIG. 1.

본 발명은 메모리 내에서 데이터의 신규 기록이 가능한 위치를 검색하는 방법에 관한 것으로서, 보다 상세하게는, 메모리 내에 기록될 데이터의 크기에 따라 기록 가능한 위치를 신속하게 검색하고 데이터를 기록함으로써 데이터 관리를 위한 기록 위치 검색 시간을 단축시킬 수 있는 검색 및 기록 방법에 관한 것이다.The present invention relates to a method for retrieving a position where data can be newly recorded in a memory. More particularly, the present invention relates to data management by quickly retrieving a recordable position and recording data according to the size of data to be recorded in the memory. The present invention relates to a search and recording method capable of shortening a recording position search time.

휴대폰과 같은 소형 디바이스는 데스크탑 컴퓨터 등에 비하여 하드웨어의 데이터 처리 속도가 매우 느리다. 이러한 소형 디바이스에서 데이터의 처리 시간에 영향을 주는 가장 중요한 요인은 DBMS(Database Management System)과 관련된 것으로서, 특히 디바이스 내의 메모리에 신규 데이터를 기록하기 위한 최적의 위치를 찾아내는 것이다. 즉, 메모리에 데이터의 기록과 삭제가 반복됨에 따라 메모리 내에는 현재 데이터가 기록되어 있는 부분과 기록되어 있지 않은 부분이 혼재되어 있으며, 이러한 상황에서 새로운 데이터를 기록하기 위해서는 데이터가 기록되어 있지 않은 부분 중에서 새로 기록될 데이터를 수용하기에 충분한 공간 확보가 가능한 위치를 검색하여야 한다. 이때, 이러한 위치를 검색하는 과정에서 매우 큰 시간 소요가 발생하며, 이는 곧 기록에 소요되는 시간의 증가로 이어져 사용자에게 큰 불편함을 느끼게 한다.Small devices such as mobile phones have much slower data processing speeds than desktop computers. The most important factor affecting the processing time of data in such a small device is related to the Database Management System (DBMS), and in particular, finding an optimal location for writing new data to memory in the device. That is, as data is repeatedly recorded and deleted in the memory, there are mixed portions in which the current data is recorded and unrecorded portions in the memory. In this situation, in order to record new data, the portion where no data is recorded is recorded. The location should be searched to allow enough space to accommodate the newly recorded data. At this time, a very large time is required in the process of searching for such a location, which leads to an increase in the time required for recording, which makes the user feel a great inconvenience.

종래의 메모리 관리를 위한 데이터 기록 가능 위치 검색 방법으로서 대표적인 것이 스캐닝(Scanning) 방식과 사전정의 메모리(Predefined Memory) 방식이다.Representative methods of data recordable position retrieval for conventional memory management are a scanning method and a pre-defined memory method.

스캐닝 방식에서는 메모리 내의 각 섹터를 맨 앞의 섹터로부터 순차적으로 스캐닝하여, 예컨대 현재 기록될 데이터의 크기가 두 섹터를 점유하는 크기라면 연속된 두 섹터에 데이터가 기록되어 있지 않은 위치를 찾아낸다. 이와 같은 방식으로 찾아진 위치에 데이터를 기록한다. 그런데, 이러한 방식은 메모리 내의 모든 섹터를 순차적으로 스캐닝하여야 하므로 데이터를 기록할 수 있는 충분한 크기의 섹터가 검색 순서상의 말미에서 발견되는 경우에는 검색에 소요되는 시간이 매우 길어지게 된다.In the scanning method, each sector in the memory is sequentially scanned from the first sector to find a position where no data is recorded in two consecutive sectors if, for example, the size of the data to be currently recorded occupies two sectors. In this way, the data is recorded at the found position. However, this method requires scanning all sectors in the memory sequentially, so that when a sector large enough to record data is found at the end of the search order, the time required for searching becomes very long.

사전정의 메모리 방식에서는 임시로 정해진 메모리 공간을 확보하여 두었다가 최적의 위치를 찾도록 한다. 그러나, 무한정 메모리를 확보하여 둘 수는 없으며, 언제 데이터가 기록될 필요가 있을지 모르는 메모리의 사전 확보에 따라 메모리 관리의 효용성이 매우 낮아지게 된다는 문제점이 있다.In the predefined memory method, the memory space is temporarily reserved to find an optimal location. However, there is a problem in that the memory cannot be secured indefinitely, and the utility of memory management is very low due to the advancement of the memory, which may not be necessary when data is to be recorded.

한편, 위와 같은 종래의 메모리 관리방식에 의하면, 사용가능한 메모리 공간임에도 불구하고 데이터의 기록과 삭제가 빈번하게 반복됨에 따라 실제로는 데이터의 기록을 위해 사용될 수 없는 메모리 부분이 발생하게 되는 문제점이 있다.On the other hand, according to the conventional memory management scheme as described above, there is a problem in that a memory portion which cannot be actually used for writing data is generated as the recording and deleting of data are frequently repeated despite the available memory space.

본 발명은 상기한 바와 같은 문제점을 해결하기 위하여 안출된 것으로서, 본 발명의 목적은 기록하고자 하는 데이터가 기록될 수 있는 메모리 내의 위치를 최단 시간 내에 검색함으로써 특히 휴대폰과 같이 데이터 프로세싱의 속도 저하가 문제되는 소형 디바이스에서 신속한 데이터베이스 관리가 가능하며 또한 데이터 기록에 사용될 수 없는 메모리 부분이 최소화될 수 있도록 하는 데이터 기록 위치 검색 및 기록 방법을 제공하는 것이다.SUMMARY OF THE INVENTION The present invention has been made to solve the above problems, and an object of the present invention is to search for a location in a memory in which data to be recorded can be recorded in the shortest time, thereby reducing the speed of data processing such as a mobile phone. The present invention provides a method for retrieving and recording a data record position, which enables rapid database management in a small device, and minimizes a portion of memory that cannot be used for data recording.

상기와 같은 목적을 달성하기 위하여 본 발명은, 각각이 복수의 섹터로 구성된 복수의 데이터뱅크로 구획된 메모리 내에서 데이터의 신규 기록이 가능한 위치의 검색/기록 방법을 제안한다. 본 발명의 검색/기록 방법은, (a) 각각의 상기 데이터뱅크에 대해 대응되어 설정된 기록영역에 기록된 정보를 검색하는 단계로서, 상기 기록영역에는 상기 데이터가 기록되어 있지 않은 상기 섹터들 중 연이어 배열된 상기 섹터의 최대 개수에 대한 정보가 기록되어 있는, 상기 검색 단계; (b) 상기 (a) 단계에서 상기 최대 개수가 현재 기록될 데이터의 섹터수 이상인 것으로 검색된 상기 데이터뱅크를 결정하는 단계; (c) 상기 (b) 단계에서 결정된 상기 데이터뱅크 내에서 상기 기록될 데이터의 상기 섹터수 이상인 위치를 검색하는 단계; 및 (d) 상기 (c) 단계에서 검색된 상기 위치에 상기 기록될 데이터를 기록하는 단계;를 포함하는 것을 특징으로 한다.In order to achieve the above object, the present invention proposes a search / write method of a position where data can be newly recorded in a memory partitioned into a plurality of data banks each composed of a plurality of sectors. The search / recording method of the present invention comprises the steps of: (a) retrieving information recorded in a correspondingly set recording area for each of said data banks, wherein said recording area is arranged successively among said sectors in which said data is not recorded; The retrieving step, in which information on the maximum number of sectors has been recorded; (b) determining the databank found in step (a) that the maximum number is greater than or equal to the number of sectors of data to be recorded currently; (c) searching for a position in the data bank determined in step (b) that is equal to or greater than the number of sectors of the data to be recorded; And (d) recording the data to be recorded at the position retrieved in the step (c).

본 발명의 바람직한 실시예에 의하면, (c) 단계에서의 검색 결과 상기 기록될 데이터의 상기 섹터수 이상인 상기 위치가 상기 데이터뱅크 내에 존재하지 않는 것으로 검색된 경우, 다른 데이터뱅크에 대해 상기 (b) 단계부터 반복 수행된다. 이때, 상기 데이터뱅크의 상기 기록영역 내의 상기 최대 개수에 대한 정보는 현재 상태에 부합되도록 수정된다. 이러한 기록영역의 정보 수정은 상기 (d) 단계 직후에 수행되도록 할 수도 있다.According to a preferred embodiment of the present invention, if the search result in step (c) finds that the position equal to or greater than the number of sectors of the data to be recorded does not exist in the data bank, repeating from step (b) for another data bank. Is performed. At this time, the information on the maximum number in the recording area of the data bank is modified to match the current state. Such information correction in the recording area may be performed immediately after step (d).

한편, 상기 기록영역에는 해당되는 상기 데이터뱅크의 상기 섹터의 총 개수인 총섹터수, 및 상기 데이터가 기록되어 있는 상기 섹터들의 개수인 기록섹터수에 대한 정보가 추가적으로 기록될 수 있다.Meanwhile, in the recording area, information on the total number of sectors, which is the total number of sectors of the data bank, and the number of recording sectors, which are the number of sectors in which the data is recorded, may be additionally recorded.

이러한 경우, 상기 (c) 단계는, (c-a) 상기 (b) 단계에서 결정된 상기 데이터뱅크의 상기 기록영역에서 상기 총섹터수 및 상기 기록섹터수의 개수를 검출하는 단계; 및 (c-b) 상기 기록섹터수가 상기 총섹터수의 절반 이상인 경우 상기 데이터뱅크 내에서 검색 방향상의 후반부에 배치된 상기 섹터들 내에서 상기 위치를 먼저 검색하고 상기 후반부에 배치된 섹터들 내에서 상기 위치가 검색되지 않은 경우 상기 검색 방향상의 전반부에 배치된 상기 섹터들 내에서 상기 위치를 검색하며, 상기 기록섹터수가 상기 총섹터수의 절반 미만인 경우 상기 검색 방향에 따라 상기 위치를 검색하는 단계;를 포함하여 구성될 수 있다.In this case, the step (c) may include: (c-a) detecting the total number of sectors and the number of recording sectors in the recording area of the data bank determined in the step (b); And (cb) if the number of recording sectors is more than half the total number of sectors, the position is first searched for in the sectors disposed later in the search direction in the data bank, and the position in the sectors disposed later in the data bank. Searching for the position in the sectors disposed in the first half of the search direction if not found, and searching for the position according to the search direction if the number of recorded sectors is less than half of the total sectors; Can be configured.

본 발명에 따르면, 기록하고자 하는 데이터가 기록될 수 있는 메모리 내의 위치의 검색 시간이 현저하게 단축되므로 특히 휴대폰과 같이 데이터 프로세싱의 속도 저하가 문제되는 소형 디바이스에서 신속한 데이터베이스 관리가 가능하게 되며, 또한, 특정 섹터에 대한 집중적인 기록과 삭제의 반복 가능성이 적으므로 데이터 기록에 사용될 수 없는 메모리 부분의 발생이 최소화된다.According to the present invention, since the retrieval time of a location in the memory where data to be recorded can be recorded is significantly shortened, it is possible to quickly manage a database, especially in a small device such as a mobile phone, in which a slowdown in data processing is a problem. The possibility of intensive writing and erasure of repetition for a particular sector is small, thereby minimizing the occurrence of memory portions that cannot be used for data writing.

이하에서는 첨부된 도면을 참조하여 본 발명의 바람직한 실시예를 보다 상세하게 설명한다.Hereinafter, with reference to the accompanying drawings will be described in detail a preferred embodiment of the present invention.

도 1 내지 도 4 는 본 발명에 따른 데이터 신규 기록 가능 위치 검색 및 데이터 기록 과정을 순차적으로 도시한 도면이다.1 to 4 are diagrams sequentially illustrating a process of retrieving a data and a data recordable position and a data recording process according to the present invention.

데이터가 기록될 메모리는 복수의 데이터뱅크(데이터뱅크 1, 데이터뱅크 2, 데이터뱅크 3, ㆍㆍㆍㆍ)로 구획되어 있으며, 각 데이터뱅크는 복수의 섹터로 구성되어 있다. 본 실시예에서는 도 1 내지 도 4 에 도시된 바와 같이 하나의 데이터뱅크가 10개의 섹터로 구성되어 있는 예를 보여주고 있으나, 각 데이터뱅크 내의 섹터의 개수는 이와 다르게 설정될 수 있으며 또한 데이터뱅크별로 섹터의 개수가 상이하도록 설정될 수도 있다. 하나의 섹터는 일정량의 데이터가 기록될 수 있는 크기로 설정되는 것이 바람직하다.The memory in which data is to be written is divided into a plurality of data banks (data bank 1, data bank 2, data bank 3, ...), and each data bank is composed of a plurality of sectors. In this embodiment, as shown in Figs. 1 to 4, one data bank is composed of 10 sectors. However, the number of sectors in each data bank may be set differently, and the number of sectors for each data bank is different. It may be set to be different. One sector is preferably set to a size at which a certain amount of data can be recorded.

각 데이터뱅크에는 하나씩의 기록영역이 대응되어 있다. 각 기록영역은 도시된 바와 같이 Description 이라는 필드(Field)를 가지고 있으며, 이러한 Description 필드에 기록된 번호(즉, 1, 2, 3, 등)는 대응되는 데이터뱅크의 번호를 가리킨다. 이러한 기록영역은 각 데이터뱅크에 대한 정보를 기록하기 위해 마련되며, 메모리 내의 소정 부위에 기록된다.One recording area is associated with each data bank. Each recording area has a field called Description as shown, and the numbers (i.e., 1, 2, 3, etc.) recorded in this Description field indicate the number of the corresponding data bank. This recording area is provided for recording information on each data bank, and is recorded in a predetermined portion of the memory.

기록영역은 Description 필드 외에도 Total 필드, Empty Max 필드, 및 Filled 필드를 구비하고 있다.In addition to the Description field, the recording area includes a Total field, an Empty Max field, and a Filled field.

Total 필드는 해당되는 데이터뱅크의 섹터의 총 개수인 총섹터수에 대한 정보가 기록되는 필드이다. 본 실시예에서와 같이 데이터뱅크들이 10개씩의 섹터를 갖도록 구성되는 경우에는 하나의 데이터뱅크 내의 총섹터수는 10 이므로 Total 필드에는 "10" 이라는 숫자가 기록된다.The Total field is a field in which information on the total number of sectors, which is the total number of sectors of a corresponding data bank, is recorded. In the case where the data banks are configured to have 10 sectors as in the present embodiment, the total number of sectors in one data bank is 10, and thus a number "10" is recorded in the Total field.

Empty Max 필드는 해당되는 데이터뱅크 내에서 데이터가 기록되어 있지 않은 섹터들 중 연이어 배열된 섹터의 최대 개수에 대한 정보가 기록되는 필드이다. 예컨대, 데이터뱅크 1 에서는 첫 네개의 섹터와 6번째 및 7번째 섹터에 데이터가 기록되어 있는 상태이고 4번째 섹터 및 8번째 내지 10번째 섹터에는 데이터가 기록되어 있지 않은 상태(즉, 데이터의 신규 기록이 가능한 상태)이다. 데이터가 기록되어 있지 않은 섹터 중 연이어 배열된 섹터(즉, 8번째 내지 10번째 섹터)의 최대 개수는 3 이므로, Empty Max 필드에는 "3" 이라는 숫자가 기록된다. 마찬가지로, 데이터뱅크 2 의 Empty Max 필드에는 "2" 가 기록되며, 데이터뱅크 3 의 Empty Max 필드에는 "4" 가 기록된다.The Empty Max field is a field in which information on the maximum number of sectors consecutively arranged among the sectors in which data is not recorded in the corresponding data bank is recorded. For example, in the data bank 1, data is recorded in the first four sectors and the sixth and seventh sectors, and no data is recorded in the fourth and eighth to tenth sectors (i.e., new recording of data is performed. Possible state). Since the maximum number of sectors consecutively arranged (that is, the eighth to tenth sectors) among the sectors in which no data is recorded is three, a number "3" is recorded in the Empty Max field. Similarly, "2" is recorded in the Empty Max field of Databank 2 and "4" is recorded in the Empty Max field of Databank 3.

Filled 필드에는 해당되는 데이터뱅크 내에서 데이터가 기록되어 있는 섹터들의 개수인 기록섹터수에 대한 정보가 기록된다. 예컨대, 데이터뱅크 1 에서는 6 개의 섹터에 데이터가 기록되어 있는 상태이므로, 데이터뱅크 1 의 Filled 필드에는 "6" 이 기록된다.In the Filled field, information on the number of recording sectors, which is the number of sectors in which data is recorded in a corresponding data bank, is recorded. For example, in the data bank 1, since data is recorded in six sectors, "6" is recorded in the filled field of the data bank 1.

이와 같이 구성된 메모리에 신규 데이터를 기록하고자 하는 경우 기록될 위 치를 검색하고 검색된 위치에 데이터를 기록하는 과정은 다음과 같다.When new data is to be recorded in the memory configured as described above, a process of searching for a location to be recorded and writing data to the searched location is as follows.

먼저, 도 1 과 같이 두 섹터 크기의 데이터가 추가되어 신규 기록하고자 하는 경우, 먼저 기록영역의 정보를 검색한다. 즉, 먼저 각 기록영역에 기록된 정보 중에서 각각의 데이터뱅크의 Empty Max 에 필드의 값을 조회하여 그 값이 현재 기록될 데이터의 섹터수인 "2" 보다 크거나 같은 데이터뱅크를 결정한다. 데이터뱅크 1 의 기록영역부터 순차적으로 Empty Max 필드의 값을 조회하며, 이때 데이터뱅크 1 의 Empty Max 의 값이 "3" 으로서 이 조건을 충족하므로 데이터뱅크 1 이 신규 데이터가 기록될 데이터뱅크로서 결정된다.First, when data of two sector sizes is added and newly recorded, as shown in FIG. 1, information of the recording area is first retrieved. That is, first, the value of the field is queried in the empty max of each data bank among the information recorded in each recording area, and a data bank whose value is greater than or equal to "2" which is the number of sectors of data to be recorded currently is determined. The value of the Empty Max field is sequentially searched from the recording area of the data bank 1, and at this time, the value of the empty max of the data bank 1 satisfies this condition as "3", so the data bank 1 is determined as the data bank in which new data is to be recorded.

그리고 나서, 데이터뱅크 1 의 각 섹터를 검색하여 기록될 데이터의 섹터수 이상인 위치를 검색한다. 이 위치는 기록될 데이터의 섹터수가 2 이므로 연속적으로 2 섹터 이상이 비어있는 위치로서 결정된다. 따라서, 도 1 의 데이터뱅크 1 과 같은 상태에서는 8 번째 섹터와 9 번째 섹터(또는 9 번째 섹터와 10 번째 섹터)가 기록될 위치로서 결정될 것이다.Then, each sector of data bank 1 is searched for a position that is equal to or greater than the number of sectors of data to be recorded. This position is determined as a position where two or more sectors are continuously empty because the number of sectors of data to be recorded is two. Therefore, in the same state as the data bank 1 of FIG. 1, the eighth sector and the ninth sector (or the ninth sector and the tenth sector) will be determined as positions to be recorded.

이와 같이 결정된 위치에 추가되는 데이터를 기록함으로써 데이터 기록의 최적 위치 검색과 검색된 위치에의 데이터 기록이 완료된다. 데이터의 신규 기록이 완료되면 데이터뱅크 1 의 상태는 도 2 와 같이 변경된다.By recording the data added to the determined position in this way, the optimum position search of the data record and the data recording at the retrieved position are completed. When the new recording of data is completed, the state of data bank 1 is changed as shown in FIG.

한편, 데이터뱅크 1 의 상태가 도 2 와 같이 변경됨에 따라 데이터뱅크 1 의 기록영역인 Description 1 에서는 Empty Max 의 값이 1 로, 그리고 Filled 의 값이 8 로 수정되어야 한다.On the other hand, as the state of the data bank 1 is changed as shown in Fig. 2, in the description area 1 of the data bank 1, the value of Empty Max should be changed to 1 and the value of Filled should be modified to 8.

이러한 기록영역의 정보 수정 과정은 데이터의 기록이 완료된 다음에 수행된 다. 이때, 기록영역의 정보 수정은 데이터의 기록이 완료된 직후에 곧바로 수행될 수도 있으나, 본 실시예에서는 검색과 기록의 시간을 더욱 단축시키기 위하여 데이터 기록 완료 직후 수행되지 않고 차회의 위치 검색시에 수정하는 방식을 예시한다. 이에 대해서는 도 2 내지 도 4 를 참조하여 설명한다.The information modification process of this recording area is performed after data recording is completed. At this time, the information correction in the recording area may be performed immediately after the data recording is completed. However, in the present embodiment, the information is corrected at the next position search instead of immediately after the data recording is completed in order to further shorten the searching and recording time. Illustrate the method. This will be described with reference to FIGS. 2 to 4.

도 2 와 같은 상태에서, 도 2 에 도시된 바와 같이 예컨대 3 개의 섹터 크기의 데이터가 추가되어 신규로 메모리에 기록되고자 하는 경우, 먼저 전술한 바와 동일한 과정이 수행된다.In the state as shown in FIG. 2, when the data of three sector sizes is added to be newly written in the memory, for example, as shown in FIG. 2, the same process as described above is first performed.

즉, 먼저 기록영역을 검색하여 Empty Max 의 값이 3 이상인 데이터뱅크를 결정한다. 데이터뱅크 1 의 기록영역의 정보가 아직 수정되지 않은 상태이므로 도 2 의 상태에서는 데이터뱅크 1 이 먼저 이러한 조건을 충족하여 데이터뱅크 1 이 데이터가 기록될 데이터뱅크로서 결정될 것이다.That is, first, the recording area is searched to determine a data bank having an Empty Max value of 3 or more. Since the information in the recording area of the data bank 1 has not been modified yet, in the state of FIG. 2, the data bank 1 first meets these conditions and the data bank 1 will be determined as the data bank in which data will be recorded.

그리고 나서, 전술한 바와 같이 데이터뱅크 1 내의 섹터들을 검색하여 3 개의 섹터가 연이어서 비어있는 위치를 찾는다. 그러나, 도 2 의 상태에서는 이러한 위치가 존재하지 않으므로 검색 결과 발견되지 않을 것이다. 이와 같이 기록될 위치가 발견되지 않는 것으로 판단되면 다른 데이터뱅크에 대해(즉, 데이터뱅크 2 부터) 전술한 기록영역의 정보 조회 과정부터 반복적으로 수행된다.Then, as described above, the sectors in the data bank 1 are searched to find three empty positions. However, in the state of FIG. 2, such a location does not exist and thus the search result will not be found. If it is determined that the position to be recorded is not found as described above, the data storage process is repeatedly performed for the other data banks (i.e., starting from the data bank 2) from the above-described information inquiry process of the recording area.

이때, 기록영역의 정보 조회 과정을 반복 수행하기 전에, 데이터뱅크 1 의 기록영역 내의 정보가 현재 데이터뱅크 1 의 상태에 맞게 수정된다. 즉, 도 3 에 도시된 바와 같이, 데이터뱅크 1 에 대한 기록영역에서, Empty Max 의 값은 1 로 수정되고 Filled 의 값은 8 로 수정된다.At this time, before the information retrieval process of the recording area is repeated, the information in the recording area of the data bank 1 is modified to match the state of the current data bank 1. That is, as shown in Fig. 3, in the recording area for data bank 1, the value of Empty Max is modified to 1 and the value of Filled is modified to 8.

한편, 기록영역의 조회가 반복 수행될 때, 데이터뱅크 2 는 Empty Max 의 값이 "2" 이므로 데이터가 기록될 데이터뱅크로서 결정되지 않고, 데이터뱅크 3 은 Empty Max 의 값이 "4" 이므로 데이터가 기록될 데이터뱅크로서 결정된다. 그리고 나서, 데이터가 기록될 데이터뱅크로서 결정된 데이터뱅크 3 의 각 섹터들에 대해 3 개의 섹터가 연이어서 비어있는 위치가 검색되며, 이에 따라 데이터뱅크 3 내의 7 번째 내지 9 번째 섹터(또는 8 번째 내지 10 번째 섹터)가 데이터가 기록될 위치로서 결정된다. 이와 같이 결정된 위치에 데이터가 기록됨에 따라 데이터뱅크 3 의 상태가 도 4 와 같이 변경된다.On the other hand, when the search of the recording area is repeatedly performed, data bank 2 is not determined as the data bank to which data is to be recorded because the value of Empty Max is "2", and data bank 3 is to be recorded because the value of Empty Max is "4". Determined as a databank. Then, for each sector of databank 3 determined as the databank to which data is to be written, three sectors are successively searched for empty positions, and accordingly, the seventh through ninth sectors (or eighth through tenth sectors) in databank 3 are retrieved. Is determined as the position where data is to be recorded. As data is recorded at the position determined as described above, the state of the data bank 3 changes as shown in FIG. 4.

전술한 바와 마찬가지로, 본 실시예에서는 데이터뱅크 3 의 기록영역의 정보는 즉시 수정되지는 않으며 또 다른 데이터의 신규 기록을 위한 위치 검색시 데이터뱅크 3 의 현재 상태가 기록영역에 기록된 상태와 다른 것으로 판별된 경우에 해당 기록영역의 정보를 수정하는 작업을 한다.As described above, in the present embodiment, the information of the recording area of the data bank 3 is not immediately modified, and it is determined that the current state of the data bank 3 is different from that recorded in the recording area when retrieving a position for new recording of another data. In this case, the information of the recording area is modified.

이와 같은 본 발명에 따르면, 먼저 기록영역의 정보를 통해 기록될 데이터의 크기를 수용할 수 있는 데이터뱅크가 먼저 결정되고 결정된 데이터뱅크 내의 섹터들의 검색에 의해 기록될 위치가 결정된다. 따라서, 종래의 스캐닝 방식의 위치 검색 방법에 비해 그 속도가 현저히 빠르고 종래의 서전정의 메모리 방식에 비해 메모리의 효율적 관리가 저해되지 않는다. 또한 특정 섹터에 대하여 집중적으로 빈번하게 데이터 기록 및 삭제가 반복되는 문제가 없으므로 사용 불가능한 메모리 부분의 발생이 적게 된다.According to the present invention as described above, first, a databank capable of accommodating the size of data to be recorded through the information of the recording area is first determined, and a position to be recorded is determined by searching for sectors in the determined databank. Therefore, the speed is significantly faster than that of the conventional scanning method and the efficient management of the memory is not impaired as compared with the conventional memory system. In addition, since there is no problem of intensive and frequent data writing and erasure for a particular sector, the occurrence of unusable memory parts is reduced.

또한, 본 실시예에서와 같이 기록영역의 정보를 기록 즉시 변경하지 않고 차 회의 검색에서 현 상태가 반영되지 않은 것으로 판별된 데이터뱅크에 대해서만 변경함으로써 모든 검색 및 기록시마다 기록영역의 정보를 수정하는 작업을 수행하지는 않게 된다. 따라서, 기록영역 정보의 수정에 따른 시간 소요가 매회 일어나지 않게 되므로 검색 및 기록의 시간이 단축된다.Also, as in the present embodiment, the operation of modifying the information in the recording area at every retrieval and recording is performed by changing only the data bank which is determined to not reflect the current state in the next retrieval without immediately changing the recording area information. It will not perform. Therefore, the time required for the correction of the recording area information does not occur every time, so that the time for searching and recording is shortened.

한편, 상기한 실시예에서는 데이터가 신규로 기록될 데이터뱅크가 결정된 후의 각 데이터뱅크에서의 섹터들의 검색 과정에 대해서는 자세하게 기술하지 않았으나, 각 데이터뱅크 내에서의 섹터들의 검색 과정은 종래의 스캐닝 방식 등과 같은 방식을 채용할 수도 있으며 또한 다음과 같은 방식을 채용할 수도 있다.Meanwhile, in the above-described embodiment, the searching process of the sectors in each data bank after the data bank to which data is newly written is not described in detail, but the searching process of the sectors in each data bank is similar to the conventional scanning method. It is also possible to employ and also employ the following manner.

도 5 는 도 1 에서 데이터뱅크 1 의 각 섹터에 대한 구체적인 검색 과정을 도시한 도면이다.FIG. 5 is a diagram illustrating a specific search process for each sector of data bank 1 in FIG. 1.

먼저, 기록영역의 조회 결과 데이터가 기록될 결정된 데이터뱅크(즉, 데이터뱅크 1)의 기록영역에서 Total 필드의 값과 Filled 필드의 값을 검출한다. 그리고 나서, Filled 의 값이 Total 의 값의 절반 이상인지 여부를 판별한다. Total 의 값은 당해 데이터뱅크의 총 섹터수를 나타내고 Filled 의 값은 현재 데이터가 기록된 섹터의 수를 나타내므로, 이와 같은 판별은 전체 섹터들 중에서 데이터가 기록된 섹터가 절반 이상인지 여부를 판별하는 과정이 된다.First, the value of the Total field and the value of the Filled field are detected in the recording area of the determined data bank (i.e., data bank 1) in which the inquiry result data of the recording area is to be recorded. Then, it is determined whether the value of Filled is more than half of the value of Total. Since the value of Total represents the total number of sectors in the data bank and the value of Filled represents the number of sectors in which data is currently recorded, this determination is the process of determining whether more than half of the sectors have recorded data. Becomes

통상적으로 하나의 데이터뱅크 내에서는 데이터가 기록될 때 검색 방향(기록 방향)상의 첫번째 섹터로부터 순차적으로 기록되므로, 현재 기록된 섹터의 개수가 총 섹터수의 절반 이상인 경우에는 데이터뱅크 내의 검색방향상의 전반부에 놓인 섹터(1 번째 섹터 내지 5 번째 섹터)에는 이미 데이터가 기록되어 있을 확률이 크 고 검색방향상의 후반부에 놓인 섹터(6 번째 섹터 내지 10 번째 섹터)에는 이미 데이터가 기록되어 있을 확률이 작다. 따라서, Filled 의 값이 Total 의 값의 절반 이상인 경우에는, 데이터뱅크 내에서 검색 방향상의 후반부에 배치된 섹터들 내에서 데이터가 기록 가능한 위치를 먼저 검색하고, 후반부에 배치된 섹터들 내에서 이러한 위치가 검색되지 않은 경우 검색 방향상의 전반부에 배치된 섹터들 내에서 이러한 위치의 검색 작업을 수행한다. 또한, Filled 의 값이 Total 의 값의 절반 미만인 경우에는 원래의 검색 방향에 따라 데이터가 기록 가능한 위치를 검색한다.Typically, in one data bank, data is sequentially recorded from the first sector in the search direction (recording direction) when data is recorded. Therefore, when the number of currently recorded sectors is more than half of the total number of sectors, it is placed in the first half of the search direction in the data bank. There is a high probability that data has already been recorded in the sectors (1st through 5th sectors) and there is a low probability that data has already been recorded in the sectors (6th through 10th sectors) placed in the latter half of the search direction. Therefore, if the value of Filled is more than half of the value of Total, the position where data can be written is first searched in the sectors arranged in the latter part of the search direction in the data bank, and the position is determined in the sectors arranged in the latter part. If it is not searched, a search operation of this position is performed in sectors arranged in the first half in the search direction. If the value of Filled is less than half of the value of Total, the position where data can be recorded is searched according to the original search direction.

도 5 와 같이 데이터뱅크 1 의 경우에는 절반 이상이 되므로(즉, 6/10 > 1/2) 후반부에 대해 1차 검색이 이루어지고 후반부에서 적절한 위치가 발견되지 않을 경우에 전반부에 대해 2차 검색이 이루어진다. 데이터뱅크 1 의 현재 구조에서는 후반부에서 적절한 위치가 발견되므로 2차 검색은 수행되지 않는다.As shown in FIG. 5, since data bank 1 is more than half (that is, 6/10> 1/2), the first search is performed on the second half, and the second search is performed on the first half when the proper position is not found on the second half. Is done. In the current structure of Databank 1, the secondary search is not performed because the proper location is found in the second half.

이러한 과정을 살펴보면, 첫 번째 섹터로부터 검색 방향을 따라 순차적으로 검색한 경우에 비하여 검색 시간이 현저하게 줄어드는 것을 알 수 있다. 또한, 이러한 과정은 특정 섹터에 대해 집중적으로 기록 및 삭제가 반복되는 확률을 낮추며, 따라서 사용 불가능한 메모리 부분의 발생 가능성을 현저하게 낮추어주는 기능을 한다.Looking at this process, it can be seen that the search time is significantly reduced compared to the case of sequentially searching from the first sector along the search direction. This process also lowers the probability of intensive write and erase repetition for a particular sector, and thus serves to significantly reduce the likelihood of an unusable memory portion.

통계적인 시뮬레이션 결과에 따르면 Fregmentation(사용불가능한 메모리 부분)의 발생 비율이 5% 이내로 낮추어져 메모리 관리 효용성이 확인되었으며, 전체적인 검색 속도 또한 종래의 스캐닝 방식에 비해 5 배 정도 증가됨이 확인되었다.According to the statistical simulation results, the rate of occurrence of Fregmentation (unusable memory part) is lowered to within 5%, confirming the memory management effectiveness, and confirming that the overall retrieval speed is also increased by five times compared to the conventional scanning method.

본 발명에 따르면, 기록하고자 하는 데이터가 기록될 수 있는 메모리 내의 위치의 검색 시간이 현저하게 단축되므로 특히 휴대폰과 같이 데이터 프로세싱의 속도 저하가 문제되는 소형 디바이스에서 신속한 데이터베이스 관리가 가능하게 된다는 장점이 있다.According to the present invention, since the retrieval time of a location in the memory where data to be recorded can be recorded is significantly shortened, there is an advantage that rapid database management is possible, particularly in a small device such as a mobile phone, in which the speed of data processing is slow .

또한, 본 발명에 따르면, 특정 섹터에 대한 집중적인 기록과 삭제의 반복 가능성이 적으므로, 데이터 기록에 사용될 수 없는 메모리 부분의 발생이 최소화된다는 장점이 있다.Further, according to the present invention, since the possibility of intensive writing and erasure of a specific sector is less likely to be repeated, there is an advantage that the occurrence of a memory portion which cannot be used for data writing is minimized.

상기에서는 본 발명의 바람직한 실시예에 대해 도시하고 설명하였으나, 본 발명은 상술한 특정의 실시예에 한정되지 않으며 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에 의해 본 발명의 기술사상과 아래에 기재될 특허청구범위의 균등범위 내에서 다양한 수정 및 변형이 가능할 것이며, 이러한 변형은 본 발명의 보호범위에 속할 것이다.In the above, the preferred embodiment of the present invention has been illustrated and described, but the present invention is not limited to the specific embodiments described above, and the technical spirit of the present invention and the following by those skilled in the art to which the present invention pertains. Various modifications and variations will be possible within the equivalent scope of the claims set forth herein, and such variations will fall within the protection scope of the present invention.

Claims (6)

각각이 복수의 섹터로 구성된 복수의 데이터뱅크로 구획된 메모리 내에서 데이터의 신규 기록이 가능한 위치의 검색/기록 방법에 있어서,A retrieval / write method of a position where data can be newly recorded in a memory partitioned into a plurality of data banks each composed of a plurality of sectors, (a) 각각의 상기 데이터뱅크에 대해 대응되어 설정된 기록영역에 기록된 정보를 검색하는 단계로서, 상기 기록영역에는 상기 데이터가 기록되어 있지 않은 상기 섹터들 중 연이어 배열된 상기 섹터의 최대 개수에 대한 정보가 기록되어 있는, 상기 검색 단계;(a) retrieving information recorded in a correspondingly set recording area for each of the data banks, wherein information on a maximum number of the sectors arranged consecutively among the sectors in which the data is not recorded is recorded in the recording area; The retrieval step is recorded; (b) 상기 (a) 단계에서 상기 최대 개수가 현재 기록될 데이터의 섹터수 이상인 것으로 검색된 상기 데이터뱅크를 결정하는 단계;(b) determining the databank found in step (a) that the maximum number is greater than or equal to the number of sectors of data to be recorded currently; (c) 상기 (b) 단계에서 결정된 상기 데이터뱅크 내에서 상기 기록될 데이터의 상기 섹터수 이상인 위치를 검색하는 단계;(c) searching for a position in the data bank determined in step (b) that is equal to or greater than the number of sectors of the data to be recorded; (c-1) 상기 (c) 단계에서의 검색 결과 상기 기록될 데이터의 상기 섹터수 이상인 상기 위치가 상기 데이터뱅크 내에 존재하지 않는 것으로 검색된 경우, 해당되는 상기 데이터뱅크의 상기 기록영역 내의 상기 최대 개수에 대한 정보를 수정하고 다른 데이터뱅크에 대해 상기 (b) 단계부터 반복 수행하는 단계; 및(c-1) when the search result in step (c) finds that the position equal to or greater than the number of sectors of the data to be recorded does not exist in the data bank, the maximum number in the recording area of the corresponding data bank is determined. Modifying the information and repeating the steps from step (b) for the other data banks; And (d) 상기 (c) 단계에서의 검색 결과 상기 기록될 데이터의 상기 섹터수 이상인 상기 위치가 상기 데이터뱅크 내에 존재하는 것으로 검색된 경우, 검색된 상기 위치에 상기 기록될 데이터를 기록하는 단계;(d) recording the data to be recorded at the retrieved position when the position as the result of the retrieval in step (c) is found to be present in the data bank which is equal to or greater than the number of sectors of the data to be recorded; 를 포함하는 것을 특징으로 하는 검색/기록 방법.Search / recording method comprising a. 삭제delete 삭제delete 삭제delete 제 1 항에 있어서,The method of claim 1, 상기 기록영역에는 해당되는 상기 데이터뱅크의 상기 섹터의 총 개수인 총섹터수, 및 상기 데이터가 기록되어 있는 상기 섹터들의 개수인 기록섹터수에 대한 정보가 추가적으로 기록되어 있는 것을 특징으로 하는 검색/기록 방법.A retrieval / recording method, characterized in that information is further recorded in the recording area corresponding to the total number of sectors, the total number of sectors of the sector, and the number of recording sectors, the number of sectors on which the data is recorded. . 제 5 항에 있어서,The method of claim 5, 상기 (c) 단계는,In step (c), (c-a) 상기 (b) 단계에서 결정된 상기 데이터뱅크의 상기 기록영역에서 상기 총섹터수 및 상기 기록섹터수의 개수를 검출하는 단계; 및(c-a) detecting the total number of sectors and the number of recording sectors in the recording area of the data bank determined in the step (b); And (c-b) 상기 기록섹터수가 상기 총섹터수의 절반 이상인 경우 상기 데이터뱅크 내에서 검색 방향상의 후반부에 배치된 상기 섹터들 내에서 상기 위치를 먼저 검색하고 상기 후반부에 배치된 섹터들 내에서 상기 위치가 검색되지 않은 경우 상기 검색 방향상의 전반부에 배치된 상기 섹터들 내에서 상기 위치를 검색하며, 상기 기록섹터수가 상기 총섹터수의 절반 미만인 경우 상기 검색 방향에 따라 상기 위치를 검색하는 단계;(cb) when the number of recording sectors is at least half of the total number of sectors, the position is first searched in the sectors arranged in the latter half of the search direction in the data bank, and the position is searched in the sectors arranged in the latter half. If not, searching for the position in the sectors arranged in the first half of the search direction, and searching for the position according to the search direction if the number of recorded sectors is less than half of the total number of sectors; 를 포함하는 것을 특징으로 하는 검색/기록 방법.Search / recording method comprising a.
KR1020060015533A 2006-02-17 2006-02-17 Method for searching a position to be recorded with data in a memory KR100656762B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020060015533A KR100656762B1 (en) 2006-02-17 2006-02-17 Method for searching a position to be recorded with data in a memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020060015533A KR100656762B1 (en) 2006-02-17 2006-02-17 Method for searching a position to be recorded with data in a memory

Publications (1)

Publication Number Publication Date
KR100656762B1 true KR100656762B1 (en) 2006-12-13

Family

ID=37733078

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020060015533A KR100656762B1 (en) 2006-02-17 2006-02-17 Method for searching a position to be recorded with data in a memory

Country Status (1)

Country Link
KR (1) KR100656762B1 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000057049A (en) 1998-08-04 2000-02-25 Victor Co Of Japan Ltd Flash memory filing system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000057049A (en) 1998-08-04 2000-02-25 Victor Co Of Japan Ltd Flash memory filing system

Similar Documents

Publication Publication Date Title
JP4832521B2 (en) Data management method in flash memory media
US11853549B2 (en) Index storage in shingled magnetic recording (SMR) storage system with non-shingled region
KR101613678B1 (en) Recovery for non-volatile memory after power loss
EP2209074A1 (en) Data storage processing method, data searching method and devices thereof
KR102195836B1 (en) Method for managing index
US8225060B2 (en) Data de-duplication by predicting the locations of sub-blocks within the repository
US7526600B2 (en) Data management device and method for flash memory
US20120239851A1 (en) Prioritized erasure of data blocks in a flash storage device
KR20190134115A (en) Method and apparatus for providing efficient indexing and computer program included in computer readable medium therefor
JP2005222534A (en) Data management apparatus and method used for flash memory
CN111913890B (en) Random read-write method of nonvolatile memory based on security module
KR101699779B1 (en) Indexing method for flash memory
KR20180135390A (en) Data journaling method for large solid state drive device
KR20020081696A (en) Method and system for reducing fragmentation
KR100656762B1 (en) Method for searching a position to be recorded with data in a memory
JP2007148965A (en) Error block management method and device for flash disk device
CN107450859B (en) Method and device for reading file data
KR20060106993A (en) Method for storing data in flash memory
US20100077147A1 (en) Methods for caching directory structure of a file system
CN114741382A (en) Caching method and system for reducing read time delay
KR100859989B1 (en) Apparatus for managing space information of flash memory and method of the same
CN108304331B (en) NorFlash-based circular queue type data storage method and device
US20090055574A1 (en) NAND Flash Memory Device And Related Method Thereof
US20200320054A1 (en) Computer program for providing database management
KR100521155B1 (en) Apparatus and method for writing data in flash memory

Legal Events

Date Code Title Description
A201 Request for examination
A302 Request for accelerated examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20100607

Year of fee payment: 4

LAPS Lapse due to unpaid annual fee