Unlock instant, AI-driven research and patent intelligence for your innovation.

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

Active Publication Date: 2017-12-05
TENCENT TECH (SHENZHEN) CO LTD
View PDF6 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0006] In order to solve the problem in the prior art that after the system kernel and the virtual machine kernel are modified, the system and the virtual machine cannot be upgraded, which reduces the efficiency of using the application program, the embodiment of the present invention provides a method and device for storing data

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A method and apparatus for storing data
  • A method and apparatus for storing data
  • A method and apparatus for storing data

Examples

Experimental program
Comparison scheme
Effect test

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...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a method and device for storing data, belonging to the technical field of computers. The method includes: receiving data to be stored in the memory, and obtaining the data structure type of the data; when the data structure type of the data is an array, determining the memory space allocated for the array data structure in the direct memory managed by the system for the data storage location; when the data structure type of the data is a linked list or a hash table, determine the memory allocated in advance in the direct memory managed by the system in the preset fixed-length storage method and / or the preset variable-length storage method for the data The storage location of the space; according to the storage location of the data, the data is stored in the direct memory managed by the system. According to the data structure type of the data, the present invention stores the data in the direct memory managed by the system according to the preset storage mode, which not only avoids the problem that the throughput of the application program decreases due to the garbage collection mechanism of the heap memory.

Description

technical field [0001] The invention relates to the field of computer technology, in particular to a method and device for storing data. Background technique [0002] With the development of Java language programming, there are some problems with memory stored procedures when using Java applications. Traditionally, applications developed using the Java language are stored on the heap memory allocated by the JVM (JavaVirtual Machine, Java Virtual Machine) and managed by the GC (Garbage Collection, Garbage Collection) mechanism. The GC mechanism will cause an uncontrollable and unpredictable running suspension of the application program, which in turn will reduce the throughput of the application program during runtime. With the expansion of the memory usage scale of the application program, the throughput reduction degree caused by the heap memory and GC will be in the order of Linear or even exponential growth, so the memory size of the application's stand-alone and cluster...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F12/0871G06F17/30G06F12/02
Inventor 张帆
Owner TENCENT TECH (SHENZHEN) CO LTD