Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Data reading and writing method and device

A reading and writing method and data writing technology, applied in the field of data processing, can solve problems such as low concurrency efficiency and disordered conflict, and achieve the effect of improving concurrency efficiency

Active Publication Date: 2020-09-15
ALIBABA GRP HLDG LTD
View PDF4 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] The embodiment of the present invention provides a method and device for reading and writing data, so as to at least solve the technical problem that the JDK's built-in blocking queue is prone to out-of-order conflicts under high concurrency conditions, resulting in low concurrency efficiency

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
  • Data reading and writing method and device
  • Data reading and writing method and device
  • Data reading and writing method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0040] According to an embodiment of the present invention, an embodiment of a method for reading and writing data is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, Also, although a logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in an order different from that shown or described herein.

[0041] The method embodiment provided in Embodiment 1 of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. figure 1 It shows a hardware structural block diagram of a computer terminal (or mobile device) for realizing the data reading and writing method. like figure 1 As shown, the computer terminal 10 (or mobile device 10) may include one or more (shown by 102a, 102b, ..., 102n in the figure) processor 102 (the processor 102 may includ...

Embodiment 2

[0112] According to an embodiment of the present invention, an embodiment of a method for reading and writing data is also provided, Figure 7 It is the flow of a data reading and writing method according to Embodiment 2 of the present application, such as Figure 7 As shown, the method includes:

[0113] Step S71, the data reading module searches for the target storage unit from the storage queue, wherein the storage queue includes a plurality of storage units, and each storage unit includes: a first field for storing elements and a second field for storing read-write identifiers field.

[0114] Specifically, the above-mentioned data reading module may be a Handler. The storage queue can be a blocking queue applied in a distributed database, and the queue is a bounded queue. The above-mentioned read-write identification is an identification used to represent the read-write status of the storage unit, and is used for the data writing module or the data reading module to det...

Embodiment 3

[0165] According to an embodiment of the present invention, a device for reading and writing data for implementing the method for reading and writing data in Embodiment 1 is also provided, Figure 9 It is a schematic diagram of a data reading and writing device according to Embodiment 3 of the present application, such as Figure 9 As shown, the device 900 includes:

[0166] The search module 902 is used for the data writing module to find the target storage unit from the storage queue, wherein the storage queue includes a plurality of storage units, and each storage unit at least includes: a first field for storing elements and a first field for storing read Write the second field of the identifier.

[0167] The judging module 904 is used for the data writing module to judge whether the target storage unit is empty according to the second field of the target storage unit.

[0168] Write module 906, for when the target storage unit is empty, the data write module writes the ...

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 data reading and writing method and device. The method comprises the steps that a data writing module finds a target storage unit from a storage queue, the storage queue comprises a plurality of storage units, and each storage unit at least comprises a first field used for storing elements and a second field used for storing read-write identifiers; the data writing modulejudges whether the target storage unit is empty or not according to the second field of the target storage unit; and under the condition that the target storage unit is empty, the data writing modulewrites the element to be written into a first field of the target storage unit and changes a second field of the target storage unit into a first preset value, and the first preset value is used forindicating that the element is written into the target storage unit. According to the method and the device, the technical problem of relatively low concurrence efficiency caused by easy out-of-orderconflict of the blocking queue of the JDK under the condition of high concurrence is solved.

Description

technical field [0001] The invention relates to the field of data processing, in particular to a method and device for reading and writing data. Background technique [0002] A distributed database system refers to the use of high-speed computer networks to connect multiple physically dispersed data storage units to form a logically unified database. The basic idea of ​​a distributed database is that the data in the original centralized database is scattered and stored on multiple data storage nodes connected through the network to obtain larger storage capacity and higher access volume. However, in the case of high concurrency, distributed databases run in parallel with multiple threads and cannot guarantee the order of execution of instructions between threads, so out-of-order conflicts are prone to occur. [0003] Aiming at the problem that JDK's built-in blocking queue is prone to out-of-order conflicts under high concurrency conditions, resulting in low concurrency eff...

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 Applications(China)
IPC IPC(8): G06F16/27
CPCG06F16/27Y02D10/00
Inventor 汪翔
Owner ALIBABA GRP HLDG LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products