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
Example Embodiment
[0033] Example 1
[0034] see figure 1 , this embodiment provides a method for reading data, and the method flow is as follows:
[0035] 101: Determine the position of the head pointer and the position of the tail pointer of the channel;
[0036] 102: Compare the position of the head pointer and the position of the tail pointer;
[0037] 103: Continuously read data packets according to the comparison result.
[0038] Among them, the data packets are continuously read according to the comparison result, which specifically includes:
[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 head pointer position until after the end of the channel, including:
[0041] Change the head pointer position, and read the data packet from the changed head pointer position until the tail...
Example Embodiment
[0045] Embodiment 2
[0046] This embodiment provides a method for reading data, which reduces the number of times of reading data by continuously reading data, especially when the speed of processing data packets is lower than the speed of generating data packets, reducing the number of data in the channel probability of overflow. see figure 2 , the method process provided by this embodiment is as follows:
[0047] 201: Determine the position of the head pointer and the position of 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) will be printed on each data packet. ), and at the same time change the tail pointer position to point to the latest data position after storing the added data packet in the channel. Each data packet is continuous in physical position. The positi...
Example Embodiment
[0057] Embodiment 3
[0058] see Figure 5 , this embodiment provides a device for reading data, the device includes:
[0059] A determination module 501 is used to determine the head pointer position and the tail pointer position of the channel;
[0060] The comparison module 502 is used to compare the height of the head pointer position and the tail pointer position determined by the determination module 501;
[0061] The reading module 503 is configured to continuously read the data packets according to the comparison result of the comparison module 502 .
[0062] The reading module 503 is specifically configured to read the data packet from the head pointer position 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 start reading the data packet from the position of the head pointer, until after the end of the 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.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap