A method and apparatus for storing data
A technology for storing data and storage methods, applied in the computer field, can solve problems such as inability to upgrade systems and virtual machines, and reduce the efficiency of using applications
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0096] The embodiment of the present invention provides a method for storing data, see figure 1 .
[0097] It should be noted that, before implementing the method for storing data of the present invention, a JAVA programming library is constructed, which is divided into two layers from bottom to top, namely: storage engine layer and data structure layer. Among them, the storage engine layer includes variable-length storage engine and fixed-length storage engine, and the data structure layer includes commonly used data structures such as arrays, linked lists, and hash tables. The storage engine layer is built on the basis of direct memory as a whole, thereby avoiding the use of heap memory and the influence of GC. The direct memory is the memory directly managed by the Linux system. The data structure layer is built on the basis of the storage engine layer as a whole, providing commonly used data structures, so that application development can use these data structures to conv...
Embodiment 2
[0114] The embodiment of the present invention provides a method for storing data, see Figure 4 , it should be noted that this embodiment of the present invention stores data corresponding to a data structure of a linked list type.
[0115] The method flow includes:
[0116] 401: Receive data to be stored in memory, and acquire a data structure type of the data.
[0117] 402: When the data structure type of the data is a linked list, determine the memory space pre-allocated in the direct memory managed by the system in the preset fixed-length storage mode and / or the preset variable-length storage mode for the data storage location.
[0118] Specifically, the data of the data structure of the linked list type can be stored in fixed-length and variable-length storage methods according to the fixed length or non-fixed length of the data part of the data.
[0119] When the data part of the data is fixed length:
[0120] Step 402 can specifically be:
[0121] 4021: When the d...
Embodiment 3
[0152] The embodiment of the present invention provides a method for storing data, see Figure 5 , it should be noted that this embodiment of the present invention stores data corresponding to a data structure of a hash table type. Further, the description of the steps in the present invention is the same as some of the descriptions of the steps in Embodiment 2, and will not be repeated here.
[0153] The method flow includes:
[0154] 501: Receive data to be stored in memory, and acquire a data structure type of the data.
[0155] 502: When the data structure type of the data is a hash table, determine the memory allocated in advance in the direct memory managed by the system in the preset fixed-length storage mode and / or the preset variable-length storage mode for the data The storage location of the space.
[0156] Specifically, for the data of the data structure of the hash table type, the usual implementation of the hash table includes two parts: a hash bucket and a ha...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


