CN103186608A - Method and device for processing data in queue serialization way - Google Patents

Method and device for processing data in queue serialization way Download PDF

Info

Publication number
CN103186608A
CN103186608A CN2011104561942A CN201110456194A CN103186608A CN 103186608 A CN103186608 A CN 103186608A CN 2011104561942 A CN2011104561942 A CN 2011104561942A CN 201110456194 A CN201110456194 A CN 201110456194A CN 103186608 A CN103186608 A CN 103186608A
Authority
CN
China
Prior art keywords
data
serializing
formation
frame
parsing
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
Application number
CN2011104561942A
Other languages
Chinese (zh)
Other versions
CN103186608B (en
Inventor
雷声
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Aeonmed Co Ltd
Original Assignee
Beijing Aeonmed Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Aeonmed Co Ltd filed Critical Beijing Aeonmed Co Ltd
Priority to CN201110456194.2A priority Critical patent/CN103186608B/en
Publication of CN103186608A publication Critical patent/CN103186608A/en
Application granted granted Critical
Publication of CN103186608B publication Critical patent/CN103186608B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Communication Control (AREA)

Abstract

The invention discloses a method for processing data in a queue serialization way. The method comprises the steps as follows: S1, setting a fast buffer region and a slow buffer region at a communication port; S2, receiving input initial data, dividing into fast data and slow data according to the preliminary analysis, and correspondingly placing in the fast buffer region and the slow buffer region by a one-way queue structure to form a data frame; S3, judging if the data frame is legal, if so, entering the step S4, if not, entering the step S3, and abandoning the data frame; and S4, dequeuing, analyzing and displaying the data frame in a queued way. The invention further discloses a device for processing the data in the queue serialization way. According to the method and the device, the data is processed in the queue serialization way, so that the data processing process is faster and the real-time performance is improved.

Description

A kind of method and apparatus of formation serializing formula deal with data
Technical field
The present invention relates to the discrete data process field, more particularly, relate to a kind of method and apparatus of formation serializing formula deal with data.
Background technology
At the medicine equipment design field; along with the growing of user's request and the strict demand to security that medicine equipment is consistent; Anesthesia machine need be realized more function and possess more safeguard measure; the software and hardware that also just means Anesthesia machine will be towards multisystem, the design of multiunit direction, and certain expectation function is finished in each unit.Therefore, certainly exist certain exchanges data between the unit, the RS-232 serial port is to use more a kind of standard communication interface, and it possesses features such as full duplex communication, higher stability, better ease for use, so can realize multiple communication modes based on it.The present invention is based on the asynchronous communication interface of RS-232 full-duplex mode, under the prerequisite of widely used " shaking hands+verification and type " communications protocol, realize a kind of rapid data higher to real-time, preferentially receive and dispatch the algorithm of processing.
In Anesthesia machine, with the control of breathing unit (be called for short: BDU) and user interface elements (be called for short: real-time requirement and data load GUI) are the highest, and between these 2 unit, most producers can use serial communication, as RS-232, I2C etc.And the two rapid data that needs to guarantee real-time comprises: the real-time waveform data of 1-3 kind value, electronic flow-meter (are called for short: EFM) data, Realtime Alerts data and ventilating mode switching command etc.So-called slow data comparatively speaking namely refers to the data that the transmission cycles such as monitor value data, status data, trend data are long.
The present invention will with typical waveform show rapid data (be called for short: rapid data) and the monitor value slow data (be called for short: data slow data) receive, data resolve to example, the elaboration subsequent content.The process that all rapid data assemblings, data send, identical with the principle that data receive.
Owing to be serial communication, from the communications protocol design point of view, often can not set up independent communication channel for rapid data, can only identify which data and belong to rapid data, this is relevant with many-sided considerations such as cost, stability.Therefore, from existing communication hardware, be difficult to accomplish the preferential answering to rapid data, can only do post-processed to data by software, fictionalize a fast data channel, preferentially provide data to show scheduling algorithm to waveform.There is following several typical shortcoming in existing rapid data Processing Algorithm:
1. on data receive, can effectively rapid data be separated with slow data, but not consider that rapid data more needs buffering, and need carry out serializing to buffered data, when receiving, not go out active or problems such as front and back reversed order, covering to guarantee data;
2. data reception and data are not resolved and are walked abreast, and resolve immediately after the reception, and namely receiving and resolving is that serial is carried out.Comparatively speaking, data are resolved owing to will take out raw data and carry out necessary operations such as numerical value conversion, in the occasion that real-time is had relatively high expectations, are relatively slow.This can cause the processing time-delay of next frame rapid data, and this time-delay can accumulation, finally causes raw data capped or lose, and causes to misexplain or leak solution;
3. because the data after resolving are not considered buffering yet, this just requires original just the slowest relative waveform to show that the sampling period shortens, even and waveform shows that the sampling period shortens to and data parsing cycle synchronisation, because the existence of problem 2 can not be avoided covering or obliterated data.Because the procedure for displaying speed-raising causes the GUI system overhead to increase sharply, and the improvement of actual displayed effect and not obvious; The GUI waveform shows that the design in total cycle is forced to run counter to needs of expected design, and waveform shows that problems such as total period definition is limited come one after another.
Summary of the invention
In order to solve above problem, the invention provides a kind of method and apparatus of formation serializing formula deal with data.
The invention discloses a kind of method of formation serializing formula deal with data, comprising:
S1., fast cache district and buffer zone at a slow speed are set at the communication port place;
S2. receive the raw data of input, and be divided into rapid data and slow data by pre-parsing, and with corresponding described fast cache district and the buffer zone at a slow speed put into of unidirectional queue structure, form Frame;
S3. judge whether described Frame is legal, if legal, enter step S4, if illegal, enter step S31, described Frame is given it up;
S4. described Frame being gone out team in the mode of team's seriation resolves and shows.
In the method for formation serializing formula deal with data of the present invention, described pre-parsing, specifically: adopt polling method periodicity active detecting and receive the serial port data, obtain data command word and length.
In the method for formation serializing formula deal with data of the present invention, described pre-parsing, specifically: adopt machine-processed passive triggering such as interruption, event or message to receive data, obtain data command word and length.
In the method for formation serializing formula deal with data of the present invention, described communication port is: RS-232 serial port communication, I 2C, SPI, CAN.
In the method for formation serializing formula deal with data of the present invention, during described many queuing datas of reception, step S2 and step S4 can carry out simultaneously.
The invention discloses a kind of device of formation serializing formula deal with data, be used for realizing above-mentioned method, comprising:
Buffer zone arranges the unit: be used for arranging at the communication port place fast cache district and buffer zone at a slow speed;
Raw data separative element: with described buffer zone the unit is set and links to each other, be used for receiving the raw data of input, and be divided into rapid data and slow data by pre-parsing, and with corresponding described fast cache district and the buffer zone at a slow speed put into of unidirectional queue structure, form Frame;
Frame judging unit: link to each other with described raw data separative element, be used for judging whether described Frame is legal;
Data resolution unit: link to each other with described Frame judging unit, be used for that described Frame is gone out team in the mode of team's seriation and resolve and show.
In the device of formation serializing formula deal with data of the present invention, described pre-parsing, specifically: adopt polling method periodicity active detecting and receive the serial port data, obtain data command word and length.
In the device of formation serializing formula deal with data of the present invention, described pre-parsing, specifically: adopt machine-processed passive triggering such as interruption, event or message to receive data, obtain data command word and length.
In the device of formation serializing formula deal with data of the present invention, described communication port is: RS-232 serial port communication, I 2C, SPI, CAN.
In the device of formation serializing formula deal with data of the present invention, during described many queuing datas of reception, described raw data separative element receives data and described data resolution unit resolution data can carry out synchronously.
Implement the method and apparatus of formation serializing formula deal with data of the present invention, have following beneficial technical effects:
A) utilize formation to record rapid data and slow data respectively, make data sequenceization, can be not overlapping or cover;
B) transmitting-receiving with data separates with resolving, and handles with multithreading thought and resolves, and guarantee serializing equally;
C) use the distinctive characteristic of formation, make the access control of data become simple and easy, efficient;
D) data are not lost, and the rapid data processing procedure is accelerated, and improve real-time;
E) embedded system or non-embedded system all are suitable for.
Description of drawings
Fig. 1 is the method flow diagram of a kind of formation serializing of embodiment of the invention formula deal with data;
Fig. 2 is the device block scheme of a kind of formation serializing of embodiment of the invention formula deal with data;
The phenomenon diagram that Fig. 3 may occur for prior art serial original data sequence;
Fig. 4 separates and the serializing synoptic diagram for speed raw data of the present invention;
Fig. 5 resolves synoptic diagram for the single-threaded data of the present invention;
Fig. 6 is for resolution data serializing of the present invention and show the sampling synoptic diagram.
Embodiment
By describing technology contents of the present invention, structural attitude in detail, realized purpose and effect, give explanation below in conjunction with embodiment and conjunction with figs. are detailed.
Handle the technical matters that exists at existing rapid data, the present invention proposes a kind of feasible raising rapid data and handle real-time, fundamentally avoid loss of data, and by the design technology project of priority processing:
At problem 1, this algorithm utilizes the first in first out of formation (Queue) structure, characteristics such as data sequenceization, receive, resolve link in data and use this characteristics design data buffering, and rapid data separated with slow data, putting into different bufferings respectively, wouldn't resolve data, to improve the real-time that rapid data receives, data are not lost when guaranteeing to receive.
At problem 2, data reception buffering and data are resolved to be buffered in and are all used queue structure on the mechanism, because the existence of buffering, receive on the microcosmic and resolving and not exclusively synchronous, use and utilize the easy accessibility of formation by multithreading, relatively slow resolving is finished with receiving course is parallel as far as possible, thereby guarantee that upward reception and the parsing of data are synchronous to macroscopic view, that has realized namely also that data receive and resolve separates fully: the next frame rapid data just can be received after needn't waiting the previous frame data to resolve to finish.Further guarantee the real-time of data after parsing, still can not lose.
At problem 3, in case data loss problem solves, as long as BDU (Breath Delivery Unit, the control of breathing unit) hold the sampled data that provides abundant, GUI (Graphical User Interface, graph user interface unit) hold the effect of not only waveform demonstration obviously to improve, the flexibility ratio that shows total period definition also increases greatly: needn't consider to show and resolves synchronous, show that the sampling period can define within the specific limits, show the weak point in sampling period or longly only determine high or low to the utilization factor of sampled data, make to average out as required between the display effect of waveform and system overhead.
See also Fig. 1, a kind of method of formation serializing formula deal with data comprises:
S1., fast cache district and buffer zone at a slow speed are set at the communication port place;
S2. receive the raw data of input, and be divided into rapid data and slow data by pre-parsing, and with corresponding described fast cache district and the buffer zone at a slow speed put into of unidirectional queue structure, form Frame;
The pre-parsing refers to adopt polling method periodicity active detecting and receives the serial port data, obtains data command word and length or adopts machine-processed passive triggerings such as interruption, event or message to receive data, obtains data command word and length.
Described communication port is RS-232 serial port communication, I 2C (Internal Integrate ChipCommunication, synchronous communication between inside chip), SPI (Serial Peripheral Interface, Serial Peripheral Interface), CAN (Controller Area Network, controller area network) etc.
S3. judge whether described Frame is legal, if legal, enter step S4, if illegal, enter step S31, described Frame is given it up;
S4. described Frame being gone out team in the mode of team's seriation resolves and shows.
During described many queuing datas of reception, step S2 and step S4 can carry out simultaneously.
See also Fig. 2, a kind of device of formation serializing formula deal with data is used for realizing above-mentioned method that comprise: buffer zone arranges unit 10, raw data separative element 20, Frame judging unit 30, data resolution unit 40.
Buffer zone arranges unit 10: be used for arranging at the communication port place fast cache district and buffer zone at a slow speed;
Raw data separative element 20: with buffer zone unit 10 is set and links to each other, be used for receiving the raw data of input, and be divided into rapid data and slow data by pre-parsing, and with corresponding described fast cache district and the buffer zone at a slow speed put into of unidirectional queue structure, form Frame;
Frame judging unit 30: link to each other with raw data separative element 20, be used for judging whether described Frame is legal;
Data resolution unit 40: link to each other with Frame judging unit 30, be used for that described Frame is gone out team in the mode of team's seriation and resolve and show.
Wherein, described pre-parsing, specifically: adopt polling method periodicity active detecting and receive the serial port data, obtain data command word and length or adopt machine-processed passive triggering such as interruption, event or message to receive data, obtain data command word and length, described communication port is RS-232 serial port communication, I 2C, SPI, CAN etc., during described many queuing datas of reception, described raw data separative element receives data and described data resolution unit resolution data can carry out synchronously.
To as " slow data ", elaborate technical scheme of the present invention (illustrating) with oxygen concentration monitor value data with the Wave data of 3 values as " rapid data " below:
" rapid data " of 3 values: airway pressure-time (PAW-t) Wave data, gas flow rate-time (Flow-t) Wave data and tidal volume-time (VolumeTidal-t) Wave data.For guarantee that 3 values can be sent by BDU synchronously in a rapid data frame;
Transmission cycle: Tw=20ms (millisecond);
Oxygen concentration monitoring " slow data ": BDU sends the oxygen concentration Frame;
Transmission cycle: To=2s (second);
Set forth as data receiver's gui software realization of the present invention so that " raw data separate and serializing ", " receiving separating of data and resolution data ", " serializing of resolution data " three aspects are concrete respectively below:
Raw data is separated and serializing:
This stage main target is to collect all raw data that BDU sends, and according to rapid data or slow data sign, and data are put into the buffering of rapid data and slow data respectively, realizes separating, but will guarantee the sequencing of data simultaneously.
This stage is only identified easily to the speed data, and this is called " the pre-parsing ".Pre-resolve not carried out complete solution to whole frame data and analysed (complete solution analyse as: calculation check and), because complete solution is analysed the conversion that may relate to numerical operation or value type, can take more CPU time, even cause receiving time-delay.Owing to be serial port, there is rapid data that slow data is also arranged in the data of sending, fast data at a slow speed also may appear in the data sequence of receiving with the unexpected time interval, as shown in Figure 3, represent slow data with bold box among Fig. 3, show rapid data with the fine rule frame table, arrow is represented effluxion.
Can see, in the multiframe rapid data of receiving, insert the slow data frame every now and then.The rapid data that rightmost side expection arrives among the figure just can occur after will be by the time having passed prior to its slow data.This phenomenon is easy to occur in the communications protocol of widely used " transmission+elongated instruction regularly ", and reason is multiple: may be relevant with protocol definition, the maximum rate of change of adjacent frame length, BDU task weight, BDU data transmission control mode etc.For the present invention and existing algorithm, the processing of this original data sequence is the same on the efficient, but the processing in later stage has the essence difference.
The hardware case that data receive according to the RS-232 serial port is divided into two kinds of schemes:
1. the serial port bottom is not is not received and dispatched buffering, as the system based on processors such as single-chip microcomputer, DSP, its serial port communication mechanism is generally receives that 1 byte just causes serial ports and interrupts, gui software is write the serial ports interrupt handling routine, be that unit sequence is collected serial data with the byte, the buffering of putting into the array form forms the raw data row.
2. the serial port bottom has the transmitting-receiving buffering, as the environment based on PC or embedded OS, its serial port end itself has been provided with buffering, data are cushioned and just can cause interruption/event after a certain amount of, interruption/button.onrelease receives data, and the reception program is once received the data of a more than byte usually.
If according to scheme 1, existing most routine all can be pointed to the developer direction whether judgment data finish and go to develop, and the program that just receives must know that when frame data finish, and could will put in order frame data and put into buffering.This certainly will or increase frame control in agreement content reduces the valid data amount that Frame carries; Will carry out complete solution to data in the reception stage and analyse, in order to end of identification symbol and verification and, reduced transmitting-receiving efficient, also run counter to the design original intention in this stage---collect data earlier and postpone resolving.
If according to scheme 2, though can avoid in the scheme 1 situation about will analyse the data complete solution, if but a plurality of bufferings are not set, just can't disposablely collect a plurality of Frames, most prior aries is to use array (Array) or structural array data structures such as (Struct Array) as receiving buffering, and must specify size during the array initialization, if Frame is elongated, this size just is difficult to determine.The access control of array element normally realizes by pointer or counter, if the value of pointer or counter leads to errors for a certain reason, taking out the position of data last time will have no way of learning, serious, can directly cause system crash ... also run counter to the original intention of this stage design---the correct and serializing of data.
The problem that runs in view of above-mentioned analytical plan 1 and scheme 2 data receiver's cases is so Fig. 1 of the present invention has proposed to use unidirectional formation (Queue) structure to receive the thought of buffer zone as data.The outstanding feature of queue structure is exactly serializing: the data of joining the team, must follow the principle of " first in first out ", and the data of namely joining the team at first when taking, go out team at first, can not go out team from the centre.
The application queue structure has following some benefit, can effectively avoid the drawback in such scheme 1 and the scheme 2.
Because queue structure only allows to insert data at tail of the queue, team's head takes out data, serializing that can very easy assurance data.Avoid using extra access control, as: access pointer, fundamentally stop to misplug and miss the access errors of getting.Because the characteristic of formation " tail of only jumping the queue " can once all be inserted formation with many data of receiving, reduce access times.
Formation can the initialization size, also can not specify size according to the hardware resource actual conditions, overflow the back system and append the contiguous memory space automatically to tail of the queue, the length variations of formation to access control without any influence.
General type formation " Queue<T〉" more can freely arrange<T be the self-defining data type, its member will deposit in strict accordance with the data designated type.The present invention utilizes general this characteristic of type formation, will receive data and resolution data separates fully.
Two buffer queues are set, will deposit respectively after " rapid data " and " slow data " process " the pre-parsing ", pre-method of resolving can be divided into following common dual mode again:
Adopt polling method with Tw cycle active detecting and receive the serial port data, pre-resolution data command word and length;
Adopt machine-processed passive triggering such as interruption, event or message to receive data, pre-resolution data command word and length.
No matter adopt which kind of pre-analysis mode, such scheme all can be realized pre-parsing.
According to pre-resolve command word, the quick or slow data of identification; According to pre-parsing length, data are joined the team respectively, as shown in Figure 4.
But, no matter adopt scheme 1 or scheme 2, all can run into the incomplete situation of last frame data.
If employing scheme 2, because the serial port bottom is controlled by embedded system, itself possesses buffering, pre-dissection process can be carried out at serial port buffering place, if find that the last frame data are imperfect, can know in advance and will not go into to receive team, wait to receive to reenter after complete and receive team.
If employing scheme 1 then needs for data receive an extra buffering to be set.This is buffered in and receives before the buffering, is equivalent to the serial port buffering that embedded system provides in the scheme 2, and this buffering also can utilize the formation principle to realize.Can whether learn less than the Frame size by the real-time extra buffering of inquiry (formation principle) number of members, if less than, then this frame can be waited until to receive next time to reenter after complete and receive team.
Receive separating of data and resolution data:
After data received correctly, the complete solution that will begin data was analysed process.
Complete solution is analysed process generally needs following several steps:
1. by communications protocol, whether the judgment data frame is legal, illegal giving it up.Here will and calculate and compare operation to verification, this also is the essential requirement of reliability aspect;
2. by communications protocol, to all valid data extract, processing such as numerical value conversion, assignment;
3. even direct assign operation is arranged, but most resolution data has the serializing demand, be to the resolution data serializing.
Most cases, the resolving requirement of data and the receiving course of data are synchronous as much as possible, and especially rapid data requires just stronger to this real-time.
Because resolution data and receive data and have essential distinction, the present invention proposes a kind of thought that resolution data and reception data are separated.This multithreading application for resolving in future provides possibility, can utilize system resource to improve the efficient of resolving more fully.Utilize the easy accessibility of formation, implementation procedure is also comparatively simple: the whole frame of correct data that will have reception now goes out team → parsing.Because rapid data separates by pre-the parsing when receiving with slow data, make rapid data when resolving, to write algorithm separately, and preferentially obtain handling, improve resolution speed.
Receive data and after resolution data separates, just can consider the parsing of data separately because the existence of buffering, the parsing of every frame data needn't with receive synchronous fully, also may be after harvesting the 2nd frame data, the 1st frame data have just been resolved.Rapid data all is the time interval of Millisecond usually, if be used for the instant data of demonstration, presses most at present design requirements, is to allow to have the acceptable time difference between demonstration and data processing.Since it is so, just for the reception of data with resolve the asynchronous chance that foundation and design mechanism are provided, and the target that this stage need reach, be: data are received and resolve asynchronous, the raising analyzing efficiency makes asynchronous error can accept not accumulate, and accomplishes that macroscopic view goes up synchronous that data receive and resolve.
The modern procedures development technique has proposed the concept of multithreading, and task is dispersed as little task section, and the task that makes is dispersion order processed (not simultaneously, being equivalent to asynchronous) at microcosmic, but is that complete sum is synchronous on the macroscopic view.Therefore, multithreading being applied in data resolving relatively is fit to.Just divide single-threaded and two kinds of different running software modes of multithreading to set forth the process that data are resolved below:
Single-threaded, process flow diagram as shown in Figure 5:
So-called single-threaded, be exactly " single process ", the meaning of " single task ", most non-embedded Single Chip Microcomputer (SCM) system all belong to this kind situation.The single-threaded reception that means data and resolve and all in the flow process of an order, carry out, but this and do not mean that resolving can't raise the efficiency.For single-threaded, except the optimization of analysis program itself, can also guarantee that the macroscopic view of resolving is synchronous by the interruption that is similar to multithreading.If be that the timer of timing cycle interrupts periodic polling to resolve demand with Tw by one for example---there are the data of reception to use, then trigger resolving by timer.Certainly exist a big prerequisite to be exactly here: receiving data and resolution data must separately store.As everyone knows: interrupt service routine must be efficiently, and the process of numerical evaluation conversion should not occur in break in service.So, in interrupt service routine, what can be done? answer is clearly: (1) finds whether have data to be received, this can learn by the number of members that inquiry receives buffering, because buffering is formation, need not as array, calculate and the queried access sign, as long as go out team according to command word and the length of pre-parsing! (2) set up an one-dimension array that group data, the size of this array can be predicted, and a sign is set when this array has data, tells that the analytical function in the major cycle has data to need to resolve at present.After major cycle is polled to this sign, call parsing and clear flag that analytical function is realized data, resolve for the next frame data and prepare.The data that this mode produces are handled and are shown that the error between the sampling is elongated, depend on the longest timing of timer (Tw)+major cycle cycle (Tp) in theory, and can predict the worst time fully, and all be Millisecond.Introduce interrupt mechanism, can improve the efficient of single-threading program processing procedure greatly, thereby improve the real-time of global design.
Multithreading:
The process that multithreading is handled, with single-threaded in the concept of " timer interruption " very similar.And multithreading expands " timer interruption "---under the threading mechanism control of multitask system, be equivalent to realize a plurality of " timer interruptions ", and each " interruption " is exactly a thread, utilize thread synchronization mechanism, can make some data in the process by plural thread process.The benefit of a maximum of doing like this, make exactly single-threaded in:
The longest timing of error=timer (Tw)+major cycle cycle (Tp) between data are handled and demonstration is sampled
This elongated error more fixed length that becomes.This is because " the longest timing of timer " is dispersed as the timeslice that each thread is finished again by Tw, for example distribute a thread with 5ms, finish the task of a 20ms like this, just need 4 threads in theory, if and system supports the thread more than 4, just can make the task of these 4 threads on macroscopic view, fulfil task ahead of schedule with the time less than 20ms, this just makes the time of " worst case " shorten, and, the operation of thread is only relevant with the task weight with the resource of total system, when the most cases system task was not heavy, the time of worst case approached fixing substantially.
The serializing of resolution data, as shown in Figure 6.
How the main target in the stage of front is for effectively to control losing of data, and the target in this stage then is according to display requirement, and abundant resolution data is provided.And these data need serializing equally.
Approach or equal the cycle that resolution data provides as long as show the cycle of sampling, the demonstration of waveform just enough fine and smooth with near true waveform.But in order not produce wrong showing, the data of parsing still need serializing,, take the mechanism of general type formation to realize equally here.Data after the parsing are regularly joined the team with structure or other data layouts, formation must arrange maximum space, after data reach maximum space, do not take team's data away if still show sampling, then team's data go out team automatically, because general type formation can admit overall data as the structure as a member of formation, the data that go out team will be whole frame resolution datas, can not cause overlapping between data.If during have and show the sampling access queue, then can take a current team data away.So, the display requirement of waveform only with showing that sampling is relevant, can reduce the distortion of waveform on data transmission to a certain extent.
The present invention is owing to introduced buffering, and the true Wave data that BDU sends finally shows to the GUI display terminal, is that certain phase error is arranged.The reason that produces phase error is that data are not to send to demonstration once being received, but resolved and cushion and just send to demonstration after a certain amount of, and the phase error size directly is directly proportional with buffer size.Though the present invention has this inherent shortcoming at present, but the size of buffering can be controlled in the reasonable scope, so the phase error that produces also is relative fixed and controlled, can not accumulate, the 2nd shortcoming of this and aforesaid prior art compared, and the effect behind the long-play has very big difference.
Make a general survey of the display technique of existing other field, all can have certain time-delay with True Data, as long as this time-delay do not accumulate, and in receptible scope, all can be used for replacing the algorithm of the 2nd shortcoming of similar prior art.
Implement the method and apparatus of formation serializing formula deal with data of the present invention, have following beneficial technical effects:
A) utilize formation to record rapid data and slow data respectively, make data sequenceization, can be not overlapping or cover;
B) transmitting-receiving with data separates with resolving, and handles with multithreading thought and resolves, and guarantee serializing equally;
C) use the distinctive characteristic of formation, make the access control of data become simple and easy, efficient;
D) data are not lost, and the rapid data processing procedure is accelerated, and improve real-time;
E) embedded system or non-embedded system all are suitable for.
By reference to the accompanying drawings embodiments of the invention are described above; but the present invention is not limited to above-mentioned embodiment; above-mentioned embodiment only is schematic; rather than it is restrictive; those of ordinary skill in the art is under enlightenment of the present invention; not breaking away under the scope situation that aim of the present invention and claim protect, also can make a lot of forms, these all belong within the protection of the present invention.

Claims (10)

1. the method for a formation serializing formula deal with data is characterized in that, comprising:
S1., fast cache district and buffer zone at a slow speed are set at the communication port place;
S2. receive the raw data of input, and be divided into rapid data and slow data by pre-parsing, and with corresponding described fast cache district and the buffer zone at a slow speed put into of unidirectional queue structure, form Frame;
S3. judge whether described Frame is legal, if legal, enter step S4, if illegal, enter step S31, described Frame is given it up;
S4. described Frame being gone out team in the mode of team's seriation resolves and shows.
2. the method for formation serializing formula deal with data according to claim 1 is characterized in that, described pre-parsing, specifically: adopt polling method periodicity active detecting and receive the serial port data, obtain data command word and length.
3. the method for formation serializing formula deal with data according to claim 1 is characterized in that, described pre-parsing, specifically: adopt machine-processed passive triggering such as interruption, event or message to receive data, obtain data command word and length.
4. the method for formation serializing formula deal with data according to claim 1 is characterized in that described communication port is: RS-232 serial port communication, I2C, SPI, CAN.
5. the method for formation serializing formula deal with data according to claim 1 is characterized in that, during described many queuing datas of reception, step S2 and step S4 can carry out simultaneously.
6. the device of a formation serializing formula deal with data is used for realizing the described method of claim 1, it is characterized in that, comprising:
Buffer zone arranges the unit: be used for arranging at the communication port place fast cache district and buffer zone at a slow speed;
Raw data separative element: with described buffer zone the unit is set and links to each other, be used for receiving the raw data of input, and be divided into rapid data and slow data by pre-parsing, and with corresponding described fast cache district and the buffer zone at a slow speed put into of unidirectional queue structure, form Frame;
Frame judging unit: link to each other with described raw data separative element, be used for judging whether described Frame is legal;
Data resolution unit: link to each other with described Frame judging unit, be used for that described Frame is gone out team in the mode of team's seriation and resolve and show.
7. the device of formation serializing formula deal with data according to claim 6 is characterized in that, described pre-parsing, specifically: adopt polling method periodicity active detecting and receive the serial port data, obtain data command word and length.
8. the device of formation serializing formula deal with data according to claim 6 is characterized in that, described pre-parsing, specifically: adopt machine-processed passive triggering such as interruption, event or message to receive data, obtain data command word and length.
9. the device of formation serializing formula deal with data according to claim 6 is characterized in that described communication port is: RS-232 serial port communication, I 2C, SPI, CAN.
10. the device of formation serializing formula deal with data according to claim 6 is characterized in that, during described many queuing datas of reception, described raw data separative element receives data and described data resolution unit resolution data can carry out synchronously.
CN201110456194.2A 2011-12-30 2011-12-30 The method and apparatus that a kind of queue serializes formula processing data Active CN103186608B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110456194.2A CN103186608B (en) 2011-12-30 2011-12-30 The method and apparatus that a kind of queue serializes formula processing data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110456194.2A CN103186608B (en) 2011-12-30 2011-12-30 The method and apparatus that a kind of queue serializes formula processing data

Publications (2)

Publication Number Publication Date
CN103186608A true CN103186608A (en) 2013-07-03
CN103186608B CN103186608B (en) 2017-08-08

Family

ID=48677777

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110456194.2A Active CN103186608B (en) 2011-12-30 2011-12-30 The method and apparatus that a kind of queue serializes formula processing data

Country Status (1)

Country Link
CN (1) CN103186608B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104063216A (en) * 2014-06-12 2014-09-24 北京航天发射技术研究所 High-speed data processing display method based on Labview
CN106095716A (en) * 2016-06-24 2016-11-09 武汉光迅科技股份有限公司 A kind of serial port communication method based on head and the tail round-robin queue
CN107645564A (en) * 2017-10-24 2018-01-30 厦门市福工动力技术有限公司 A kind of CAN message analytic method and its system based on data buffer storage
CN108551358A (en) * 2018-03-16 2018-09-18 恒玄科技(上海)有限公司 A kind of method of adjustment of bluetooth headset difference model subaudio frequency data
CN109213102A (en) * 2018-09-11 2019-01-15 深圳众城卓越科技有限公司 More order monitoring methods, device, computer equipment and storage medium
CN109939310A (en) * 2017-12-20 2019-06-28 北京谊安医疗***股份有限公司 The slave computer of ventilator sends the method and ventilator of data to host computer
CN107493266B (en) * 2017-07-26 2020-07-28 广州广电运通金融电子股份有限公司 Communication system, method and device of embedded self-service terminal
CN111835611A (en) * 2020-07-08 2020-10-27 北京软安科技有限公司 Vehicle CAN bus data analysis method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2248952A (en) * 1990-10-05 1992-04-22 Digital Equipment Corp Hierarchical integrated circuit cache memory
US6301629B1 (en) * 1998-03-03 2001-10-09 Alliance Semiconductor Corporation High speed/low speed interface with prediction cache
CN101146102A (en) * 2007-10-16 2008-03-19 深圳国人通信有限公司 HDLC data uplink and downlink method and communication device in RRU network
JP2008160370A (en) * 2006-12-22 2008-07-10 Kddi Corp Data transmission system and method, data transmission device, and data reception device
CN101707506A (en) * 2009-11-06 2010-05-12 中兴通讯股份有限公司 Business clock transparent transmission method and system in optical transport network
CN101986611A (en) * 2010-11-30 2011-03-16 东南大学 Quick flow grouping method based on two-level cache

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2248952A (en) * 1990-10-05 1992-04-22 Digital Equipment Corp Hierarchical integrated circuit cache memory
US6301629B1 (en) * 1998-03-03 2001-10-09 Alliance Semiconductor Corporation High speed/low speed interface with prediction cache
JP2008160370A (en) * 2006-12-22 2008-07-10 Kddi Corp Data transmission system and method, data transmission device, and data reception device
CN101146102A (en) * 2007-10-16 2008-03-19 深圳国人通信有限公司 HDLC data uplink and downlink method and communication device in RRU network
CN101707506A (en) * 2009-11-06 2010-05-12 中兴通讯股份有限公司 Business clock transparent transmission method and system in optical transport network
CN101986611A (en) * 2010-11-30 2011-03-16 东南大学 Quick flow grouping method based on two-level cache

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104063216A (en) * 2014-06-12 2014-09-24 北京航天发射技术研究所 High-speed data processing display method based on Labview
CN106095716A (en) * 2016-06-24 2016-11-09 武汉光迅科技股份有限公司 A kind of serial port communication method based on head and the tail round-robin queue
CN106095716B (en) * 2016-06-24 2020-06-02 武汉光迅科技股份有限公司 Serial port communication method based on head-to-tail circular queue
CN107493266B (en) * 2017-07-26 2020-07-28 广州广电运通金融电子股份有限公司 Communication system, method and device of embedded self-service terminal
CN107645564A (en) * 2017-10-24 2018-01-30 厦门市福工动力技术有限公司 A kind of CAN message analytic method and its system based on data buffer storage
CN107645564B (en) * 2017-10-24 2021-03-23 厦门市福工动力技术有限公司 CAN message analysis method and system based on data cache
CN109939310A (en) * 2017-12-20 2019-06-28 北京谊安医疗***股份有限公司 The slave computer of ventilator sends the method and ventilator of data to host computer
CN108551358A (en) * 2018-03-16 2018-09-18 恒玄科技(上海)有限公司 A kind of method of adjustment of bluetooth headset difference model subaudio frequency data
CN109213102A (en) * 2018-09-11 2019-01-15 深圳众城卓越科技有限公司 More order monitoring methods, device, computer equipment and storage medium
CN109213102B (en) * 2018-09-11 2022-01-18 深圳众城卓越科技有限公司 Multi-command monitoring method and device, computer equipment and storage medium
CN111835611A (en) * 2020-07-08 2020-10-27 北京软安科技有限公司 Vehicle CAN bus data analysis method and device
CN111835611B (en) * 2020-07-08 2022-04-05 北京软安科技有限公司 Vehicle CAN bus data analysis method and device

Also Published As

Publication number Publication date
CN103186608B (en) 2017-08-08

Similar Documents

Publication Publication Date Title
CN103186608A (en) Method and device for processing data in queue serialization way
CN107291547B (en) Task scheduling processing method, device and system
US8572299B2 (en) Hardware accelerator module and method for setting up same
EP2701074B1 (en) Method, device, and system for performing scheduling in multi-processor core system
CN106293919A (en) The built-in tasks dispatching device of a kind of Time Triggered and method
TWI323433B (en) Graphics pipeline precise interrupt method and appartus
CN103221934A (en) Control node for a processing cluster
CN105183698B (en) A kind of control processing system and method based on multi-core DSP
JP5793690B2 (en) Interface device and memory bus system
WO2014025145A1 (en) Method and apparatus for processing message between processors
CN104536827B (en) A kind of data dispatching method and device
CN106790694A (en) The dispatching method of destination object in distributed system and distributed system
CN108255585B (en) SDK abnormal control and application program operation method, device and equipment thereof
CN101383712A (en) Routing node microstructure for on-chip network
CN102750132A (en) Thread control and call method for multithreading virtual assembly line processor, and processor
US20110289302A1 (en) Data processing device and method
CN102455940A (en) Processing method and system of timers and asynchronous events
CN106528281A (en) Satellite telemetry data offline unified rapid processing system
CN111158876B (en) Log processing method, device, equipment and computer readable storage medium
CN108123850B (en) Comprehensive scheduling method and device for preemption problem of interrupt holders
CN107066413A (en) A kind of method and its bus system for being used to handle multiple bus apparatus data
WO2011137833A1 (en) Network processor and method for diagnosing programs stored in network processor
CN103237012B (en) Method for processing multimedia data on basis of free components
CN105187519B (en) A kind of socket transmission system based on AIO
CN101349975B (en) Method for implementing interrupt bottom semi-section mechanism in embedded operation system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant