CN107436859A - A kind of collecting method based on AMP - Google Patents
A kind of collecting method based on AMP Download PDFInfo
- Publication number
- CN107436859A CN107436859A CN201710660324.1A CN201710660324A CN107436859A CN 107436859 A CN107436859 A CN 107436859A CN 201710660324 A CN201710660324 A CN 201710660324A CN 107436859 A CN107436859 A CN 107436859A
- Authority
- CN
- China
- Prior art keywords
- cpu
- data
- message
- collecting method
- interrupt
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F15/00—Digital computers in general; Data processing equipment in general
- G06F15/16—Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
- G06F15/163—Interprocessor communication
- G06F15/17—Interprocessor communication using an input/output type connection, e.g. channel, I/O port
Landscapes
- Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a kind of collecting method based on AMP, using dual-CPU architecture, has the first CPU and the 2nd CPU in dual-CPU architecture, wherein, first CPU is connected with collecting device group, is responsible for data acquisition, and the 2nd CPU is responsible for extraction, processing, integration and upper hair to data;And the first passes through interrupt mode between CPU and the 2nd CPU and message queue carries out information exchange.The collecting method based on AMP is easy to implement, and data acquisition and efficiency of transmission are high.
Description
Technical field
The present invention relates to a kind of collecting method based on AMP.
Background technology
With industrialization and information-based rapid development, the application of automation equipment in the industry is more and more extensive, and counts
According to collection in automation and very important effect is played with control system.How in real time, data acquisition is efficiently carried out
Become an important topic for improving industrial intelligent degree with data interaction.
Under the scene not high to data acquisition or processing requirement, more collections that data are carried out using chips such as STM32
And processing;And in the higher system of data acquisition efficiency requirement, common chip can not meet demand.Therefore, introduce
Multi-core CPU (such as ZC7020) completes processing and the interaction flow of data.Multi-core CPU bring stronger parallel processing capability,
Higher calculating density and lower clock frequency, and greatly reduce radiating and power consumption.
The multiprocessing pattern of multi core chip is broadly divided into AMP (asymmetric multiprocessing), SMP (symmetric multi-processors) and BMP is (mixed
Close multiprocessing) three kinds.In view of most of operating systems all support SMP reason, most commonly used at present is SMP patterns, by one
Individual OS manages each kernel, and the load that shares out the work.But there is certain performance in task scheduling, management of process etc. in SMP
Expense, the acquisition system performance that this can be strict to requirement of real-time adversely affect.
For example, patent CN106487909A proposes a kind of remote data acquisition system based on ARM and embedded Linux
System, the collection terminal of system by only being realized by an arm chip and its peripheral hardware, the data of acquisition by router transmit to
Internet, host computer then directly obtain information data from internet.Patent CN101957808A proposes a kind of multi -CPU and led to
Believe method and system, the system is based on SMP structures, by interrupting the interaction between message queue progress multi -CPU;Connect from CPU
After the interrupt signal for receiving host CPU triggering, the data are obtained from message queue from CPU kernel, and will by SOCKET
The data transfer is to the application program.Above-mentioned patent is gathered for single CPU or the multi -CPU drainage pattern based on SMP, single CPU
Under drainage pattern, collecting efficiency is low, can not take into account the real-time of uplink and downlink passage;Multi -CPU drainage pattern based on SMP
Though system real time is made moderate progress, in view of linux itself real-time drawback, can not meet hard requirement of real-time.
Data collecting system uses single cpu model or multi -CPU symmetric multi-processors pattern more at present, under single CPU drainage patterns,
Frequently task scheduling switching can cause collecting efficiency low, can not in time feedback collection data, take into account uplink and downlink and lead to
The real-time in road;Though the multi -CPU drainage pattern based on SMP makes moderate progress to system real time, a CPU be responsible for it is up, it is another
Individual CPU is responsible for descending, but in view of linux itself real-time drawback, exists in task scheduling, management of process etc. certain
Performance cost, it can not be used in the hard real-time demand scene for needing to power off at once if data exception.
Therefore, it is necessary to design a kind of new collecting method.
The content of the invention
The technical problems to be solved by the invention are to provide a kind of collecting method based on AMP, it is contemplated that solution
When certainly collecting device uses single operating system, the problem of real-time is influenceed by task scheduling etc. and causes real-time to decline, the base
Easy to implement in AMP collecting method, data acquisition and efficiency of transmission are high.
The technical solution of invention is as follows:
A kind of collecting method based on AMP, using dual-CPU architecture, there is the first CPU and second in dual-CPU architecture
CPU, wherein, the first CPU is connected with collecting device group, is responsible for data acquisition, and the 2nd CPU is responsible for extraction to data, processing, whole
Conjunction and upper hair;Upper hair refers to upload onto the server, mobile phone or host computer etc.;
And the first passes through interrupt mode between CPU and the 2nd CPU and message queue carries out information exchange.
First CPU loads ucosii operating systems;2nd CPU loads linux operating systems.
After first CPU initialization, message queue is established.
In the first CPU, if there is abnormal data to need to be fed back immediately in single data acquisition completion or gathered data
When, the first CPU triggers the 2nd CPU external interrupt by I/O port, notifies the 2nd CPU processing.
First CPU carries out basic (i.e. original) data acquisition, and data are carried out with preliminary judgement, when announcement in need
When alert abnormal data or gathered data reaches hair threshold value (data amount check such as collection reaches 1000), data are filled into
In the structure of message, and message queue is pushed into for reading.
First CPU drags down corresponding internuclear interrupt pin according to the type of upper hair data, so as to trigger the outer of the 2nd CPU
Interrupt in portion.
After the 2nd CPU hardware detection is pulled low to interrupt pin, Interrupt Subroutine is jumped to automatically;Interrupting
The message in message queue will be read out and be parsed in processing subprogram.
When judging type of message for the message urgently alerted, directly alarm data is packed from Interrupt Subroutine
And upper hair.
When the message for judging type of message and urgently alerting to be non-(i.e. normal gathered data), flag marks are put 1;Before
After platform thread detects that flag marks put 1, the data of institute's band in message are handled, integrated and packed;Finally, by man-machine friendship
Mutual interface completes the upper hair of data.
First CPU is connected by least one acquisition interface with collecting device group, and the 2nd CPU is connected with least one display
Terminal.
Data acquisition device based on AMP corresponding to this method, including the first CPU, the 2nd CPU, collecting device group and deposit
Reservoir;
Message queue is provided with memory;First CPU and the 2nd CPU are connected with memory, the first CPU and the 2nd CPU
The message queue can be accessed;
First CPU I/O port connects the 2nd CPU external interrupt input port;First CPU and the 2nd CPU passes through internuclear
Interrupt mode triggering is interrupted;
Collecting device group is used for collection site data;Collecting device group is connected with the first CPU.
The described data acquisition device based on AMP also includes the Man Machine Interface being connected with the 2nd CPU.
Man Machine Interface is connected with least one of display screen, keyboard, touch-screen.
First CPU and the 2nd CPU uses Cortex-A9 types CPU.
Pass through AI/DI interfaces, IIC interfaces, SPI interface, USB interface, 232 interfaces between first CPU and collecting device group
It is connected with least one of 485 interfaces interface.
Ucosii operating systems are mounted with first CPU;Linux operating systems are mounted with the 2nd CPU.
The described data acquisition device based on AMP also includes the communication module being connected with the 2nd CPU;Communication module is used for
With mobile phone or server communication.
Communication module be ethernet communication module, GPRS, 3G, 4G, 5G, bluetooth communication, ZigBee communication module,
At least one of WiFi communication module.
Described message queue is annular message queue.
First CPU is responsible for the collection to underlying device data, there is abnormal number in single data acquisition completion or gathered data
During according to needing to be fed back immediately, the first CPU triggers the 2nd CPU external interrupt, so as to notify the 2nd CPU processing;The
Two CPU enter corresponding interrupt service routine according to the difference of interrupt priority level, and extract message simultaneously in corresponding message queue
Carry out the processing of next step.
AI signal acquisition module DI signal acquisition modules are using full scale channel separation, fully differential In-put design.Simulate on 8 tunnels
Measure (magnitude of current) input;2 railway digital amounts (dry contact) input, and RS485 interfaces Phototube Coupling and isolated from power technology, effectively suppress
Lightning, thunderbolt, ESD and is disturbed altogether.
First CPU operating system needs strictly to meet real-time demand, therefore, as long as operating system is simplified, real-time
Height.Therefore, ucosii operating systems can use the real time operating system such as RTLinux, ecos to replace.
2nd CPU needs to have the functions such as perfect file management, memory management, task scheduling, and to ensure embedded
The stability of system.Therefore, the extensive utilization in embedded device can only be used and the linux operating systems increased income are moved
Plant.
Beneficial effect:
The collecting method based on AMP of the present invention, using the CPU of double Cortex-A9 cores, and has been abandoned traditional
SMP architecture, it is responsible for the collection of data with the very strong ucosii operating systems of real-time, to possess perfect memory management, task
The functions such as scheduling and the good linux operating systems of stability are responsible for extraction, processing, integration and upper hair to data.Two operations
Enter the interaction of row information between system with message queue by interrupting.The patent is without periphery circuit design, it is only necessary to by software
Configured, code development modularity is strong, takes full advantage of CPU resource, realizes the maximization of collecting efficiency.
The present invention makes full use of the AMP frameworks of the linux based on the very high ucosii of real-time and high stability, and data are adopted
Collect efficiency high, and it is easy to implement.
Brief description of the drawings
Fig. 1 is the general structure schematic diagram of the data acquisition device based on AMP;
Fig. 2 is the hardware connection diagram by taking the chip of double Cortex-A9 cores as an example;
Fig. 3 is the first CPU flow chart of data processing figure;
Fig. 4 is the 2nd CPU flow chart of data processing figure;
Fig. 5 is the 2nd CPU interrupt handling routine flow chart.
Embodiment
The present invention is described in further details below with reference to the drawings and specific embodiments:
Embodiment 1:Such as Fig. 1~5, a kind of collecting method based on AMP, using dual-CPU architecture, in dual-CPU architecture
With the first CPU and the 2nd CPU, wherein, the first CPU is connected with collecting device group, is responsible for data acquisition, responsible couple of the 2nd CPU
Extraction, processing, integration and the upper hair of data;Upper hair refers to upload onto the server, mobile phone or host computer etc.;
And the first passes through interrupt mode between CPU and the 2nd CPU and message queue carries out information exchange.
First CPU loads ucosii operating systems;2nd CPU loads linux operating systems.
After first CPU initialization, message queue is established.
In the first CPU, if there is abnormal data to need to be fed back immediately in single data acquisition completion or gathered data
When, the first CPU triggers the 2nd CPU external interrupt by I/O port, notifies the 2nd CPU processing.
First CPU carries out basic (i.e. original) data acquisition, and data are carried out with preliminary judgement, when announcement in need
When alert abnormal data or gathered data reaches hair threshold value (data amount check such as collection reaches 1000), data are filled into
In the structure of message, and message queue is pushed into for reading.
First CPU drags down corresponding internuclear interrupt pin according to the type of upper hair data, so as to trigger the outer of the 2nd CPU
Interrupt in portion.
After the 2nd CPU hardware detection is pulled low to interrupt pin, Interrupt Subroutine is jumped to automatically;Interrupting
The message in message queue will be read out and be parsed in processing subprogram.
When judging type of message for the message urgently alerted, directly alarm data is packed from Interrupt Subroutine
And upper hair.
When the message for judging type of message and urgently alerting to be non-(i.e. normal gathered data), flag marks are put 1;Before
After platform thread detects that flag marks put 1, the data of institute's band in message are handled, integrated and packed;Finally, by man-machine friendship
Mutual interface completes the upper hair of data.
First CPU is connected by least one acquisition interface with collecting device group, and the 2nd CPU is connected with least one display
Terminal.
The present invention device abandon simple ucosii real time operating systems, using ucosii and linux act synergistically into
The mode of row data acquisition and processing (DAP).The poll collection for being responsible for carrying out bottom data high real-time by ucosii operating systems is appointed
Business;The tasks such as processing, integration, package and the alarm of data are then scheduled and realized by linux operating systems.Dual-core dual system
Between communication by interrupt and message queue complete.The patent is without periphery circuit design, it is only necessary to is carried out for double-core CPU soft
Configuration and planning on part, enormously simplify hardware circuit;After ucosii completes collection, by interrupt notification Linux system,
The corresponding thread of Linux system then extracts data from corresponding message queue, and carries out data analysis, processing and alarm, in real time
Property greatly improves.
To achieve these goals, collecting method of the invention and device are included with lower module:
Real-time acquisition module, the module is realized by a CPU core for loading ucosii operating systems, completes basic data
Acquisition function, after the completion of collection, linux cores are notified by interrupt signal line;
Double-core interactive module, the module are realized that CPU0 produces by two CPU internal memories shared and its message queue of maintenance
After raw data, the pointer of message can be pressed into circle queue, and queue tail pointer is added 1;CPU1, which receives interrupt signal, to be passed through
The queue heads of circle queue access message pointer, meanwhile, by queue head pointer plus 1;
Data processing module, the module are accessed by the pointer read from queue and parse message, pass through the class of message
Type carries out the operation such as parsing, preservation and processing of data;
Human-computer interaction module, the module carries out general data according to the type and pre-defined requirement of data or alarm is believed
The transmission of breath, transmission means are:GPRS, Ethernet and RS485 buses.
As shown in Fig. 2 CPU core 0 controls all interfaces related to collection, such as AI/DI interfaces, IIC interfaces etc..By
Ucosii task block is responsible for the collection to underlying device data.There is abnormal data in single data acquisition completion or gathered data
When needing to be fed back immediately, core 0 drags down corresponding interrupt pin, and notice CPU core 1 is handled.CPU core 1 is according to interruption
The difference of priority enters corresponding interrupt service routine, and extracts in corresponding message queue message and carry out the place of next step
Reason.
The handling process of CPU core 0 with ucosii operating systems is as shown in Figure 3.
(1) CPU complete own hardware initialization, and configure corresponding acquisition interface pattern (CPOL of such as SPI interface and
CPHA), communication speed (such as baud rates of 232 interfaces).
(2) acquisition parameter in FLASH is read, the initialization of software is carried out according to these parameters and establishes message queue.
(3) carry out basic data acquisition, and data carried out with preliminary judgement, when alarm in need abnormal data or
When gathered data reaches hair threshold value, data are filled into the structure of message, and are pushed into message queue for reading.
(4) corresponding internuclear interrupt pin is dragged down according to the type of upper hair data.
The handling process of CPU core 1 with linux operating systems is as shown in Figures 4 and 5.
(1) hardware initialization is completed.
(2) thread is established, reads the configuration parameter in FLASH, and the initialization of software, configuration are carried out according to these parameters
Respective interrupt pin and Interrupt Subroutine.
(3) interacting for heartbeat packet and routine data is carried out with display terminal, waits flag marks to put 1.
(4) after hardware detection is pulled low to interrupt pin, Interrupt Subroutine is jumped to automatically.In interrupt processing
The message in message queue will be read out and be parsed in program.When judging type of message for the message urgently alerted, directly
Connect alarm data packing and upper hair from Interrupt Subroutine.Otherwise flag marks are put 1.
(5) after foreground thread detects that flag marks put 1, the data of institute's band in message are handled, integrated and packed.
Finally, the upper hair of data is completed by Man Machine Interface.
Claims (10)
1. a kind of collecting method based on AMP, it is characterised in that using dual-CPU architecture, have first in dual-CPU architecture
CPU and the 2nd CPU, wherein, the first CPU is connected with collecting device group, is responsible for data acquisition, and the 2nd CPU is responsible for putting forward data
Take, handle, integrating and upper hair;
And the first passes through interrupt mode between CPU and the 2nd CPU and message queue carries out information exchange.
2. the collecting method according to claim 1 based on AMP, it is characterised in that the first CPU loads ucosii behaviour
Make system;2nd CPU loads linux operating systems.
3. the collecting method according to claim 1 based on AMP, it is characterised in that after the first CPU initialization,
Establish message queue.
4. the collecting method according to claim 3 based on AMP, it is characterised in that in the first CPU, if single
When having abnormal data to need to be fed back immediately in data acquisition completion or gathered data, the first CPU passes through I/O port triggering the
Two CPU external interrupt, notify the 2nd CPU processing.
5. the collecting method according to claim 4 based on AMP, it is characterised in that the first CPU carries out basic number
According to collection, and data are carried out with preliminary judgement, when the abnormal data or gathered data of alarm in need reach upper hair threshold value
(data amount check such as collection reaches 1000), data are filled into the structure of message, and are pushed into message queue for reading
Take.
6. the collecting method according to claim 5 based on AMP, it is characterised in that the first CPU is according to upper hair data
Type corresponding internuclear interrupt pin is dragged down, so as to trigger the 2nd CPU external interrupt.
7. the collecting method according to claim 6 based on AMP, it is characterised in that when the 2nd CPU hardware detection
After being pulled low to interrupt pin, Interrupt Subroutine is jumped to automatically;Will be in message queue in Interrupt Subroutine
Message be read out and parse.
8. the collecting method according to claim 7 based on AMP, it is characterised in that when judging type of message for urgently
When the message alerted, by alarm data packing and upper hair directly from Interrupt Subroutine.
9. the collecting method according to claim 7 based on AMP, it is characterised in that when judging type of message to be non-
During the message urgently alerted, flag marks are put 1;After foreground thread detects that flag marks put 1, to the data of institute's band in message
Handled, integrated and packed;Finally, the upper hair of data is completed by Man Machine Interface.
10. according to the collecting method based on AMP described in claim any one of 1-9, it is characterised in that the first CPU leads to
Cross at least one acquisition interface with collecting device group to be connected, the 2nd CPU is connected with least one display terminal.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710660324.1A CN107436859A (en) | 2017-08-04 | 2017-08-04 | A kind of collecting method based on AMP |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710660324.1A CN107436859A (en) | 2017-08-04 | 2017-08-04 | A kind of collecting method based on AMP |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107436859A true CN107436859A (en) | 2017-12-05 |
Family
ID=60460385
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710660324.1A Pending CN107436859A (en) | 2017-08-04 | 2017-08-04 | A kind of collecting method based on AMP |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107436859A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101324855A (en) * | 2008-08-12 | 2008-12-17 | 杭州华三通信技术有限公司 | Method, system, component and multi-CPU equipment for detecting auxiliary CPU operating status |
CN102736595A (en) * | 2012-06-06 | 2012-10-17 | 中国电力科学研究院 | Unified platform of intelligent power distribution terminal based on 32 bit microprocessor and real time operating system (RTOS) |
US20140281092A1 (en) * | 2013-03-13 | 2014-09-18 | Sarathy Jayakumar | System management interrupt handling for multi-core processors |
CN106557358A (en) * | 2015-09-29 | 2017-04-05 | 北京东土军悦科技有限公司 | A kind of date storage method and device based on dual core processor |
CN106713185A (en) * | 2016-12-06 | 2017-05-24 | 瑞斯康达科技发展股份有限公司 | Load balancing method and apparatus of multi-core CPU |
-
2017
- 2017-08-04 CN CN201710660324.1A patent/CN107436859A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101324855A (en) * | 2008-08-12 | 2008-12-17 | 杭州华三通信技术有限公司 | Method, system, component and multi-CPU equipment for detecting auxiliary CPU operating status |
CN102736595A (en) * | 2012-06-06 | 2012-10-17 | 中国电力科学研究院 | Unified platform of intelligent power distribution terminal based on 32 bit microprocessor and real time operating system (RTOS) |
US20140281092A1 (en) * | 2013-03-13 | 2014-09-18 | Sarathy Jayakumar | System management interrupt handling for multi-core processors |
CN106557358A (en) * | 2015-09-29 | 2017-04-05 | 北京东土军悦科技有限公司 | A kind of date storage method and device based on dual core processor |
CN106713185A (en) * | 2016-12-06 | 2017-05-24 | 瑞斯康达科技发展股份有限公司 | Load balancing method and apparatus of multi-core CPU |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107367991A (en) | A kind of data acquisition device based on AMP | |
CN107561990A (en) | A kind of industrial sensor signal picker and acquisition method based on edge calculations | |
CN103645796B (en) | Based on high-performance hydrographic water resource telemetering terminal and the power consumption control method thereof of ARM framework | |
CN111459665A (en) | Distributed edge computing system and distributed edge computing method | |
CN103200081A (en) | Heterogeneous network environment oriented Internet of things gateway development platform | |
CN110300959A (en) | Task management when dynamic operation | |
CN206962829U (en) | A kind of mainboard of vehicle peace control Internet of things access equipment | |
CN104899420A (en) | Intelligent-ship-channel-oriented ship basic data collection analyzer | |
CN107436859A (en) | A kind of collecting method based on AMP | |
CN104133433B (en) | Power distribution automation terminal in standard system framework | |
CN101483000A (en) | Tax control system based on wireless network tax controller | |
CN205619971U (en) | Room humiture remote monitoring system is baked to two redundant host computers based on distributed architecture | |
CN103607286B (en) | Multi-functional communication interface machine device based on PowerPC embedded systems | |
CN204613943U (en) | Towards the boats and ships basic data acquisition analyzer in wisdom navigation channel | |
CN212413185U (en) | Intelligent monitoring edge gateway | |
CN204117091U (en) | A kind of computing machine uninterrupted power supply mechanism | |
CN202310123U (en) | Vehicle-mounted GPRS (General Packet Radio Service) communication device | |
CN202872470U (en) | Real-time data access interface device of power utilization information acquisition system | |
CN106161430A (en) | application service device for data cluster | |
CN205992148U (en) | Power dispatching automation data collecting system | |
CN110691128A (en) | Communication method, system, medium and device based on IPMI system health management middleware | |
CN209946765U (en) | High-performance server structure based on domestic CPU | |
CN202872469U (en) | Real-time data access interface device of electric energy system | |
CN205427580U (en) | Electric power communication management machine | |
CN201435116Y (en) | Tax control system based on wireless network fiscal processor |
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 | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20171205 |
|
WD01 | Invention patent application deemed withdrawn after publication |