CN103970584B - Data transmission method, Multi-serial port drive assembly and on-board multimedia device - Google Patents

Data transmission method, Multi-serial port drive assembly and on-board multimedia device Download PDF

Info

Publication number
CN103970584B
CN103970584B CN201310033801.3A CN201310033801A CN103970584B CN 103970584 B CN103970584 B CN 103970584B CN 201310033801 A CN201310033801 A CN 201310033801A CN 103970584 B CN103970584 B CN 103970584B
Authority
CN
China
Prior art keywords
serial port
data
virtual
read
read request
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.)
Active
Application number
CN201310033801.3A
Other languages
Chinese (zh)
Other versions
CN103970584A (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.)
Hefei Jie Fa Technology Co Ltd
Original Assignee
Hefei Jie Fa Technology 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 Hefei Jie Fa Technology Co Ltd filed Critical Hefei Jie Fa Technology Co Ltd
Priority to CN201310033801.3A priority Critical patent/CN103970584B/en
Publication of CN103970584A publication Critical patent/CN103970584A/en
Application granted granted Critical
Publication of CN103970584B publication Critical patent/CN103970584B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Transfer Systems (AREA)

Abstract

The invention discloses a kind of data transmission method, Multi-serial port drive assembly and on-board multimedia device.The data transmission method includes:Pass through the read request of at least two application programs corresponding to the reception of at least two virtual serial ports;Virtual serial port node is respectively created at least two application programs;The data for corresponding to read request are read to peripheral driver by physical serial interface;And send the data read at least two application programs simultaneously according to virtual serial port node.By using the data transmission method of the present invention, at least two application programs can be made while obtain the data from peripheral driver.

Description

Data transmission method, Multi-serial port drive assembly and on-board multimedia device
Technical field
The present invention relates to technical field of data transmission, is filled more particularly to a kind of data transmission method, Multi-serial port driver Put and on-board multimedia device.
Background technology
By commercial communication satellite, global positioning system(GPS, Global Positioning System)It is applied to Above automobile navigation, shown the way for driver, here it is onboard navigation system.Onboard navigation system has certain journey in the car The popularization of degree.
Under normal circumstances, GPS drivers are all to send out data upwards in the form of physical serial interface.Physical serial interface abbreviation thing Manage serial ports, also referred to as physical serial communication interface(It is often referred to com interface), it is the expansion interface using serial communication mode.Physics Serial line interface refers to that ground order of data one transmits, and is characterized in that communication line is simple, as long as a pair of transmission line cans Realize two-way communication.
Present inventor has found in actual applications, typically have multiple application programs to think in long-term research and development GPS valid data are obtained simultaneously, and traditional physical serial interface is all formula driving alone, i.e., GPS drivers can only be simultaneously by one Individual application program is opened, and other application programs want that obtaining location information has to separately seek method.
The content of the invention
In view of this, the present invention provides a kind of data transmission method, Multi-serial port drive assembly and vehicle mounted multimedia dress Put.
According to an embodiment of the present invention, there is provided a kind of data transmission method, including:Connect by least two virtual serial ports The read request of at least two application programs corresponding to receipts;Virtual serial port node is respectively created at least two application program; The data for corresponding to the read request are read to peripheral driver by physical serial interface;It is and same according to the virtual serial port node When at least two application program send read the data.
According to another embodiment of the present invention, there is provided a kind of Multi-serial port drive assembly, including:Receiving module, for leading to Cross the read request of at least two application programs corresponding to the reception of at least two virtual serial ports;Creation module, for for it is described at least Virtual serial port node is respectively created in two application programs;Read module, for by physical serial interface to peripheral driver read pair The data of read request described in Ying Yu;And sending module, for according to the virtual serial port node simultaneously to described at least two Application program sends the data read.
According to a further embodiment of this invention, there is provided a kind of on-board multimedia device, including:Physical serial interface and Multi-serial port Driver, the Multi-serial port driver include:Receiving module, for by least two corresponding to the reception of at least two virtual serial ports The read request of individual application program;Creation module, for virtual serial port node to be respectively created at least two application program;Read Modulus block, for reading the data corresponding to the read request to peripheral driver by the physical serial interface;And send mould Block, for sending the data read at least two application program simultaneously according to the virtual serial port node.
Data transmission method, Multi-serial port drive assembly and on-board multimedia device provided by the present invention, can make At least two application programs obtain the data from peripheral driver simultaneously.
Brief description of the drawings
Fig. 1 is the flow chart of the embodiment of data transmission method one of the present invention;
Fig. 2 is the flow chart of another embodiment of data transmission method of the present invention;
Fig. 3 is the flow chart of the another embodiment of data transmission method of the present invention;
Fig. 4 is the flow chart of the another embodiment of data transmission method of the present invention;
Fig. 5 is the structural representation of the embodiment of Multi-serial port drive assembly one of the present invention;
Fig. 6 is the postrun result schematic diagram of Multi-serial port drive assembly of the present invention;
Fig. 7 is the structural representation of another embodiment of Multi-serial port drive assembly of the present invention;
Fig. 8 is the postrun another result schematic diagram of Multi-serial port drive assembly of the present invention;
Fig. 9 is the postrun another result schematic diagram of Multi-serial port drive assembly of the present invention;
Figure 10 is the structural representation of the another embodiment of Multi-serial port drive assembly of the present invention;
Figure 11 is the structural representation of the another embodiment of Multi-serial port drive assembly of the present invention;
Figure 12 is the structural representation of the another embodiment of Multi-serial port drive assembly of the present invention;
Figure 13 is the structural representation of the another embodiment of Multi-serial port drive assembly of the present invention;
Figure 14 is the structural representation of the embodiment of on-board multimedia device one of the present invention.
Embodiment
Some vocabulary has been used in claims and specification to censure specific component.Technology in art Personnel are, it is to be appreciated that hardware manufacturer may call same component with different nouns.The claims and explanation Book is used as the standard of differentiation with the difference of component functionally not in a manner of the difference of title is used as and distinguishes component Then.It is open term in the " comprising " mentioned in claims and specification, therefore should be construed to " including but do not limit In ".The present invention is described in detail with embodiment below in conjunction with the accompanying drawings.
Refering to Fig. 1, Fig. 1 is the flow chart of the embodiment of data transmission method one of the present invention, including:
Step S101:Pass through the read request of at least two application programs corresponding to the reception of at least two virtual serial ports.
As known to those skilled in the art, physical serial interface abbreviation physical serial interface, also referred to as physical serial communication interface(It is logical Often refer to com interface), it is the expansion interface using serial communication mode.And virtual serial port is not actual physical serial interface, no longer make With data cable, but by the communication function of virtual mode simulative serial port, so as to complete communication process.
Step S102:Virtual serial port node is respectively created at least two application programs.
Step S103:The data for corresponding to read request are read to peripheral driver by physical serial interface.
Reading data are carried out to peripheral driver by physical serial interface, the data of reading are stored in corresponding memory cell In, if corresponding memory cell is shared, the data of reading are stored in shared memory cell, if at least Two application programs are assigned each self-corresponding memory cell respectively, then it is single the data of reading to be stored in into each self-corresponding storage In member.
It is worth noting that, peripheral driver includes but is not limited to GPS drivers, other peripheral drivers for example pass through string Mouth GSM/GPRS data transfers driver, Bluetooth data transfer driver etc..
Step S104:Send the data read at least two application programs simultaneously according to virtual serial port node.Obtaining After the data of peripheral driver, the data read are sent at least two application programs simultaneously according to virtual serial port node, so as to Corresponding data are obtained from corresponding memory cell at least two application programs.
The read request that the present invention passes through at least two application programs corresponding to the reception of at least two virtual serial ports;It is at least two Virtual serial port node is respectively created in individual application program;The number for corresponding to read request is read to peripheral driver by physical serial interface According to;And send the data read at least two application programs simultaneously according to virtual serial port node, in this way, can Make at least two application programs by least two virtual serial ports while obtain the data from peripheral driver.
Refering to Fig. 2 and Fig. 3, Fig. 2 and Fig. 3 are the flow charts of two embodiments of data transmission method of the present invention, including:
Step S201:Pass through the read request of at least two application programs corresponding to the reception of at least two virtual serial ports.
Step S202:Judge whether Multi-serial port driver first switches on, it is empty that Multi-serial port driver includes at least two Intend serial ports.
When there is application program to open Multi-serial port driver, Multi-serial port driver can judge whether current be to beat for the first time Open, if Multi-serial port driver is to first switch on, into step S203, if Multi-serial port driver is not to beat for the first time Open, then into step S204.
It should be noted that step S201 and step S202 can preset sequencing and hold without the sequencing of fixation OK, can also perform simultaneously, as long as step S202 is completed before step S204.
Step S203:If Multi-serial port driver is to first switch on, physical serial interface is opened, and is created for monitoring physics The serial ports monitoring thread of Serial Port Event.
If Multi-serial port driver is to first switch on, show that physical serial interface is also not turned on, it is necessary to open physical serial interface, Serial ports monitoring thread is created simultaneously, and serial ports monitoring thread is used for the generation for monitoring physical serial interface event, physical serial interface event package Include but be not limited to read data, write data, signal change state, signal interruption, signal state error, signal condition instruction etc..
Step S204:Virtual serial port node is respectively created at least two application programs.
Step S205:The virtual serial port node created is added in virtual serial port catalogue, and counts virtual serial port section The number of point.The virtual serial port node corresponding to each application program created in step S204 is added to virtual serial port mesh Virtual string corresponding to being preserved in record, also, in virtual serial port catalogue under each virtual serial port node corresponding to application program The attribute of mouth, such as:Serial port baud rate, data bit, check bit etc..The number of virtual serial port node is counted, can be with Know when the number of the application program of front opening Multi-serial port driver.
Step S206:It is at least two application assigned memory cell according to read request.
Memory cell, which is used to preserve, reads the data that peripheral driver is obtained, and can be answered according to read request at least two Can also be respectively the respective memory cell of each application assigned with the shared memory cell of program distribution.
Wherein, step S206 is specifically included:The memory cell according to corresponding to read request is at least two application assigneds, In order to which according to virtual serial port catalogue, the data read from peripheral driver are saved in corresponding memory cell.Or In another embodiment, step S206 is specifically included:It is that each application program distributes each self-corresponding storage respectively according to read request Unit.
In actual applications, can be that at least two application programs distribute each self-corresponding storage list respectively according to read request Member, application program, memory cell and virtual serial port node correspond, therefore, can will be from outer according to virtual serial port catalogue The data that portion's driver is read are saved in each self-corresponding memory cell.Or journey is applied at least two according to read request The shared memory cell of sequence distribution, uses another way to realize the corresponding relation between application program, memory cell etc., Can realize the purpose data read from peripheral driver being saved in corresponding memory cell, it is no longer superfluous herein to chat.Deposit Storage unit can be buffer, round-robin queue etc..
Step S207:Data corresponding to read request are read to peripheral driver by physical serial interface, and by the number of reading According to preservation in the memory unit.
Wherein, step S207 is specifically included:Sub-step S207a and sub-step S207b, as shown in Figure 3.
Sub-step S207a:Thread is monitored according to the serial ports created, determines whether the physical serial interface of corresponding physical serial interface Event occurs.
Sub-step S207b:If there is physical serial interface event, data are obtained from physical serial interface, and by the data of reading Preserve to memory cell.In another embodiment, the result for reading data can also be preserved to memory cell, such as read data and lose Lose, read data success, only read partial data etc..
Step S208:Send the data read at least two application programs simultaneously according to virtual serial port node.
Wherein, step S208 is specifically included:Virtual serial port node in virtual serial port catalogue, while at least two Application program sends the data read.
Step S209:When any one in application program closes corresponding virtual serial port, virtual serial port section is judged Whether the number of point is equal to zero.If the number of virtual serial port node is not equal to zero, into step S210, if virtual serial port section The number of point is equal to zero, into step S211.
Step S210:If the number of virtual serial port node is not equal to zero, destroy in virtual serial port catalogue with closing virtually The corresponding virtual serial port node of the application program of serial ports and/or destroy and the application program of closing virtual serial port is corresponding deposits Storage unit.
Step S211:If the number of virtual serial port node is equal to zero, physical serial interface is closed, and exits serial ports monitoring line Journey.
If the number of virtual serial port node is not equal to zero, the application with closing virtual serial port in virtual serial port catalogue is destroyed The corresponding virtual serial port node of program;, can if being assigned with each self-corresponding memory cell respectively to each application program To destroy corresponding memory cell, corresponding memory cell can not also be destroyed;If apply journey at least two Sequence is assigned with shared memory cell, then need not destroy corresponding memory cell.If number of virtual serial port node etc. In zero, show that no application program opens virtual serial port, or application program has been switched off all virtual serial ports, now goes here and there more Mouth driver can close physical serial interface, and exit serial ports monitoring thread.
In addition, in another embodiment of the invention, the reading of at least two received application programs can be determined whether Whether whether request is identical, i.e., be to read data to identical peripheral driver.If the read request received is identical(I.e. at least two Application program is to read data to same peripheral driver), then physical serial interface only need to once be read to peripheral driver At least two application programs can the data of needs be sent to simultaneously corresponding to, it is greatly improved the effect of data transfer of the present invention Rate.In another embodiment of the present invention, if the read request received differs(I.e. multiple application programs are respectively to different outer Portion's driver reads data), the read request received can be subjected to packet transaction, identical read request is divided into identical group, and To the application assigned identical memory cell corresponding to identical read request, so that physical serial interface is read to peripheral driver The data corresponding to the read request can be stored in same memory cell, then simultaneously to the application program for sending identical read request Send data.
It should be noted that in actual applications, can be as the case may be if the result that can be substantially the same Step in present embodiment is increased and decreased or the execution sequence of step is exchanged, no longer carries out superfluous chat herein.
In a word, the present invention passes through the read request of at least two application programs corresponding to the reception of at least two virtual serial ports, root It is at least two application assigned memory cell according to read request;Read to correspond to peripheral driver by physical serial interface and read to ask The data asked, and the data of reading are preserved in the memory unit;And simultaneously should at least two according to virtual serial port node The data read are sent with program, in order to which at least two application programs obtain the data of reading from memory cell, pass through this Kind mode, at least two application programs can be made by least two virtual serial ports while obtain the number from peripheral driver According to.
Refering to Fig. 4, Fig. 4 is the flow chart of the another embodiment of data transmission method of the present invention, present embodiment and Fig. 1's Embodiment is substantially similar, and what difference was present embodiment reception is the write request of application program.Present embodiment bag Include following steps:
Step S301:Pass through the write request of at least two application programs corresponding to the reception of at least two virtual serial ports.
Step S302:It is at least two application assigned memory cell according to write request.
Step S303:The data that will be write in peripheral driver preserve in the memory unit.
Step S304:Data by physical serial interface to peripheral driver write-in corresponding to write request.
By present embodiment, except multiple application programs can be made to be come from by least two virtual serial ports while acquisition Outside the data of peripheral driver, at least two application programs can also be made to be write by least two virtual serial ports to peripheral driver Enter data.Those skilled in the art read above for Fig. 1-Fig. 3 explanation after, it should be appreciated that in Fig. 4 each step it is detailed Way, and can by the step deformation application in Fig. 2, Fig. 3 to the data transmission method of processing write requests, for brevity, This is repeated no more.
Refering to Fig. 5, Fig. 5 is the structural representation of the embodiment of Multi-serial port drive assembly one of the present invention, and the Multi-serial port drives Dynamic device device 100 includes:Receiving module 101, creation module 102, read module 103 and sending module 104.
Receiving module 101 is used for please by the reading of at least two application programs corresponding to the reception of at least two virtual serial ports Ask.
Virtual serial port is not actual physical serial interface, without the use of data cable, but simulates string by virtual mode The communication function of mouth, so as to complete communication process.Creation module 102 is used to virtual string be respectively created at least two application programs Mouth node.
Read module 103 is used to read the data corresponding to read request to peripheral driver by physical serial interface.
Sending module 104 is used to be sent to described outer at least two application program simultaneously according to virtual serial port node Portion's driver reads the result of data.
Fig. 5 postrun result schematic diagram of Multi-serial port drive assembly is as shown in fig. 6, the result of operation produces at least two Individual virtual serial port and memory cell.
The Multi-serial port drive assembly of the present invention applies journey by corresponding to the reception of at least two virtual serial ports at least two The read request of sequence, it is that virtual serial port node is respectively created at least two application programs according to read request;It is outside by physical serial interface Portion's driver reads the data corresponding to read request;After the data of peripheral driver are obtained, the data of reading are stored in and deposited In storage unit, wherein can be the memory cell that at least two application assigneds share according to read request, can also be respectively The respective memory cell of at least two application assigneds;Sent out simultaneously at least two application programs further according to virtual serial port node The data of reading are sent, in this way, at least two application programs can be made by least two virtual serial ports while obtained Data from peripheral driver.
Refering to Fig. 7, Fig. 7 is the structural representation of another embodiment of Multi-serial port drive assembly of the present invention, more strings Mouth drive assembly 200 includes:Receiving module 201, the first judge module 202, the first execution module 203, creation module 204, Memory cell 205, read module 206 and sending module 207.
Receiving module 201 is used for please by the reading of at least two application programs corresponding to the reception of at least two virtual serial ports Ask.After at least two application programs send read request by least two virtual serial ports, connect by least two virtual serial port The read request of at least two application programs corresponding to receipts.
First judge module 202 is used to judge whether Multi-serial port driver first switches on, Multi-serial port drive assembly Including at least two virtual serial ports.First execution module 203 is used for when Multi-serial port drive assembly is to first switch on, and opens Physical serial interface, and the serial ports created for monitoring physical serial interface event monitors thread.
If Multi-serial port driver is to first switch on, show that physical serial interface is also not turned on, it is necessary to open physical serial interface, Serial ports monitoring thread is created simultaneously, and serial ports monitoring thread is used for the generation for monitoring physical serial interface event, physical serial interface event package Include but be not limited to read data, write data, signal change state, signal interruption, signal state error, signal condition instruction etc..
Creation module 204 is used to virtual serial port node be respectively created at least two application programs.Creation module 204 is also created Virtual serial port catalogue is built, and the virtual serial port node created is added in virtual serial port catalogue, and counts virtual serial port section The number of point.In virtual serial port catalogue corresponding virtual serial port is preserved under each virtual serial port node corresponding to application program Attribute, such as:Serial port baud rate, data bit, check bit etc..The number of virtual serial port node is counted, can be obtained Know when the number of the application program of front opening Multi-serial port driver.
Now, the result schematic diagram that Multi-serial port drive assembly 200 is run referring to Fig. 8 and Fig. 9, the result of operation produce to Few two virtual serial ports, memory cell, virtual serial port catalogue and serial ports monitoring thread.
In actual applications, memory cell 205 can be distributed according to different design considerations.In reality as shown in Figure 9 Apply in example, be that at least two application programs distribute corresponding memory cell respectively according to read request, application program, memory cell with And virtual serial port node corresponds, and therefore, according to virtual serial port catalogue, can preserve the data read from peripheral driver Into memory cell 1 and memory cell 2.In the embodiment shown in fig. 8, it is at least two application programs point according to read request With shared memory cell, another way is used to realize the corresponding relation between application program, memory cell etc., equally Can realize the purpose data read from peripheral driver being saved in memory cell, it is no longer superfluous herein to chat.
Read module 206 is used to read the data corresponding to read request to peripheral driver by physical serial interface.It is real one Apply in example, read module 206 also includes judging unit and reading unit.Judging unit is used for according to the serial ports monitoring line created Journey, judges whether physical serial interface has physical serial interface event.When judging unit judges to have the generation of physical serial interface event, read Unit obtains data from physical serial interface.
Sending module 207 is used to send the data read at least two application programs simultaneously according to virtual serial port node. Specifically, virtual serial port node of the sending module 207 in virtual serial port catalogue, while sent out at least two application programs Send the data of reading.
In another embodiment, Multi-serial port drive assembly 200 can also include the second judge module 208 and the second execution Module 209, refers to Figure 10.Second judge module 208 is used for when the corresponding virtual serial port of closing application program, judges Whether the number of virtual serial port node is equal to zero.When the number of virtual serial port node is not equal to zero, the second execution module 209 is sold Virtual serial port node corresponding with closing the application program of virtual serial port in virtual serial port catalogue is ruined, if to each application program Be assigned with each self-corresponding memory cell respectively, then can destroy corresponding memory cell simultaneously, can not also destroy with Its corresponding memory cell.When the number of virtual serial port node is equal to zero, the second execution module 209 closes physical serial interface, and Exit serial ports monitoring thread.
In another embodiment, Multi-serial port drive assembly 200 can also include the 3rd judge module 210, refer to figure 11.3rd judge module 210 is used to judge whether the read request of at least two application programs is identical, i.e., whether is to outside identical Portion's driver reads data.When the 3rd judge module 210 judges that above-mentioned read request is identical(That is at least two application programs be to Same peripheral driver reads data), read module 206 reads data, now physics by physical serial interface to peripheral driver Serial ports need to only carry out once reading to peripheral driver can be sent to the data of needs simultaneously corresponding at least two application Program, it is greatly improved the efficiency of data transfer of the present invention.In another embodiment of the present invention, when the 3rd judge module 210 Judge that above-mentioned read request differs(I.e. multiple application programs read data to different peripheral drivers respectively)When, it will can receive To read request be grouped, identical read request is divided into identical group, and to the application program corresponding to identical read request Distribute identical memory cell, so as to physical serial interface to peripheral driver read to should the data of read request can be stored in together One memory cell, then send data to the application program for sending identical read request simultaneously.
In addition, receiving module 201 is additionally operable to by least two application programs corresponding to the reception of at least two virtual serial ports Write request.Now, refering to Figure 12, the device also includes writing module 211, writing module 211 be used for by physical serial interface to Peripheral driver writes data.Memory cell 205 preserves the data that will be write in peripheral driver.
It should be noted that in actual applications, can be as the case may be to the module or list in above-mentioned embodiment Member is increased and decreased, for example, the first judge module, the second judge module and the 3rd judge module can also be integrated into a judgement Module;First execution module, the second execution module and the 3rd execution module can also be integrated into an execution module, herein not Superfluous chat is carried out again.
Refering to Figure 13, Figure 13 is the structural representation of the another embodiment of Multi-serial port drive assembly of the present invention, the device Including:Processor 301 and memory 302.
Processor 301 is used for the read request by least two application programs corresponding to the reception of at least two virtual serial ports; It is at least two application assigned memories 302 according to read request;Data are read peripheral driver by physical serial interface, and will The data of reading preserve in the memory 302;And the data read are sent at least two application programs simultaneously.
Processor 301 is additionally operable to that virtual serial port node is respectively created at least two application programs;It is virtual by what is created Serial ports node is added in virtual serial port catalogue, and counts the number of virtual serial port node;It is virtual that memory 302 is additionally operable to storage The number of serial ports catalogue and virtual serial port node.
Processor 301 is additionally operable to according to virtual serial port catalogue, while the data read are sent at least two application programs.
It is memory 302 corresponding at least two application programs are distributed respectively that processor 301, which is additionally operable to according to read request, with It is easy to according to virtual serial port catalogue, the data read from peripheral driver is saved in corresponding memory 302.
Refering to Figure 14, Figure 14 is the structural representation of the embodiment of on-board multimedia device one of the present invention, vehicle mounted multimedia Device 400 includes physical serial interface 401 and Multi-serial port driver 402, wherein, Multi-serial port driver 402 include receiving module 21, Creation module 22, read module 23 and sending module 24, wherein:Receiving module 21, for passing through at least two virtual serial ports The read request of at least two application programs corresponding to reception;Creation module 22, for being respectively created at least two application programs Virtual serial port node;Read module 23, for reading the data corresponding to read request to peripheral driver by physical serial interface;With And sending module 24, for sending the data read at least two application programs simultaneously according to virtual serial port node.
Specific implementation form on each module in on-board multimedia device 400 see above-mentioned virtual serial port driver dress The corresponding description in each embodiment is put, will not be repeated here.
Multi-serial port drive assembly of the present invention passes through at least two application programs corresponding to the reception of at least two virtual serial ports Read request, be at least two application assigned memory cell according to read request;Peripheral driver is read by physical serial interface Data, and the data of reading are preserved in the memory unit;And the data read are sent at least two application programs simultaneously, In order to which at least two application programs obtain the data of reading from memory cell, in this way, at least two can be made Application program obtains the data from peripheral driver simultaneously by least two virtual serial ports.
Embodiments of the present invention are the foregoing is only, are not intended to limit the scope of the invention, it is every to utilize this The equivalent structure or equivalent flow conversion that description of the invention and accompanying drawing content are made, or directly or indirectly it is used in other correlations Technical field, it is included within the scope of the present invention.

Claims (21)

  1. A kind of 1. data transmission method, it is characterised in that including:
    The read request of at least two application programs is received by least two virtual serial ports of Multi-serial port virtual drive;
    Virtual serial port node is respectively created at least two application program;
    Judge whether the read request is identical;
    If the read request is identical, a digital independent is carried out;
    If the read request is different, by the read request packet transaction, identical read request is divided into identical group, and identical is read The data of the read request are read in the corresponding application assigned identical memory cell of request, storage;
    The data for corresponding to the read request are read to peripheral driver by physical serial interface;And
    Send the data read at least two application program simultaneously according to the virtual serial port node.
  2. 2. data transmission method according to claim 1, it is characterised in that described at least two application program point Not Chuan Jian after virtual serial port node, in addition to:
    The virtual serial port node created is added in virtual serial port catalogue, and counts of the virtual serial port node Number.
  3. 3. data transmission method according to claim 2, it is characterised in that it is described according to the virtual serial port node simultaneously The step of data read being sent at least two application program, including:
    According to the virtual serial port catalogue, while the data read are sent at least two application program.
  4. 4. data transmission method according to claim 2, it is characterised in that also include:
    It is that at least two application program distributes corresponding memory cell respectively according to the read request, in order to according to Virtual serial port catalogue, the data read from the peripheral driver are saved in the corresponding memory cell.
  5. 5. data transmission method according to claim 2, it is characterised in that described at least two application program point Not Chuan Jian virtual serial port node the step of before, in addition to:
    Judge whether Multi-serial port driver first switches on, the Multi-serial port driver includes described at least two virtual strings Mouthful;
    If the Multi-serial port driver is to first switch on, the physical serial interface is opened, and is created for monitoring physical serial interface The serial ports monitoring thread of event.
  6. 6. data transmission method according to claim 5, it is characterised in that it is described by physical serial interface to peripheral driver The step of reading the data corresponding to the read request includes:
    Thread is monitored according to the serial ports created, judges whether the physical serial interface has the physical serial interface event;
    If there is the physical serial interface event, data are obtained from the physical serial interface, and preserve the data to storing list Member.
  7. 7. data transmission method according to claim 5, it is characterised in that the data transmission method also includes:
    When any one in the application program closes the corresponding virtual serial port, the virtual serial port node is judged Number whether be equal to zero;
    If the number of the virtual serial port node is not equal to zero, destroy in the virtual serial port catalogue with closing the virtual string Mouthful the corresponding virtual serial port node of the application program and/or destroy the application program with closing the virtual serial port Corresponding memory cell;If the number of the virtual serial port node is equal to zero, the physical serial interface is closed, and is exited described Serial ports monitors thread.
  8. 8. data transmission method according to claim 1, it is characterised in that further comprise:
    It is at least two application assigneds memory cell according to the read request;And
    The data of reading are preserved to the memory cell.
  9. 9. data transmission method according to claim 8, it is characterised in that it is described according to the read request for it is described at least The step of two application assigned memory cell, including:
    It is the memory cell corresponding at least two application program is distributed respectively according to the read request.
  10. 10. data transmission method according to claim 1, it is characterised in that it is described by physical serial interface to external drive Device also includes before reading the step of data corresponding to the read request:
    Judge whether the read request of at least two application program is identical;
    When the read request is identical, data are read to the peripheral driver by the physical serial interface.
  11. 11. data transmission method according to claim 1, it is characterised in that also include:
    Pass through the write request of at least two application program corresponding at least two virtual serial port reception;
    Data by the physical serial interface to peripheral driver write-in corresponding to the write request.
  12. 12. data transmission method according to claim 11, it is characterised in that it is described by the physical serial interface to described Also include before the step of peripheral driver write-in corresponds to the data of the write request:
    It is at least two application assigneds memory cell according to the write request;And
    The data that will be write in the peripheral driver are stored in the memory cell.
  13. 13. a kind of Multi-serial port drive assembly, it is characterised in that described device includes:
    Receiving module, the reading for receiving at least two application programs by least two virtual serial ports of Multi-serial port driver please Ask;
    Creation module, for virtual serial port node to be respectively created at least two application program;
    3rd judge module, for judging whether the read request is identical;
    If the read request is identical, a digital independent is carried out;
    If the read request is different, by the read request packet transaction, identical read request is divided into identical group, and identical is read The data of the read request are read in the corresponding application assigned identical memory cell of request, storage;
    Read module, for reading the data corresponding to the read request to peripheral driver by physical serial interface;And
    Sending module, described in sending reading at least two application program simultaneously according to the virtual serial port node Data.
  14. 14. Multi-serial port drive assembly according to claim 13, it is characterised in that
    The creation module, virtual serial port catalogue is also created, and the virtual serial port node created is added to the void Intend in serial ports catalogue, and count the number of the virtual serial port node.
  15. 15. Multi-serial port drive assembly according to claim 14, it is characterised in that the sending module is according to the void Intend serial ports catalogue, while the data read are sent at least two application program.
  16. 16. Multi-serial port drive assembly according to claim 14, it is characterised in that also include:
    Memory cell, for according to the virtual serial port catalogue, preserving the data read from the peripheral driver.
  17. 17. Multi-serial port drive assembly according to claim 14, it is characterised in that the Multi-serial port drive assembly is also Including:
    First judge module, for judging whether the Multi-serial port drive assembly first switches on, the Multi-serial port driving Device device includes at least two virtual serial port;
    First execution module, for when the Multi-serial port drive assembly is to first switch on, opening the physical serial interface, and Create the serial ports for monitoring physical serial interface event and monitor thread.
  18. 18. Multi-serial port drive assembly according to claim 17, it is characterised in that the read module includes:
    Judging unit, for monitoring thread according to the serial ports created, judge whether the physical serial interface has the physics Serial Port Event occurs;
    Reading unit, for when there is the physical serial interface event to occur, then obtaining data from the physical serial interface.
  19. 19. Multi-serial port drive assembly according to claim 17, it is characterised in that the Multi-serial port drive assembly is also Including:
    Second judge module, for when any one in the application program closes the corresponding virtual serial port, sentencing Whether the number of the disconnected virtual serial port node is equal to zero;
    Second execution module, for when the number of the virtual serial port node is not equal to zero, destroying the virtual serial port catalogue In the virtual serial port node corresponding with closing the application program of the virtual serial port;In of the virtual serial port node When number is equal to zero, the physical serial interface is closed, and exits the serial ports monitoring thread.
  20. 20. Multi-serial port drive assembly according to claim 13, it is characterised in that
    The receiving module is additionally operable to by least two application program corresponding at least two virtual serial port reception Write request;
    The Multi-serial port drive assembly also includes writing module, and said write module is used for by the physical serial interface to described Data of the peripheral driver write-in corresponding to the write request.
  21. 21. Multi-serial port drive assembly according to claim 20, it is characterised in that the memory cell is additionally operable to preserve The data corresponding to the write request.
CN201310033801.3A 2013-01-29 2013-01-29 Data transmission method, Multi-serial port drive assembly and on-board multimedia device Active CN103970584B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310033801.3A CN103970584B (en) 2013-01-29 2013-01-29 Data transmission method, Multi-serial port drive assembly and on-board multimedia device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310033801.3A CN103970584B (en) 2013-01-29 2013-01-29 Data transmission method, Multi-serial port drive assembly and on-board multimedia device

Publications (2)

Publication Number Publication Date
CN103970584A CN103970584A (en) 2014-08-06
CN103970584B true CN103970584B (en) 2018-01-16

Family

ID=51240120

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310033801.3A Active CN103970584B (en) 2013-01-29 2013-01-29 Data transmission method, Multi-serial port drive assembly and on-board multimedia device

Country Status (1)

Country Link
CN (1) CN103970584B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101894041A (en) * 2010-07-15 2010-11-24 中兴通讯股份有限公司 Multivirtual serial port system and communication method thereof
CN102479166A (en) * 2010-11-26 2012-05-30 鸿富锦精密工业(深圳)有限公司 System and method for sharing serial port

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1332291C (en) * 2005-11-25 2007-08-15 北京中星微电子有限公司 Virtual serial port device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101894041A (en) * 2010-07-15 2010-11-24 中兴通讯股份有限公司 Multivirtual serial port system and communication method thereof
CN102479166A (en) * 2010-11-26 2012-05-30 鸿富锦精密工业(深圳)有限公司 System and method for sharing serial port

Also Published As

Publication number Publication date
CN103970584A (en) 2014-08-06

Similar Documents

Publication Publication Date Title
US11373466B2 (en) Data recorders of autonomous vehicles
US6195730B1 (en) Computer system with storage device mapping input/output processor
CA2307816C (en) Buffering data that flows between buses operating at different frequencies
WO2020160268A1 (en) Autonomous vehicle data recorders
CN100595720C (en) Apparatus and method for direct memory access in a hub-based memory system
KR100800989B1 (en) Memory arbitration system and method having an arbitration packet protocol
US20080155160A1 (en) Block-based data striping to flash memory
JP5300324B2 (en) Test apparatus and test method
US8819312B2 (en) Low latency first-in-first-out (FIFO) buffer
US8484390B2 (en) Message handler and method for controlling access to data of a message memory of a communications module
US7822884B2 (en) Distributed direct memory access provision within a data processing system
JP2009517725A (en) Method and system for enabling indeterminate read data latency in a memory system
CN101877666B (en) Method and device for receiving multi-application program message based on zero copy mode
CN103226525B (en) memory device, computing device and data transmission method
US7460531B2 (en) Method, system, and program for constructing a packet
US6134629A (en) Determining thresholds and wrap-around conditions in a first-in-first-out memory supporting a variety of read and write transaction sizes
CN109664777A (en) For determining the system and method for the charge arrangement of electric vehicle
US7680992B1 (en) Read-modify-write memory with low latency for critical requests
CN106409337B (en) The control method of eMMC and eMMC controller based on FPGA
CN104281545B (en) A kind of method for reading data and equipment
CN113973088B (en) MCU communication service system of intelligent host
CN103970584B (en) Data transmission method, Multi-serial port drive assembly and on-board multimedia device
CN107402723A (en) Read and write the method and storage system of data
US7017008B2 (en) Method and apparatus for optimizing data streaming in a computer system utilizing random access memory in a system logic device
KR102117856B1 (en) Handling collisions between accesses in multiport memories

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Hefei City, Anhui province 230000 Wangjiang Road No. 800 building 10 layer A3 Innovation Industrial Park

Applicant after: Hefei Jie FA Technology Co., Ltd.

Address before: Hefei City, Anhui province 230000 Wangjiang Road No. 800 building 10 layer A3 Innovation Industrial Park

Applicant before: Smart technology (Hefei) Co., Ltd.

GR01 Patent grant
GR01 Patent grant