Mode for realizing key-value storage based on javascript

A key-value pair and storage operation technology, applied in the field of key-value pair storage, can solve the problems of inability to store objects in a form, cannot be directly updated, etc., and achieve the effect of simplifying cumbersomeness

Inactive Publication Date: 2015-12-16
苏州博优赞信息科技有限责任公司
View PDF1 Cites 7 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Due to the particularity of its language, it is impossible to directly store objects in the form of Key-Value (key-value ...

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
  • Mode for realizing key-value storage based on javascript

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0014] The specific implementation manners of the present invention will be further described below in conjunction with the drawings and examples. The following examples are only used to illustrate the technical solution of the present invention more clearly, but not to limit the protection scope of the present invention.

[0015] The technical scheme of concrete implementation of the present invention is:

[0016] Such as figure 1 As shown, a method of implementing key-value pair storage based on javascript includes the following steps:

[0017] 1) Define a Map method, which contains at least the following three basic methods:

[0018] put(key, va1ue), get(key), remove(key), other methods can be extended;

[0019] 2) Create a collection in the Map method, which contains an object with an array length of 2, so that the array object can be used to save the key and value;

[0020] 3) Implement the storage operation in the put method: first traverse the collection object crea...

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 mode for realizing key-value storage based on javascript. The mode comprises the following steps of: 1) defining a Map method; 2) creating a set in the Map method, wherein the set contains an object with array length of 2, so that keys and values can be conveniently stored by using array objects; 3) performing a storage operation in a put method; 4) obtaining a value object according to a key value in a get method; and 5) performing a deletion operation in a remove method. According to the mode, JavaScript is applied to the set for storing the object array, so that the keys and the Values can be stored separately, the problem that JavaScript cannot realize Key-Value storage is solved, and the cumbersome process for cyclically traversing the values after storage is simplified. More succinctly, the problem in local temporary caching of information or information cascade processing (such as quick city and region correlation) is efficiently solved.

Description

technical field [0001] The invention relates to a method for realizing key-value pair storage based on javascript. Background technique [0002] javaScript is an object-based and event-driven and relatively secure client-side scripting language. It is a dynamic-type, weak-type, and prototype-based literal scripting language; it is also a script widely used in client-side Web development. Language; often used to add dynamic functions to HTML (a subset of Standard General Markup Language) web pages, such as responding to various operations of users. Due to the particularity of its language, it is impossible to directly store objects in the form of Key-Value (key-value pairs), so that after storing data, it is impossible to directly add a certain identifier and quickly obtain the corresponding value. Contents of the invention [0003] The purpose of the present invention is to overcome the defects in the prior art, and provide a method for realizing key-value pair storage ba...

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
IPC IPC(8): G06F9/44
Inventor 王世华薛斌廖志民
Owner 苏州博优赞信息科技有限责任公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products