CN109413101A - A kind of information transferring method between client and server-side - Google Patents

A kind of information transferring method between client and server-side Download PDF

Info

Publication number
CN109413101A
CN109413101A CN201811499164.8A CN201811499164A CN109413101A CN 109413101 A CN109413101 A CN 109413101A CN 201811499164 A CN201811499164 A CN 201811499164A CN 109413101 A CN109413101 A CN 109413101A
Authority
CN
China
Prior art keywords
server
client
msmq
tcp
message
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
CN201811499164.8A
Other languages
Chinese (zh)
Other versions
CN109413101B (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.)
NINGBO BOTAIKE INTELLIGENT TECHNOLOGY CO LTD
Original Assignee
NINGBO BOTAIKE INTELLIGENT 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 NINGBO BOTAIKE INTELLIGENT TECHNOLOGY CO LTD filed Critical NINGBO BOTAIKE INTELLIGENT TECHNOLOGY CO LTD
Priority to CN201811499164.8A priority Critical patent/CN109413101B/en
Publication of CN109413101A publication Critical patent/CN109413101A/en
Application granted granted Critical
Publication of CN109413101B publication Critical patent/CN109413101B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Abstract

The present invention relates to technical field of information processing, disclose the information transferring method between a kind of client and server-side, including step S1: the request message of asynchronous process to be carried out is transferred to corresponding server-side by general purpose routine by client, server-side returns to response message to client by general purpose routine, step S2: the request message of asynchronous process to be carried out is transferred to corresponding server-side by spare module by client, server-side returns to response message to client by spare module, client can be realized first by general purpose routine and be transmitted with the signal of server-side, when general purpose routine breaks down, there can be spare module to continue to transmit, guarantee information processing it is reliable with it is efficient.

Description

A kind of information transferring method between client and server-side
Technical field
The present invention relates to technical field of information processing, more specifically, it relates between a kind of client and server-side Information transferring method.
Background technique
Big amount of access, high concurrent large-scale website in, the consumption of the thread of Web server is very serious, thread money Ten code insurance of source is expensive, how to improve thread utilization rate, improves the key point that the responding ability requested is often web site performance optimization.But The operation of some high concurrents, high time-consuming, low real-time is had in systems and usually, and the result of these operations is for website user For do not need to timely feedback, but if webpage wait these simultaneously operatings return, to thread occupy and respond have Serious influence reduces the handling capacity of service.
Therefore asynchronous process generally is carried out using the operation of Microsoft Message queue (MSMQ) to height consumption now, by using Another process that message queue can be routed to message to be processed on the machine or other machine is handled, this Mode provides better resource expansion.It is handled, can be reduced to local resource by the way that message is routed to other machine Consumption, while asynchronous provided by message queue and offline mechanism can preferably improve the responding ability of main program.
However, when carrying out asynchronous information transmission by interconnected network between different machines, it can be due to being responsible for The network of transmission generates the interruption of information transmission because of the failure surprisingly generated therewith, not can guarantee information after resuming normal biography Defeated, reliability and efficiency to work generate strong influence.
Summary of the invention
In view of the above-mentioned problems, the purpose of the present invention is to provide the information transmission sides between a kind of client and server-side Method has the advantages that highly reliable, high-efficient.
Foregoing invention purpose of the invention has the technical scheme that
A kind of information transferring method between client and server-side, includes the following steps:
S1: the request message of asynchronous process to be carried out is transferred to corresponding server-side, the clothes by general purpose routine by client Business end returns to response message to the client by the general purpose routine;
S2: the request message of asynchronous process to be carried out is transferred to corresponding server-side, the clothes by spare module by client Business end returns to response message to the client by the spare module.
It is transmitted through the above technical solutions, client can be realized by general purpose routine first with the signal of server-side, when logical Broken down with path, can there is spare module to continue to transmit, guarantee information processing it is reliable with it is efficient.
The present invention is further arranged to: the step S1 is specifically included:
S11: the client request message is written in the server-side MSMQ;
S12: the processing module of the server-side is answered by described in after reading the request message stored in the server-side MSMQ Message is answered to be written in the server-side MSMQ;
S13: the client MSMQ reads the response message.
Through the above technical solutions, asynchronous transmission processing is carried out by operation of the message queue to height consumption, it can be more preferable The main solicited message of processing and corresponding response message, the responding ability of main program can be promoted.
The present invention is further arranged to: the step S2 is specifically included:
S21: the spare module initialization;
S22: the request message is written in the server-side MSMQ by the spare module for the client;
S23: the processing module of the server-side is answered by described in after reading the request message stored in the server-side MSMQ Message is answered to be written in the server-side MSMQ;
S24: the client MSMQ reads the response message by the spare module.
Through the above technical solutions, if Transmission in S1 and can not continue to complete, enable spare module and carry out letter Breath continues to transmit, and realizes the information exchange of client and server-side.
The present invention is further arranged to: the spare module is TCP service module, including being arranged in the client TCP Client and the TCP server-side being arranged in the server-side, the step S21 are specifically included:
S211: the TCP server-side opens TCP port and the transmitting terminal of TCP Client establishes connection, waits number of request to be received According to.
Through the above technical solutions, windows system itself has TCP service and possesses corresponding TCP port, TCP sheet Body is a kind of transmission control protocol, has corresponding data transport service, easy to use, stability is strong.
The present invention is further arranged to: the step S22 is specifically included:
S221: the solicited message is translated into the request data that the TCP server-side can identify by the client, and It is received and is sent by the TCP Client;
S222: the request data is translated into the server-side MSMQ energy after the TCP server-side reception request data The request message enough identified is written in the server-side MSMQ.
Through the above technical solutions, communication can be realized at the solicited message write service end of client.
The present invention is further arranged to: the step S24 is specifically included:
S241: the processing module of the server-side is translated after reading the response message stored in the server-side MSMQ The reply data that can be identified at the TCP server-side;
S242: the TCP Client is transcribed into the institute that the client MSMQ can be identified after reading the reply data Response message is stated, and the response message is stored in the client MSMQ.
Through the above technical solutions, client can be written the response message of server-side, reversed communication or feedback are realized.
The present invention is further arranged to: the write operation application Windows communication infrastructure of message queue in the step S11 WCF is handled.
Compared with prior art, the beneficial effects of the present invention are:
By the way that two communication lines are arranged, more processing times are provided to main operational objective in a manner of asynchronous transmission information And space, the unnecessary wasting of resources is reduced, and wherein after a communication line interrupt, it can be by another communication line not The transmission for continuing data in the case where original function is influenced, it is practical and convenient reliable.
Detailed description of the invention
Fig. 1 is the flow diagram of embodiment in the present invention;
Fig. 2 is the flow diagram of embodiment in the present invention.
Specific embodiment
With reference to the accompanying drawings and examples, the present invention will be described in detail.
A kind of information transferring method between client and server-side, thinking are to provide two kinds of reliable data transmission ways Diameter, realizes the efficient communication transmission of information between two information transmit-receive components, such as realizes that MS client (is grasped based on Windows Make the Maneger System client of system) and CC server-side (Control Center, control centre) efficient communication, such as Shown in Fig. 1, include the following steps:
The request message of asynchronous process to be carried out is transferred to corresponding server-side by general purpose routine by step S1, client, clothes Business end returns to response message to client by general purpose routine.If server-side can not by request message transmission to server-side, into Enter step S2.
Step S2: the request message of asynchronous process to be carried out is transferred to corresponding service by spare module by client End, server-side return to response message to client by spare module.Continue to guarantee client and server-side by spare module High efficiency communication, it is simple and reliable.
Above-mentioned steps S1 is specifically included:
Step S11: client is by Windows operating system, and the address of service provided according to server-side, request message road By to after server-side, request message write service end MSMQ(MicroSoft Message Queue, Microsoft Message queue) in It is stored, enters back into step S12.
Step S12: the request message that the processing module of server-side can be called and be stored in the MSMQ of reading service end, it can be with Generate immediately can also postpone generate response message after in the MSMQ of write service end, avoid unnecessary information processing from occupying whole The time is handled, the responding ability of communication efficiency and main program is promoted.
Step S13: client MSMQ reads response message.Above-mentioned and next MSMQ(Microsoft Message queue) Write-in and extraction can pass through WCF (Windows Communication Foundation, Windows the communication base using Microsoft Plinth) technology is uniformly processed.
Spare module includes the TCP Client being arranged in client and the TCP server-side that is arranged in server-side, when upper The general purpose routine stated breaks down, and can pass through a kind of transmission control protocol of TCP() service module as spare module after resuming It is defeated, TCP service is itself had using windows system and possesses the advantage of corresponding TCP port, in conjunction with the asynchronous transmission of MSMQ Function guarantees that the other end that can be transmitted from one end of data, stability are stronger.
Step S2 is specifically included:
Connection is established with the transmitting terminal of TCP Client after the port initialization of step S21:TCP server-side, waits number of request to be received According to.
Step S22: client by spare module by request message write service end MSMQ, because of the client of TCP It can not identify the solicited message directly from client MSMQ, need to enter step S221.
Step S221: solicited message is translated into the request data that TCP server-side can identify by client, and by TCP visitor Family end receives and sends, which changes into Json format after being packaged into object (TtansferTCP) by client, due to adopting Data are stored and indicated with the text formatting for being totally independent of programming language, and hierarchical structure is succinctly and clear, so that Json As ideal data interchange language, it is easy to people and reads and write, while being also easy to machine parsing and generating, can be effectively promoted Data transmission efficiency.S222 is entered step while sending request data to TCP server-side.
After step S222:TCP server-side receives request data, request data is now translated into MQ data, write service end In MSMQ.When server-side needs to call request message in server-side MSMQ, S23 is entered step.
Step S23: it after the request message stored in the processing module reading service end MSMQ of server-side, generates response and disappears Breath, then by response message write service end MSMQ, and make it into state to be sent.It carries out sending the response if necessary, Enter step S24.
Step S24: client MSMQ reads response message by spare module.In this process, likewise, passing through It needs first to be packaged translation when TCP is to client transmissions response message, enters step S241.
Step S241: the response message stored in the processing module reading service end MSMQ of server-side will dress up object (TtansferTCP) S242 is entered step after changing into the reply data of Json format after.
Step S242:TCP client converts thereof into MQ data after reading reply data again, and reconvert is at client MSMQ It can identify received MQ data, send and be stored in client MSMQ, the extraction of client is waited to use.
The above is only a preferred embodiment of the present invention, protection scope of the present invention is not limited merely to above-mentioned implementation Example, all technical solutions belonged under thinking of the present invention all belong to the scope of protection of the present invention.It should be pointed out that for the art Those of ordinary skill for, several improvements and modifications without departing from the principles of the present invention, these improvements and modifications It should be regarded as protection scope of the present invention.

Claims (7)

1. the information transferring method between a kind of client and server-side, which comprises the steps of:
S1: the request message of asynchronous process to be carried out is transferred to corresponding server-side, the clothes by general purpose routine by client Business end returns to response message to the client by the general purpose routine;
S2: the request message of asynchronous process to be carried out is transferred to corresponding server-side, the clothes by spare module by client Business end returns to response message to the client by the spare module.
2. the information transferring method between client according to claim 1 and server-side, which is characterized in that the step S1 is specifically included:
S11: the client request message is written in the server-side MSMQ;
S12: the processing module of the server-side is answered by described in after reading the request message stored in the server-side MSMQ Message is answered to be written in the server-side MSMQ;
S13: the client MSMQ reads the response message.
3. the information transferring method between client according to claim 2 and server-side, which is characterized in that the step S2 is specifically included:
S21: the spare module initialization;
S22: the request message is written in the server-side MSMQ by the spare module for the client;
S23: the processing module of the server-side is answered by described in after reading the request message stored in the server-side MSMQ Message is answered to be written in the server-side MSMQ;
S24: the client MSMQ reads the response message by the spare module.
4. the information transferring method between client according to claim 3 and server-side, which is characterized in that described spare Module is TCP service module, including the TCP Client being arranged in the client and the TCP being arranged in the server-side Server-side, the step S21 are specifically included:
S211: the TCP server-side opens TCP port and the transmitting terminal of TCP Client establishes connection, waits number of request to be received According to.
5. the information transferring method between client according to claim 4 and server-side, which is characterized in that the step S22 is specifically included:
S221: the solicited message is translated into the request data that the TCP server-side can identify by the client, and It is received and is sent by the TCP Client;
S222: the request data is translated into the server-side MSMQ energy after the TCP server-side reception request data The request message enough identified is written in the server-side MSMQ.
6. the information transferring method between client according to claim 5 and server-side, which is characterized in that the step S24 is specifically included:
S241: the processing module of the server-side is translated after reading the response message stored in the server-side MSMQ The reply data that can be identified at the TCP server-side;
S242: the TCP Client is transcribed into the institute that the client MSMQ can be identified after reading the reply data Response message is stated, and the response message is stored in the client MSMQ.
7. the information transferring method between client according to claim 2 and server-side, which is characterized in that the step The write operation application Windows communication infrastructure WCF of message queue is handled in S11.
CN201811499164.8A 2018-12-08 2018-12-08 Information transmission method between client and server Active CN109413101B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811499164.8A CN109413101B (en) 2018-12-08 2018-12-08 Information transmission method between client and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811499164.8A CN109413101B (en) 2018-12-08 2018-12-08 Information transmission method between client and server

Publications (2)

Publication Number Publication Date
CN109413101A true CN109413101A (en) 2019-03-01
CN109413101B CN109413101B (en) 2021-08-31

Family

ID=65457958

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811499164.8A Active CN109413101B (en) 2018-12-08 2018-12-08 Information transmission method between client and server

Country Status (1)

Country Link
CN (1) CN109413101B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111009060A (en) * 2019-12-18 2020-04-14 宁波博太科智能科技股份有限公司 Method and system for area real-time control of entrance guard

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7047411B1 (en) * 1999-12-17 2006-05-16 Microsoft Corporation Server for an electronic distribution system and method of operating same
CN1801736A (en) * 2005-01-01 2006-07-12 华为技术有限公司 Abatement managing system and abatement managing method for asynchronous shift mode
CN101110776A (en) * 2007-07-05 2008-01-23 华为技术有限公司 Backup method, backup device and backup system for data business
CN101193023A (en) * 2006-11-20 2008-06-04 中兴通讯股份有限公司 Method for establishing backup path of video transmission in wireless Ad hoc network
CN101252461A (en) * 2008-04-11 2008-08-27 华为技术有限公司 Signaling transmission protecting method, apparatus, terminal and system
CN101378334A (en) * 2008-09-25 2009-03-04 卡斯柯信号有限公司 Communication method base on dual-network redundant universal network model
CN101964763A (en) * 2010-09-30 2011-02-02 北京神州泰岳软件股份有限公司 Message handling method
CN105391711A (en) * 2015-11-05 2016-03-09 山东超越数控电子有限公司 Business platform and tipc-protocol-based communication method
CN106572013A (en) * 2016-11-09 2017-04-19 蔡日基 Single-connection multi-router backup TCP (transmission control protocol) network system

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7047411B1 (en) * 1999-12-17 2006-05-16 Microsoft Corporation Server for an electronic distribution system and method of operating same
CN1801736A (en) * 2005-01-01 2006-07-12 华为技术有限公司 Abatement managing system and abatement managing method for asynchronous shift mode
CN101193023A (en) * 2006-11-20 2008-06-04 中兴通讯股份有限公司 Method for establishing backup path of video transmission in wireless Ad hoc network
CN101110776A (en) * 2007-07-05 2008-01-23 华为技术有限公司 Backup method, backup device and backup system for data business
CN101252461A (en) * 2008-04-11 2008-08-27 华为技术有限公司 Signaling transmission protecting method, apparatus, terminal and system
CN101378334A (en) * 2008-09-25 2009-03-04 卡斯柯信号有限公司 Communication method base on dual-network redundant universal network model
CN101964763A (en) * 2010-09-30 2011-02-02 北京神州泰岳软件股份有限公司 Message handling method
CN105391711A (en) * 2015-11-05 2016-03-09 山东超越数控电子有限公司 Business platform and tipc-protocol-based communication method
CN106572013A (en) * 2016-11-09 2017-04-19 蔡日基 Single-connection multi-router backup TCP (transmission control protocol) network system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111009060A (en) * 2019-12-18 2020-04-14 宁波博太科智能科技股份有限公司 Method and system for area real-time control of entrance guard
CN111009060B (en) * 2019-12-18 2022-04-15 宁波博太科智能科技股份有限公司 Method and system for area real-time control of entrance guard

Also Published As

Publication number Publication date
CN109413101B (en) 2021-08-31

Similar Documents

Publication Publication Date Title
US9250984B2 (en) Message history display system and method
WO2023284699A1 (en) Protocol stack data transmission method based on linux system, and computer device and storage medium
CN101964763B (en) Message handling method
US10693816B2 (en) Communication methods and systems, electronic devices, and computer clusters
CN1987925A (en) Complex front platform of financial system and transfering method transaction data
CN108063813B (en) Method and system for parallelizing password service network in cluster environment
CN101945013A (en) System and method for implementing server configuration management
CN102810069A (en) JAVA object requesting and responding methods, devices and systems and terminal
CN107741884B (en) Method and device for realizing message pushing by hierarchical state machine
CN103514173A (en) Data processing method and node equipment
CN115794313B (en) Virtual machine debugging method, system, electronic device and storage medium
CN103024058A (en) Method and system for invoking web services
CN114124881B (en) Message pushing method based on priority and related device
CN115454361A (en) Network point remote printing method, device, equipment and storage medium
CN101605301B (en) Cluster system for multi-node transaction processing and a request message distributing method
CN109413101A (en) A kind of information transferring method between client and server-side
CN102843435A (en) Access and response method and access and response system of storing medium in cluster system
WO2021179841A1 (en) Microservice invoking method and apparatus, device and medium
CN101582057B (en) Method, device and system for controlling communication and transmission of human interface device
CN102054213A (en) Information integration method, device and system
US6625753B1 (en) Recovery facility for an SNA communication network
CN111756844A (en) Multi-language message agent method and device
CN107395765B (en) Distributed file system, network communication method, platform and creation method thereof
CN103391257A (en) Message storing and forwarding method, device and system
CN108234595B (en) Log transmission method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 315301 No. 148 Mingzhou West Road, Cixi City, Ningbo City, Zhejiang Province

Applicant after: Ningbo Botaike Intelligent Technology Co., Ltd.

Address before: 315301 No. 148 Mingzhou West Road, Cixi City, Ningbo City, Zhejiang Province

Applicant before: Ningbo Botaike Intelligent Technology Co.,Ltd.

CB02 Change of applicant information
CB02 Change of applicant information

Address after: 315300 south of 5th floor, building C, 2588 Sanbei street, Baisha street, Cixi City, Ningbo City, Zhejiang Province

Applicant after: Ningbo Botaike Intelligent Technology Co.,Ltd.

Address before: 315301 No. 148 Mingzhou West Road, Cixi City, Ningbo City, Zhejiang Province

Applicant before: Ningbo Botaike Intelligent Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant