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

Method and device for circularly reading and writing in buffer zone

A read-write method and read-write device technology, applied in the field of storage, can solve the problems of wasting search time, reduce data reading speed, and not being simple enough, and achieve the effects of increasing data reading speed, reducing search time, and easy operation

Active Publication Date: 2011-08-31
HANGZHOU HIKVISION SYST TECH
View PDF3 Cites 20 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0009] If writing mode 1 is used, then when calculating aDataLen, it is necessary to first determine how the data is stored. If a part of the data is stored at the end of the buffer and a part of the bytes is stored at the beginning of the buffer, then when calculating aDataLen, it is necessary to first Combine these two parts of bytes, and then calculate the length based on the combined bytes. This method is cumbersome and not easy enough when calculating aDataLen
[0010] If writing method 2 is used, when the end of the buffer is read, because there are some invalid data, when searching for valid data, the entire invalid data at the end must be searched, and then the search will start from the beginning of the buffer, and this process will waste Part of the search time, reducing the speed of data reading

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
  • Method and device for circularly reading and writing in buffer zone
  • Method and device for circularly reading and writing in buffer zone
  • Method and device for circularly reading and writing in buffer zone

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0047] In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and examples.

[0048] The present invention mainly adds a variable for marking the invalid position at the tail end of the buffer on the basis of the existing buffer reading and writing method 2, so that in the process of reading data, the invalid data area can be skipped when searching for valid data, and directly from The buffer starts a partial search, thereby reducing the search time, and the existing writing method 2 ensures the simple characteristic of data length calculation, so as to achieve the purpose of improving the speed of reading data while ensuring the operation of reading data is simple.

[0049] The method for reading and writing the buffer according to the embodiment of the present invention will be described in detail below using the data writing pr...

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 for circularly reading and writing in a buffer zone, which comprises the following steps: when to-be-written data is written into the buffer zone but the tail space of the buffer zone is insufficient to store the complete to-be-written data, writing the to-be-written data from a starting position of the buffer zone and marking on the tail of data in the buffer zone; and when the data is read from the buffer zone and an address-reading pointer points at the mark, directly searching for the valid data position from the starting position of the buffer zone and then performing the subsequent data-reading operation. The invention also discloses a device for circularly reading and writing in the buffer zone. By using the method and device, the speed for reading data can be increased while the operation for reading data is simple and convenient.

Description

technical field [0001] The invention relates to the field of storage technology, in particular to a method and device for circularly reading and writing a buffer. Background technique [0002] At present, when using the buffer for data reading and writing, a certain method is generally used to realize the circular reading and writing of the buffer. Specific steps are as follows: [0003] First allocate a fixed-size memory for the program, for example, use pBufferBeginPtr to mark the starting address of the block of memory, and then define two pointer objects m_pReadPtr and pWritePtr; m_pReadPtr is used to mark the position of the buffer read data, m_pWritePtr is used to mark and buffer The location where the area is written. [0004] When writing data, first combine the data into the format of delimiter + data length + data, for example, mark the combined data with pData (the data length of pData is nDataLen), and then judge whether the remaining space of the buffer can st...

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): G06F3/06G06F12/08G06F12/0802
Inventor 邓世华
Owner HANGZHOU HIKVISION SYST TECH
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