CN101119392B - SOCKET united access method - Google Patents

SOCKET united access method Download PDF

Info

Publication number
CN101119392B
CN101119392B CN2007101308700A CN200710130870A CN101119392B CN 101119392 B CN101119392 B CN 101119392B CN 2007101308700 A CN2007101308700 A CN 2007101308700A CN 200710130870 A CN200710130870 A CN 200710130870A CN 101119392 B CN101119392 B CN 101119392B
Authority
CN
China
Prior art keywords
message
thread
socket
interface
business processing
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.)
Expired - Fee Related
Application number
CN2007101308700A
Other languages
Chinese (zh)
Other versions
CN101119392A (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.)
NANJING CITY LINKAGE SYSTEM INTEGRATION CO Ltd
Original Assignee
NANJING CITY LINKAGE SYSTEM INTEGRATION 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 NANJING CITY LINKAGE SYSTEM INTEGRATION CO Ltd filed Critical NANJING CITY LINKAGE SYSTEM INTEGRATION CO Ltd
Priority to CN2007101308700A priority Critical patent/CN101119392B/en
Publication of CN101119392A publication Critical patent/CN101119392A/en
Application granted granted Critical
Publication of CN101119392B publication Critical patent/CN101119392B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The present invention discloses a SOCKET unified accessing method which chooses and deploies working mode according to the operation needs. Wherei, the method includes the steps as follows: setting working mode by the deploying file; for the interface part of the communication: under the server mode, the IST or course is started moveably, once accessing the IST or course is started; judging the complete information report according to the deploying; under the client mode, the information is sent to the different connecting according to the needs of the operation disposal mould; start the operation disposal mould and supervise if the mould is normal, under the innormal circumstance, the operation disposal mould can be restarted; for the operation disposal interface. The client multi-thread or course parallel disposal operation provides the unified developing moulding board to different accessing agreement; when the backstage data base or server is blocked, for the long time waiting operation request from outside, present invention can pause the operation disposal and directly return the overtime; using the UNIXA area agreement between the two moulds of the SOCKET interface to make the communication between the courses.

Description

The unified method that inserts of SOCKET
Technical field
The present invention relates to the SOCKET basic function and carry out network programming, possibly have different interface protocols, and need between consideration process/thread scheduling, process/thread logical for different interfaces; TCP/IP SOCKET interface is because the interface exploitation workload that the miscellaneous problem of agreement causes is big, and the problem of fluctuation of service is unified access platform through the SOCKET that develops.
Background technology
Socket is also referred to as " socket " usually, is used to describe IP address and port, is the handle of a communication chain.Application program is perhaps replied network requests through " socket " to the network request of sending usually.Wireless BSS peripheral interface mainly uses two kinds of methods to realize: 1, TCP/IP SOCKET except that file interface; 2, adopt some software product to realize (such as BEA TUXEDO, WEBSERVICE etc.).
Method one is exactly that the SOCKET basic function that provides of employing system carries out network programming, possibly have different interface protocols for different interfaces, and need technical problems such as communication between consideration process/thread scheduling, process/thread, database manipulation.Method two has been realized the unification of technology and agreement basically, can think that these products are exactly a commercialization to method one.Disconnected with service for client, the software reuse property of being developed is stronger, generally need not go to consider between the communications protocol, process/thread scheduling, process/thread of bottom technical problems such as communication in the time of exploitation.
The method one that still has a lot of interfaces still to adopt at present, the agreement that this a part of interface mainly adopts have H2, SGIP, SMPP, MML, 8583 or the like, also have some the mutation agreements on a lot of these standard interface standards in front.Because interface protocol is miscellaneous, causing developing this class method often is just need write a program to a class interface, does not have unified access platform, and the development amount is big, the interface fluctuation of service.
Summary of the invention
The present invention seeks to: propose the unified method that inserts of SOCKET, because the interface exploitation workload that the miscellaneous problem of agreement causes is big, the problem of fluctuation of service is unified access platform through the SOCKET that develops to TCP/IP SOCKET interface.This platform has encapsulated SOCKET communication (comprising FTP), parallel, unified Business Processing template.This platform can use on all SOCKET interfaces.
The unified method that inserts of technical scheme of the present invention: SOCKET is selected and configuration SOCKET unifies the working method of access platform according to concrete business demand, and working method disposes realization through configuration file:
Communications protocol: the agreement of both sides' communication modes, an end are client (requesting party), and the other end is service end (answer party), and client is sent request, service end echo reply, the mode that communications protocol mode determination data is handled and the flow direction of data;
Link information: the appointed information that communication two party connects, IP address, port numbers, the connected mode of ICP/IP protocol definition;
Operational mode: the working method of specifying SOCKET to unify access platform is thread mode or process mode, and reasonable disposition Thread Count or process number, reaches and sufficiently and reasonably utilizes resource;
Message format: according to the organizational composition of interface definition standard appointment message, the appointment of critical field in the heading, location definition, length definition;
Data message: specify SOCKET unify the access platform backstage Service Processing Module access data sources relevant information (as, database linkage information, middleware link information);
Log management: specify SOCKET to unify the message logging of access platform and the recording mode and the memory location of business diary; The message logging of access platform and the recording mode of business diary and memory location;
At first TCP/IP SOCKET interface (SOCKET unifies access platform) separated into two parts: with the mutual interface section of communicating by letter of peripheral system; Interface section with the Business Processing of background data base transaction;
Interface section for communication: under the service end pattern, thread/process is dynamically to start, and the thread/process that just rises that inserts is arranged; According to configuration determination full message message; Under the client mode, send a message to different connections according to the requirement of Service Processing Module; Start Service Processing Module and monitor whether it normal, when Service Processing Module is abnormal, can it be restarted;
Interface section for Business Processing: client multithreading/process parallel processing is professional, for different interface protocols, unified development template is provided; When background data base/service stopped up, for the service request of the wait as long for of periphery, the processing of suspending operation was directly returned overtime; Adopt UNIX territory agreement to carry out Inter-Process Communication between two modules of SOCKET interface; Service end thread/process is that dynamically startup and the professional step of client multithreading/process parallel processing are:
1 with the mutual thread, 2 of Business Processing thread whether have message need to submit to, the 3rd, then submit message to the backstage Business Processing process, 4 send messages Business Processing process, 5 receive the message to peripheral system to be sent, 6 from professional treatment progress and receives that message, 7 messages put into the Business Processing process and receive buffer memory, 8 data and insert and deposit newspaper justice chained list, the taking-up of 9 data to peripheral system to be sent and whether have message to send to the backstage; Be to get into 10, do not get into 12,10 and read etc. from buffer memory and to send message, 11 and send messages.12 receive message, 13 from the periphery receives message, gets into 7.
Play the Business Processing thread, read and dispose the back: message chained list, the 25 taking-up data that 21 message sink threads and Business Processing thread, 22 message sinks, 23 reception deposit data, 24 deposits receive from peripheral system are carried out Business Processing, 26 message are sent
The reason that TCP/IP SOCKET interface is divided into two big modules is: 1, Business Processing need not go to consider network communication;
2, communication part is specialized in network service, does not have the complicated service logic, since simple, so stable and efficient.
For the interface section of communication, we design and mainly will consider with the lower part: access that 1, can multithreading/process and picking out.2, for service end, thread/process is dynamically to start, and has and inserts the thread/process that just rises, and saves resource.3, can be according to configuration determination full message message.4,, can send a message to different connections according to the requirement of Service Processing Module for client; Can do load balance process; Can judge whether peripheral connection is normal, can the informing business processing module suspend operation under the abnormal conditions.5, can start Service Processing Module and monitor whether it normal, when Service Processing Module is abnormal, can it be restarted.6, can do legitimacy to access judges.
For the interface section of Business Processing, we design main consideration the following aspects: 1, client's multithreading/process parallel processing is professional.2,, unified development template is provided for different interface protocols; 3, when background data base/service stops up, for the service request of the wait as long for of periphery, the processing of suspending operation is directly returned overtime.4,, can do load balance process for the service request that receives.
Adopt UNIX territory agreement to carry out Inter-Process Communication between two modules.
Beneficial effect: SOCKET unify access platform with respect to before interface routine at random, realized the templating of development mode, but also can free customized development pattern; Need not develop communication module; Generally need not consider parallel and thread/Inter-Process Communication technical problem; Stable, and whether the process that communication module can the monitoring business processing module is normal; Because the concurrent technique of the multithreading/process of employing, processing speed obviously improves;
System is before enforcement; Requirement investigation personnel or pre-marketing work personnel must be through thickly investigations and to the effective communication of opposite end side of week; Through detailed analysis, the perfect interface exploitation document of the final formation of rational agreement; In the practical implementation process of project, the enforcement personnel should accomplish following work:
First: the backstage Service Processing Module of unifying access platform according to concrete business demand exploitation SOCKET in the exploitation document.For different communications protocol, the working method of Service Processing Module is also different.As: for the opposite end is originating end (requesting party): groundwork is that the interface definition according to message is converted into tiny logical elements with message; Calling the correspondent service logic processing module handles; And result returned to the opposite end with the form of response message, thereby accomplish once mutual.For local terminal is originating end (requesting party): groundwork is to call the business logic processing module earlier to produce logical data, organizes logical data to form message then and mails to the opposite end.
Second: select and configuration SOCKET unifies the working method of access platform according to concrete business demand, working method mainly disposes realization through configuration file, mainly comprises the following aspects:
● communications protocol: the agreement of both sides' communication modes, an end are client (requesting party), and the other end is service end (answer party), and client is sent request, service end echo reply, the mode that communications protocol mode determination data is handled and the flow direction of data.
● link information: the appointed information that communication two party connects, the IP address of ICP/IP protocol definition, port numbers, connected mode (long connection, the short connection) etc.
● operational mode: the working method of specifying SOCKET to unify access platform is thread mode or process mode, and reasonable disposition Thread Count or process number, reaches and sufficiently and reasonably utilizes resource.
● message format: according to the organizational composition of interface definition standard appointment message, the appointment of critical field in the heading, location definition, length definition.
● data message: specify SOCKET unify the access platform backstage Service Processing Module access data sources relevant information (as, database linkage information, middleware link information) etc.
● log management: specify SOCKET to unify the message logging of access platform and the recording mode and the memory location of business diary.
The 3rd: the both sides of communication carry out the strictness test to system: after development and working method configuration were accomplished, communication two party must carry out strict test to whole system.Form and transmission to message packet are analyzed and are monitored, and to the legitimacy of data with accuracy detects and verification, the processing of service logic are judged and are verified.Can the assurance system work accurately.Can run well in the peak traffic phase for the assurance system simultaneously, must carry out high data volume, high concurrent, high fault-tolerant equal pressure test, guarantee that system can run well under high pressure.
Description of drawings
Fig. 1 is a flow chart of the present invention
Embodiment
SOCKET unifies access platform-deposit payment at bank interface:
● business scenario is described: certain mobile phone user is defaulting subscriber, and this user passes through to bank outlets and pays telephone expenses, and bank's prompting telephone expenses are paid success, the user mobile phone start.
● data flow: bank is transferred to mobile operator with information such as phone number, the amount of money of paying the fees through socket; Operator socket interface carries out analysis and judgement to message after receiving request message; Calling pays the fees writes off, the machine module of stopping is accomplished to user's the processing of paying the fees and with result and returned to bank, tells the subscriber payment success after bank receives and replys.
● system development: exploitation SOCKET unifies the backstage collection charges processing module of access platform, and calling pays the fees writes off, stops the machine processing module.
● configuration management: the IP that the socket of configuration bank interface monitors, port numbers, bank is a client, and local terminal is a service end, and according to the thread work mode, connected mode connects for long, and maximum concurrent number is set to 10 etc.
● system testing: test with bank, analyze the correctness of bank interface request and response message, the machine processing is write off, stopped to paying the fees of user verify.
● pressure test: and data volume between the bank, concurrency, unusual etc. pressure test.
● online implementing: after the whole errorless completion of above-mentioned work, can carry out the formal on-line running of system.
Software flow pattern shown in Figure 1:
1, start-up routine.
2 if the service end pattern, and watcher thread has then walked abreast.
3 if the service end pattern, and the other side initiates to connect, and the connection thread then walk abreast.
4 if client mode, has then walked abreast to connect thread.
5, connect thread and be responsible for receiving the chained list that data are put into peripheral system reception message, be responsible for from deposit the message chained list that is sent to peripheral system, reading message and send to peripheral system from the periphery.
6, walked abreast and the thread of backstage Business Processing process interaction; This thread is responsible for the message in the chained list of depositing the message that peripheral system receives is submitted to backstage Business Processing process, and the message deposit of being responsible for backstage Business Processing thread is sent is to the message chained list that is sent to peripheral system.
7, the backstage Business Processing process that walked abreast.
8, backstage Business Processing process a plurality of Business Processing threads that walked abreast, the message sink thread has walked abreast.

Claims (1)

1.SOCKET the unified method that inserts is selected and configuration SOCKET unifies the working method of access platform according to concrete business demand, working method disposes realization through configuration file:
Communications protocol: the agreement of both sides' communication modes, an end are client, and the other end is a service end, and client is sent request, service end echo reply, the mode that communications protocol mode determination data is handled and the flow direction of data;
Link information: the appointed information that communication two party connects, IP address, port numbers, the connected mode of ICP/IP protocol definition;
Operational mode: the working method of specifying SOCKET to unify access platform is thread mode or process mode, and reasonable disposition Thread Count or process number, reaches and sufficiently and reasonably utilizes resource;
Message format: according to the organizational composition of interface definition standard appointment message, the appointment of critical field in the heading, location definition, length definition; Data message: specify SOCKET to unify the relevant information of access data sources of the Service Processing Module on access platform backstage; Log management: specify SOCKET to unify the message logging of access platform and the recording mode and the memory location of business diary;
It is characterized in that SOCKET unifies access platform and is used for the deposit payment at bank interface: comprise the business scenario description; Data flow: bank is transferred to mobile operator with phone number, the amount information of paying the fees through socket; Move and after operator socket interface is received request message message is carried out analysis and judgement; Calling pays the fees writes off, the machine module of stopping is accomplished to user's the processing of paying the fees and with result and returned to bank, tells the subscriber payment success after bank receives and replys; Configuration management: the IP that the socket of configuration bank interface monitors, port numbers, bank is a client, and local terminal is a service end, and according to the thread work mode, connected mode connects for long, and maximum concurrent number is set to 10; System testing: test with bank, analyze the correctness of bank interface request and response message, the machine processing is write off, stopped to paying the fees of user verify; Pressure test: and data volume between the bank, concurrency, unusual pressure test;
At first SOCKET interface separated into two parts: with the mutual interface section of communicating by letter of peripheral system; Interface section with the Business Processing of background data base transaction;
Interface section for communication: under the service end pattern, thread/process is dynamically to start, and has access just to start thread/process; According to configuration determination full message message; Under the client mode, send a message to different connections according to the requirement of Service Processing Module; Start Service Processing Module and monitor whether it normal, when Service Processing Module is abnormal, can it be restarted;
Interface section for Business Processing: client multithreading/process parallel processing is professional, for different interface protocols, unified development template is provided; When background data base/service stopped up, for the service request of the wait as long for of periphery, the processing of suspending operation was directly returned overtime; Adopt UNIX territory agreement to carry out Inter-Process Communication between the client of SOCKET interface, two modules of service end; Service end thread/process dynamically starting with the professional step of client multithreading/process parallel processing is: 1) initiate and the mutual thread, 2 of Business Processing thread) whether have message need to submit to, 3) be then submit message to the backstage Business Processing process, 4) send message to the backstage Business Processing process, 5) from the professional treatment progress reception message to peripheral system to be sent, 6) receive message, 7) message puts into Business Processing process reception buffer memory, 8) the data insertion; Deposit the message chained list, 9 to peripheral system to be sent) the data taking-up; Whether there is message to send; Be to get into 10); Do not get into 12), 10) read from buffer memory and to send message, 11) send message, 12) receive message, 13 from peripheral system) receive get into 7 by message);
Initiate the Business Processing thread, read the configuration back: 21) message sink thread and Business Processing thread starting, 22) message sink, 23) receive deposit data, 24) the deposit data receive message chained list, 25 from peripheral system) take out data and carry out Business Processing, 26) the message transmission;
SOCKET unifies the course of work of access platform:
Start-up routine;
If the service end pattern, then parallel starting watcher thread; The other side initiates to connect, and then parallel starting connects thread;
If client mode, then parallel starting connects thread; Connect thread and be responsible for receiving the chained list that data are put into peripheral system reception message, be responsible for from deposit the message chained list that is sent to peripheral system, reading message and send to peripheral system from the periphery; The thread of parallel starting and backstage Business Processing process interaction; This thread is responsible for the message in the chained list of depositing the message that peripheral system receives is submitted to backstage Business Processing process, and the message deposit of being responsible for backstage Business Processing thread is sent is to the message chained list that is sent to peripheral system;
Parallel starting backstage Business Processing process; The a plurality of Business Processing threads of the parallel starting of backstage Business Processing process, parallel starting message sink thread.
CN2007101308700A 2007-08-21 2007-08-21 SOCKET united access method Expired - Fee Related CN101119392B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2007101308700A CN101119392B (en) 2007-08-21 2007-08-21 SOCKET united access method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2007101308700A CN101119392B (en) 2007-08-21 2007-08-21 SOCKET united access method

Publications (2)

Publication Number Publication Date
CN101119392A CN101119392A (en) 2008-02-06
CN101119392B true CN101119392B (en) 2012-04-25

Family

ID=39055323

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2007101308700A Expired - Fee Related CN101119392B (en) 2007-08-21 2007-08-21 SOCKET united access method

Country Status (1)

Country Link
CN (1) CN101119392B (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101814077B (en) * 2009-12-04 2012-04-11 四川川大智胜软件股份有限公司 OCI 9-based database access middleware
CN101823858B (en) * 2010-04-21 2012-01-18 中南大学 Self-compacting concrete
CN102509251A (en) * 2011-09-27 2012-06-20 宇龙计算机通信科技(深圳)有限公司 Data statistics method and device
CN102413133B (en) * 2011-11-17 2014-07-02 曙光信息产业(北京)有限公司 Client server transmission method with controllable time
CN103746861A (en) * 2013-10-29 2014-04-23 汉柏科技有限公司 Service inter-status mutual detection method
CN104965932A (en) * 2015-07-31 2015-10-07 山东蚁巡网络科技有限公司 Method for performing real-time pushing on logs in log centralization management platform
CN105262718B (en) * 2015-09-01 2018-11-09 许继电气股份有限公司 A kind of more stipulations cut-in methods of plant stand based on pipeline and agency
WO2017166099A1 (en) * 2016-03-30 2017-10-05 李昕光 Server front positioning method
WO2017166096A1 (en) * 2016-03-30 2017-10-05 李昕光 Server front positioning method
CN106027315B (en) * 2016-07-12 2019-09-27 中国银联股份有限公司 Data processing system accesses emulation mode
CN107465551A (en) * 2017-08-24 2017-12-12 深圳互联先锋科技有限公司 port detecting method and device
CN109768970B (en) * 2018-12-24 2021-05-04 通号通信信息集团有限公司 Configurable universal protocol generation method
CN111447120B (en) * 2020-03-30 2021-08-20 中国建设银行股份有限公司 Pressure testing method and system based on Tuxedo
CN112242923A (en) * 2020-09-15 2021-01-19 中国人民解放军战略支援部队信息工程大学 System and method for realizing unified data management network function based on mimicry defense
CN112702403B (en) * 2020-12-17 2023-04-07 深圳市新国都通信技术有限公司 Intelligent service connection method based on re-networking and communication module
CN113076131A (en) * 2021-04-07 2021-07-06 山东爱拓软件开发有限公司 Embedded software system construction method and system based on multi-process architecture idea
CN114301891B (en) * 2021-12-27 2023-10-13 北京睿芯高通量科技有限公司 Python-based Web service and Socket client interaction method and system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1787438A (en) * 2005-11-30 2006-06-14 浙江大学 Electronic business network system and intelligent information terminal thereof
CN1835607A (en) * 2006-04-25 2006-09-20 沈阳昂立信息技术有限公司 Short message two-staged netgate based on PC server and service environment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1787438A (en) * 2005-11-30 2006-06-14 浙江大学 Electronic business network system and intelligent information terminal thereof
CN1835607A (en) * 2006-04-25 2006-09-20 沈阳昂立信息技术有限公司 Short message two-staged netgate based on PC server and service environment

Also Published As

Publication number Publication date
CN101119392A (en) 2008-02-06

Similar Documents

Publication Publication Date Title
CN101119392B (en) SOCKET united access method
CN109933522B (en) Test method, test system and storage medium for automatic case
CN102158370B (en) Automated testing method and system
US8756126B2 (en) Billing device and processing method
CN109889551A (en) A kind of method of the Internet of Things cloud platform of Intelligent hardware access
CN101227343B (en) Method and device for testing TCPv6 and UDPv6
CN109785042A (en) Abnormality eliminating method, server, storage medium and the device of distributed deployment
CN111324599B (en) Block chain experiment system and management method
CN110213092A (en) Resource access method, platform management equipment, storage medium and the device of mixed cloud
CN108536484A (en) Parameter amending method, device, terminal device and storage medium
CN102752770B (en) Method and device for polling service system
CN106407061A (en) Northbound interface testing device and northbound interface testing method
CN108763052A (en) A kind of method for testing performance and system of virtual reality software memory reclaim mechanism
Gomaa et al. Reusable component interconnection patterns for distributed software architectures
CN111447273A (en) Cloud processing system and data processing method based on cloud processing system
CN103036911A (en) Business data processing system and business data processing method
CN113810379B (en) Exception handling method and multi-service system
CN115499432A (en) Family terminal computing resource management system and computing resource scheduling method
CN109118153A (en) Pre-process the method and device of work order request
CN112328439A (en) Stability test method and system for hardware equipment
CN115543491A (en) Microservice processing method and device
CN112124131A (en) Unified access management method and system for charging piles based on multiple communication protocols
JP3613511B2 (en) Mobile terminal device
CN1543138B (en) Automatic processing system for broadband ADSL service
KR100629018B1 (en) The legacy interface system and operating method for enterprise wireless application service

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20120425

Termination date: 20210821

CF01 Termination of patent right due to non-payment of annual fee