A bit file storage method, a bit file query method, a device, and a terminal equipment

CN115421655BActive Publication Date: 2026-09-29SHENZHEN COOCAA NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211040667.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-29
Publication Date
2026-09-29
Estimated Expiration
2042-08-29

AI Technical Summary

Technical Problem

[0004]本发明要解决的技术问题在于,针对现有技术的上述缺陷,提供一种位文件存储方法、位文件查询方法、装置、终端设备,旨在提供解决现有技术中基于位来实现数据存储时,容易造成大量的存储空间浪费的问题

Benefits of technology

[0039]有益效果:与现有技术相比,本发明提供了一种位文件存储方法,首先获取所有的位数据,并将所有的所述位数据依次进行数据编码,得到每一个所述位数据所对应的编码信息,所述编码信息反映的是用于存储数据的存储空间的编号。然后,根据所有的所述编码信息,将所有的所述位数据进行分页处理,得到若干数据页,每一个所述数据页中包括若干个所述位数据。最后,获取存在数据的目标位数据,并确定所述存在数据的目标位数据所对应的目标数据页,并将所述目标数据页进行存储,得到位文件。本发明在基于位来实现数据存储时,对位数据进行编码、分页等处理,以便确定出存在数据的位数据所对应的数据页,因此在存储时,只需要将存在数据的数据页进行存储即可,有效节省了存储空间。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115421655B_ABST
    Figure CN115421655B_ABST
Patent Text Reader

Abstract

The application discloses a bit file storage method, a bit file query method, a bit file storage device, a bit file query device and a terminal device. The bit file query method comprises the following steps: acquiring all bit data, and sequentially performing data coding on the bit data to obtain coding information corresponding to each bit data. The bit data reflects a storage space used for storing data. According to all the coding information, the bit data is subjected to paging processing to obtain a plurality of data pages, and each data page comprises a plurality of bit data. Target bit data with existing data is acquired, a target data page corresponding to the target bit data with existing data is determined, and the target data page is stored to obtain a bit file. When data storage is realized based on bits, the bit data is subjected to coding, paging and other processing, so that the data page corresponding to the bit data with existing data is determined. Therefore, only the data page with existing data needs to be stored during storage, and the storage space is effectively saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data storage and display technology, and in particular to a bit file storage method, a bit file query method, an apparatus, and a terminal device. Background Technology

[0002] As enterprise data volumes continue to grow, the storage, transmission, and retrieval of big data consume increasing amounts of resources. Bit-based data storage, transmission, and retrieval are addressing resource shortages; a bit file of just a few megabytes can store vast amounts of data, and bit-based transmission and retrieval are extremely fast. However, bit-based storage works by fixing one bit to one piece of data and using the bit's state (0 or 1) to indicate whether data exists. If a small amount of data contains a bit that is far down in the sequence, the bit file becomes very large (due to sparse data), wasting significant storage space.

[0003] Therefore, existing technologies still need to be improved and enhanced. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a bit file storage method, bit file query method, apparatus, and terminal device to address the above-mentioned defects of the prior art, aiming to solve the problem that the prior art of data storage based on bits is prone to causing a large amount of storage space waste.

[0005] In a first aspect, the present invention provides a screen display method based on attention training, wherein the method includes:

[0006] All bit data are acquired and all the bit data are encoded sequentially to obtain the encoding information corresponding to each bit data. The encoding information reflects the number of the storage space used to store the data.

[0007] Based on all the encoded information, all the bit data is paginated to obtain several data pages, each of which includes several bits of data.

[0008] Obtain the target bit data of the existing data, determine the target data page corresponding to the target bit data of the existing data, and store the target data page to obtain a bit file.

[0009] In one implementation, the step of paging all the bit data according to all the encoded information to obtain several data pages includes:

[0010] Based on all the encoded information, the encoded information is paginated in order, with each page consisting of 8 bits, to obtain several data pages. Each data page includes 8 bits of data.

[0011] In one implementation, obtaining the target bit data that exists includes:

[0012] Obtain the data identifier corresponding to each bit data;

[0013] If the data identifier is 1, then the bit data with the data identifier 1 is used as the target bit data for obtaining the existing data.

[0014] In one implementation, storing the target data page to obtain a bit file includes:

[0015] All the data pages are divided into several directory sections, each consisting of 8 data pages.

[0016] Obtain the target directory portion corresponding to the target data page, and set identification information for the target data page in the target directory portion, wherein the identification information is used to reflect the existence of data in the target data page, and the identification information is 1;

[0017] The target data page in the target directory portion is stored to obtain the bit file.

[0018] Secondly, embodiments of the present invention also provide a bit file query method, wherein the method includes:

[0019] Obtain the target encoding information corresponding to the bit data to be queried;

[0020] Based on the target encoding information, the target data page corresponding to the bit data to be queried is determined in the bit file, and the target directory portion corresponding to the target data page is determined;

[0021] The target bit data corresponding to the target encoding information is determined from the target data page, and the stored data in the target bit data is read.

[0022] In one implementation, the step of determining the target directory portion corresponding to the queried bit data in the bit file based on the target encoding information, and determining the target data page corresponding to the target encoding information from the target directory portion, includes...

[0023] Divide the target encoding information by 8 and take the modulo to obtain the target data page corresponding to the target encoding information;

[0024] Based on the target data page, determine the target directory portion corresponding to the target data page.

[0025] In one implementation, determining the target bit data corresponding to the target encoding information from the target data page and reading the stored data in the target bit data includes:

[0026] Obtain the identification information corresponding to the target data page in the target directory section;

[0027] If the identification information is 1, then the target bit data corresponding to the target encoding information is determined from the target data page;

[0028] Obtain the data identifier corresponding to the target bit data. If the data identifier is 1, then read the data in the target bit data.

[0029] Secondly, embodiments of the present invention also provide a bit file storage device, wherein the device includes:

[0030] The data encoding module is used to acquire all bit data and encode all the bit data sequentially to obtain the encoding information corresponding to each bit data. The encoding information reflects the number of the storage space used to store the data.

[0031] The paging processing module is used to paging all the bit data according to all the encoded information to obtain several data pages, each of the data pages including several bit data.

[0032] The data storage module is used to acquire the target bit data of the existing data, determine the target data page corresponding to the target bit data of the existing data, and store the target data page to obtain a bit file.

[0033] Thirdly, embodiments of the present invention also provide a bit file query device, wherein the device includes:

[0034] The encoding acquisition module is used to acquire the target encoding information corresponding to the bit data to be queried;

[0035] The data page determination module is used to determine the target data page corresponding to the bit data to be queried in the bit file based on the target encoding information, and to determine the target directory portion corresponding to the target data page;

[0036] The data reading module is used to determine the target bit data corresponding to the target encoding information from the target data page, and read the stored data in the target bit data.

[0037] Fourthly, embodiments of the present invention also provide a terminal device, wherein the terminal device includes a memory, a processor, and a bit file storage program or a bit file query program stored in the memory and executable on the processor, wherein the processor executes the bit file storage program or the bit file query program to implement the steps of the bit file storage method or the bit file query method of any of the above solutions.

[0038] Fourthly, embodiments of the present invention also provide a computer-readable storage medium, wherein a bit file storage program or a bit file query program is stored on the computer-readable storage medium, and when the bit file storage program or bit file query program is executed by a processor, it implements the steps of the bit file storage method or the bit file query method of any of the above-described schemes.

[0039] Beneficial Effects: Compared with existing technologies, this invention provides a bit file storage method. First, all bit data is acquired and sequentially encoded to obtain encoding information corresponding to each bit data. This encoding information reflects the storage space number used to store the data. Then, based on all the encoding information, all the bit data is paginated to obtain several data pages, each containing several bits of data. Finally, the target bit data containing the existing data is acquired, and the target data page corresponding to the target bit data is determined and stored to obtain a bit file. This invention, when implementing data storage based on bits, performs encoding and pagination on the bit data to determine the data page corresponding to the bit data containing the existing data. Therefore, during storage, only the data pages containing the existing data need to be stored, effectively saving storage space. Attached Figure Description

[0040] Figure 1 A flowchart illustrating a specific implementation of the bit file storage method provided in this embodiment of the invention.

[0041] Figure 2 A flowchart illustrating a specific implementation of the bit file query method provided in this embodiment of the invention.

[0042] Figure 3 A functional schematic diagram of a bit file storage device provided in an embodiment of the present invention.

[0043] Figure 4 This is a functional schematic diagram of the bit file query device provided in an embodiment of the present invention.

[0044] Figure 5 A schematic diagram of a terminal device provided in an embodiment of the present invention. Detailed Implementation

[0045] To make the objectives, technical solutions, and effects of this invention clearer and more explicit, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0046] This invention provides a bit file storage method that saves storage space and reduces storage waste. In specific application, this embodiment first acquires all bit data and sequentially encodes all the bit data to obtain encoding information corresponding to each bit data. This encoding information reflects the number of the storage space used to store the data. Then, based on all the encoding information, all the bit data is paginated to obtain several data pages, each data page including several bits of data. Finally, the target bit data containing the existing data is acquired, and the target data page corresponding to the target bit data is determined and stored to obtain a bit file. Therefore, this embodiment, when implementing data storage based on bits, performs encoding and pagination on the bit data to determine the data page corresponding to the bit data containing the existing data. Thus, during storage, only the data pages containing the existing data need to be stored, effectively saving storage space and solving the space waste caused by data sparsity.

[0047] When querying a bit file, this embodiment provides a bit file query method. Specifically, this embodiment first obtains the target encoding information corresponding to the bit data to be queried. Then, based on the target encoding information, it determines the target directory portion corresponding to the bit data to be queried in the bit file, and determines the target data page corresponding to the target encoding information from the target directory portion. Finally, it determines the target bit data corresponding to the target encoding information from the target data page and reads the stored data in the target bit data. Therefore, this embodiment, when performing a bit file query, can locate the target data page based on the target encoding information corresponding to the bit data to be queried, and then read the stored data in the target bit data within that target data page, achieving fast data query and retrieval.

[0048] Exemplary methods

[0049] The bit file storage method of this embodiment can be applied to terminal devices, which can be intelligent product terminals such as computers. Specifically, for example... Figure 1 As shown, the bit file storage method includes the following steps:

[0050] Step S100: Obtain all bit data and encode all the bit data sequentially to obtain the encoding information corresponding to each bit data. The encoding information reflects the number of the storage space used to store the data.

[0051] This embodiment first defines and encodes all bit data sequentially. During data encoding, this embodiment uniformly uses ASCII to represent data size. The encoding information corresponding to each bit data is as follows:

[0052] Bit data encoding information

[0053] Mac0 0

[0054] Mac1 1

[0055] Mac2 2

[0056] Mac3 3

[0057] Mac4 4

[0058] Mac5 5

[0059] Mac6 6

[0060] Mac7 7 ...

[0062] Macn n

[0063] In this embodiment, all bit data is encoded so that each bit data corresponds to an encoding information. For example, if there are n bits of data, there are n encoding information, and the encoding information ranges from 0 to n. Each encoding information represents a storage space used to store the data.

[0064] Step S200: Based on all the encoded information, all the bit data is paginated to obtain several data pages, each of which includes several bits of data.

[0065] After obtaining all the encoded information, this embodiment can perform paging processing on the bit data based on the encoded information, dividing the bit data into several data pages, such that each data page includes several bits of the bit data. For example, this embodiment can perform paging processing on all the encoded information in sequence, dividing it into data pages of 8 bits each, to obtain several data pages, with each data page including 8 bits of the bit data.

[0066] Step S300: Obtain the target bit data of the existing data, determine the target data page corresponding to the target bit data of the existing data, and store the target data page to obtain a bit file.

[0067] Next, this embodiment obtains the target bit data containing existing data and determines the target data page corresponding to the target bit data containing existing data. For example, if the encoding information of the target bit data containing existing data is 25, and each data page contains 8 bits of data, then the corresponding target data page is the first bit data in page 4. At this point, during storage, the target data page – page 4 – can be directly stored, resulting in a bit file. Since the bit file in this embodiment does not store data pages containing other bits without data, storage resources can be reduced.

[0068] In one implementation, this embodiment determines the target bit data by finding the bit data containing data from all the bit data and then using it as the target bit data. Specifically, this embodiment obtains the data identifier corresponding to each bit data. If the data identifier is 1, it indicates that the bit data with data identifier 1 is not empty, and the bit data with data identifier 1 is used as the target bit data for obtaining the existing data. If the data identifier is 0, it indicates that the bit data with data identifier 0 is empty. Based on this, this embodiment can find all the target bit data. For example, this embodiment can obtain Table 1 as shown below. Table 1 shows that all the bit data is paginated in order, with each page consisting of 8 bits, resulting in several data pages. Table 1 shows the data page portions of page 0 (bits 0-7), page 12 (bits 96-104), and page 25 (bits 200-207).

[0069]

[0070] Table 1

[0071] As shown in Table 1, the data identifier of the first bit in page 0 is 1, indicating that data exists in the first bit of page 0, and no data exists in the other bits. Similarly, the data identifier of the 5 bits in page 12 (corresponding to the bit data encoding information of 100) is 1, indicating that data exists in the 5th bit of page 12, and no data exists in the other bits. Likewise, the data identifier of the first bit in page 25 (corresponding to the bit data encoding information of 200) is 1, indicating that data exists in the first bit of page 25, and no data exists in the other bits.

[0072] Since this embodiment processes all bit data into pages, resulting in several data pages, this embodiment can further divide all data pages into several directory sections, each consisting of eight data pages. Each directory section includes eight data pages. Next, this embodiment obtains the target directory section corresponding to the target data page and sets identification information for the target data page within the target directory section. This identification information reflects the presence of data in the target data page, and is set to 1. If the identification information is 1, it indicates that data exists in the target data page. Therefore, in each directory section, excluding the target data page containing data, the identification information for the remaining data pages is 0. Thus, after dividing the directory in this embodiment, the data format shown in Table 2 is obtained as follows:

[0073]

[0074] Table 2

[0075] As shown in Table 2, in this embodiment, the 31 data pages are divided into four directory sections: Directory 1, Directory 2, Directory 3, and Directory 4. Table 2 also shows that the identifier information for the first data page (page 0) in Directory 1 is 1, indicating that data exists on page 0, and no data exists on the other data pages. The identifier information for the fifth data page (page 12) in Directory 1 is 1, indicating that data exists on page 12, and no data exists on the other data pages. The identifier information for all data pages in Directory 3 is 0, indicating that no data exists on any of the data pages in Directory 3. The identifier information for the second data page (page 25) in Directory 4 is 1, indicating that data exists on page 25, and no data exists on the other data pages.

[0076] Furthermore, in this embodiment, the directory portion and the data page portion can be merged to obtain the bit file shown in Table 3.

[0077]

[0078]

[0079] Table 3

[0080] After this embodiment completes the partitioning of bit data into data pages and the partitioning of data pages into directories, the target data pages (such as pages 0, 12, and 25 in Table 2) in the target directory portion containing the data (such as directories 1, 2, and 4 in Table 2) can be stored to obtain the bit file. Therefore, this embodiment only needs to store the data pages containing the data, effectively saving storage space.

[0081] In another implementation, when a bit file needs to be queried, this embodiment provides a bit file query method. This bit file query method can be applied to terminal devices, including intelligent product terminals such as computers. Specifically, as follows... Figure 2 As shown, the bit file query method includes the following steps:

[0082] Step S10: Obtain the target encoding information corresponding to the bit data to be queried.

[0083] As described in the above embodiments, all bit data are predefined and encoded sequentially in this embodiment. Therefore, in this embodiment, when a bit file query is required, it is necessary to query the data stored in a specific bit data. Therefore, this embodiment needs to obtain the target encoding information corresponding to the bit data to be queried. For example, the target encoding information in this embodiment is 25, so the query is for the bit data corresponding to 25.

[0084] Step S20: Based on the target encoding information, determine the target data page corresponding to the bit data to be queried in the bit file, and determine the target directory portion corresponding to the target data page.

[0085] In this embodiment, every 8 bits of data are divided into a data page, and every 8 data pages are further divided into a directory section. Therefore, after determining the target encoding information, the target encoding information can be divided by 8 and modulo taken to obtain the target data page. Then, based on the target data page, the target directory section corresponding to the target data page is determined. For example, in this embodiment, to query Mac20 (the 20th bit of data), 20 / 8 modulo is taken to obtain that Mac20 is located on page 2. Querying Table 3, page 2 is found to be located in directory 1. Then, page 2 (i.e., the third data page in directory 1) is retrieved from directory 1 in Table 3.

[0086] Step S30: Determine the target bit data corresponding to the target encoding information from the target data page, and read the stored data in the target bit data.

[0087] This embodiment first obtains the identification information corresponding to the target data page in the target directory portion. If the identification information is 1, it indicates that data exists in the target data page. Therefore, this embodiment determines the target bit data corresponding to the target encoding information from the target data page; then, it obtains the data identifier corresponding to the target bit data. If the data identifier is 1, it indicates that data exists in the target bit data, so this embodiment can read the stored data in the target bit data. For example, when querying that Mac20 is located on page 2, and then obtaining from Table 3 that page 2 is located in directory 1, and then querying page 2 in directory 1 (i.e., the third data page in directory 1) in Table 3, if the page 2 identification information is 0, it means that there is no data in any of the bit data in page 2, so it can be determined that Mac20 does not exist. Since the bit file only stores bit data that contains data, Mac20 does not exist in the bit file.

[0088] Similarly, to query Mac200 (the 200th bit of data), we divide 200 / 8 modulo to find that Mac20 is located on page 25. Looking up Table 3, we find that page 25 is located in directory 4. Then, we look up page 25 in directory 4 (the second data page in directory 4). The page 25 identifier is 1, indicating that data exists on page 25. At this point, we can also calculate the first bit of Mac200 on page 25 using modulo operation. Therefore, the data identifier for this bit is 1, indicating that data exists in this bit, and thus Mac200 exists in the bit file.

[0089] Similarly, to query Mac201 (the 201st bit of data), we take the modulo of 201 / 8 to find that Mac20 is located on page 25. Looking up Table 3, we find that page 25 is located in directory 4. Then, we look up page 25 in directory 4 (the second data page in directory 4). The page 25 identifier is 1, indicating that data exists on page 25. At this point, we can also calculate the second bit of Mac200 on page 25 using the modulo operation. The data identifier for this second bit is 0, indicating that this bit does not exist. Therefore, Mac201 does not exist in the bit file.

[0090] In this embodiment, when querying a bit file, the first step is to determine which directory section the target data page is located in. After determining the target directory section, the next step is to determine whether data exists in the target data page. If data exists in the target data page, the next step is to check whether the target bit data exists in the target data page. If data exists, the data in the target bit data is read.

[0091] Therefore, this embodiment, when implementing data storage based on bits, performs encoding and paging processes on the bit data to determine the data page corresponding to the bit data containing the data. Thus, during storage, only the data page containing the data needs to be stored, effectively saving storage space and solving the space waste caused by data sparsity. When performing bit file queries, the target data page can be located based on the target encoding information corresponding to the bit data to be queried, and then the stored data in the target bit data of that target data page can be read, achieving fast data query and retrieval.

[0092] Exemplary device

[0093] Based on the above embodiments, the present invention also provides a bit file query device, such as... Figure 3 As shown, the device includes a data encoding module 10, a paging processing module 20, and a data storage module 30. Specifically, the data encoding module 10 is used to acquire all bit data and sequentially encode all the bit data to obtain encoding information corresponding to each bit data. The encoding information reflects the number of the storage space used to store the data. The paging processing module is used to paging all the bit data according to all the encoding information to obtain several data pages, each data page including several bits of data. The data storage module 20 is used to acquire the target bit data of the existing data, determine the target data page corresponding to the target bit data of the existing data, and store the target data page to obtain a bit file.

[0094] In one implementation, the paging processing module 20 includes:

[0095] The data page partitioning unit is used to perform paging processing on all the encoded information in a sequential manner, dividing all the encoded information into data pages of 8 bits each, to obtain a number of data pages, each of which includes 8 bits of data.

[0096] In one implementation, the data storage module 30 includes:

[0097] A data identifier acquisition unit is used to acquire the data identifier corresponding to each bit data;

[0098] The target bit data determination unit is used to determine the bit data with the data identifier set to 1 as the target bit data for obtaining the existing data if the data identifier is 1.

[0099] The directory partitioning unit is used to divide all the data pages into a directory partition in such a way that each directory partition consists of 8 data pages, resulting in several directory partitions, each directory partition including 8 data pages;

[0100] The identification information acquisition unit is used to acquire the target directory portion corresponding to the target data page, and set identification information for the target data page in the target directory portion, wherein the identification information is used to reflect the existence of data in the target data page, and the identification information is 1;

[0101] The bit file storage unit is used to store the target data pages in the target directory portion to obtain the bit file.

[0102] The working principle of each module in the bit file storage device of this embodiment is the same as that of each step in the above method embodiment, and will not be repeated here.

[0103] The present invention also provides a bit file query device, such as Figure 4 As described above, the device includes: an encoding acquisition module 101, a data page determination module 102, and a data reading module 103. Specifically, the encoding acquisition module 101 is used to acquire target encoding information corresponding to the bit data to be queried. The data page determination module 102 is used to determine the target data page corresponding to the bit data to be queried in the bit file based on the target encoding information, and to determine the target directory portion corresponding to the target data page. The data reading module 103 is used to determine the target bit data corresponding to the target encoding information from the target data page, and to read the stored data in the target bit data.

[0104] In one implementation, the data page determination module 102 includes:

[0105] The target data page determination unit is used to divide the target encoding information by 8 and take the modulo to obtain the target data page corresponding to the target encoding information;

[0106] The target directory portion determination unit is used to determine the target directory portion corresponding to the target data page based on the target data page.

[0107] In one implementation, the data reading module 103 includes:

[0108] The identification information acquisition unit is used to acquire the identification information of the target directory portion corresponding to the target data page;

[0109] A target bit data determination unit is used to determine the target bit data corresponding to the target encoding information from the target data page if the identification information is 1.

[0110] The data reading unit is used to obtain the data identifier corresponding to the target bit data. If the data identifier is 1, the data in the target bit data is read.

[0111] The working principle of each module in the bit file query device of this embodiment is the same as that of each step in the above method embodiment, and will not be repeated here.

[0112] Based on the above embodiments, the present invention also provides a terminal device, the principle block diagram of which is shown in Figure 5. The terminal device may include one or more processors 100 (…). Figure 5 (Only one is shown in the diagram), a memory 101, and a computer program 102 stored in the memory 101 and executable on one or more processors 100, such as a bit file storage program or a bit file query program. When one or more processors 100 execute the computer program 102, they can implement the various steps in the bit file storage method embodiment or the bit file query method embodiment. Alternatively, when one or more processors 100 execute the computer program 102, they can implement the functions of each module / unit in the bit file storage method embodiment or the bit file query method embodiment, without limitation here.

[0113] In one embodiment, the processor 100 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0114] In one embodiment, memory 101 may be an internal storage unit of an electronic device, such as a hard drive or RAM. Memory 101 may also be an external storage device of the electronic device, such as a plug-in hard drive, smart media card (SMC), secure digital (SD) card, flash card, etc. Furthermore, memory 101 may include both internal and external storage units. Memory 101 is used to store computer programs and other programs and data required by the terminal device. Memory 101 can also be used to temporarily store data that has been output or will be output.

[0115] Those skilled in the art will understand that Figure 5The block diagram shown is merely a partial structural diagram related to the present invention and does not constitute a limitation on the terminal device to which the present invention is applied. The specific terminal device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.

[0116] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the methods described above. Any references to memory, storage, operational databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual operating data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0117] In summary, this invention discloses a bit file storage method, a bit file query method, an apparatus, and a terminal device. The bit file query method includes: acquiring all bit data and sequentially encoding all bit data to obtain encoding information corresponding to each bit data, where the bit data reflects the storage space used to store the data; paging all bit data according to all encoding information to obtain several data pages, each data page including several bit data; acquiring target bit data containing existing data, determining the target data page corresponding to the target bit data containing existing data, and storing the target data page to obtain a bit file. This invention, when implementing data storage based on bits, performs encoding and paging processes on the bit data to determine the data page corresponding to the bit data containing existing data. Therefore, during storage, only the data pages containing existing data need to be stored, effectively saving storage space.

[0118] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A bit file storage method, characterized in that, The method includes: All bit data are acquired and all the bit data are encoded sequentially to obtain the encoding information corresponding to each bit data. The encoding information reflects the number of the storage space used to store the data. The data encoding uses ASCII encoding, and the encoded information consists of consecutive integers starting from 0. Based on all the encoded information, all the bit data is paginated to obtain several data pages, each of which includes several bits of data. Obtain the target bit data of the existing data, determine the target data page corresponding to the target bit data of the existing data, and store the target data page to obtain a bit file; The step of storing the target data page to obtain a bit file includes: All the data pages are divided into several directory sections, each consisting of 8 data pages. Obtain the target directory portion corresponding to the target data page, and set identification information for the target data page in the target directory portion, wherein the identification information is used to reflect the existence of data in the target data page, and the identification information is 1; The directory portion and the data page portion are merged to obtain a bit file.

2. The bit file storage method according to claim 1, characterized in that, The step of paging all the bit data according to all the encoded information to obtain several data pages includes: Based on all the encoded information, the encoded information is paginated in order, with each page consisting of 8 bits, to obtain several data pages. Each data page includes 8 bits of data.

3. The bit file storage method according to claim 1, characterized in that, The acquisition of the target bit data containing existing data includes: Obtain the data identifier corresponding to each bit data; If the data identifier is 1, then the bit data with the data identifier 1 is used as the target bit data for obtaining the existing data.

4. A bit file query method, characterized in that, The method includes: Obtain the target encoding information corresponding to the bit data to be queried; The data encoding uses ASCII encoding, and the encoded information consists of consecutive integers starting from 0. Based on the target encoding information, the target data page corresponding to the bit data to be queried is determined in the bit file, and the target directory portion corresponding to the target data page is determined; Determine the target bit data corresponding to the target encoding information from the target data page, and read the stored data in the target bit data; The methods for obtaining the bit file include: All the data pages are divided into several directory sections, each consisting of 8 data pages. Obtain the target directory portion corresponding to the target data page, and set identification information for the target data page in the target directory portion, wherein the identification information is used to reflect the existence of data in the target data page, and the identification information is 1; The directory portion and the data page portion are merged to obtain a bit file.

5. The bit file query method according to claim 4, characterized in that, The step of determining the target data page corresponding to the queried bit data in the bit file based on the target encoding information, and determining the target directory portion corresponding to the target data page, includes: Divide the target encoding information by 8 and take the modulo to obtain the target data page corresponding to the target encoding information; based on the target data page, determine the target directory portion corresponding to the target data page.

6. The bit file query method according to claim 5, characterized in that, The step of determining the target bit data corresponding to the target encoding information from the target data page and reading the stored data in the target bit data includes: Obtain the identification information corresponding to the target data page in the target directory section; If the identification information is 1, then the target bit data corresponding to the target encoding information is determined from the target data page; Obtain the data identifier corresponding to the target bit data. If the data identifier is 1, then read the data in the target bit data.

7. A bit file storage device, characterized in that, The apparatus is used to implement the bit file storage method as described in any one of claims 1-3, the apparatus comprising: The data encoding module is used to acquire all bit data and encode all the bit data in sequence to obtain the encoding information corresponding to each bit data. The encoding information reflects the number of the storage space used to store the data. The paging processing module is used to paging all the bit data according to all the encoded information to obtain several data pages, each of the data pages including several bit data. The data storage module is used to acquire the target bit data of the existing data, determine the target data page corresponding to the target bit data of the existing data, and store the target data page to obtain a bit file.

8. A bit file query device, characterized in that, The apparatus is used to implement the bit file query method as described in any one of claims 4-6, the apparatus comprising: The encoding acquisition module is used to acquire the target encoding information corresponding to the bit data to be queried; The data page determination module is used to determine the target data page corresponding to the bit data to be queried in the bit file based on the target encoding information, and to determine the target directory portion corresponding to the target data page; The data reading module is used to determine the target bit data corresponding to the target encoding information from the target data page, and read the stored data in the target bit data.

9. A terminal device, characterized in that, The terminal device includes a memory, a processor, and a bit file storage program or a bit file query program stored in the memory and executable on the processor. When the processor executes the bit file storage program or the bit file query program, it implements the steps of the bit file storage method as described in any one of claims 1-3 or the steps of the bit file query method as described in any one of claims 4-6.