CN103701788B - A kind of communicator and flexible bus of cross-platform flexible bus - Google Patents

A kind of communicator and flexible bus of cross-platform flexible bus Download PDF

Info

Publication number
CN103701788B
CN103701788B CN201310706996.3A CN201310706996A CN103701788B CN 103701788 B CN103701788 B CN 103701788B CN 201310706996 A CN201310706996 A CN 201310706996A CN 103701788 B CN103701788 B CN 103701788B
Authority
CN
China
Prior art keywords
thread
communication
flexible bus
data
data queue
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201310706996.3A
Other languages
Chinese (zh)
Other versions
CN103701788A (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.)
SHENZHEN JINHONGWEI TECHNOLOGY CO LTD
Zhuhai Subehart Energy Technology Co ltd
Original Assignee
SHENZHEN JINHONGWEI TECHNOLOGY CO LTD
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SHENZHEN JINHONGWEI TECHNOLOGY CO LTD filed Critical SHENZHEN JINHONGWEI TECHNOLOGY CO LTD
Priority to CN201310706996.3A priority Critical patent/CN103701788B/en
Publication of CN103701788A publication Critical patent/CN103701788A/en
Application granted granted Critical
Publication of CN103701788B publication Critical patent/CN103701788B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The present invention is applied to field of computer technology there is provided a kind of communicator and flexible bus of cross-platform flexible bus, and described device includes:Communication thread unit, two different connections for safeguarding double net identical services ports;Thread pool container, for the management container as the communication thread unit;Data queue's buffer unit, the data queue for caching the data queue received and transmission;Processor is connected, for pre-processing the data queue;Service adapter, for sorting out two different connections of the described pair of net identical services port and assisted network switches when a network segment Network Abnormal.The present invention realizes the unitized of communication mode, it is easy to safeguard by communication thread unit, thread pool container, data queue's buffer unit, connection processor, service adapter.

Description

A kind of communicator and flexible bus of cross-platform flexible bus
Technical field
The invention belongs to field of computer technology, more particularly to a kind of communicator and flexible bus of cross-platform flexible bus.
Background technology
With the development that electric power software function moduleization is designed, network service interaction is asking of must facing between module Topic.The communication development mode of respective style is used due to different developers exploitation disparate modules, and when each exploit person When member develops communication module again, it also occur that the problem of many criminals are same wrong, so as to have impact on development efficiency.And due to The coding style and the difference of programming experience of each developer, the communication cryptology that everyone exports can have larger difference, It is more difficult when going wrong to safeguard, also occur that many people repeat to make the situation of same mistake.
In summary, communication module difference of the prior art is big, it is difficult to safeguard.
The content of the invention
The purpose of the embodiment of the present invention is to provide a kind of communicator of cross-platform flexible bus, it is intended to solve prior art In communication module difference it is big, it is difficult to the problem of safeguarding.
The embodiment of the present invention is achieved in that a kind of communicator of cross-platform flexible bus, and described device includes:
Communication thread unit, two different connections for safeguarding double net identical services ports;
Thread pool container, for the management container as the communication thread unit;
Data queue's buffer unit, the data queue for caching the data queue received and transmission;
Processor is connected, for pre-processing the data queue;
Service adapter, for sorting out two different connections of the described pair of net identical services port and when a network segment network Assisted network switches when abnormal.
The embodiment of the present invention additionally provides a kind of flexible bus, and the flexible bus includes above-mentioned device.
Compared with prior art, beneficial effect is the embodiment of the present invention:By communication thread unit, thread pool container, Data queue's buffer unit, connection processor, service adapter, realize the unitized of communication mode, it is easy to safeguard.
Brief description of the drawings
Fig. 1 is the logical construction schematic diagram of the communicator of cross-platform flexible bus provided in an embodiment of the present invention;
Fig. 2 is the thread classification of the communication thread unit of the communicator of cross-platform flexible bus provided in an embodiment of the present invention Schematic diagram;
Fig. 3 is the schematic diagram of the thread pool container of the communicator of cross-platform flexible bus provided in an embodiment of the present invention;
Fig. 4 is the thread of the communicator of cross-platform flexible bus provided in an embodiment of the present invention with being connected processor and adaptation Device relation schematic diagram;
Fig. 5 is the application deployment schematic diagram of flexible bus 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.
Embodiment provided in an embodiment of the present invention is as follows:
Fig. 1 to Fig. 4 is referred to, the embodiments of the invention provide a kind of communicator of cross-platform flexible bus, described device Including:
Communication thread unit 101, two different connections for safeguarding double net identical services ports;
Thread pool container 102, for the management container as the communication thread unit;
Data queue's buffer unit 103, the data queue for caching the data queue received and transmission;
Processor 104 is connected, for pre-processing the data queue;
Service adapter 105, for sorting out two different connections of the described pair of net identical services port and when a network segment Assisted network switches during Network Abnormal.
In the present embodiment, in communication thread unit 101, communication thread is divided into two major classes, three groups, i.e. TCP threads With 2 major classes of UDP threads, TCP service roles, 3 groups of TCP Client role and UDP threads.Each thread is responsible for safeguarding double Two different connections of net identical services port(TCP threads).
In the present embodiment, thread pool container 102 is used as the management container of all kinds communication thread, or thread management Member.Thread pool container 102 be responsible for communication thread such as TCP threads and UDP threads are created, destroyed, is inquired about, is dispatched, is reused, The management roles such as recovery.Thread pool container 102 is also interactive interface of the flexible bus with other software module, and other modules use soft Interface that bus is opened to the outside world by thread pool container 102 is carried out.Thread pool container 102, thread pool is divided the work and made Thread pool and caching two thread pools of thread pool;Worker thread pond carries out the thread container of communication work, caching thread Pond is standby thread container;When there is new connection to set up, then its respective thread in the caching thread pond is dispatched to described In worker thread pond, when there is connection to disconnect, then its respective thread in the worker thread is discharged, and the thread of release is reclaimed For caching thread, it is dispatched in the caching thread pond.
In the present embodiment, data queue's buffer unit 103, as the data buffer storage pond that each connection is pending, for delaying Deposit and receive data queue and send data queue, data queue's buffer unit 103 sends buffering with TCP and reception buffering is similar, Data queue and transmission data queue are received by caching, it can be ensured that will not handle energy because of transient data when data peak The not enough influence or loss data to data communication of power.
In the present embodiment, processor 104 is connected, specifically for the data prediction safeguarded, operated to data queue, The namely direct manager of data queue.
In the present embodiment, data are divided into two kinds of types of service, when same third party system communicates, using without heading Data type, internally uses the data type with heading in system.The data class with heading is internally used in system Type contributes to the interference for preventing invalid data to system, it is ensured that the legitimacy of connection, will be disconnected when there is illegal connection.
In the present embodiment, service adapter 105 is set exclusively for double Network Communications are supported.
The communication thread unit uses ACE Overpassing Platform by Using technologies.
In the present embodiment, the communication thread unit 101 includes the XPCOM components for externally providing interface.
In the present embodiment, described device also includes:
Heartbeat detection unit, for sending self-defined heartbeat message, when not receiving response message or just in the given time During normal communication data packet, then connection or handover network are re-established.
In the present embodiment, the communicator of cross-platform flexible bus is specially the logical of the cross-platform flexible bus under C/C++ language T unit.
The communicator of the cross-platform flexible bus of the present embodiment, using ACE Overpassing Platform by Using technologies.It is cross-platform using ACE Communication characteristic, it is more complicated for ACE mechanism, it is skilled grasp, using it is more difficult the characteristics of, it is sealed again using Object-oriented Technique Dress, again reduction uses complexity.
The communicator of the cross-platform flexible bus of the present embodiment, using thread pool.ACE is not only to Overpassing Platform by Using socket Programming is encapsulated, and also causes this concept of thread has been carried out on each platform abstract so that the programming of multithreading can be with non- It is often simple.The multi-threaded code can be also run on the platform for not supporting thread.Management to socket connections is used Thread pool mode manages communication thread unit 101 with the communication port between other modules, there is the pipe of thread pool container 102 Reason, socket networked communication resources with regard to that can be managed well, it is to avoid because error causes the phenomenon of the wasting of resources.
The communicator of the cross-platform flexible bus of the present embodiment, using the cross-platform component technologys of XPCOM.XPCOM is one Cross-platform component model, its full name is Cross Platform Component Object Module.XPCOM realizes one Individual framework(framework), in this framework, it allows developer to break single overall software project, and is decomposed into multiple Smaller modularization fragment(pieces), these fragments namely component(components).XPCOM components externally provide interface, For XPCOM interfaces, it is necessary to consider 2 factors:
(1), interface with according to contract (Contract) program:One interface reaches contract between component and CLIENT PROGRAM About.Not any compulsory measure ensures to accept this contract, but it can be fatal to ignore it.In the programming based on component In, component ensures that the interface that it is provided is constant.The component of different editions is offered to same access method.This just with Reached a kind of contract for this angle using its CLIENT PROGRAM, the programming based on component also commonly referred to as according to Contract is programmed.
(2)Interface and encapsulation:The abstract maintainability to software between module boundaries with reusability is most important 's.
The communicator of the cross-platform flexible bus of the present embodiment, using Object-oriented Technique, utilizes three of object-oriented Essential characteristic(Encapsulation, inherit, it is polymorphic)The purpose for software can be made to realize easy care, high-quality, high efficiency, easily extending is become reconciled Place.Simultaneously because the Object-oriented Technique that ACE and XPCOM are also used, so flexible bus can also using Object-oriented Technique The condensate for making flexible bus be an Object-oriented Technique from general frame, realizes clear in structure, the clean and tidy effect of code.
The communicator of the cross-platform flexible bus of the present embodiment, supports double network technologies.Electric power software particularly monitoring software, In order to ensure communication reliability, generally using double planar network architectures.Flexible bus supports double nets it is ensured that program module is in a network segment The operation of another network segment is seamlessly switched in the case of paralysis, not lost data packets, so as to ensure communication reliability.
The communicator of the cross-platform flexible bus of the present embodiment, utilizes heartbeat detection unit.It can determine whether whether TCP connections are steady It is fixed, self-defined heartbeat is sent in passage idle, other side replys heartbeat at once after receiving.If failing to receive within the defined period To the heartbeat message or proper communication packet of other side, then judge that the connection is broken, connection is re-established automatically or is switched The network segment.
The communicator of the cross-platform flexible bus of the present embodiment, using Double Data type-scheme.A kind of data type conduct Internal system data, band internal data heading(Internally communication, supports double nets);Another data type is logical as same third party Letter data form(Correspondence with foreign country, double nets are not supported), without data message head, this is determined after a connection setup.
The communicator of the cross-platform flexible bus of the present embodiment, can apply to following scene:Power network schedule automation system Communication middleware between system each service module of main station system;It is logical between each service module of electrical power distribution automatization system main station system Believe middleware;Communication middleware between each service module of electric substation automation system main station system;Concentrator station main station system is each Communication middleware between service module;Communication middleware between each service module of other monitoring systems.
The communicator of the cross-platform flexible bus of the present embodiment, can be deployed to service together as dynamic base and system software On device or PC, when system software needs to carry out network service, network connection is created to flexible bus request, i.e., into flexible bus Thread management person asks scheduling thread and carries out corresponding connection processing.
The communicator for the cross-platform flexible bus that the present embodiment is provided, using component technology, blocking technology and towards right As technology, developer and running environment are supplied to the form of dynamic base, so as to realize that solution electric power software unit melts hair During for the cross-platform of communication function and reuse and require the purpose of problem.Cross Platform Technology ensures that software can be in mixing platform Run under environment.
The communicator for the cross-platform flexible bus that the present embodiment is provided, user is only needed to using connecing that software is externally provided Mouthful network programming just can be easily carried out, communication fault-tolerance is handled etc. into work gives flexible bus inter-process, it is ensured that no Because of communicative reasons robustness can be caused to reduce.
The embodiment of the present invention additionally provides a kind of flexible bus, and the flexible bus includes above-mentioned device.
Fig. 5 illustrates deployed position of the flexible bus of the present embodiment offer in software architecture, and flexible bus is used as dynamic base It is deployed to together on server or PC with system software, when system software needs to carry out network service, asks to create to flexible bus Establishing network is connected, i.e., thread management person's request scheduling thread into flexible bus simultaneously carries out corresponding connection processing.
The communicator and flexible bus of the cross-platform flexible bus of the present invention, pass through communication thread unit, thread pool container, number According to queue buffer unit, connection processor, service adapter, the unitized of communication mode is realized, it is easy to safeguard.
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 Any modifications, equivalent substitutions and improvements made within refreshing and principle etc., should be included in the scope of the protection.

Claims (2)

1. a kind of communicator of cross-platform flexible bus, it is characterised in that described device includes:
Communication thread unit, two different connections for safeguarding double net identical services ports;
Thread pool container, for the management container as the communication thread unit;
Data queue's buffer unit, the data queue for caching the data queue received and transmission;
Processor is connected, for pre-processing the data queue;
Service adapter, for sorting out two different connections of the described pair of net identical services port and when a network segment Network Abnormal When assisted network switch;
The communicator, using Double Data type-scheme;A kind of data type is used as internal system data, band internal data report Literary head;Another data type is as same third party's communication data format, without data message head;
The communication thread unit includes TCP threads and UDP threads;
The thread pool container is used to create the TCP threads and UDP threads, destroy, inquire about, dispatch, reuse or returned Receive;
The thread pool container includes worker thread pond and caching thread pool;
When there is new connection to set up, then its respective thread in the caching thread pond is dispatched in the worker thread pond, When there is connection to disconnect, then its respective thread in the worker thread is discharged, and by the thread scheduling of release to the cache lines Cheng Chizhong;
The communication thread unit uses ACE Overpassing Platform by Using technologies;
The communication thread unit includes the XPCOM components for externally providing interface;
Described device also includes:
Heartbeat detection unit, for sending self-defined heartbeat message, when not receiving response message in the given time or normal During communication data packet, then connection or handover network are re-established.
2. a kind of flexible bus, it is characterised in that the flexible bus includes the device described in claim 1.
CN201310706996.3A 2013-12-20 2013-12-20 A kind of communicator and flexible bus of cross-platform flexible bus Active CN103701788B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310706996.3A CN103701788B (en) 2013-12-20 2013-12-20 A kind of communicator and flexible bus of cross-platform flexible bus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310706996.3A CN103701788B (en) 2013-12-20 2013-12-20 A kind of communicator and flexible bus of cross-platform flexible bus

Publications (2)

Publication Number Publication Date
CN103701788A CN103701788A (en) 2014-04-02
CN103701788B true CN103701788B (en) 2017-09-26

Family

ID=50363185

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310706996.3A Active CN103701788B (en) 2013-12-20 2013-12-20 A kind of communicator and flexible bus of cross-platform flexible bus

Country Status (1)

Country Link
CN (1) CN103701788B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106325991B (en) * 2016-08-19 2020-04-03 东软集团股份有限公司 Instruction scheduling method and device of flow engine
CN110572436B (en) * 2019-08-12 2020-09-22 浙江讯盟科技有限公司 Multi-place cross-cluster server deployment method and system
CN111555800B (en) * 2020-05-15 2021-07-20 北京光润通科技发展有限公司 Gigabit dual-optical-port server adapter
CN116821944B (en) * 2023-08-31 2023-11-14 中电安世(成都)科技有限公司 Data processing method and system based on data element

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101097653A (en) * 2007-07-17 2008-01-02 东北大学 Electric energy quality and electrical power system malfunction detection wave recording device and method
CN101710734A (en) * 2009-11-06 2010-05-19 深圳南瑞科技有限公司 Dual-network switching monitoring equipment of transformer substation
CN102957739A (en) * 2012-02-08 2013-03-06 深圳市金宏威技术股份有限公司 Communication method and device for monitoring system of electric automobile charging station

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101097653A (en) * 2007-07-17 2008-01-02 东北大学 Electric energy quality and electrical power system malfunction detection wave recording device and method
CN101710734A (en) * 2009-11-06 2010-05-19 深圳南瑞科技有限公司 Dual-network switching monitoring equipment of transformer substation
CN102957739A (en) * 2012-02-08 2013-03-06 深圳市金宏威技术股份有限公司 Communication method and device for monitoring system of electric automobile charging station

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
《一个基于ACE的微总线的设计与实现》;程德蓉;《重庆科技学院学报(自然科学版)》;20061230;第8卷(第4期);第77-80页 *
《基于软总线的微总线研究及在远程教学平台的应用》;程德蓉;《中国优秀硕士学位论文全文库》;20071115(第5期);正文第3页第1.2.2节、第7页第1.2.4节-第8页第1.4节、第9页第2.1节、第13页第3.1节-第16页最后一段、第29页第5.1.2节-第36页最后一段、第44页第6.2.1节及附图2.1、图6.2 *

Also Published As

Publication number Publication date
CN103701788A (en) 2014-04-02

Similar Documents

Publication Publication Date Title
CN102377814B (en) Remote assistance service method aiming at embedded operation system
CN104243481B (en) A kind of method and system of power information acquisition advance data processing
CN103701788B (en) A kind of communicator and flexible bus of cross-platform flexible bus
CN104461575B (en) The device and method that a kind of across Mobile operating system platform native interface of page script language is called
CN101697536B (en) Method for transmitting mass data in real time by penetrating positive physical isolation device
CN104683352A (en) Industrial communication isolation gap with double-channel ferrying function
CN104038390B (en) A kind of linux server clusters based on netlink unify peripheral hardware action listener method
CN103618741A (en) TCP long connection communication system and method
CN101741912A (en) Method, network apparatus and distributed network system for processing computation task
CN102946376B (en) Method for implementing asynchronous communication
CN108063824A (en) A kind of cloud service system and construction method
CN104111874A (en) High-concurrence high-reliability load balance software architecture design of virtual mainframe in cloud computing environment
CN106775993A (en) A kind of physical machine is migrated to the method and system of cloud computing platform
CN105282128A (en) Bidirectional calling method and system based on long connection
CN107995043A (en) Application disaster recovery and backup systems and calamity based on mixing cloud platform are for collocation method
CN105321121A (en) Power cloud platform based power utilization information acquisition system
CN203135901U (en) Encryption equipment management device
CN106843963A (en) The device and method of automatic deployment JAVA application programs in K UX operating systems
Min et al. Design and implementation of the multi-channel RS485 IOT gateway
CN104836831B (en) A kind of object method of servicing for Internet of Things
CN106789099A (en) High-speed isolated network method and terminal based on PCIE
CN104393985A (en) Cipher machine based on multi-NIC (network interface card) technology
CN205986955U (en) Wisdom city thing networking cloud data butt joint management device
CN104217314A (en) Routing information capturing method and device
CN116192863B (en) Micro-service flow processing method, DPU service grid deployment method and system

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
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 518000 Guangdong city of Shenzhen province Nanshan District South Road No. 9 nine Wei new software park building 8 floor 701-712 room 7

Patentee after: Shenzhen Jinhongwei Technology Co.,Ltd.

Address before: 518000 Guangdong city of Shenzhen province Nanshan District South Road No. 9 nine Wei new software park building 8 floor 701-712 room 7

Patentee before: SHENZHEN GOLDEN HIGHWAY TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200201

Address after: 401-410, floor 4, building 5, No.66, Keji 1st Road, Tangjiawan Town, Xiangzhou District, Zhuhai City, Guangdong Province

Patentee after: Zhuhai subehart Energy Technology Co.,Ltd.

Address before: 518000 Guangdong city of Shenzhen province Nanshan District South Road No. 9 nine Wei new software park building 8 floor 701-712 room 7

Patentee before: Shenzhen Jinhongwei Technology Co.,Ltd.