Device and method for positioning storage space

By establishing a KV time information comparison table in the storage device, and corresponding time parameter information with the data storage address, the problem of too long search time during data query in the prior art is solved, and the efficiency of fast positioning and retrieval of data is achieved.

CN120066377APending Publication Date: 2025-05-30AEROSPACE SCI & IND INERTIA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311605092.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-28
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

The prior art requires a long time to search when querying data stored at a specific moment, especially in storage devices without a file system.

Method used

By establishing a KV time information comparison table in the easyflash memory library, the time parameter information corresponds one by one to the data storage address of the second storage space, and the data storage address is quickly positioned using the KV key-value pair.

Benefits of technology

It realizes the rapid positioning of data storage addresses through time information, reduces search time and improves the efficiency of data retrieval.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066377A_ABST
    Figure CN120066377A_ABST
Patent Text Reader

Abstract

The invention provides a device for positioning a storage space, a first storage space is used for storing parameter information, a second storage space is used for storing data, an easyflash memory bank is connected with the first storage space, KV key value pairs of the easyflash memory bank enable time parameter information to correspond to data storage addresses of the second storage space one by one, and a KV time information comparison table is formed; the information storage unit is linked with the first storage space, corresponding key words are selected at a certain fixed time point according to a KV time information comparison table, data storage address information of the second storage space is recorded by using value, and KV key value pair parameter information is recorded in the first storage space; the information reading unit is linked with the first storage space and the second storage space, and the information reading unit is positioned to a corresponding data storage address of the second storage space through the KV time information comparison table. According to the invention, the problem of long time for searching data due to storage equipment without a file system is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of storage space management and storage data search, and particularly relates to a device and method for locating storage space. Background Art

[0002] The storage devices used in the single-chip microcomputer embedded system are getting larger and larger in storage space. Generally, the storage devices have a file system and can quickly query data at a specific time point. However, for storage devices without a file system and with a large amount of stored data, it takes a long time to search for the data stored at a specific moment. Summary of the Invention

[0003] The purpose of the present invention is to overcome the deficiencies in the prior art and provide a device and method for locating storage space. The solution of the present invention can solve the problems existing in the above prior art.

[0004] The technical solution of the present invention:

[0005] According to a first aspect, a device for locating storage space includes a first storage space, a second storage space, an easyflash memory library, a KV time information comparison table, an information reading unit, and an information storing unit. The first storage space stores parameter information, the second storage space is used to store data, the easyflash memory library is connected to the first storage space, the KV time information comparison table is located in the easyflash memory library, and the KV key-value pairs of the easyflash memory library correspond the time parameter information with the data storage addresses of the second storage space one by one to form a KV time information comparison table; the information storing unit is linked to the first storage space, and at a certain fixed time point, selects a corresponding key keyword according to the KV time information comparison table and records the data storage address information of the second storage space with value, and the KV key-value pair parameter information is recorded in the first storage space; the information reading unit is linked to the first storage space and the second storage space. When it is necessary to extract data stored in the second storage space at a specific time, the information reading unit quickly locates the corresponding data storage address of the second storage space through the KV key-value pair time information comparison table and reads the data to be extracted from the corresponding data storage address.

[0006] Further, the first storage space is a SPIFLASH.

[0007] Further, the second storage space is an SD card.

[0008] Further, the time parameter information includes a key keyword and a value information value. The key keyword includes the starting year and month of storage, and the value information value is a string containing 31 SD card storage starting address information.

[0009] Preferably, the key keyword is set in the format of the nth year + month.

[0010] Preferably, the key keyword includes a full storage flag. After full storage, recording starts to be overwritten from the first year.

[0011] According to a second aspect, there is provided a method for locating a storage space, including the following steps:

[0012] Form a KV time information comparison table by combining the time information parameters of data storage and the data storage address, and store it in the first storage space;

[0013] When reading data, obtain the data storage address from the KV time information comparison table according to the storage time of the data to be read;

[0014] Read the required data from the second storage space according to the accessed address.

[0015] Further, after the first storage space is full, the KV time information comparison table saves the number of full storage times and starts to overwrite records from the first year.

[0016] According to a third aspect, there is provided a single-chip microcomputer, and the single-chip microcomputer includes the device for locating a storage space described above.

[0017] According to a fourth aspect, there is provided a single-chip microcomputer, and the single-chip microcomputer uses the method for locating a storage space of the present invention to locate the storage space.

[0018] Advantages of the present invention compared with the prior art:

[0019] (1) Through the KV time information comparison table, the present invention stores the storage time and storage address of data as a KV key-value pair. When searching for information, the data storage address in the second storage space can be quickly located through the time information, omitting the operation of searching address by address according to time, and reducing the search time;

[0020] (2) Through the KV key-value pair provided by the easyflash memory library, the present invention stores the storage time and storage address of data more quickly and conveniently, reducing the data search time;

[0021] (3) By setting a dual storage space, the present invention separately stores and manages parameters and data, reducing the time for traversing parameters when searching according to time and improving the search efficiency. Description of the Drawings

[0022] The accompanying drawings included are used to provide a further understanding of the embodiments of the present invention, which form a part of the specification, illustrate the embodiments of the present invention, and, together with the written description, explain the principles of the present invention. Obviously, the drawings in the following description are only some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0023] Figure 1 The schematic structural diagram of a device for locating a storage space provided according to an embodiment of the present invention is shown;

[0024] Figure 2 The schematic diagram of the steps of a method for locating a storage space provided according to an embodiment of the present invention is shown;

[0025] Figure 3 The flowchart of a method for locating a storage space provided according to an embodiment of the present invention is shown. Detailed implementation manners

[0026] It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. The description of at least one exemplary embodiment below is actually only illustrative and in no way limits the present invention and its application or use. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.

[0027] It should be noted that the terms used herein are only for describing specific implementation manners and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0028] Unless otherwise specifically stated, the relative arrangements, numerical expressions, and numerical values of the components and steps set forth in these embodiments do not limit the scope of the present invention. At the same time, it should be understood that for the sake of convenience in description, the dimensions of the various parts shown in the drawings are not drawn in actual proportional relationships. Technologies, methods, and devices known to those of ordinary skill in the relevant art may not be discussed in detail, but where appropriate, the said technologies, methods, and devices should be regarded as part of the authorization specification. In all the examples shown and discussed here, any specific value should be construed as merely exemplary and not as a limitation. Therefore, other examples of the exemplary embodiments may have different values. It should be noted that similar reference numerals and letters denote similar items in the following drawings, and thus, once an item is defined in one drawing, it does not need to be further discussed in subsequent drawings.

[0029] As Figure 1 shown, according to an embodiment of the first aspect of the present invention, there is provided a device for locating a storage space, including a first storage space, a second storage space, an easyflash memory bank, a KV time information comparison table, an information reading unit, and an information storing unit. The first storage space stores parameter information, the second storage space is used for storing data, the easyflash memory bank is connected to the first storage space, the KV time information comparison table is located in the easyflash memory bank, and the KV key-value pairs of the easyflash memory bank correspond the time parameter information one-to-one with the data storage addresses of the second storage space to form the KV time information comparison table; the information storing unit is linked to the first storage space, and at a certain fixed time point, selects the corresponding key keyword according to the KV time information comparison table and records the data storage address information of the second storage space with value, and the KV key-value pair parameter information is recorded in the first storage space; the information reading unit is linked to the first storage space and the second storage space, and when it is necessary to extract the data stored in the second storage space at a specific time, the information reading unit quickly locates the corresponding data storage address of the second storage space through the KV key-value pair time information comparison table, and reads the data to be extracted from the corresponding data storage address. With this setting, through the KV time information comparison table, the storage time and storage address of the data are stored as KV key-value pairs. When searching for information, the data storage address of the second storage space is quickly located through the time information, omitting the operation of searching address by address according to time and reducing the search time; through the KV key-value pairs of the easyflash memory bank, the storage time and storage address of the data are stored more quickly and conveniently, reducing the search time of the data; by setting a dual storage space in the present invention, the parameters and data are stored and managed separately, reducing the time for traversing the parameters when searching according to time and improving the search efficiency.

[0030] Further, in one embodiment, the first storage space is SPIFLASH, a space with a small storage capacity, which can reduce the traversal time of time parameters during search.

[0031] Further, in one embodiment, the second storage space is an SD card, which has a large storage capacity and can store a sufficient amount of data information.

[0032] Further, in one embodiment, the time parameter information includes a key keyword and a value information value. The key keyword includes the storage start year and month, and the value information value is a string containing 31 starting address information of the second storage space. With this setting, the time parameters of each day can be recorded, and when locating data, the time can be accurate to the day.

[0033] Preferably, in one embodiment, the key keyword is set in the format of the nth year + month, so as to avoid frequent changes to the keyword information when the years are different.

[0034] Preferably, in one embodiment, the key keyword includes a full storage flag, and after being full, the recording starts to be overwritten from the first year. Specifically, 0 means not full, 1 means full once, and m means full m times.

[0035] According to the second aspect, a method for locating a storage space is provided, including the following steps:

[0036] Step 1, form a KV time information comparison table by combining the time information parameters of data storage and the data storage address, and store it in the first storage space;

[0037] Further, in one embodiment, the time parameter information includes a key keyword and a value information value. The key keyword includes the storage start year and month, and the value information value is a string containing 31 starting address information of the second storage space. With this setting, the time parameters of each day can be recorded, and when locating data, the time can be accurate to the day.

[0038] Preferably, in one embodiment, the key keyword is set in the format of the nth year + month, so as to avoid frequent changes to the keyword information when the years are different.

[0039] Preferably, in one embodiment, the key keyword includes a full storage flag, and after being full, the recording starts to be overwritten from the first year. Specifically, 0 means not full, 1 means full once, and m means full m times.

[0040] Step 2, when reading data, obtain the data storage address from the KV time information comparison table according to the storage time of the data to be read;

[0041] Step 3, read the required data from the second storage space according to the access address.

[0042] Further, in one embodiment, after the KV time information comparison table fills up the first storage space, it saves the number of times it is filled up and starts overwriting the records from the first year.

[0043] According to an embodiment of the third aspect, a single-chip microcomputer is provided, and the single-chip microcomputer includes the device for positioning the storage space described above.

[0044] According to an embodiment of the fourth aspect, a single-chip microcomputer is provided, and the single-chip microcomputer uses the method for positioning the storage space of the present invention to position the storage space.

[0045] In order to further elaborate on a device and method for positioning a storage space of the present invention, the present invention will be described in detail below with reference to the accompanying drawings.

[0046] The single-chip microcomputer embedded system uses dual storage spaces for storage management. The first storage space uses SPIFLASH to store parameter information, and the second storage space uses an SD card to store data; an easyflash lightweight embedded memory library is embedded in the single-chip microcomputer embedded system and associated with the SPIFLASH; a custom KV time information comparison table is defined, and the time parameter information is corresponding to the data storage address of the SD card through KV key-value pairs. As shown in the following table, the key keyword includes the starting year of storage, the full flag, and the key-value information for each month in the 5 years (set as needed) after this time year (a total of 60 items), and the value information records the starting address of the SD card occupied by the storage for each day of the corresponding month (a total of 31 address information items).

[0047] The key keyword is set in the format of the nth year + month. Add1-1 is the first month of the first year starting from the starting year of storage (Usetime), avoiding frequent changes to the keyword information when the years are different.

[0048] The value information is set as string information, including 31 SD card storage starting address information items, corresponding to the starting storage addresses at 0 o'clock every day of the 31 days of the corresponding month.

[0049] When the 5-year storage is full, record the full flag (Addwhole), and it can record that it has been full m times. Start overwriting the records from the first year. Add1-1 is the starting address information of the SD card occupied by the data for each of the 31 days of January in Usetime + 5*m years.

[0050]

[0051]

[0052] Step 1, record the starting time year information to the SPIFLASH;

[0053] Step 2: The collected data is stored in the SD card in the order of the storage address;

[0054] Step 3: At 0:00 every day, select the corresponding key according to the KV time information comparison table and record the data storage address information of the SD card with value. The KV key-value pair parameter information (time - address) is recorded in the SPI FLASH;

[0055] Step 4: When it is necessary to extract the data stored in the SD card within a specific time, first parse the start time starttime and the end time endtime of the data to be extracted;

[0056] Step 5: Calculate the corresponding key keyword information according to starttime and endtime;

[0057] Step 6: Query the corresponding value information according to the key keyword information to obtain the corresponding SD card data storage address information;

[0058] Step 7: Directly read the corresponding data from the locked SD card storage data address, omitting the operation of searching address by address according to time.

[0059] Advantages of the present invention compared with the prior art:

[0060] (1) Through the KV time information comparison table, the present invention stores the storage time and storage address of the data as a KV key-value pair. When searching for information, the data storage address in the second storage space can be quickly located through the time information, omitting the operation of searching address by address according to time and reducing the search time;

[0061] (2) Through the KV key-value pair provided by the easyflash memory library, the present invention stores the storage time and storage address of the data more quickly and conveniently, reducing the search time of the data;

[0062] (3) By setting up a dual storage space, the present invention separately stores and manages the parameters and data, reducing the time for traversing the parameters when searching according to time and improving the search efficiency.

[0063] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A device for locating storage space, characterized in that, it includes a first storage space, a second storage space, an easyflash memory library, a KV time information comparison table, an information reading unit and an information storing unit. The first storage space stores parameter information, the second storage space is used to store data, the easyflash memory library is connected to the first storage space, the KV time information comparison table is located in the easyflash memory library, and the KV key-value pairs of the easyflash memory library correspond the time parameter information with the data storage addresses of the second storage space one by one to form a KV time information comparison table; the information storing unit is linked to the first storage space, and at a certain fixed time point, selects the corresponding key keyword according to the KV time information comparison table and uses the value to record the data storage address information of the second storage space, and the KV key-value pair parameter information is recorded in the first storage space; the information reading unit is linked to the first storage space and the second storage space. When data stored in the second storage space at a specific time needs to be extracted, the information reading unit quickly locates the corresponding data storage address of the second storage space through the KV key-value pair time information comparison table, and reads the data to be extracted from the corresponding data storage address.

2. The device for locating storage space according to claim 1, characterized in that, the first storage space is a SPIFLASH.

3. The device for locating storage space according to claim 2, characterized in that, the second storage space is an SD card.

4. The device for locating storage space according to claim 1, characterized in that, the time parameter information includes a key keyword and a value information value. The key keyword includes the starting year and month of storage, and the value information value is a string containing 31 SD card storage starting address information.

5. The device for locating storage space according to claim 4, characterized in that, the key keyword is set in the format of the nth year + month.

6. The device for locating storage space according to claim 4, characterized in that, the key keyword includes a full storage flag, and after full storage, it starts to overwrite and record from the first year.

7. A method for locating storage space using the device for locating storage space according to any one of claims 1 to 6, characterized in that, it includes the following steps: Form a KV time information comparison table from the time information parameters of data storage and the data storage address, and store it in the first storage space; When reading data, obtain the data storage address from the KV time information comparison table according to the storage time of the data to be read; Read the required data from the second storage space according to the access address.

8. The method for locating storage space according to claim 7, characterized in that, after the first storage space of the KV time information comparison table is full, the number of full storage times is saved, and it starts to overwrite and record from the first year.

9. A single-chip microcomputer, characterized in that, The single-chip microcomputer described above includes the device for locating storage space described in claims 1 to 6.

10. A single-chip microcomputer, characterized in that the single-chip microcomputer described above locates the storage space by using the method for locating storage space described in claim 7 or 8.