CN105138490A - Serial data filtration system and method - Google Patents

Serial data filtration system and method Download PDF

Info

Publication number
CN105138490A
CN105138490A CN201510401913.9A CN201510401913A CN105138490A CN 105138490 A CN105138490 A CN 105138490A CN 201510401913 A CN201510401913 A CN 201510401913A CN 105138490 A CN105138490 A CN 105138490A
Authority
CN
China
Prior art keywords
data
serial ports
hardware device
send
filtering module
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
CN201510401913.9A
Other languages
Chinese (zh)
Other versions
CN105138490B (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.)
China Standard Software Co Ltd
Original Assignee
China Standard Software 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 China Standard Software Co Ltd filed Critical China Standard Software Co Ltd
Priority to CN201510401913.9A priority Critical patent/CN105138490B/en
Publication of CN105138490A publication Critical patent/CN105138490A/en
Application granted granted Critical
Publication of CN105138490B publication Critical patent/CN105138490B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus

Abstract

The invention provides a serial data filtration system and method which achieve the purpose of unified and standardized serial data processing. The filtration system is applied to filtration of communication data between a business application program and a serial hardware device, and comprises a configurable file module, an application calling interface and a serial filtration module, wherein the configurable file module is used for configuring a user-state filtration rule for processing the serial data and storing the rule to a configurable file; the application calling interface is used for extracting the configurable file from the configurable file module and sending the configurable file to the serial filtration module; the serial filtration module is used for receiving the configurable file and storing the configuration file; and the user-state filtration rule configured in the configuration file is used for filtering and sending the serial data.

Description

The filtering system of serial data and method
Technical field
The present invention relates to serial port communication technology field, particularly a kind of filtering system of serial data and method.
Background technology
Serial bus is the communication mode with a pair simple twisted-pair feeder, the data line that this mode uses is few, communications cost can be saved in telecommunication, computing machine can be connected into, realize multiple spot, two-way communication and data acquisition, equipment is simple, and cheap, it has noise inhibiting ability, higher message transmission rate and reliability.Just because of this, serial bus system is used widely in fields such as industrial data collection and control, instrument and meter, automotive electronics, telecommunication apparatus.Serial line interface is used to connect measurement and automation equipment, break away from computer-internal ISA (IndustrialStandardArchitecture, industrial standard architecture bus) or the additional hardware requirement of PCI (PeripheralComponentInterconnection, peripheral element extension interface) slot.
Along with industry change, the new demand in market constantly occurs, for adapting to the changes in demand in market fast, commercial unit has certain independence, collaborative work can be carried out easily with other commercial unit, the organic rationalization of each commercial unit is made to build a complete system, and then fast responding market change.Commercial unit based on the communication on serial ports becomes open hardware structure, accelerates the time-to-market of product, therefore day by day becomes important based on serial port protocol exploitation.
In prior art, need to use oscillograph based on the communication protocol that serial ports is developed or application records daily record carrys out positioning analysis communication issue.On the one hand, the oscillograph that some specialties are expensive can add the cost of great development.On the other hand, although use the mode of application records daily record simple, lack unified standard, because the differentiation of format issues and daily record program architecture between different exploitation versions, multi version merger can be caused difficult in maintenance.At present, application program serial ports log code copies stickup everywhere, and the journal function of continuous overlapping development adds the maintenance cost of fatware, causes the less stable of software development.Therefore, urgently provide a kind of mode effectively to realize the monitoring of serial data.
Summary of the invention
In view of the above problems, the present invention is proposed to provide a kind of overcoming the problems referred to above or the filtering system of serial data solved the problem at least in part and corresponding method.
According to an aspect of of the present present invention, provide a kind of filtering system of serial data, be applied to the situation of the communication data between filter traffic application program and serial ports hardware device, comprise: configurable file module, application call interface and serial ports filtering module, wherein,
Described configurable file module, for configuring the User space filtering rule processed serial data, and is stored to configurable file;
Described application call interface, for extracting described configurable file from described configurable file module, and is sent to described serial ports filtering module;
Described serial ports filtering module, for receiving described configurable file, and stores; And
Receive the first data that described business application will send to described serial ports hardware device, call the configurable file of storage, the User space filtering rule configured in described configurable file is used to filter described first data, obtain the first data after filtering, send the first data after described filtration to described serial ports hardware device; And/or
Receive the second data that described serial ports hardware device will send to described business application, call the configurable file of storage, the User space filtering rule configured in described configurable file is used to filter described second data, obtain the second data after filtering, send the second data after described filtration to described business application.
Alternatively, described system also comprises the log pattern for recording data variation, wherein,
Described serial ports filtering module, also at the end of the filter operation for described first data and/or described second data, send can the notification message of log to described application call interface;
Described application call interface, also for receiving described notification message, calling described log pattern and carrying out record to the first data after described filtration and/or the second data after described filtration;
Described log pattern, for carrying out log recording to the first data after described filtration and/or the second data after described filtration.
Alternatively, described serial ports filtering module also for:
When himself initialization, detect described serial ports hardware device, gateway place is driven to add function hook at the serial equipment that described serial ports hardware device is corresponding, with when described serial equipment drives called, receive described business application and will send to the first data of described serial ports hardware device or receive the second data that described serial ports hardware device will send to described business application.
Alternatively, described serial ports filtering module is based upon in the kernel of operating system, be connected with the TTY device drives framework in operating system nucleus, wherein, described TTY device drives framework is used for the serial equipment driving corresponding to the serial ports hardware device of operating system connection and manages and distribute.
Alternatively, described serial ports filtering module also for:
When described TTY device drives framework receive described business application will send to the first data of described serial ports hardware device time, receive described first data that described TTY device drives framework sends.
Alternatively, described serial ports filtering module also for:
The second data after described filtration are sent to described TTY device drives framework, to send the second data after described filtration to described business application by described TTY device drives framework.
Alternatively, described serial ports filtering module also for:
The serial equipment sending to described serial ports hardware device corresponding the first data after described filtration drives, and to drive call instruction register by described serial equipment, the first data after described filtration is sent to described serial ports hardware device.
Alternatively, described serial ports filtering module also for:
Drive call instruction register at serial equipment corresponding to described serial ports hardware device, obtain described serial ports hardware device when will send to the second data of described business application, receive described serial equipment and drive described second data sent.
According to another aspect of the present invention, additionally provide a kind of filter method of serial data, be applied to the situation of the communication data between filter traffic application program and serial ports hardware device, comprise:
Configurable file module configures the User space filtering rule processed serial data, and is stored to configurable file;
Application call interface extracts described configurable file from described configurable file module, and is sent to serial ports filtering module;
Described serial ports filtering module receives described configurable file, and is stored by described configurable file; And
Described serial ports filtering module receives the first data that described business application will send to described serial ports hardware device, call the configurable file of storage, the User space filtering rule configured in described configurable file is used to filter described first data, obtain the first data after filtering, send the first data after described filtration to described serial ports hardware device; And/or
Receive the second data that described serial ports hardware device will send to described business application, call the configurable file of storage, the User space filtering rule configured in described configurable file is used to filter described second data, obtain the second data after filtering, send the second data after described filtration to described business application.
Alternatively, described method also comprises:
At the end of the filter operation for described first data and/or described second data, described serial ports filtering module send can the notification message of log to described application call interface;
Notification message described in described application call interface, calls log pattern and carries out record to the first data after described filtration and/or the second data after described filtration.
Alternatively, described method also comprises:
Described serial ports filtering module is when himself initialization, detect described serial ports hardware device, gateway place is driven to add function hook at the serial equipment that described serial ports hardware device is corresponding, with when described serial equipment drives called, receive described business application and will send to the first data of described serial ports hardware device or receive the second data that described serial ports hardware device will send to described business application.
Alternatively, described method also comprises:
Described serial ports filtering module is based upon in the kernel of operating system, be connected with the TTY device drives framework in operating system nucleus, wherein, described TTY device drives framework drives for the serial equipment corresponding to the serial ports hardware device of operating system connection and manages and distribute.
Alternatively, described serial ports filtering module receives the first data that described business application will send to described serial ports hardware device, comprising:
Receive by described TTY device drives framework the first data that described business application will send to described serial ports hardware device, and described first data are sent to described serial ports filtering module;
Described serial ports filtering module receives described first data that described TTY device drives framework sends.
Alternatively, described serial ports filtering module sends the second data after described filtration to described business application, comprising:
The second data after described filtration are sent to described TTY device drives framework by described serial ports filtering module;
The second data after described filtration are sent to described business application by described TTY device drives framework.
Alternatively, described serial ports filtering module sends the first data after described filtration to described serial ports hardware device, comprising:
The serial equipment that the first data after described filtration send to described serial ports hardware device corresponding by described serial ports filtering module drives;
Drive call instruction register by described serial equipment, the first data after described filtration are sent to described serial ports hardware device.
Alternatively, described serial ports filtering module receives the second data that described serial ports hardware device will send to described business application, comprising:
The serial equipment corresponding by described serial ports hardware device drives call instruction register, obtains the second data that described serial ports hardware device will send to described business application, and described second data are passed to described serial ports filtering module;
Described serial ports filtering module receives described serial equipment and drives described second data sent.
The filtering system of serial data provided by the invention and method, achieve the object of unitized, standardized serial data process.The filtering system of this serial data includes configurable file module, can unify, configure the User space filtering rule processed serial data neatly, and be stored to configurable file.From configurable file module, extract configurable file by application call interface subsequently, and be sent to serial ports filtering module.And then, serial ports filtering module receives configurable file and stores, when receiving business application and will sending to the first data of serial ports hardware device, call the configurable file of storage, the User space filtering rule configured in configurable file is used to filter the first data, obtain the first data after filtering, send the first data after filtering to serial ports hardware device; And when reception serial ports hardware device will send to the second data of business application, call the configurable file of storage, the User space filtering rule configured in configurable file is used to filter the second data, obtain the second data after filtering, send the second data after filtering to business application.Thus, present invention achieves the User space filtering rule according to configuring in configurable file module, serial data is carried out to the object of unified standardization ground filtration treatment, thus effectively solve different hardware equipment manufacturer to the various serial data format needs of upper-layer service application program.Further, the present invention configures by configurable file module is unified the User space filtering rule processed serial data, and operability and maintainability are by force.Further, serial ports filtering module provided by the invention possesses reusability, can filter according to the User space filtering rule configured in configurable file to serial data, without the need to overlapping development journal function, realize simple, reliability is strong, and decreases exploitation and the maintenance cost of business application.
Above-mentioned explanation is only the general introduction of technical solution of the present invention, in order to technological means of the present invention can be better understood, and can be implemented according to the content of instructions, and can become apparent, below especially exemplified by the specific embodiment of the present invention to allow above and other objects of the present invention, feature and advantage.
According to hereafter by reference to the accompanying drawings to the detailed description of the specific embodiment of the invention, those skilled in the art will understand above-mentioned and other objects, advantage and feature of the present invention more.
Accompanying drawing explanation
By reading hereafter detailed description of the preferred embodiment, various other advantage and benefit will become cheer and bright for those of ordinary skill in the art.Accompanying drawing only for illustrating the object of preferred implementation, and does not think limitation of the present invention.And in whole accompanying drawing, represent identical parts by identical reference symbol.In the accompanying drawings:
Fig. 1 shows the structural representation carrying out data communication in the embodiment of the present invention between business application and serial ports hardware device;
Fig. 2 shows the structural representation of the filtering system of serial data according to an embodiment of the invention;
Fig. 3 shows the structural representation of the filtering system of serial data in accordance with another embodiment of the present invention;
Fig. 4 shows the overall initialized process flow diagram of filtering system of serial data according to an embodiment of the invention;
Fig. 5 shows the process flow diagram of the filter method of serial data according to an embodiment of the invention; And
Fig. 6 shows the process flow diagram of the filter method of serial data in accordance with another embodiment of the present invention.
Embodiment
Below with reference to accompanying drawings exemplary embodiment of the present disclosure is described in more detail.Although show exemplary embodiment of the present disclosure in accompanying drawing, however should be appreciated that can realize the disclosure in a variety of manners and not should limit by the embodiment set forth here.On the contrary, provide these embodiments to be in order to more thoroughly the disclosure can be understood, and complete for the scope of the present disclosure can be conveyed to those skilled in the art.
Fig. 1 shows the structural representation carrying out data communication in the embodiment of the present invention between business application and serial ports hardware device.In Fig. 1, business application 110 drives 131 by Virtual File System 120, TTY device drives framework 130 and the serial equipment in operating system (as (SuSE) Linux OS) kernel, communicates with serial ports hardware device 140.Wherein, VFS (VirtualFileSystem, Virtual File System) be the external interface of (SuSE) Linux OS, any program of archives economy that will use all must use via this layer interface, Linux all devices can, as the access of file process, make application system need not be concerned about storage medium and the file system type of bottom.TTY, TeleTYpe or teletypewriters, originally teletype writer was referred to, by reading and send the thing of information by string line printer-keyboard, usual use TTY is called for short various types of terminal device, TTY equipment comprises virtual console, serial ports and pseudo terminal device, and TTY device drives framework can be used for driving 131 manage and distribute to serial equipment corresponding to serial ports hardware device that operating system connects.
In the business application shown in Fig. 1 and carry out on the basis of data communication between serial ports hardware device, the embodiment of the present invention proposes a kind of filtering system of serial data, can communication data between filter traffic application program and serial ports hardware device.Fig. 2 shows the structural representation of the filtering system of serial data according to an embodiment of the invention.See Fig. 2, the filtering system of this serial data at least can comprise: configurable file module 210, application call interface 220 and serial ports filtering module 230, wherein:
Configurable file module 210, for configuring the User space filtering rule processed serial data, and is stored to configurable file;
Application call interface 220, one end is connected with configurable file module 210, and the other end is connected with serial ports filtering module 230, for extracting configurable file from configurable file module 210, and is sent to serial ports filtering module 230;
Serial ports filtering module 230, for receiving configurable file, and stores;
Serial ports filtering module 230 is at the configurable file of reception, and after storing, the first data of serial ports hardware device 140 also will be sent to for receiving business application 110, call the configurable file of storage, the User space filtering rule configured in configurable file is used to filter the first data, obtain the first data after filtering, send the first data after filtering subsequently to serial ports hardware device 140;
In addition, serial ports filtering module 230 also will send to the second data of business application 110 for receiving serial ports hardware device 140, call the configurable file of storage, the User space filtering rule configured in configurable file is used to filter the second data, obtain the second data after filtering, send the second data after filtering to business application 110.
The filtering system of serial data provided by the invention, achieves the object of unitized, standardized serial data process.The filtering system of this serial data includes configurable file module, can unify, configure the User space filtering rule processed serial data neatly, and be stored to configurable file.From configurable file module, extract configurable file by application call interface subsequently, and be sent to serial ports filtering module.And then, serial ports filtering module receives configurable file and stores, when receiving business application and will sending to the first data of serial ports hardware device, call the configurable file of storage, the User space filtering rule configured in configurable file is used to filter the first data, obtain the first data after filtering, send the first data after filtering to serial ports hardware device; And when reception serial ports hardware device will send to the second data of business application, call the configurable file of storage, the User space filtering rule configured in configurable file is used to filter the second data, obtain the second data after filtering, send the second data after filtering to business application.Thus, present invention achieves the User space filtering rule according to configuring in configurable file module, serial data is carried out to the object of unified standardization ground filtration treatment, thus effectively solve different hardware equipment manufacturer to the various serial data format needs of upper-layer service application program.Further, the present invention configures by configurable file module is unified the User space filtering rule processed serial data, and operability and maintainability are by force.Further, serial ports filtering module provided by the invention possesses reusability, can filter according to the User space filtering rule configured in configurable file to serial data, without the need to overlapping development journal function, realize simple, reliability is strong, and decreases exploitation and the maintenance cost of business application.
Further, serial ports filtering module 230 is when himself initialization, detection serial ports hardware device 140,131 gateway places are driven to add function hook at the serial equipment of serial ports hardware device 140 correspondence, thus when serial equipment drives 131 to be called, receive business application 110 and will send to the first data of serial ports hardware device 140 or receive the second data that serial ports hardware device 140 will send to business application 110.
In an embodiment of the present invention, as shown in Figure 3, serial ports filtering module 230 is based upon in the kernel of operating system, be connected with the TTY device drives framework 130 in operating system nucleus, because TTY device drives framework 130 can be used for driving 131 manage and distribute to the serial equipment of serial ports hardware device 140 correspondence that operating system connects, thus serial ports filtering module 230 is when himself initialization, serial ports hardware device 140 can be detected by TTY device drives framework 130, 131 gateway places are driven to add function hook at the serial equipment of serial ports hardware device 140 correspondence.
In Fig. 3, in communication stream from top to down, when TTY device drives framework 130 receive business application 110 will send to the first data of serial ports hardware device 140 time, first data are sent to serial ports filtering module 230 by TTY device drives framework 130, and now serial ports filtering module 230 receives the first data that TTY device drives framework 130 sends.The configurable file of storage is called at serial ports filtering module 230, the User space filtering rule configured in configurable file is used to filter the first data, after obtaining the first data after filtering, the first data after filtration send to the serial equipment of serial ports hardware device 140 correspondence to drive 131 by serial ports filtering module 230, to be driven 131 call instruction registers by serial equipment, the first data after filtering are sent to serial ports hardware device 140.
In Fig. 3, in communication stream from bottom to top, the serial equipment of serial ports hardware device 140 correspondence drives 131 call instruction registers, obtain serial ports hardware device 140 when will send to the second data of business application 110, serial equipment drives 131 second data are sent to serial ports filtering module 230, and now serial ports filtering module 230 receives serial equipment and drives 131 the second data sent.The configurable file of storage is called at serial ports filtering module 230, call the configurable file of storage, the User space filtering rule configured in configurable file is used to filter the second data, after obtaining the second data after filtering, the second data after filtration are sent to TTY device drives framework 130 by serial ports filtering module 230, to send the second data after filtration to business application 110 by TTY device drives framework 130.
In addition, in an alternative embodiment of the invention, as shown in Figure 3, the filtering system of serial data can also comprise the log pattern 310 for recording data variation.Serial ports filtering module 230 at the end of the filter operation for the first data and/or the second data, then send can the notification message of log to application call interface 220.Application call interface 220 receiving notice message, calls log pattern 310 and carries out record to the first data after filtration and/or the second data after filtering.Now, log pattern 310 carries out log recording to the first data after filtration and/or the second data after filtering, and in order to follow-up debugging and systematic analysis, thus realizes serial data monitoring.
In addition, application call interface 220 can also extract configurable file and be sent to Virtual File System 120 in operating system nucleus from configurable file module 210, and then calls TTY device drives framework 130 to arrange the property value of serial ports.
Below by being introduced the implementation procedure of the filter method of serial data of the present invention in detail by several specific embodiment, in embodiments, be introduced for (SuSE) Linux OS.
Embodiment one
Fig. 4 shows the overall initialized process flow diagram of filtering system of serial data according to an embodiment of the invention.See Fig. 4, this flow process comprises the following steps S402 to step S412.
Step S402, (SuSE) Linux OS starts, and namely machine CPU (central processing unit) first starts BIOS (BasicInputOutputSystem, Basic Input or Output System (BIOS)) after powering up, operation system boot code.
Step S404, internal memory framework initialization, namely Linux initialization memory management framework is switched to protected mode, sets up free memory administrative mechanism.
Step S406, the initialization of serial ports hardware device, namely the detection of serial ports hardware device performs serial ports hardware device setup code, and device interrupt is registered.
Step S408, the initialization of serial ports filtering module, namely completes concrete serial ports hardware device detection, drives gateway place to add function hook at serial equipment, called by operating system when driving sends or receives, provide event notification mechanism for follow-up serial data filters.
Step S410, TTY device drives framework initialization, i.e. TTY device drives framework initialization, carry out unified management and distribution to all Linux terminal equipment.
Step S412, os starting completes, and namely operating system completes guiding, enters operation system environment.
Above step S402 to step S412 achieves the overall initialization of filtering system of serial data, the following examples how to arrange serial ports attribute by introducing in detail and when business application sends the first data to serial ports hardware device, how serial ports filtering module is tackled the first data and to be filtered.
Embodiment two
Fig. 5 shows the process flow diagram of the filter method of serial data according to an embodiment of the invention.See Fig. 5, this flow process comprises the following steps S502 to step S524.
Step S502, preserve the configuration of original serial ports, namely serial ports is system shared resource, when not other user of influential system, first preserves original serial ports configuration parameter.
Step S504, carries out serial ports configuration, and namely serial communication will ensure that the baud rate, data bit, check bit, position of rest etc. of communicating pair are consistent.Minimum character and stand-by period are set, when reception character and stand-by period are not specially required, can 0 be set to.
Step S506, activate serial ports configuration, namely after configuration, need activate configuration and make it come into force, just can open serial ports, carry out read-write operation, its use-pattern is the same with file operation.
The device file that step S508, LinuxVFS, Linux Virtual File System can be opened user, turns and jumps to the driving of concrete serial equipment.
Step S510, calls TTY device drives framework, and business application will send to the first data of serial ports hardware device to send to serial ports filtering module by TTY device drives framework.
Step S512, the interception of serial ports filtering module needs the first data sent, and process replication backs up.
Step S514, serial ports filtering module judges whether the filtration treatment rule that there is corresponding serial ports, if there is corresponding filtration treatment rule, then performs step S516, if not, then continues to perform step S518.
Step S516, serial ports filtering module carries out corresponding data filtering process to the first data, the data after process is issued serial equipment and drives.
Step S518, serial equipment drives the transmission data receiving serial ports filtering module and transmit, and call instruction register, sends the data to serial ports hardware device.
Step S520, serial ports hardware device receives data, and carries out data transmission.
In step S516, after serial ports filtering module carries out corresponding data filtering process to the first data, can also send can the notification message of log to application call interface.
Step S522, application call interface notification message, calls log pattern and carries out record to the first data after filtration.
Step S524, log pattern carries out log recording to the first data after filtration, facilitates follow-up carrying out to debug and systematic analysis.
Be described above when business application sends the first data to serial ports hardware device, the implementation procedure that serial ports filtering module is tackled the first data and filtered.In the following embodiments, serial ports hardware device will be introduced when sending the second data to business application, the implementation procedure that serial ports filtering module is tackled the second data and filtered.
Embodiment three
Fig. 6 shows the process flow diagram of the filter method of serial data in accordance with another embodiment of the present invention.See Fig. 6, this flow process comprises the following steps S602 to step S624.
Step S602, serial ports hardware device receives data, and peripheral system sends the second data by serial ports, triggers serial ports hardware device and produces operating system interruption.
Step S604, Linux interrupt system, namely Linux is according to interruption source, calls general interrupt system service routine with the interrupt number of default.
Step S606, interrupt system service routine, finds concrete serial equipment to drive according to interrupt source, and calls serial equipment driving.
Step S608, serial equipment is driven through serial ports hardware command register, obtains the second data, and the second data are passed to serial ports filtering module.
Step S610, serial ports filtering module receives the second data.
Step S612, serial ports filtering module judges whether corresponding serial ports has filtering rule, if had, then continues to perform step S614; Otherwise, continue to perform step S616.
Step S614, carries out corresponding data filtering, and the second data after filtering are sent to TTY device drives framework.
Step S616, TTY device drives framework receives data, and sends the data to LinuxVFS.
Step S618, LinuxVFS send the data that TTY device drives framework receives to business application.
Step S620, business application receives the data that LinuxVFS transmits.
In step S614, after serial ports filtering module carries out corresponding data filtering process to the second data, can also send can the notification message of log to application call interface.
Step S622, application call interface notification message, calls log pattern and carries out record to the first data after filtration.
Step S624, log pattern carries out log recording to the first data after filtration, facilitates follow-up carrying out to debug and systematic analysis.
According to the combination of any one preferred embodiment above-mentioned or multiple preferred embodiment, the embodiment of the present invention can reach following beneficial effect:
The filtering system of serial data provided by the invention and method, achieve the object of unitized, standardized serial data process.The filtering system of this serial data includes configurable file module, can unify, configure the User space filtering rule processed serial data neatly, and be stored to configurable file.From configurable file module, extract configurable file by application call interface subsequently, and be sent to serial ports filtering module.And then, serial ports filtering module receives configurable file and stores, when receiving business application and will sending to the first data of serial ports hardware device, call the configurable file of storage, the User space filtering rule configured in configurable file is used to filter the first data, obtain the first data after filtering, send the first data after filtering to serial ports hardware device; And when reception serial ports hardware device will send to the second data of business application, call the configurable file of storage, the User space filtering rule configured in configurable file is used to filter the second data, obtain the second data after filtering, send the second data after filtering to business application.Thus, present invention achieves the User space filtering rule according to configuring in configurable file module, serial data is carried out to the object of unified standardization ground filtration treatment, thus effectively solve different hardware equipment manufacturer to the various serial data format needs of upper-layer service application program.Further, the present invention configures by configurable file module is unified the User space filtering rule processed serial data, and operability and maintainability are by force.Further, serial ports filtering module provided by the invention possesses reusability, can filter according to the User space filtering rule configured in configurable file to serial data, without the need to overlapping development journal function, realize simple, reliability is strong, and decreases exploitation and the maintenance cost of business application.
Further, the various relevant knowledges of existing software are used for setting up new software by the present invention, to reduce the cost of software development and maintenance.Multiplexing serial port filtering module improves software setup power and quality, comprises domain knowledge, development Experience, design decision, architecture, demand, design, code and document etc.
In addition, the present invention can also reduce about serial ports test period, comprised journal format, log storage path and maintenance period, serial monitoring demand analysis, design, realization, Installation Validation and the relevant process management management of product, resource management.
The present invention can also meet the software quality of user to system, and reliability, operability and maintainability are strong.Serial ports filtering module reusability improves the production cycle of product, reduces the release maintenance difficulty brought after traditional software copies stickup, reduces the R&D costs of product, improve the compatibility of product.
In instructions provided herein, describe a large amount of detail.But can understand, embodiments of the invention can be put into practice when not having these details.In some instances, be not shown specifically known method, structure and technology, so that not fuzzy understanding of this description.
Similarly, be to be understood that, in order to simplify the disclosure and to help to understand in each inventive aspect one or more, in the description above to exemplary embodiment of the present invention, each feature of the present invention is grouped together in single embodiment, figure or the description to it sometimes.But, the method for the disclosure should be construed to the following intention of reflection: namely the present invention for required protection requires feature more more than the feature clearly recorded in each claim.Or rather, as claims below reflect, all features of disclosed single embodiment before inventive aspect is to be less than.Therefore, the claims following embodiment are incorporated to this embodiment thus clearly, and wherein each claim itself is as independent embodiment of the present invention.
Those skilled in the art are appreciated that and adaptively can change the module in the equipment in embodiment and they are arranged in one or more equipment different from this embodiment.Module in embodiment or unit or assembly can be combined into a module or unit or assembly, and multiple submodule or subelement or sub-component can be put them in addition.Except at least some in such feature and/or process or unit be mutually repel except, any combination can be adopted to combine all processes of all features disclosed in this instructions (comprising adjoint claim, summary and accompanying drawing) and so disclosed any method or equipment or unit.Unless expressly stated otherwise, each feature disclosed in this instructions (comprising adjoint claim, summary and accompanying drawing) can by providing identical, alternative features that is equivalent or similar object replaces.
In addition, those skilled in the art can understand, although embodiments more described herein to comprise in other embodiment some included feature instead of further feature, the combination of the feature of different embodiment means and to be within scope of the present invention and to form different embodiments.Such as, in detail in the claims, the one of any of embodiment required for protection can use with arbitrary array mode.
All parts embodiment of the present invention with hardware implementing, or can realize with the software module run on one or more processor, or realizes with their combination.It will be understood by those of skill in the art that the some or all functions that microprocessor or digital signal processor (DSP) can be used in practice to realize according to the some or all parts in the filtering system of the serial data of the embodiment of the present invention.The present invention can also be embodied as part or all equipment for performing method as described herein or device program (such as, computer program and computer program).Realizing program of the present invention and can store on a computer-readable medium like this, or the form of one or more signal can be had.Such signal can be downloaded from internet website and obtain, or provides on carrier signal, or provides with any other form.
The present invention will be described instead of limit the invention to it should be noted above-described embodiment, and those skilled in the art can design alternative embodiment when not departing from the scope of claims.In the claims, any reference symbol between bracket should be configured to limitations on claims.Word " comprises " not to be got rid of existence and does not arrange element in the claims or step.Word "a" or "an" before being positioned at element is not got rid of and be there is multiple such element.The present invention can by means of including the hardware of some different elements and realizing by means of the computing machine of suitably programming.In the unit claim listing some devices, several in these devices can be carry out imbody by same hardware branch.Word first, second and third-class use do not represent any order.Can be title by these word explanations.
So far, those skilled in the art will recognize that, although multiple exemplary embodiment of the present invention is illustrate and described herein detailed, but, without departing from the spirit and scope of the present invention, still can directly determine or derive other modification many or amendment of meeting the principle of the invention according to content disclosed by the invention.Therefore, scope of the present invention should be understood and regard as and cover all these other modification or amendments.

Claims (16)

1. a filtering system for serial data, is applied to the situation of the communication data between filter traffic application program and serial ports hardware device, it is characterized in that, comprising: configurable file module, application call interface and serial ports filtering module, wherein,
Described configurable file module, for configuring the User space filtering rule processed serial data, and is stored to configurable file;
Described application call interface, for extracting described configurable file from described configurable file module, and is sent to described serial ports filtering module;
Described serial ports filtering module, for receiving described configurable file, and stores; And
Receive the first data that described business application will send to described serial ports hardware device, call the configurable file of storage, the User space filtering rule configured in described configurable file is used to filter described first data, obtain the first data after filtering, send the first data after described filtration to described serial ports hardware device; And/or
Receive the second data that described serial ports hardware device will send to described business application, call the configurable file of storage, the User space filtering rule configured in described configurable file is used to filter described second data, obtain the second data after filtering, send the second data after described filtration to described business application.
2. system according to claim 1, is characterized in that, also comprises the log pattern for recording data variation, wherein,
Described serial ports filtering module, also at the end of the filter operation for described first data and/or described second data, send can the notification message of log to described application call interface;
Described application call interface, also for receiving described notification message, calling described log pattern and carrying out record to the first data after described filtration and/or the second data after described filtration;
Described log pattern, for carrying out log recording to the first data after described filtration and/or the second data after described filtration.
3. system according to claim 1, is characterized in that, described serial ports filtering module also for:
When himself initialization, detect described serial ports hardware device, gateway place is driven to add function hook at the serial equipment that described serial ports hardware device is corresponding, with when described serial equipment drives called, receive described business application and will send to the first data of described serial ports hardware device or receive the second data that described serial ports hardware device will send to described business application.
4. system according to claim 1, it is characterized in that, described serial ports filtering module is based upon in the kernel of operating system, be connected with the TTY device drives framework in operating system nucleus, wherein, described TTY device drives framework drives for the serial equipment corresponding to the serial ports hardware device of operating system connection and manages and distribute.
5. system according to claim 4, is characterized in that, described serial ports filtering module also for:
When described TTY device drives framework receive described business application will send to the first data of described serial ports hardware device time, receive described first data that described TTY device drives framework sends.
6. the system according to claim 4 or 5, is characterized in that, described serial ports filtering module also for:
The second data after described filtration are sent to described TTY device drives framework, to send the second data after described filtration to described business application by described TTY device drives framework.
7. system according to claim 1, is characterized in that, described serial ports filtering module also for:
The serial equipment sending to described serial ports hardware device corresponding the first data after described filtration drives, and to drive call instruction register by described serial equipment, the first data after described filtration is sent to described serial ports hardware device.
8. system according to claim 1, is characterized in that, described serial ports filtering module also for:
Drive call instruction register at serial equipment corresponding to described serial ports hardware device, obtain described serial ports hardware device when will send to the second data of described business application, receive described serial equipment and drive described second data sent.
9. a filter method for serial data, is applied to the situation of the communication data between filter traffic application program and serial ports hardware device, it is characterized in that, comprising:
Configurable file module configures the User space filtering rule processed serial data, and is stored to configurable file;
Application call interface extracts described configurable file from described configurable file module, and is sent to serial ports filtering module;
Described serial ports filtering module receives described configurable file, and is stored by described configurable file; And
Described serial ports filtering module receives the first data that described business application will send to described serial ports hardware device, call the configurable file of storage, the User space filtering rule configured in described configurable file is used to filter described first data, obtain the first data after filtering, send the first data after described filtration to described serial ports hardware device; And/or
Receive the second data that described serial ports hardware device will send to described business application, call the configurable file of storage, the User space filtering rule configured in described configurable file is used to filter described second data, obtain the second data after filtering, send the second data after described filtration to described business application.
10. method according to claim 9, is characterized in that, also comprises:
At the end of the filter operation for described first data and/or described second data, described serial ports filtering module send can the notification message of log to described application call interface;
Notification message described in described application call interface, calls log pattern and carries out record to the first data after described filtration and/or the second data after described filtration.
11. methods according to claim 9, is characterized in that, also comprise:
Described serial ports filtering module is when himself initialization, detect described serial ports hardware device, gateway place is driven to add function hook at the serial equipment that described serial ports hardware device is corresponding, with when described serial equipment drives called, receive described business application and will send to the first data of described serial ports hardware device or receive the second data that described serial ports hardware device will send to described business application.
12. methods according to claim 9, is characterized in that, also comprise:
Described serial ports filtering module is based upon in the kernel of operating system, be connected with the TTY device drives framework in operating system nucleus, wherein, described TTY device drives framework drives for the serial equipment corresponding to the serial ports hardware device of operating system connection and manages and distribute.
13. methods according to claim 12, is characterized in that, described serial ports filtering module receives the first data that described business application will send to described serial ports hardware device, comprising:
Receive by described TTY device drives framework the first data that described business application will send to described serial ports hardware device, and described first data are sent to described serial ports filtering module;
Described serial ports filtering module receives described first data that described TTY device drives framework sends.
14. methods according to claim 12 or 13, it is characterized in that, described serial ports filtering module sends the second data after described filtration to described business application, comprising:
The second data after described filtration are sent to described TTY device drives framework by described serial ports filtering module;
The second data after described filtration are sent to described business application by described TTY device drives framework.
15. methods according to claim 9, is characterized in that, described serial ports filtering module sends the first data after described filtration to described serial ports hardware device, comprising:
The serial equipment that the first data after described filtration send to described serial ports hardware device corresponding by described serial ports filtering module drives;
Drive call instruction register by described serial equipment, the first data after described filtration are sent to described serial ports hardware device.
16. methods according to claim 9, is characterized in that, described serial ports filtering module receives the second data that described serial ports hardware device will send to described business application, comprising:
The serial equipment corresponding by described serial ports hardware device drives call instruction register, obtains the second data that described serial ports hardware device will send to described business application, and described second data are passed to described serial ports filtering module;
Described serial ports filtering module receives described serial equipment and drives described second data sent.
CN201510401913.9A 2015-07-09 2015-07-09 The filtration system and method for serial data Active CN105138490B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510401913.9A CN105138490B (en) 2015-07-09 2015-07-09 The filtration system and method for serial data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510401913.9A CN105138490B (en) 2015-07-09 2015-07-09 The filtration system and method for serial data

Publications (2)

Publication Number Publication Date
CN105138490A true CN105138490A (en) 2015-12-09
CN105138490B CN105138490B (en) 2018-05-04

Family

ID=54723842

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510401913.9A Active CN105138490B (en) 2015-07-09 2015-07-09 The filtration system and method for serial data

Country Status (1)

Country Link
CN (1) CN105138490B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113094110A (en) * 2021-04-07 2021-07-09 山东省计算中心(国家超级计算济南中心) Method and system for filtering serial port data
CN113741718A (en) * 2020-05-29 2021-12-03 杭州海康威视数字技术股份有限公司 Control data conversion method and device and master control equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005062544A1 (en) * 2003-12-20 2005-07-07 Robert Bosch Gmbh Network bridge
CN102468899A (en) * 2010-11-08 2012-05-23 普华基础软件股份有限公司 Channelizing STM-1 access distribution method of and system thereof
CN104268443A (en) * 2014-09-28 2015-01-07 北京航天数控系统有限公司 Protective equipment of numerical control system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005062544A1 (en) * 2003-12-20 2005-07-07 Robert Bosch Gmbh Network bridge
CN102468899A (en) * 2010-11-08 2012-05-23 普华基础软件股份有限公司 Channelizing STM-1 access distribution method of and system thereof
CN104268443A (en) * 2014-09-28 2015-01-07 北京航天数控系统有限公司 Protective equipment of numerical control system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113741718A (en) * 2020-05-29 2021-12-03 杭州海康威视数字技术股份有限公司 Control data conversion method and device and master control equipment
CN113094110A (en) * 2021-04-07 2021-07-09 山东省计算中心(国家超级计算济南中心) Method and system for filtering serial port data
CN113094110B (en) * 2021-04-07 2022-11-22 山东省计算中心(国家超级计算济南中心) Method and system for filtering serial port data

Also Published As

Publication number Publication date
CN105138490B (en) 2018-05-04

Similar Documents

Publication Publication Date Title
CN103201729B (en) USB (universal serial bus) monitoring between high-speed chip
KR100843495B1 (en) A method for sending service data to an rfid tag while an attached computer system is powered off and a computer system therefor
WO2017053319A1 (en) Containerized architecture to manage internet-connected devices
US10169183B2 (en) Mobile device and chassis with contactless tags to diagnose hardware and software faults
CN105760159A (en) Website developing method and system
CN101853173A (en) Software upgrading method and device of programmable logic device of distributed system
US10091066B2 (en) Integration method and system
CN105530655A (en) Flow monitoring method and device
CN105812368A (en) Universal programming method for multiple communication protocols
CN102567268A (en) Detection method for USB to virtual serial port/MODEM
CN102866925A (en) Communication method and system for middleware and user interface
CN103944761A (en) Android log information filter method and system
CN105138490A (en) Serial data filtration system and method
CN107633053A (en) A kind of file management method, apparatus and system
CN111290802B (en) Information analysis method and device for BMC internal device and readable storage medium
Datasheet ICC
WO2020222845A1 (en) External module for network connection to programmable logic controller (plc) backplane
CN101442539B (en) Method and apparatus for implementing field filtration
US8645756B1 (en) Systems and methods for remotely troubleshooting a software problem occurring on a computing device
CN104615560A (en) Electronic device and method of checking connected state of signal line thereof
CN105389260A (en) Basic input/output system (BIOS) debugging system and method
CN103095513A (en) Simulation testing device and method of Encryption equipment
CN105049337A (en) Communication method and device between smart devices based on instant messaging
CN104951389A (en) Server display management implementing system and method
JP4990105B2 (en) Communication device

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