Method and device for reading data
A technology for reading data and data packets, which is applied in the computer field, can solve the problems of data overflow and low data reading efficiency, reduce the number of times to read data, reduce the probability of data overflow, and reduce the number of times to read data Effect
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0027] see figure 1 , this embodiment provides a method for reading data, the method flow is as follows:
[0028] 101: Determine the head pointer position and the tail pointer position of the channel;
[0029] 102: Compare the height of the head pointer position and the tail pointer position;
[0030] 103: Continuously read data packets according to the comparison result.
[0031] Among them, the data packets are read continuously according to the comparison result, specifically including:
[0032] 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.
[0033] Further, the data packet is read from the position of the header pointer to the end of the channel, including:
[0034] Change the position of the head pointer, and read the data packet from the changed head pointer position to the tail pointer position.
[0035] Optionally...
Embodiment 2
[0039] 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:
[0040] 201: Determine the position of the head pointer and the tail pointer of the channel;
[0041] 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 packets in the channel, change the position of the tail pointer at the same time so that it points to the latest data position. Each data packet is continuous in physical position. The position of the head pointer and tail pointer of th...
Embodiment 3
[0051] see Figure 5 , the present embodiment provides a device for reading data, the device comprising:
[0052] A determining module 501, configured to determine the position of the head pointer and the position of the tail pointer of the channel;
[0053] 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;
[0054] The reading module 503 is configured to continuously read data packets according to the comparison result of the comparison module 502 .
[0055] 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.
[0056] 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