CN103701869B - A kind of method for controlling communication of multiport electricity meter - Google Patents
A kind of method for controlling communication of multiport electricity meter Download PDFInfo
- Publication number
- CN103701869B CN103701869B CN201310671801.6A CN201310671801A CN103701869B CN 103701869 B CN103701869 B CN 103701869B CN 201310671801 A CN201310671801 A CN 201310671801A CN 103701869 B CN103701869 B CN 103701869B
- Authority
- CN
- China
- Prior art keywords
- port
- epitope
- external communication
- request
- communication request
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Abstract
Port is initialized the invention discloses a kind of method for controlling communication of multiport electricity meter, including according to the epitope number of port number and each Port Management:Particular hardware equipment corresponding to each port is defined, while configures the epitope of each Port Management;Monitor external communication request, and the port numbers according to belonging to the epitope number of request determines the epitope;Judge whether the port is idle, if then carrying out communication operation and locking the port;If otherwise external communication request is added in the waiting list of the port;The port waiting list is checked after completing a communication request, and the request in queue is performed according to first in first out order.Present invention effect in production practices is fine, it is necessary to when accessing common resource, the automatic waiting lines of system is handled each thread independent operating.Ensure that all system resources make full use of, reach maximum productivity.
Description
Technical field
The invention belongs to ammeter field, more particularly to a kind of method for controlling communication of multiport electricity meter.
Background technology
, it is necessary to be configured by 485 communication modes to ammeter before ammeter dispatches from the factory, copy reading differentiates, the operation such as calibration.Using
Single serial mode communication, elapsed time are that single table communication time is multiplied by ammeter quantity.For production in enormous quantities, this mode limits
The raising of production capacity is made.Existing way needs to communicate with every piece of ammeter respectively, takes longer.
The content of the invention
Object of the present invention is to provide a kind of method for controlling communication of multiport electricity meter, it is intended to solves existing ammeter
Communication caused respectively with the communication of every piece of ammeter using serial mode it is time-consuming it is longer, limit the problem of production capacity improves.
The invention provides a kind of method for controlling communication of multiport electricity meter, comprise the steps:
Port is initialized according to the epitope number of port number and each Port Management:Define corresponding to each port and have
Body hardware device, while configure the epitope of each Port Management;
Multiple threads are started according to port number, monitor the external communication request sent in a parallel fashion, and according to outside
The epitope number of communication request determines the port numbers belonging to the epitope;
Judge whether the port is idle, if then carrying out communication operation and locking the port;If otherwise please by external communication
Ask and be added in the waiting list of the port;
The port waiting list is checked after completing an external communication request, and team is performed according to first in first out order
External communication request in row.
Further, different external communications request is run by common interface under multiport pattern.
Further, the corresponding hardware device of a port.
Present invention effect in production practices is fine, and each thread independent operating is, it is necessary to when accessing common resource, and system is certainly
Dynamic waiting lines's processing.Ensure that all system resources make full use of, reach maximum productivity.
Brief description of the drawings
Fig. 1 is the flow chart of the method for control communication of multiport electricity meter provided in an embodiment of the present invention.
Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, it is right below in conjunction with drawings and Examples
The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and
It is not used in the restriction present invention.
Fig. 1 shows the flow of the method for control communication of multiport electricity meter provided in an embodiment of the present invention, its specific steps
For:
Implementation process includes port initialization, queue management, and several parts are realized in communication.
Port is initialized according to the epitope number of port number and each Port Management first, it is corresponding to define each port
Particular hardware equipment, while configure the epitope of each Port Management.Wherein 11 mode of control is fastest, 1 control multimode loss
Some speed, but hardware cost can be saved.User can be balanced according to condition in hardware input and speed.
After the completion of port initialization, external communication request is begun listening for, external communication request can be sent in a parallel fashion,
Port numbers of the system according to belonging to the epitope number that external communication is asked determines the epitope, and judge whether the port is now idle,
Communication operation can be carried out when the port free time, while locks the port., then please by external communication when port is in busy state
Ask and be added in the waiting list of the port.The port waiting list is checked after completing an external communication request, according to
First in first out order performs the external communication request in queue.
Communication achievement unit is divided into independent expansible plug-in unit, and user can complete different communication functions according to different demands,
Autgmentability is strong.Different external communication requests are run by common interface under multiport pattern.Each mould can be achieved
The independence of block, efficient whole flow process can be managed collectively again.
The present invention reduces communication time by Multi-serial port simultaneous communications.Improve production efficiency.Can be according to hardware condition, 1
Serial ports controls the communication of ammeter, can also 1 serial ports control more ammeters.Elapsed time depends on 1 serial ports and controls ammeter
Quantity, the used time is:The table number of single 1 serial ports control of table communication time *.
The problem of present invention is by multiple serial ports and ammeter simultaneous communications.Solve single serial ports and ammeter communication speed is slow, imitate
The problem of rate is low.Polylith ammeter is configured, when calibration etc. operates, if multiple serial ports simultaneous communications, efficiency can be passed through
It will significantly improve.
This module starts multiple threads according to port number, while handles the communication of multiple epitope communications.Because hardware limits
System, it is impossible to ensure that each table platform is attained by 1 serial ports and controls an epitope, it is necessary to handle, assist by automatic queuing's mechanism
Adjust the external communication request of different port.
The present invention coordinates the communication of multiple epitopes by multithreading.Effect is fine in production practices, each thread
, it is necessary to when accessing common resource, the automatic waiting lines of system is handled independent operating.Ensure that all system resources make full use of, reach
To maximum productivity.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all essences in the present invention
All any modification, equivalent and improvement made within refreshing and principle etc., should be included in the scope of the protection.
Claims (3)
- A kind of 1. method for controlling communication of multiport electricity meter, it is characterised in that comprise the steps:Port is initialized according to the epitope number of port number and each Port Management:Define specific hard corresponding to each port Part equipment, while configure the epitope of each Port Management;Multiple threads are started according to port number, monitor the external communication request sent in a parallel fashion, and according to external communication The epitope number of request determines the port numbers belonging to the epitope;Judge whether the port is idle, if then carrying out communication operation and locking The fixed port;If otherwise external communication request is added in the waiting list of the port;The port waiting list is checked after completing an external communication request, and is performed according to first in first out order in queue External communication request.
- 2. the method as described in claim 1, it is characterised in that different external communication requests is by common interface in multiport Run under pattern.
- 3. the method as described in claim 1, it is characterised in that the corresponding hardware device of a port.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310671801.6A CN103701869B (en) | 2013-12-10 | 2013-12-10 | A kind of method for controlling communication of multiport electricity meter |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310671801.6A CN103701869B (en) | 2013-12-10 | 2013-12-10 | A kind of method for controlling communication of multiport electricity meter |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103701869A CN103701869A (en) | 2014-04-02 |
CN103701869B true CN103701869B (en) | 2018-01-19 |
Family
ID=50363263
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310671801.6A Active CN103701869B (en) | 2013-12-10 | 2013-12-10 | A kind of method for controlling communication of multiport electricity meter |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103701869B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108551460B (en) * | 2018-07-20 | 2020-11-24 | 南京工程学院 | SOCKET communication establishment method under complex network environment |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103036878A (en) * | 2012-12-07 | 2013-04-10 | 广东电网公司佛山供电局 | Device and method for networking protocol conversion |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB2364787B (en) * | 2000-07-13 | 2004-11-24 | Siemens Metering Ltd | Method and apparatus for repeating an energy consumption pulse on a modular meter |
CN201233414Y (en) * | 2008-07-12 | 2009-05-06 | 广东东方电讯科技有限公司 | Intelligent ammeter box |
CN102692579A (en) * | 2011-03-25 | 2012-09-26 | 鸿富锦精密工业(深圳)有限公司 | Serial port detection circuit |
CN102929823A (en) * | 2012-09-08 | 2013-02-13 | 佳都新太科技股份有限公司 | Multiple serial port communication system and method based on thread pool |
CN202998138U (en) * | 2012-11-30 | 2013-06-12 | 中国科学院沈阳自动化研究所 | A distributed Ethernet system with a single auxiliary end and multiple main ends |
-
2013
- 2013-12-10 CN CN201310671801.6A patent/CN103701869B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103036878A (en) * | 2012-12-07 | 2013-04-10 | 广东电网公司佛山供电局 | Device and method for networking protocol conversion |
Also Published As
Publication number | Publication date |
---|---|
CN103701869A (en) | 2014-04-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106534338B (en) | A kind of cloud robot implementation method | |
CN104346229B (en) | A kind of processing method for the optimization of embedded OS Inter-Process Communication | |
CN105183852B (en) | A kind of database migration method and apparatus | |
CN107526645B (en) | A kind of communication optimization method and system | |
CN106775946B (en) | A kind of virtual machine Method of Creation Process | |
CN104468638B (en) | A kind of distributed data processing method and system | |
CN102917006B (en) | A kind of unified control and management method and device realizing computational resource and object permission | |
CN104951688B (en) | Suitable for the exclusive data encryption method and encrypted card under Xen virtualized environment | |
CN103617088A (en) | Method, device and processor of device for distributing core resources in different types of threads of processor | |
CN109408205A (en) | Method for scheduling task and device based on hadoop cluster | |
CN101178666A (en) | Coordinating and scheduling method between heterogeneous multi-core | |
CN211628241U (en) | PCIE bus structure switching topology through software | |
CN107102890A (en) | The moving method and moving apparatus of a kind of virtual machine | |
CN109298901A (en) | Object processing method, device, equipment, storage medium and vehicle | |
CN110636139A (en) | Optimization method and system for cloud load balancing | |
CN110187970A (en) | A kind of distributed big data parallel calculating method based on Hadoop MapReduce | |
CN104410511B (en) | A kind of server management method and system | |
CN103701869B (en) | A kind of method for controlling communication of multiport electricity meter | |
CN107368336A (en) | A kind of cloud data center deployed with devices and the method and apparatus of management | |
WO2019037527A1 (en) | Usb interface request scheduling method and apparatus, and device | |
CN107239419A (en) | It is a kind of that the adaptive method of network interface is realized under PowerPC DPAA patterns | |
CN107682228A (en) | A kind of method for monitoring state and its device of OpenStack clusters | |
CN107729057A (en) | Flow processing method being buffered a kind of data block under multi-core DSP more | |
CN106933646A (en) | A kind of method and device for creating virtual machine | |
CN110324194A (en) | Method, apparatus, system and medium for load balancing |
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 |