CN103701788A - Cross-platform flexible bus communication device and flexible bus - Google Patents

Cross-platform flexible bus communication device and flexible bus Download PDF

Info

Publication number
CN103701788A
CN103701788A CN201310706996.3A CN201310706996A CN103701788A CN 103701788 A CN103701788 A CN 103701788A CN 201310706996 A CN201310706996 A CN 201310706996A CN 103701788 A CN103701788 A CN 103701788A
Authority
CN
China
Prior art keywords
thread
flexible bus
communication
unit
platform
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
CN201310706996.3A
Other languages
Chinese (zh)
Other versions
CN103701788B (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

Images

Landscapes

  • Stored Programmes (AREA)
  • Small-Scale Networks (AREA)

Abstract

The invention is applied to the field of computer technologies and provides a cross-platform flexible bus communication device and a flexible bus. The device comprises a communication thread unit, a thread pool container, a data queue buffer unit, a connected processor and a service adapter, wherein the communication thread unit is used for maintaining two different connections of identical service ports of two networks; the thread pool container is used for serving as a management container of the communication thread unit; the data queue buffer unit is used for buffering received data queues and transmitted data queues; the connected processor is used for preprocessing the data queues; the service adapter is used for categorizing the two different connections of the identical service ports of the two networks and assisting network switchover when the network of a network segment is abnormal. According to the cross-platform flexible bus communication device and the flexible bus, the unification of communication modes is realized through the communication thread unit, the thread pool container, the data queue buffer unit, the connected processor and the service adapter, and the maintenance is easy.

Description

A kind of communicator of cross-platform flexible bus and flexible bus
Technical field
The invention belongs to field of computer technology, relate in particular to a kind of communicator and flexible bus of cross-platform flexible bus.
Background technology
Along with the development of electric power software function moduleization design, between module, network service is the problem that must face alternately.Because different developers develop disparate modules, adopt the communication development mode of style separately, and when each developer develops communication module again, the same wrong problem of many criminals also can occur, thereby affected development efficiency.And due to the difference of each developer's coding style and programming experience, everyone can exist larger difference by the communication cryptology of output, more difficult maintenance when going wrong, also there will be many people to repeat to make the situation of same mistake.
In sum, communication module difference of the prior art is large, is difficult to safeguard.
Summary of the invention
The object of the embodiment of the present invention is to provide a kind of communicator of cross-platform flexible bus, is intended to solve communication module difference of the prior art large, 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 comprises:
Communication thread unit, for safeguarding two different connections of two net identical services ports;
Thread pool container, for the Manage Containers as described communication thread unit;
Data queue's buffer unit, the data queue receiving for buffer memory and the data queue of transmission;
Connect processor, for data queue described in preliminary treatment;
Service adapter, for sort out two different connections of described pair of net identical services port and when the network segment Network Abnormal assisted network switch.
The embodiment of the present invention also provides a kind of flexible bus, and described flexible bus comprises 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, realized the unitized of communication mode, be easy to safeguard.
Accompanying drawing explanation
Fig. 1 is the logical construction schematic diagram of the communicator of the cross-platform flexible bus that provides of the embodiment of the present invention;
Fig. 2 is the thread classification schematic diagram of communication thread unit of the communicator of the cross-platform flexible bus that provides of the embodiment of the present invention;
Fig. 3 is the schematic diagram of thread pool container of the communicator of the cross-platform flexible bus that provides of the embodiment of the present invention;
Fig. 4 be the cross-platform flexible bus that provides of the embodiment of the present invention communicator thread be connected processor and adapter is related to schematic diagram;
Fig. 5 is the application deployment schematic diagram of the flexible bus that provides of the embodiment of the present invention.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
The embodiment that the embodiment of the present invention provides is as follows:
Refer to Fig. 1 to Fig. 4, the embodiment of the present invention provides a kind of communicator of cross-platform flexible bus, and described device comprises:
Communication thread unit 101, for safeguarding two different connections of two net identical services ports;
Thread pool container 102, for the Manage Containers as described communication thread unit;
Data queue's buffer unit 103, the data queue receiving for buffer memory and the data queue of transmission;
Connect processor 104, for data queue described in preliminary treatment;
Service adapter 105, for sort out two different connections of described pair of net identical services port and when the network segment Network Abnormal assisted network switch.
In the present embodiment, in communication thread unit 101, communication thread is divided into two large classes, three groups, i.e. 2 large classes of TCP thread and UDP thread, TCP service role, TCP client role and 3 groups of UDP thread.Each thread is responsible for safeguarding two different connections (TCP thread) of two net identical services ports.
In the present embodiment, thread pool container 102, as the Manage Containers of all kinds communication thread, or claims thread management person.Thread pool container 102 is responsible for communication thread as management roles such as TCP thread and UDP thread create, destroy, inquire about, dispatch, reuse, recovery.Thread pool container 102 be also flexible bus with the interactive interface of other software modules, with flexible bus, the interface by thread pool container 102 opening carries out other modules.Thread pool container 102, divides work thread pool and two thread pools of buffer memory thread pool by thread pool; Worker thread pond is the thread container of ongoing communication work, and buffer memory thread pool is standby thread container; When having new connection to set up, the its respective thread in described buffer memory thread pool is dispatched in described worker thread pond, when having the disconnection of connection, discharges its respective thread in described worker thread, and the thread of release is recovered as to buffer memory thread, be dispatched in described buffer memory thread pool.
In the present embodiment, data queue's buffer unit 103, as each, connect pending data buffer storage pond, for buffer memory, receive data queue and send data queue, data queue's buffer unit 103 sends buffering and receives buffering similar with TCP, by buffer memory, received data queue and sent data queue, can guarantee in data peak not can be because the deficiency of temporary transient data-handling capacity be on the impact of data communication or obliterated data.
In the present embodiment, connect processor 104, specifically for the data preliminary treatment that data queue is safeguarded, operated, the direct manager of data queue namely.
In the present embodiment, data are divided into two kinds of types of service, when same third party's system communication, adopt not with the data type of heading, adopt the data type with heading in built-in system.In built-in system, adopt the data type with heading to contribute to prevent the interference of invalid data to system, guarantee the legitimacy of connection, when having illegal connection, will be disconnected.
In the present embodiment, service adapter 105 is specially for supporting two Network Communications to arrange.
Described communication thread unit adopts ACE Overpassing Platform by Using technology.
In the present embodiment, described communication thread unit 101 comprises externally provides the XPCOM of interface assembly.
In the present embodiment, described device also comprises:
Heartbeat detection unit, for sending self-defined heartbeat message, when not receiving in the given time response message or normal communication data packet, re-establishes and connects or handover network.
In the present embodiment, the communicator of cross-platform flexible bus is specially the communicator of the cross-platform flexible bus under C/C++ language.
The communicator of the cross-platform flexible bus of the present embodiment, adopts ACE Overpassing Platform by Using technology.Utilize ACE Overpassing Platform by Using characteristic, more complicated for ACE mechanism, skilled grasp, the more difficult feature of use, adopt Object-oriented Technique to encapsulate it again, again reduces and use complexity.
The communicator of the cross-platform flexible bus of the present embodiment, adopts thread pool.ACE not only encapsulates Overpassing Platform by Using socket programming, also makes this concept of thread carry out on each platform abstract, makes the programming of multithreading can be very simple.Even also can move this multi-threaded code on the platform of not supporting thread.The management that socket is connected adopts thread pool mode supervisory communications thread units 101 with the communication port between other modules, there is the management of thread pool container 102, socket network service resource just can well be managed, and avoids causing due to error the phenomenon of the wasting of resources.
The communicator of the cross-platform flexible bus of the present embodiment, adopts the cross-platform component technology of XPCOM.XPCOM is a cross-platform component model, and its full name is Cross Platform Component Object Module.XPCOM has realized a framework (framework), and in this framework, it allows developer to break single holistic software project, and is decomposed into a plurality of less modularization fragments (pieces), and these fragments are also assembly (components).XPCOM assembly externally provides interface, for XPCOM interface, need to consider 2 factors:
(1), interface and programming according to contract (Contract) a: interface is reached contract between assembly and CLIENT PROGRAM.Do not have any compulsory measure and guarantee this contract of approval, but it can be fatal ignoring it.In the programming based on assembly, assembly guarantees that the interface that it provides is constant.The assembly of different editions all will provide same access method.This has just reached a kind of contract with using its CLIENT PROGRAM. and from this angle, the programming based on assembly is conventionally also referred to as programming according to contract.
(2) interface and encapsulation: abstract between assembly border is vital to the maintainability of software and reusability.
The communicator of the cross-platform flexible bus of the present embodiment, adopts Object-oriented Technique, utilizes OO three essential characteristics (encapsulation, succession, polymorphic) can make software realize object and the benefit of easy care, high-quality, high efficiency, easily expansion.The Object-oriented Technique simultaneously also all adopting due to ACE and XPCOM, is the condensate of an Object-oriented Technique so flexible bus employing Object-oriented Technique also can make flexible bus from general frame, and implementation structure is clear, the effect that code is clean and tidy.
The communicator of the cross-platform flexible bus of the present embodiment, supports two network technologies.Electric power software is monitoring software particularly, in order to guarantee communication reliability, conventionally adopts two planar network architectures.The two nets of flexible bus support just can guarantee that program module seamlessly switches to another network segment operation in the situation that of a network segment paralysis, lost data packets not, thereby assurance communication reliability.
The communicator of the cross-platform flexible bus of the present embodiment, utilizes heartbeat detection unit.Can judge whether TCP connects stable, in passage idle, sends self-defined heartbeat, the other side receives rear horse back reply heartbeat.If fail to receive the other side's heartbeat message or proper communication packet in official hour section, judge that this connection breaks, automatically re-establish and connect or switch the network segment.
The communicator of the cross-platform flexible bus of the present embodiment, adopts Double Data type-scheme.Data type, as internal system data, is with internal data heading (two nets are supported in internally communication); Another kind of data type, as same third party's communication data form (correspondence with foreign country is not supported two nets), is not with data message head, and this determines after connecting foundation.
The communicator of the cross-platform flexible bus of the present embodiment, can be applied to following scene: the communication middleware between each service module of automation system for the power network dispatching main station system; Communication middleware between each service module of electrical power distribution automatization system main station system; Communication middleware between each service module of electric substation automation system main station system; Communication middleware between each service module of concentrator station main station system; Communication middleware between each service module of other supervisory control systems.
The communicator of the cross-platform flexible bus of the present embodiment, can be used as dynamic base is deployed on server or PC together with systems soft ware, when systems soft ware need to carry out network service, to flexible bus request, create network and connect, to the thread management person's request scheduling thread in flexible bus and carry out corresponding connection and process.
The communicator of the cross-platform flexible bus that the present embodiment provides, adopt component technology, blocking technology and Object-oriented Technique, form with dynamic base offers developer and running environment, thereby realize to solve in electric power software unit development process for the cross-platform of communication function and reuse the object that requires problem.Cross Platform Technology guarantees that software can move under mixing platform environment.
The communicator of the cross-platform flexible bus that the present embodiment provides, user only need to use the interface that software externally provides just can carry out easily network programming, by work such as communication fault-tolerant processing, give flexible bus inter-process, guarantee can not reduce because communication reason causes robustness.
The embodiment of the present invention also provides a kind of flexible bus, and described flexible bus comprises above-mentioned device.
Fig. 5 has illustrated flexible bus that the present embodiment the provides deployed position in software architecture, flexible bus is deployed on server or PC together with systems soft ware as dynamic base, when systems soft ware need to carry out network service, to flexible bus request, create network and connect, to the thread management person's request scheduling thread in flexible bus and carry out corresponding connection and process.
The communicator of cross-platform flexible bus of the present invention and flexible bus, by communication thread unit, thread pool container, data queue's buffer unit, connection processor, service adapter, realized the unitized of communication mode, is easy to safeguard.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any modifications of doing within the spirit and principles in the present invention, be equal to and replace and improvement etc., within all should being included in protection scope of the present invention.

Claims (9)

1. a communicator for cross-platform flexible bus, is characterized in that, described device comprises:
Communication thread unit, for safeguarding two different connections of two net identical services ports;
Thread pool container, for the Manage Containers as described communication thread unit;
Data queue's buffer unit, the data queue receiving for buffer memory and the data queue of transmission;
Connect processor, for data queue described in preliminary treatment;
Service adapter, for sort out two different connections of described pair of net identical services port and when the network segment Network Abnormal assisted network switch.
2. device as claimed in claim 1, is characterized in that, described communication thread unit comprises TCP thread and UDP thread.
3. device as claimed in claim 2, is characterized in that, described thread pool container is for creating, destroy, inquire about, dispatch, reuse or reclaim described TCP thread and UDP thread.
4. device as claimed in claim 1, is characterized in that, described thread pool container comprises worker thread pond and buffer memory thread pool.
5. device as claimed in claim 4, it is characterized in that, when having new connection to set up, the its respective thread in described buffer memory thread pool is dispatched in described worker thread pond, when having the disconnection of connection, discharge its respective thread in described worker thread, and by the thread scheduling discharging in described buffer memory thread pool.
6. device as claimed in claim 1, is characterized in that, described communication thread unit adopts ACE Overpassing Platform by Using technology.
7. device as claimed in claim 6, is characterized in that, described communication thread unit comprises externally provides the XPCOM of interface assembly.
8. device as claimed in claim 1, is characterized in that, described device also comprises:
Heartbeat detection unit, for sending self-defined heartbeat message, when not receiving in the given time response message or normal communication data packet, re-establishes and connects or handover network.
9. a flexible bus, is characterized in that, described flexible bus comprises the device described in any one in claim 1 to 8.
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 true CN103701788A (en) 2014-04-02
CN103701788B 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)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106325991A (en) * 2016-08-19 2017-01-11 东软集团股份有限公司 Instruction scheduling method and device for process engine
CN110572436A (en) * 2019-08-12 2019-12-13 浙江讯盟科技有限公司 Multi-place cross-cluster server deployment method and system
CN111555800A (en) * 2020-05-15 2020-08-18 北京光润通科技发展有限公司 Gigabit dual-optical-port server adapter
CN116821944A (en) * 2023-08-31 2023-09-29 中电安世(成都)科技有限公司 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的微总线的设计与实现》", 《重庆科技学院学报(自然科学版)》 *
程德蓉: "《基于软总线的微总线研究及在远程教学平台的应用》", 《中国优秀硕士学位论文全文库》 *

Cited By (8)

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

Also Published As

Publication number Publication date
CN103701788B (en) 2017-09-26

Similar Documents

Publication Publication Date Title
CN101697536B (en) Method for transmitting mass data in real time by penetrating positive physical isolation device
CN102377814B (en) Remote assistance service method aiming at embedded operation system
CN103618741A (en) TCP long connection communication system and method
CN103701788A (en) Cross-platform flexible bus communication device and flexible bus
CN104243481A (en) Electricity consumption data acquisition and pre-processing method and system
CN102196039B (en) Cloud-computing-based multi-robot system and implementation method thereof
CN102946376B (en) Method for implementing asynchronous communication
CN102801961A (en) Multiprocess-based audio/video data processing method and system
CN103139018B (en) Network card status monitoring under a kind of modulation integral system and TCP communication method
CN102567273A (en) Miniature integrated core processor based on fiber channel (FC) network
CN108063824A (en) A kind of cloud service system and construction method
CN104038390B (en) A kind of linux server clusters based on netlink unify peripheral hardware action listener method
CN105516292A (en) Hot standby method of cloud platform of intelligent substation
CN107992370A (en) VxWorks platform multi-tasks Software framework implementation method
CN108123826B (en) Cross-region data interaction system and method
CN107040406A (en) A kind of end cloud cooperated computing system and its fault-tolerance approach
CN107249121A (en) A kind of video monitoring system based on cloud platform
CN105049419A (en) Mimicry-network step-by-step exchange routing system based on heterogeneous diversity
CN104111874A (en) High-concurrence high-reliability load balance software architecture design of virtual mainframe in cloud computing environment
CN108429812A (en) A kind of IP curings that traditional financial system micro services are implemented
CN102662784A (en) Method and equipment for repairing faults of built-in system
CN100538647C (en) The processing method for service stream of polycaryon processor and polycaryon processor
CN107992752B (en) Data processing method and device and computer equipment
CN201576280U (en) Intelligent platform management interface IPMI
CN103139199A (en) Method for achieving information interaction among sub systems through platform information bus mechanism

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.