Method and device for reading data
A technology for reading data and data packets, applied in the computer field, can solve the problems of data overflow and low data reading efficiency, and achieve the effect of reducing the number of times, reducing the probability of data overflow, and reducing the number of times.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0034] see figure 1 , this embodiment provides a method for reading data, the method flow is as follows:
[0035] 101: Determine the head pointer position and the tail pointer position of the channel;
[0036] 102: Compare the height of the head pointer position and the tail pointer position;
[0037] 103: Continuously read data packets according to the comparison result.
[0038] Among them, the data packets are read continuously according to the comparison result, specifically including:
[0039] When it is compared that the position of the head pointer is higher than the position of the tail pointer, the data packet is read from the position of the head pointer until the end of the channel.
[0040] Further, the data packet is read from the position of the header pointer to the end of the channel, including:
[0041] Change the position of the head pointer, and read the data packet from the changed head pointer position to the tail pointer position.
[0042] Optionally...
Embodiment 2
[0046] This embodiment provides a method for reading data. The method reduces the number of times of reading data by continuously reading data, especially for reducing the speed of data in the channel when the speed of processing data packets is lower than the speed of generating data packets. probability of overflow. see figure 2 , the method flow provided by this embodiment is specifically as follows:
[0047] 201: Determine the position of the head pointer and the tail pointer of the channel;
[0048] For this step, the channel has a head pointer and a tail pointer. Every time a data packet is added in the channel, a fixed format STX(0x02)+channel auxiliary information+original data packet+ETX(0x03 ), and after storing the increased data packet in the channel, change the position of the tail pointer at the same time to make it point to the latest data position. Each data packet is continuous in physical position. The position of the head pointer and tail pointer of the ...
Embodiment 3
[0058] see Figure 5 , the present embodiment provides a device for reading data, the device comprising:
[0059] A determining module 501, configured to determine the position of the head pointer and the position of the tail pointer of the channel;
[0060] The comparison module 502 is used to compare the height of the head pointer position determined by the determination module 501 and the tail pointer position;
[0061] The reading module 503 is configured to continuously read data packets according to the comparison result of the comparison module 502 .
[0062] Wherein, the reading module 503 is specifically configured to read the data packet from the position of the head pointer to the end of the channel when the comparison module 502 compares that the position of the head pointer is higher than the position of the tail pointer.
[0063] Further, the reading module 503 is also used to read the data packet from the head pointer position until the end of the channel, cha...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com