CN114509966A - Asynchronous high-speed serial port real-time continuous data acquisition system - Google Patents
Asynchronous high-speed serial port real-time continuous data acquisition system Download PDFInfo
- Publication number
- CN114509966A CN114509966A CN202111651388.8A CN202111651388A CN114509966A CN 114509966 A CN114509966 A CN 114509966A CN 202111651388 A CN202111651388 A CN 202111651388A CN 114509966 A CN114509966 A CN 114509966A
- Authority
- CN
- China
- Prior art keywords
- data
- serial port
- real
- packet
- splicing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000005070 sampling Methods 0.000 claims abstract description 23
- 238000000034 method Methods 0.000 claims abstract description 18
- 238000001914 filtration Methods 0.000 claims abstract description 11
- 230000008569 process Effects 0.000 claims abstract description 10
- 238000012545 processing Methods 0.000 claims abstract description 9
- 230000001360 synchronised effect Effects 0.000 claims abstract description 4
- 238000013500 data storage Methods 0.000 claims description 9
- 230000005540 biological transmission Effects 0.000 claims description 7
- 230000006870 function Effects 0.000 claims description 6
- 238000006243 chemical reaction Methods 0.000 claims description 5
- 238000012795 verification Methods 0.000 claims description 4
- 230000003750 conditioning effect Effects 0.000 claims description 3
- 238000012360 testing method Methods 0.000 abstract description 8
- 238000004891 communication Methods 0.000 description 11
- 238000010586 diagram Methods 0.000 description 7
- 238000013461 design Methods 0.000 description 4
- 238000011161 development Methods 0.000 description 4
- 230000003993 interaction Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 239000003990 capacitor Substances 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 239000000126 substance Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/04—Programme control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/042—Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
- G05B19/0423—Input/output
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/20—Pc systems
- G05B2219/24—Pc safety
- G05B2219/24215—Scada supervisory control and data acquisition
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/02—Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]
Abstract
The invention discloses a real-time continuous data acquisition system of an asynchronous high-speed serial port, which comprises: the hardware acquisition module is used for converting the acquired analog signals into digital signals; the software control module is used for filtering the digital signal, accumulating the digital signal through a pulse counter, and sending the filtered digital signal to a serial port buffer area of a receiver to form a real-time continuous data stream; and the real-time data splicing module is used for analyzing the serial port data through the acquisition thread and judging the integrity and continuity of the serial port data so as to realize splicing processing of the real-time continuous data stream under the condition of no synchronous signal. By adopting a multi-serial-port card and a pulse sampling controller module and designing a serial-port high-speed transceiving and data packet splicing module, the condition that no packet is lost or wrong data is ensured in the test process is ensured; multistage hardware filtering and software filtering are adopted in the acquisition system, so that complete data reception and extremely low error rate can be guaranteed under the condition of high-speed serial port real-time data acquisition.
Description
Technical Field
The present invention relates to the field of communications. And more particularly to a real-time continuous data acquisition system for asynchronous high-speed serial ports.
Background
In the data acquisition and communication application scenario, a serial communication interface is often adopted to replace other large communication interfaces as an interface for data transceiving and interactive communication. In the data transmission process, synchronization signals are generally adopted to synchronize the real-time performance of a receiving end and a sending end, but when a clock source is not used as the synchronization signal, when the serial port packet data is larger, the whole packet data task cannot be completed in multiple timed receiving, so that packet loss or error codes are caused, and particularly, when the serial port is transmitted at a high speed, for example, the serial port receiving and sending period below 10ms or the baud rate is greater than the transmission rate of 460800, the problem is more obvious.
The Chinese patent application No. 201910683867.4 entitled "method, system and device for acquiring and analyzing serial protocol data" discloses a method, system and device for acquiring and analyzing serial protocol data, which performs frame check and frame analysis according to the contents of high and low bits of serial data, difference and mean value, and is mainly a general data analysis method applied to serial protocol change. The method only appoints and analyzes the integrity of a certain frame of serial port data, but matches the receiving and transmitting device in real time, does not take further consideration on the continuity of the multi-frame serial port data, and can cause the problems of data loss and disorder after error codes occur.
The invention discloses a multi-serial port communication control method, a device and an upper computer in the name of Chinese patent application No. CN202010667832.4, and mainly aims at monitoring a plurality of serial port control areas of a human-computer interaction interface of the upper computer, so that an operator can conveniently operate the on-off of a plurality of serial ports and receive and send data. The method is mainly used for completing related parameters and function setting of the multi-serial port based on a human-computer interaction interface, and independent operability polar data interaction integrity of the multi-serial port is not discussed.
Therefore, how to ensure complete data reception and extremely low bit error rate under the condition of high-speed serial port real-time data acquisition is a technical problem to be urgently solved by technical personnel in the field.
Disclosure of Invention
In order to solve at least one of the above problems, the present application proposes a high-speed serial communication real-time data acquisition system, which includes:
the hardware acquisition module is used for converting the acquired analog signals into digital signals;
the software control module is used for filtering the digital signal, accumulating the digital signal through a pulse counter, and sending the filtered digital signal to a serial port buffer area of a receiver to form a real-time continuous data stream;
and the real-time data splicing module is used for analyzing the serial port data through the acquisition thread and judging the integrity and continuity of the serial port data so as to realize splicing processing of the real-time continuous data stream under the condition of no synchronous signal.
In a specific embodiment, the hardware acquisition module includes:
a sampling controller, an industrial personal computer, an RS-422 transceiver, an RS-422 multi-serial port card and a data transmission cable, wherein,
the sampling controller is used for converting the input analog signals into digital signals and sending the digital signals to the RS-422 multi-serial-port card through the RS-422 transceiver, specifically, the sampling controller is used for completing the real-time acquisition system of accelerometer and gyroscope pulse analog signals and the real-time sending of serial port data, the industrial personal computer carries a non-real-time operating system for receiving, wherein the sending period is TwThe timing receiving period is TRNon real-time drift of Δ TRAnd satisfy Tw<TR±ΔTR<10TwClock transceiving conditions;
the RS-422 multi-serial port card is used for sending the digital signal to a computer.
In one embodiment, the sampling controller is based on an FPGA chip with RS-422 device architecture.
In one embodiment, the RS-422 multi-serial port card is disposed on the motherboard of the computer in the form of a bus slot.
In one embodiment, the software control module comprises: the system comprises an embedded FPGA software module and an upper computer data receiving software module.
In a specific embodiment, the software control module is used for realizing the functions of analog signal acquisition, conditioning and filtering, analog-to-digital logic conversion, serial port initialization operation, high-speed data acquisition, multi-serial port and multi-thread work and real-time data display and storage.
In a specific embodiment, the real-time data splicing module comprises:
s1, serial port equipment and data initialization, which are used for starting a data acquisition thread, configuring serial port parameters including baud rate, data sending form and data acquisition interval time, emptying a serial port buffer area, splicing a data reserved storage area and a complete frame data storage area, setting a data splicing flag bit to be 0, and setting an upper computer data receiving stop flag bit to be 0;
s2, the initial packet header judging unit reads the serial port buffer area, judges whether the first byte of the current serial port data is a preset packet header byte, if yes, the data enters a complete checking unit S3, and if not, the data enters a data packet post-splicing unit S5;
s3, a complete checking unit, which reads data from the first packet header in sequence according to the preset serial port byte length N, checks the preset continuous channel code, check bit and packet tail, if the check fails, reports a data receiving and sending error warning, discards the frame data, and returns to S1; if the check is passed, the data stream with the byte length of N is stored in a complete frame data storage area according to a frame of complete data, and then the complete check unit S3 is carried out again from the next packet head until the data in the buffer area is not enough with the byte length of N, and then the data stream is transferred to a data packet pre-reservation unit S4;
s4, reserving a data packet ahead unit, reserving residual data to a splicing data reserved storage area from the next byte at the last packet tail in the buffer area, recording the length of the byte as 1, setting the splicing flag bit of the data packet as 1, and entering an initial packet header judging unit S2;
s5, a data packet post-splicing unit, for performing the packet splicing processing of the latter half of the incomplete data packet in the previous packet, judging whether the first byte of the data in the current buffer is the packet header, if not, reading the bytes backwards in sequence, when the read byte is equal to the first packet header, reserving all the data in the buffer before the byte, and setting the byte length as N, if N is satisfied, the length of the byte isback+NpreN, and the check passes, and the check is spliced with the completion of the previous packet and storedSetting the data splicing flag bit to be 0 in the complete frame data storage area, clearing the spliced data reserved storage area, reporting a data transceiving error warning if the data splicing flag bit is not met, and returning to S1;
and S6, a data receiving stopping unit for receiving the upper computer data receiving stopping mark in a timing mode in the running process of S2-S5, if the upper computer data receiving stopping mark is 0, continuing the original step, and if the upper computer data receiving stopping mark is 1, closing the serial port data acquisition thread.
The invention has the following beneficial effects:
aiming at the existing problems, the application establishes an asynchronous high-speed serial port real-time continuous data acquisition system, and ensures that no packet loss and no wrong data are generated in the test process by adopting a multi-serial port card and a pulse sampling controller module and designing a serial port high-speed transceiving and data splicing module; furthermore, multistage hardware filtering and software filtering are adopted in the acquisition system, a counter and a latch are combined in a sampling controller to design aiming at high-speed serial port data acquisition, complete data receiving can be guaranteed under the high-speed serial port real-time data acquisition, and an extremely low error rate is guaranteed.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 shows a schematic structural diagram of an asynchronous high-speed serial port real-time continuous data acquisition system according to an embodiment of the present application.
Fig. 2 shows a schematic structural diagram of a hardware acquisition module according to an embodiment of the present application.
FIG. 3 shows a schematic diagram of an FPGA chip according to an embodiment of the present application.
Fig. 4 shows a schematic diagram of an RS-422 transceiver according to an embodiment of the present application.
FIG. 5 shows a schematic diagram of a flow chart of FPGA embedded software according to an embodiment of the present application.
Fig. 6 is a schematic diagram illustrating a flowchart of the upper computer control software according to an embodiment of the present application.
Fig. 7 shows a schematic diagram of a splicing flow of a real-time data splicing module according to an embodiment of the application.
Detailed Description
In order to make the technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
As shown in fig. 1, the present application provides a high-speed serial communication real-time data acquisition system, which includes:
the hardware acquisition module 10 is used for converting the acquired analog signals into digital signals;
the software control module 20 is used for filtering the digital signals, accumulating the digital signals through a pulse counter, and sending the filtered digital signals to a serial port buffer area of a receiver to form a real-time continuous data stream;
and the real-time data splicing module 30 is used for analyzing the serial port data through the acquisition thread and judging the integrity and continuity of the serial port data so as to realize splicing processing of the real-time continuous data stream under the condition of no synchronous signal.
In a specific embodiment, the hardware acquisition module includes: a sampling controller, an industrial personal computer, an RS-422 transceiver, an RS-422 multi-serial port card and a data transmission cable, wherein,
the sampling controller is used for converting the input analog signals into digital signals and sending the digital signals to the RS-422 multi-serial-port card through the RS-422 transceiver, specifically, the sampling controller is used for completing the real-time acquisition system of accelerometer and gyroscope pulse analog signals and the real-time sending of serial-port data, and the industrial personal computer carries a non-real-time operating system for receiving the signals, wherein the requirements of receiving the signals and sending the signals to the RS-422 multi-serial-port card are metTransmission period of TwThe timing receiving period is TRNon real-time drift of Δ TRAnd satisfy Tw<TR±ΔTR<10TwClock transceiving conditions;
the RS-422 multi-serial port card is used for sending the digital signal to a computer.
In a specific example, as shown in fig. 2, the hardware acquisition module of the whole system includes a sampling controller, an industrial personal computer, an RS-422 multi-serial-port card, a transmission cable, and the like, when a test starts, a plurality of analog signals enter the sampling controller, and then are converted into digital signals, and a data stream is sent to a computer through an RS-422 serial port, where the RS-422 serial-port card is generally installed on a computer motherboard in a bus slot form, such as PCI, PCIe, and the serial-port data enters the computer for subsequent data processing.
In one embodiment, the sampling controller is based on an FPGA chip with RS-422 device architecture.
For example, as shown in fig. 3, an EP3C 25Q-series FPGA chip is selected for use in the sampling controller, wherein an SCI interface is selected to configure corresponding SCIRX and SCITX pins, and the SCIRX and SCITX pins correspond to read/write channels of serial signals. After an external analog signal enters a sampling controller, different filter circuits such as RC (resistor-capacitor) filter low-pass circuits are designed according to signals of different frequency bands and different interference forms, analog-digital signal conversion is completed in an FPGA (field programmable gate array) after filtering, and specifically, a logic device records and converts the analog signal into a count value at a certain time interval to obtain a numerical value and transmits the numerical value to an RS-422 transceiver.
It should be noted that, as shown in fig. 4, the RS-422 transceiver in this embodiment selects a MAX3491ESD chip, and outputs serial read/write signal pairs RX and TX as differential signals. Specifically, the upper computer software firstly sends an initialization command to the sampling controller through the RS422 high-speed serial port, and when the test is started, the data stream is sent to the computer multi-serial-port card for receiving through the digital signal of the FPGA and then through the RS-422 transceiver on the sampling controller.
In this example, the hardware acquisition module mainly realizes that the conversion of the digital signal is completed by the multi-channel analog signal through the filter circuit, the processing of the FPGA chip and the RS-422 transceiver.
In a specific embodiment, the software control module mainly realizes functions of serial port initialization operation, timing data receiving and sending and the like, and calls a plurality of serial ports to work in a thread synchronization mode in a multithreading mode. Wherein the software control module comprises: an embedded FPGA software module as shown in fig. 5 and an upper computer data receiving software module as shown in fig. 6. Wherein the content of the first and second substances,
the development environment of the FPGA embedded software module is Quartus II 8.1, and the programming language is Verilog. An operating system for upper computer software development selects Win 764 bit, a corresponding installation package is Qt-windows-x86-5.2.exe, a Qt creator 4.6.3 is selected as an integrated development environment, a MinGw carried by Qt creator is selected as a C + + compiler, a programming language is C + +, and a software driving mode is that a multi-serial port card drives Moxa PComm 2K.
In this example, the software control module is used to implement functions of analog signal acquisition, conditioning and filtering, analog-to-digital logic conversion, serial port initialization operation, high-speed data acquisition, multi-serial port and multi-thread work, and real-time data display and storage.
In addition, the software control module in this embodiment performs design of a primary thread and a secondary thread and an equivalent mode thread on the application program, and creates an equivalent secondary thread ComThread in the main test thread MainWindow according to the number of open serial ports. The time sequence planning and the thread synchronization in the testing process are carried out among the multiple sub-threads through the thread synchronization class QNutex and the thread waiting class QWhitCondition, so that the application program is easier to expand and maintain.
In a specific embodiment, the real-time data splicing module mainly completes the splicing function of upper and lower two packets of data under the condition that the data packets are cut off in the high-speed transceiving process of a plurality of serial ports. As shown in fig. 7, the real-time data splicing process includes:
s1, serial port equipment and data initialization, which are used for starting a data acquisition thread, configuring serial port parameters including baud rate, data sending form and data acquisition interval time, emptying a serial port buffer area, splicing a data reserved storage area and a complete frame data storage area, setting a data splicing flag bit to be 0, and setting an upper computer data receiving stop flag bit to be 0;
s2, the initial packet header judging unit reads the serial port buffer area, judges whether the first byte of the current serial port data is a preset packet header byte, if yes, the data enters a complete checking unit S3, and if not, the data enters a data packet post-splicing unit S5;
s3, a complete checking unit, which reads data from the first packet header in sequence according to the preset serial port byte length N, checks the preset continuous channel code, check bit and packet tail, if the check fails, reports a data receiving and sending error warning, discards the frame data, and returns to S1; if the check is passed, the data stream with the byte length of N is stored in a complete frame data storage area according to a frame of complete data, and then the complete check unit S3 is carried out again from the next packet head until the data in the buffer area is not enough with the byte length of N, and then the data stream is transferred to a data packet pre-reservation unit S4;
s4, reserving a data packet ahead unit, reserving residual data to a splicing data reserved storage area from the next byte at the last packet tail in the buffer area, recording the length of the byte as 1, setting the splicing flag bit of the data packet as 1, and entering an initial packet header judging unit S2;
s5, a data packet post-splicing unit, for performing the packet splicing processing of the latter half of the incomplete data packet in the previous packet, judging whether the first byte of the data in the current buffer is the packet header, if not, reading the bytes backwards in sequence, when the read byte is equal to the first packet header, reserving all the data in the buffer before the byte, and setting the byte length as N, if N is satisfied, the length of the byte isback+NpreIf the verification is passed, the data is spliced with the last packet and stored in a complete frame data storage area, the data splicing flag bit is set to be 0, meanwhile, the spliced data reserved storage area is cleared, if the verification is not met, a data transceiving error warning is reported, and the step returns to S1;
and S6, a data receiving stopping unit for receiving the upper computer data receiving stopping mark in a timing mode in the running process of S2-S5, if the upper computer data receiving stopping mark is 0, continuing the original step, and if the upper computer data receiving stopping mark is 1, closing the serial port data acquisition thread.
The technical scheme is suitable for a scene of high-speed serial port real-time data acquisition, for the data acquisition system when causing the error code because of single frame data is cut off to high-speed serial port transmission, utilize mutually supporting between hardware acquisition module, software control module and the real-time data concatenation module, guarantee the complete receipt of data and guarantee extremely low error rate under the high-speed serial port real-time data acquisition finally, the method has the characteristics of strong commonality, simple structure, the method is suitable for high-speed serial communication interface real-time data acquisition, very big reduction development time, and the development cost is reduced.
In the embodiment, a design mode of a multi-serial-port card designed by hardware is adopted, so that the multi-path serial ports can be tested and collected simultaneously on the basis of a hardware principle; by adopting a multithreading program scheduling and designing mode, the system ensures that the multi-path serial ports can simultaneously carry out test acquisition on software, so that the high-speed serial communication interface real-time data acquisition system has the characteristic of strong universality.
In addition, in the embodiment, a multi-serial-port card and a pulse sampling controller module are adopted, and a serial-port high-speed transceiving and data packet splicing module is designed, so that no packet loss and no wrong number are ensured in the test process; the acquisition system adopts multi-level hardware filtering and software filtering, and a counter and a latch are combined in a sampling controller to design the high-speed serial port data acquisition, so that the high-speed serial communication interface real-time data acquisition system of the embodiment can improve the accuracy of pulse acquisition.
It should be understood that the above-mentioned embodiments of the present invention are only examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention, and it will be obvious to those skilled in the art that other variations or modifications may be made on the basis of the above description, and all embodiments may not be exhaustive, and all obvious variations or modifications may be included within the scope of the present invention.
Claims (7)
1. The utility model provides a continuous real-time data acquisition system of high-speed serial ports of non-synchronization which characterized in that includes:
the hardware acquisition module is used for converting the acquired analog signals into digital signals;
the software control module is used for filtering the digital signals, accumulating the digital signals through the pulse counter, and sending the filtered digital signals to a serial port buffer area of a receiver to form a real-time continuous data stream;
and the real-time data splicing module is used for analyzing the serial port data through the acquisition thread and judging the integrity and continuity of the serial port data so as to realize splicing processing of the real-time continuous data stream under the condition of no synchronous signal.
2. The system of claim 1, wherein the hardware acquisition module comprises: a sampling controller, an industrial personal computer, an RS-422 transceiver, an RS-422 multi-serial port card and a data transmission cable, wherein,
the sampling controller is used for converting the input analog signals into digital signals and sending the digital signals to the RS-422 multi-serial-port card through the RS-422 transceiver, specifically, the sampling controller is used for completing the real-time acquisition system of accelerometer and gyroscope pulse analog signals and the real-time sending of serial port data, the industrial personal computer carries a non-real-time operating system for receiving, wherein the sending period is TwThe timing receiving period is TRNon real-time drift of Δ TRAnd satisfy Tw<TR±ΔTR<10TwClock transceiving conditions;
the RS-422 multi-serial port card is used for sending the digital signal to a computer.
3. The system of claim 2, wherein the sampling controller is based on an FPGA chip collocated RS-422 architecture.
4. The system of claim 2, wherein the RS-422 multi-serial port card is disposed on a motherboard of the computer in a form of a bus slot.
5. The system of claim 1, wherein the software control module comprises: the system comprises an embedded FPGA software module and an upper computer data receiving software module.
6. The system of claim 1, wherein the software control module is configured to perform functions of analog signal acquisition, conditioning and filtering, analog-to-digital logic conversion, serial port initialization operation, high-speed data acquisition, multi-serial port and multi-thread operation, and real-time data display and storage.
7. The system of claim 1, wherein the real-time data splicing module splicing process comprises:
s1, serial port equipment and data initialization, which are used for starting a data acquisition thread, configuring serial port parameters including baud rate, data sending form and data acquisition interval time, emptying a serial port buffer area, splicing a data reserved storage area and a complete frame data storage area, setting a data splicing flag bit to be 0, and setting an upper computer data receiving stop flag bit to be 0;
s2, the initial packet header judging unit reads the serial port buffer area, judges whether the first byte of the current serial port data is a preset packet header byte, if yes, the data enters a complete checking unit S3, and if not, the data enters a data packet post-splicing unit S5;
s3, a complete checking unit, which reads data from the first packet header in sequence according to the preset serial port byte length N, checks the preset continuous channel code, check bit and packet tail, if the check fails, reports a data receiving and sending error warning, discards the frame data, and returns to S1; if the check is passed, the data stream with the byte length of N is stored in a complete frame data storage area according to a frame of complete data, and then the complete check unit S3 is carried out again from the next packet head until the data in the buffer area is not enough with the byte length of N, and then the data stream is transferred to a data packet pre-reservation unit S4;
s4, reserving a data packet ahead unit, reserving residual data to a splicing data reserved storage area from the next byte at the last packet tail in the buffer area, recording the length of the byte as 1, setting the splicing flag bit of the data packet as 1, and entering an initial packet header judging unit S2;
s5, a data packet post-splicing unit, for performing the packet splicing processing of the latter half of the incomplete data packet in the previous packet, judging whether the first byte of the data in the current buffer is the packet header, if not, reading the bytes backwards in sequence, when the read byte is equal to the first packet header, reserving all the data in the buffer before the byte, and setting the byte length as N, if N is satisfied, the length of the byte isback+NpreIf the verification is passed, the data is spliced with the last packet and stored in a complete frame data storage area, the data splicing flag bit is set to be 0, meanwhile, the spliced data reserved storage area is cleared, if the verification is not met, a data transceiving error warning is reported, and the step returns to S1;
and S6, a data receiving stopping unit for receiving the upper computer data receiving stopping mark in a timing mode in the running process of S2-S5, if the upper computer data receiving stopping mark is 0, continuing the original step, and if the upper computer data receiving stopping mark is 1, closing the serial port data acquisition thread.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111651388.8A CN114509966B (en) | 2021-12-30 | 2021-12-30 | Asynchronous high-speed serial port real-time continuous data acquisition system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111651388.8A CN114509966B (en) | 2021-12-30 | 2021-12-30 | Asynchronous high-speed serial port real-time continuous data acquisition system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114509966A true CN114509966A (en) | 2022-05-17 |
CN114509966B CN114509966B (en) | 2023-11-03 |
Family
ID=81548503
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111651388.8A Active CN114509966B (en) | 2021-12-30 | 2021-12-30 | Asynchronous high-speed serial port real-time continuous data acquisition system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114509966B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116506326A (en) * | 2023-06-21 | 2023-07-28 | 季华实验室 | Sub-thread data receiving method, data monitoring method, upper computer and robot |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101135972A (en) * | 2006-08-29 | 2008-03-05 | 中兴通讯股份有限公司 | Method for upgrading terminal flash software |
CN105302612A (en) * | 2015-11-18 | 2016-02-03 | 西南技术物理研究所 | Method for quick upgrading of software program of single-chip microcomputer in electronic system case |
CN105471548A (en) * | 2015-11-04 | 2016-04-06 | 中国直升机设计研究所 | Network data packet analyzing and distributing method |
CN105571581A (en) * | 2016-03-21 | 2016-05-11 | 北京航空航天大学 | Multi-path optical gyroscope synchronous acquisition system developed based on CPLD (Complex Programmable Logic Device) |
CN107040549A (en) * | 2017-06-08 | 2017-08-11 | 山大鲁能信息科技有限公司 | A kind of TCP packet splicings processing method, server and system |
CN110908949A (en) * | 2019-09-29 | 2020-03-24 | 中国人民解放军陆军工程大学 | Receiving method of complete data frame based on SLIP protocol |
CN111207771A (en) * | 2019-12-31 | 2020-05-29 | 中国船舶重工集团公司第七一七研究所 | High-speed data acquisition and storage device of laser gyroscope |
CN111290305A (en) * | 2018-12-06 | 2020-06-16 | 航天科工惯性技术有限公司 | Multi-channel digital quantity acquisition and processing anti-collision method and system for multiple sets of inertial navigation systems |
CN112304333A (en) * | 2020-09-10 | 2021-02-02 | 北京无线电测量研究所 | Inertia subassembly testing system and testing method thereof |
CN112433977A (en) * | 2020-12-11 | 2021-03-02 | 南京丹迪克科技开发有限公司 | Method for communicating multiple serial devices of electrical measurement system based on VB environment |
-
2021
- 2021-12-30 CN CN202111651388.8A patent/CN114509966B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101135972A (en) * | 2006-08-29 | 2008-03-05 | 中兴通讯股份有限公司 | Method for upgrading terminal flash software |
CN105471548A (en) * | 2015-11-04 | 2016-04-06 | 中国直升机设计研究所 | Network data packet analyzing and distributing method |
CN105302612A (en) * | 2015-11-18 | 2016-02-03 | 西南技术物理研究所 | Method for quick upgrading of software program of single-chip microcomputer in electronic system case |
CN105571581A (en) * | 2016-03-21 | 2016-05-11 | 北京航空航天大学 | Multi-path optical gyroscope synchronous acquisition system developed based on CPLD (Complex Programmable Logic Device) |
CN107040549A (en) * | 2017-06-08 | 2017-08-11 | 山大鲁能信息科技有限公司 | A kind of TCP packet splicings processing method, server and system |
CN111290305A (en) * | 2018-12-06 | 2020-06-16 | 航天科工惯性技术有限公司 | Multi-channel digital quantity acquisition and processing anti-collision method and system for multiple sets of inertial navigation systems |
CN110908949A (en) * | 2019-09-29 | 2020-03-24 | 中国人民解放军陆军工程大学 | Receiving method of complete data frame based on SLIP protocol |
CN111207771A (en) * | 2019-12-31 | 2020-05-29 | 中国船舶重工集团公司第七一七研究所 | High-speed data acquisition and storage device of laser gyroscope |
CN112304333A (en) * | 2020-09-10 | 2021-02-02 | 北京无线电测量研究所 | Inertia subassembly testing system and testing method thereof |
CN112433977A (en) * | 2020-12-11 | 2021-03-02 | 南京丹迪克科技开发有限公司 | Method for communicating multiple serial devices of electrical measurement system based on VB environment |
Non-Patent Citations (2)
Title |
---|
刘超等: "一种串口数据帧拼接现象处理研究", 《计算机测量与控制》, pages 203 - 210 * |
李逸楠等: "一种基于SLIP协议的串行数据解析方法", 《科技与创新》, pages 25 - 28 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116506326A (en) * | 2023-06-21 | 2023-07-28 | 季华实验室 | Sub-thread data receiving method, data monitoring method, upper computer and robot |
CN116506326B (en) * | 2023-06-21 | 2023-11-24 | 季华实验室 | Sub-thread data receiving method, data monitoring method, upper computer and robot |
Also Published As
Publication number | Publication date |
---|---|
CN114509966B (en) | 2023-11-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN100471156C (en) | Data bus bridge and its working method | |
US7079528B2 (en) | Data communication method | |
EP1124179B1 (en) | An apparatus for signal synchronization between two clock domains | |
US5185863A (en) | Byte-wide elasticity buffer | |
CN103995764B (en) | A kind of logic analyser with serial bus protocol continuous trigger function | |
CN109918332B (en) | SPI slave unit and SPI device | |
CN109698824B (en) | FC-AE-1553 protocol conversion multi-protocol multi-channel data recording system | |
CN112187789B (en) | Data link protocol conversion system | |
CN107171728B (en) | 1B4B and Manchester coded forward and reverse transmission method, device and system | |
CN111459052A (en) | Multifunctional vehicle bus simulation detection system and method | |
US9825754B2 (en) | Independent UART BRK detection | |
US6092128A (en) | Ethernet repeater that couples an input data stream to multiple output data streams of differing rates and provides access to a shared bus by a number of inputs and outputs | |
EP0106939A2 (en) | Method and apparatus for simulating a magnetic tape storage equipment in a data processing system | |
CN114509966A (en) | Asynchronous high-speed serial port real-time continuous data acquisition system | |
CN103164314B (en) | Peripheral component interface express (PCIe) interface chip hardware verification method based on asynchronous physical layer interface | |
JPH02226943A (en) | System for analyzing and processing high level data link control sequence frame | |
CN111211863B (en) | MAC transmitting terminal, MAC receiving terminal and circuit, FPGA chip and data transmission system | |
CN108429707B (en) | Time trigger service repeater and method adapting to different transmission rates | |
CN111683310B (en) | Networking type data acquisition and analysis system and method | |
US6823137B2 (en) | Optical line protection device and optical line protection method | |
CN112118144A (en) | Ethernet data frame output method and system | |
CN103107862A (en) | Logic device and management data input/output (MDIO) data transmission method thereof | |
CN114726674B (en) | PROFIBUS bus process data extraction method based on FPGA | |
EP0396669B1 (en) | Method and apparatus for detecting impending overflow and/or underrun of elasticity buffer | |
US5212688A (en) | TDM expansion bus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |