CN106919479A - A kind of real-time logs recording method of embedded device controller - Google Patents
A kind of real-time logs recording method of embedded device controller Download PDFInfo
- Publication number
- CN106919479A CN106919479A CN201510984551.0A CN201510984551A CN106919479A CN 106919479 A CN106919479 A CN 106919479A CN 201510984551 A CN201510984551 A CN 201510984551A CN 106919479 A CN106919479 A CN 106919479A
- Authority
- CN
- China
- Prior art keywords
- communication port
- data
- sent
- log information
- busy condition
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2268—Logging of test results
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/14—Handling requests for interconnection or transfer
- G06F13/20—Handling requests for interconnection or transfer for access to input/output bus
- G06F13/28—Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2213/00—Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F2213/28—DMA
- G06F2213/2806—Space or buffer allocation for DMA transfers
Abstract
The present invention relates to a kind of real-time logs recording method of embedded device controller, including:Judge that embedded device controller whether there is file system, if there is file system, log information is stored with file mode, if not existing, judge whether the free word joint number in communication port caching is more than the length of the log information to be sent, if being more than or equal to, then when communication port is in the state not being in a hurry, the memory address of DMA in the transmission caching of the data copy of log information to communication port, will be reset and send length, enabled DMA and send.
Description
Technical field
The present invention relates to embedded device, more particularly to a kind of real-time logs recording method of embedded device controller.
Background technology
Real-time logs have recorded the real running of software, is generally used to debugging software or positioning software ran
The position broken down in journey.The embedded device control of such as Anesthesia machine control of breathing cell board in the market
Device possesses the function of valid data upload, but does not possess the function of real-time logs output, when failure is occurred in that, typically
It is analyzed when reappearing by pending faults such as technical staff, it is impossible to which the very first time is analyzed treatment to field failure.
The content of the invention
It is an object of the invention to overcome existing embedded device controller cannot real-time output journal information in time,
The defect for causing technical staff to be acted upon to field failure in time, so as to provide a kind of real-time logs record side
Method.
To achieve these goals, the invention provides a kind of real-time logs recording method of embedded device controller,
Including:
Step 1), embedded device controller is judged with the presence or absence of file system, if there is file system, under execution
One step, otherwise performs step 3);
Step 2), by log information with file mode store, then judge whether to need in real time to export log information,
If desired, next step, otherwise, end operation are performed;
Step 3), judge communication port caching in free word joint number whether more than the log information to be sent length,
If being more than or equal to, next step is performed, otherwise, perform step 6);Wherein, the communication port includes serial ports, net
One kind in mouth, radio port;
Step 4), judge that whether communication port, in busy condition, if communication port is in the state not being in a hurry, is performed next
Step, if communication port is in busy condition to, the data frame of log information is copied next position of communication port buffer area
Put, and data frame address and length are write into queue to be sent, after communication port is in not busy condition, then perform down
One step;
Step 5), the internal memory ground of DMA in the transmission of the data copy of log information to communication port caching, will be reset
Location and transmission length, enable DMA and send, and then perform step 7);
Step 6), communication port caching free word joint number be less than the data length to be sent, wait communication port caching idle
Byte is released, and treats that communication port caching free word joint number increases so that communication port caching free word joint number is more than or equal to
After the length of the data to be sent, then perform step 4);
Step 7), DMA send log information data, the set busy condition in transmission process;
Step 8), in the interruption that DMA is sent completely, perform following operation:
Step 8-1), reset busy condition, will the busy condition of communication port be changed into not busy condition;
Step 8-2), check in queue to be sent there is no data, if data also to be sent, by these data
Queue to be sent is removed, step 3 is then performed), if not existing data to be sent, perform step 8-3);
Step 8-3), check waiting list, if including the data of log information in waiting list, just then hold
Row step 3), if it did not, end operation.
The advantage of the invention is that:
The method of the present invention being capable of real-time Transmission and log message, it is ensured that the integrality of log information.So that
During failure, technical staff can check daily record, rapid fault point.
Brief description of the drawings
Fig. 1 is the principle schematic of daily record transmission flow;
Fig. 2 is the flow chart of the real-time logs recording method of embedded device controller of the invention.
Specific embodiment
In conjunction with accompanying drawing, the invention will be further described.
Daily record transmission flow principle such as Fig. 1, the daily record data that will be sent be copied to transmission caching, will send address and
Length writes message queue, and the task of transmission is judging DMA (Direct Memory Access, direct memory access (DMA))
After free time, reception message queue data, and the memory address and length of DMA are reset, and enable DMA and send, hair
Passing through journey does not need CPU to intervene, and dramatically reduces CPU burdens, and real-time is also improve to a certain extent.
From daily record transmission flow it is also seen that the relation of data transmission time, data volume and data buffer storage:Data buffer storage is empty
Between change the time, multiplexing is the time to change space.
The content of involved daily record can be defined according to the characteristics of each task in the present invention, it may include statistical log,
Sensor logs, communication port interactive instruction daily record, each module working condition daily record etc..The agreement definable of daily record is not
Same data frame head, instruction, length, verification etc. is realized.
With reference to Fig. 2, the real-time logs recording method of embedded device controller of the invention includes:
Step 1), embedded device controller is judged with the presence or absence of file system, if there is file system, under execution
One step, otherwise performs step 3);
Step 2), by log information with file mode store, then judge whether to need in real time to export log information,
If desired, next step, otherwise, end operation are performed;
Step 3), judge communication port caching in free word joint number whether more than the log information to be sent length,
If being more than or equal to, next step is performed, otherwise, perform step 6);Wherein, the communication port includes serial ports, net
One kind in mouth, radio port;
Step 4), judge that whether communication port, in busy condition, if communication port is in the state not being in a hurry, is performed next
Step, if communication port is in busy condition to, the data frame of log information is copied next position of communication port buffer area
Put, and data frame address and length are write into queue to be sent, after communication port is in not busy condition, then perform down
One step;
Step 5), the internal memory ground of DMA in the transmission of the data copy of log information to communication port caching, will be reset
Location and transmission length, enable DMA and send, and then perform step 7);
Step 6), communication port caching free word joint number be less than the data length to be sent, wait communication port caching idle
Byte is released, and treats that communication port caching free word joint number increases so that communication port caching free word joint number is more than or equal to
After the length of the data to be sent, then perform step 4);
Step 7), DMA send log information data, the set busy condition in transmission process;
Step 8), in the interruption that DMA is sent completely, perform following operation:
Step 8-1), reset busy condition, will the busy condition of communication port be changed into not busy condition;
Step 8-2), check in queue to be sent there is no data, if data also to be sent, by these data
Queue to be sent is removed, step 3 is then performed), if not existing data to be sent, perform step 8-3);
Step 8-3), check waiting list, if including the data of log information in waiting list, just then hold
Row step 3), if it did not, end operation.
In the method for the invention, the log content of each task is intactly copied in a data buffer zone, if
It is data buffer zone space inadequate, it is necessary to wait until that sky free space is replicated again.This guarantees the complete of log transmission
Property.
It should be noted last that, the above embodiments are merely illustrative of the technical solutions of the present invention and it is unrestricted.Although
The present invention has been described in detail with reference to embodiment, it will be understood by those within the art that, to the present invention
Technical scheme modify or equivalent, without departure from the spirit and scope of technical solution of the present invention, its is equal
Should cover in the middle of scope of the presently claimed invention.
Claims (1)
1. a kind of real-time logs recording method of embedded device controller, including:
Step 1), embedded device controller is judged with the presence or absence of file system, if there is file system, under execution
One step, otherwise performs step 3);
Step 2), by log information with file mode store, then judge whether to need in real time to export log information,
If desired, next step, otherwise, end operation are performed;
Step 3), judge communication port caching in free word joint number whether more than the log information to be sent length,
If being more than or equal to, next step is performed, otherwise, perform step 6);Wherein, the communication port includes serial ports, net
One kind in mouth, radio port;
Step 4), judge that whether communication port, in busy condition, if communication port is in the state not being in a hurry, is performed next
Step, if communication port is in busy condition to, the data frame of log information is copied next position of communication port buffer area
Put, and data frame address and length are write into queue to be sent, after communication port is in not busy condition, then perform down
One step;
Step 5), the internal memory ground of DMA in the transmission of the data copy of log information to communication port caching, will be reset
Location and transmission length, enable DMA and send, and then perform step 7);
Step 6), communication port caching free word joint number be less than the data length to be sent, wait communication port caching idle
Byte is released, and treats that communication port caching free word joint number increases so that communication port caching free word joint number is more than or equal to
After the length of the data to be sent, then perform step 4);
Step 7), DMA send log information data, the set busy condition in transmission process;
Step 8), in the interruption that DMA is sent completely, perform following operation:
Step 8-1), reset busy condition, will the busy condition of communication port be changed into not busy condition;
Step 8-2), check in queue to be sent there is no data, if data also to be sent, by these data
Queue to be sent is removed, step 3 is then performed), if not existing data to be sent, perform step 8-3);
Step 8-3), check waiting list, if including the data of log information in waiting list, just then hold
Row step 3), if it did not, end operation.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510984551.0A CN106919479B (en) | 2015-12-24 | 2015-12-24 | Real-time log recording method of embedded device controller |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510984551.0A CN106919479B (en) | 2015-12-24 | 2015-12-24 | Real-time log recording method of embedded device controller |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106919479A true CN106919479A (en) | 2017-07-04 |
CN106919479B CN106919479B (en) | 2020-04-24 |
Family
ID=59456510
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510984551.0A Active CN106919479B (en) | 2015-12-24 | 2015-12-24 | Real-time log recording method of embedded device controller |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106919479B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109067754A (en) * | 2018-08-17 | 2018-12-21 | 武汉精测电子集团股份有限公司 | A kind of communication means and system of request end and server-side |
CN109939310A (en) * | 2017-12-20 | 2019-06-28 | 北京谊安医疗系统股份有限公司 | The slave computer of ventilator sends the method and ventilator of data to host computer |
CN117149680A (en) * | 2023-10-27 | 2023-12-01 | 合肥安迅精密技术有限公司 | Main control board for uploading sub-module log of chip mounter and uploading method |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080124694A1 (en) * | 2006-11-27 | 2008-05-29 | Kb Port Llc | Method and apparatus for integrated recording and playback of video audio and data inputs |
CN103902434A (en) * | 2012-12-29 | 2014-07-02 | 北京谊安医疗系统股份有限公司 | Alarm log management method and system |
CN104978543A (en) * | 2015-07-09 | 2015-10-14 | 黄凯锋 | Mobile terminal information safety protection system and method |
-
2015
- 2015-12-24 CN CN201510984551.0A patent/CN106919479B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080124694A1 (en) * | 2006-11-27 | 2008-05-29 | Kb Port Llc | Method and apparatus for integrated recording and playback of video audio and data inputs |
CN103902434A (en) * | 2012-12-29 | 2014-07-02 | 北京谊安医疗系统股份有限公司 | Alarm log management method and system |
CN104978543A (en) * | 2015-07-09 | 2015-10-14 | 黄凯锋 | Mobile terminal information safety protection system and method |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109939310A (en) * | 2017-12-20 | 2019-06-28 | 北京谊安医疗系统股份有限公司 | The slave computer of ventilator sends the method and ventilator of data to host computer |
CN109067754A (en) * | 2018-08-17 | 2018-12-21 | 武汉精测电子集团股份有限公司 | A kind of communication means and system of request end and server-side |
CN109067754B (en) * | 2018-08-17 | 2021-04-20 | 武汉精测电子集团股份有限公司 | Communication method and system for request terminal and server terminal |
CN117149680A (en) * | 2023-10-27 | 2023-12-01 | 合肥安迅精密技术有限公司 | Main control board for uploading sub-module log of chip mounter and uploading method |
CN117149680B (en) * | 2023-10-27 | 2024-02-02 | 合肥安迅精密技术有限公司 | Main control board for uploading sub-module log of chip mounter and uploading method |
Also Published As
Publication number | Publication date |
---|---|
CN106919479B (en) | 2020-04-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9176673B2 (en) | Memory device | |
US20140068134A1 (en) | Data transmission apparatus, system, and method | |
US9946467B2 (en) | Data storage method and electronic device | |
DK2218009T3 (en) | Bidirectional data transfer in a single I / O operation | |
US8843663B2 (en) | Data transmission device and method for merging multiple commands | |
JP2011512589A5 (en) | ||
CN107357666A (en) | A kind of multi-core parallel concurrent system processing method based on hardware protection | |
JP2012533796A5 (en) | ||
US9400603B2 (en) | Implementing enhanced performance flash memory devices | |
CN106919479A (en) | A kind of real-time logs recording method of embedded device controller | |
CN105210028A (en) | Reads and writes between a contiguous data block and noncontiguous sets of logical address blocks in a persistent storage device | |
CN102652313A (en) | Flash memory controller | |
US8359425B2 (en) | Memory control device, memory device, and shutdown control method | |
US9304711B2 (en) | Latency reduction in read operations from data storage in a host device | |
CN108153536B (en) | DSP online upgrading method for dynamically adjusting RAM space | |
CN104780123B (en) | A kind of network pack receiving and transmitting processing unit and its design method | |
RU2012147915A (en) | FACILITATION OF I / O OPERATIONS IN TRANSMISSION MODE BETWEEN THE CHANNEL SUBSYSTEM AND I / O DEVICES | |
CN105718396A (en) | I<2>C bus device with big data master device transmission function and communication method thereof | |
CN109426445A (en) | Data storage method for optimizing data storage device and data storage device thereof | |
US8285509B2 (en) | Method and system of testing electronic device | |
US20170052521A1 (en) | Programmable controller and arithmetic processing system | |
CN107463475A (en) | A kind of method of chip and acquisition chip tune-up data | |
US9152348B2 (en) | Data transmitting method, memory controller and data transmitting system | |
CN103150262B (en) | Pipeline access means | |
KR102116025B1 (en) | Apparatus and Method Debugging Software of Vehicle's ECU |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |