CN105099645A - Multi-user concurrent communication method and device based on half-duplex communication device - Google Patents

Multi-user concurrent communication method and device based on half-duplex communication device Download PDF

Info

Publication number
CN105099645A
CN105099645A CN201410182537.4A CN201410182537A CN105099645A CN 105099645 A CN105099645 A CN 105099645A CN 201410182537 A CN201410182537 A CN 201410182537A CN 105099645 A CN105099645 A CN 105099645A
Authority
CN
China
Prior art keywords
message
module
client
data
duplex apparatus
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.)
Pending
Application number
CN201410182537.4A
Other languages
Chinese (zh)
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.)
Transcend Communication Inc
Original Assignee
Transcend Communication Inc
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 Transcend Communication Inc filed Critical Transcend Communication Inc
Priority to CN201410182537.4A priority Critical patent/CN105099645A/en
Publication of CN105099645A publication Critical patent/CN105099645A/en
Pending legal-status Critical Current

Links

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The present invention relates to a multi-user concurrent communication method and device based on a half-duplex communication device. The method comprises a message server and a message client, a user process starts the message client to send out a request message to a half-duplex device to the message server, and the message server is responsible for collecting the message requests of different users and hitching the request messages of the users in the message linked lists. When unprocessed message requests exist in the message linked lists, the message server is responsible for carrying out the half-duplex device communication, and sending to the message client after receiving the response data of the half-duplex device. The message linked lists in the message server are in one-to-one correspondence with the request messages of the client, and the messages in the message linked lists correspond to the client request messages of the different users. According to the present invention, the access efficiency of multiple users to the half-duplex device can be improved, and a priority mechanism is provided for differ clients to access the half-duplex device.

Description

The method and apparatus that a kind of multi-user concurrent based on half-duplex communication device communicates
Technical field
The present invention relates to the Computer Applied Technology of Field of Office Automation, particularly relate to a kind of method that multi-user concurrent based on half-duplex communication device communicates.
Background technology
Half-duplex operation is usually used in industrial bus, this system has sole user usually, traffic rate is lower, the feature that data throughput is low, in present system, due to the complexity day by day of demand, the complexity of communication and throughput is caused to rise, but the hardware that communication system adopts still adopts original semiduplex communication mode, the half-duplex operation mode of this RS485 is just have employed in the control system of the rack transceiver of our company's development, because this system communication controlling functions is comparatively complicated, half-duplex operation is carried out mutual comparatively frequent between functional module, and hardware communications is based on semiduplex characteristic, the same time processes a half-duplex request only, under the service condition of the high-frequency half-duplex apparatus bus access of the many application of many subcards, the bus marco of half-duplex apparatus request can be caused disorderly, or data delay, cause transceiver subcard plate and the unmatched result of software data.
Summary of the invention
According to the defect existed in prior art, now provide the method and system that a kind of multi-user concurrent based on half-duplex communication device communicates, to realize the access of multi-user to half-duplex apparatus, improve the utilization rate of half-duplex apparatus.
The communication means of the multi-user access half-duplex apparatus that the embodiment of the present invention provides, comprises the following steps:
A kind of message server.Be applicable to many application processes and Multi-Client Concurrency Access half-duplex apparatus in system, this server, be the ISP of half-duplex bus, it comprises message collection module, message managing module, half-duplex apparatus access control module, message transmitting module, half-duplex apparatus communication module, message back module;
Described message collection module, receives the request msg of client access half-duplex apparatus, for collecting the request msg of client by interprocess communication means;
Described message managing module, after successfully receiving client access half-duplex apparatus request message in message collection module, different according to the request msg grade of client, to waiting for the message data entering half-duplex apparatus communication module, sort.After receiving request message by message collection module, this module in charge hands over to request message in message chained list according to message level;
Described half-duplex apparatus access control module, for choosing the message of highest ranking from message chained list, waiting for and being sent to half-duplex apparatus, and adjusting message number in message chained list;
Described half-duplex apparatus communication module, by first request msg of the highest level message data that message access modules is taken out, be sent to half-duplex apparatus end, and the response data that wait-receiving mode half-duplex apparatus is replied, comprising error handling mechanism, timeout mechanism;
Described message back module, for the response data returned by half-duplex apparatus, is back to the actual generation client of these data, when half-duplex apparatus does not return valid data in overtime duration, will inform this client with a time-out information.
A kind of information client side.This information client side is half-duplex bus data requester, and it is integrated in the various application programs of multi-user, described information client side at least one comprise message coding module, message transmission module, message reception module, source codec module.
Described message coding module, before client needs to initiate half-duplex apparatus communication, for the request msg by communication, adopt half-duplex apparatus communication protocol to carry out data encoding process, comprise type of message in coding, data type, data length, message-length, message addresses, type of message, priority, checking data, requestor's unique identification, only has the data through correct coding process just can enter message transmission module;
Described message transmission module, for client modules by successfully coding after effective half-duplex apparatus visit data, be sent to message server end;
Described message reception module, for client process after successfully sending request msg, enter the response data that this module wait-receiving mode server end is replied, when message server end process this client request msg and after sending response data, this module is that client process receives response data message, the data that user obtains by oneself according to return data type, after successfully receiving correct data, need obtain final real data through decoding;
Described source codec module, resolves for the reception data obtained for client process, after client process successfully gets correct data from messenger service end, obtains final real data after being resolved by this module.
The invention has the beneficial effects as follows, improve the response speed of access half-duplex apparatus, and ensure that at the concurrent message reliability applied when initiating half-duplex apparatus request of height more, efficiently solve the packet loss phenomenon that Multi-Client Concurrency Access half-duplex apparatus causes, the half-duplex apparatus resource making one to rush on like a swarm of hornets seizes access mode, becomes orderly.
Accompanying drawing explanation
Fig. 1 is half-duplex apparatus concurrent services system entire flow schematic diagram of the present invention.
Fig. 2 is the schematic diagram of the present invention for high-priority users request.
Fig. 3 is message encoding format figure described in the invention.
Embodiment
Below in conjunction with accompanying drawing, the present invention one example is described in further detail:
With reference to accompanying drawing 1, this figure is the communication flow diagram of the present invention one example.Communicating pair adopts server, client form;
Step 1 message server starts, as the service routine on backstage in the mode of single example finger daemon;
The message queue that step 2 initialization communicates in order to implementation process, creates message chained list for managing request message;
Step 3 initialization is in order to control the thread lock of multi-thread concurrent processing logic.This thread lock is for avoiding main thread and the sub-thread accessing operation message chained list simultaneously receiving request message.Wherein, main thread gets request message from message chained list, and request message, after receiving the request message of information client side, joins in message chained list by the sub-thread receiving request message;
Step 4 creates and receives sub-thread;
Step 5 enters message collection module, waits the request message of client to be subjected, keeps mourning in silence wait when asking without client;
Step 6 is when client asks to arrive, and the request message that receipt message client is sent, and solicited message being joined in message chained list, turns back to step 5.Wherein solicited message adds the particular location of buffer memory chain, determines according to the user identity of message level and information client side.Please refer to accompanying drawing 2, this figure is that when having several untreated solicited messages such as client A, B, N in message chained list, the solicited message of high-priority users C is placed in the stem of message chained list, makes it preferentially carry out the access of half-duplex apparatus;
The number of requests of step 7 main thread poll check message chained list, when the number of requests of message chained list is less than 1, represent now without request msg, main thread preserves wait state of mourning in silence; When the number of requests of message chained list is greater than 0, indicate that solicited message arrives, main thread enters half-duplex access modules;
Step 9 enters half-duplex access control module, takes out the solicited message of highest priority user, message chained list number is subtracted 1 from the head of message chained list;
Step 9 enters half-duplex apparatus communication module, by the request msg that half-duplex apparatus access modules is taken out, is sent to half-duplex apparatus end, and the response data that wait-receiving mode half-duplex apparatus is replied;
Step 10 enters information-reply module, by the corresponding data that half-duplex apparatus is replied, is sent to the receiver module of information client side.And get back to step 7, wait for or process next solicited message;
Described message collection module, as the branch process thread of message server, utilizes interprocess communication means to receive the request msg of client process access half-duplex apparatus, for collecting the request msg of client; When not having request msg, this module keeps sleep state, waits for customer request message;
Described message managing module, after successfully receiving client access half-duplex apparatus request message in message collection module, different according to the request msg priority of client, to waiting for the message data entering half-duplex apparatus communication module, sort.After receiving request message by message collection module, this module in charge hands over to request message in message chained list according to message level, please refer to accompanying drawing 2, the diagram illustrate when half-duplex apparatus is busy, and in message chained list during existing request message, the handling process of message managing module when other request of high priority arrives;
Described half-duplex apparatus access control module, for choosing the message of highest ranking from message chained list, waiting for and being sent to half-duplex apparatus, and subtracting an operation to message number in message chained list;
Described half-duplex apparatus communication module, by the request msg that half-duplex apparatus access modules is taken out, be sent to half-duplex apparatus end, and the response data that wait-receiving mode half-duplex apparatus is replied, comprising error handling mechanism, timeout mechanism, overtime duration is 500 milliseconds, Retransmission timeout is 3 times, if three equal time-out or all return misdata, then regulation obtains frame errored response data, and client processes voluntarily according to the error message received;
Described message back module, utilizes message queue communication mechanism, half-duplex apparatus response data is replied to the client of this request message;
Described message coding module, before client needs to initiate half-duplex apparatus communication, for the request msg by communication, adopt half-duplex apparatus communication protocol to carry out data encoding process, in coding, comprise type of message, data type, data length, message-length, message addresses, type of message, priority, checking data, requestor's unique identification, only have the data through correct coding process just can enter message transmission module, as shown in Figure 3;
Described message reception module, for client process after successfully sending request msg, enter the response data that this module wait-receiving mode server end is replied, when message server end process this client request msg and after sending response data, this module is that client process receives response data message, the data that user obtains by oneself according to return data type, after successfully receiving correct data, need obtain final real data through decoding;
Described source codec module, resolves for the reception data obtained for client process, after client process successfully gets correct data from messenger service end, obtains the response data of final half-duplex apparatus reality by this module after being resolved.
The invention has the beneficial effects as follows, improve the response speed of access half-duplex apparatus, and ensure that at the concurrent message reliability applied when initiating half-duplex apparatus request of height more, efficiently solve the packet loss phenomenon that Multi-Client Concurrency Access half-duplex apparatus causes, the half-duplex apparatus resource making one to rush on like a swarm of hornets seizes access mode, becomes orderly.

Claims (16)

1. based on a multi-user concurrent communication means for half-duplex communication device, comprising: message server and information client side; Described message server is used for the request msg of receipt message client, send request data to half-duplex communication device, and receiving the response data of half-duplex apparatus, it comprises message collection module, message managing module, half-duplex apparatus access control module, half-duplex apparatus communication module, message back module; Described information client side is used for sending request data to message server, and the response data of half-duplex apparatus that receipt message server returns, it comprises at least one and comprises message coding module, message transmission module, message reception module, source codec module.
2. communication means according to claim 1, is characterized in that, described message collection module, is received the request msg of client-access half-duplex apparatus, for collecting the request msg of client by interprocess communication means.
3. communication means according to claim 1, it is characterized in that, described message managing module, after messaging server module successfully receives client-access half-duplex apparatus request msg, different according to the request msg grade of client, to waiting for the message data entering half-duplex apparatus communication module, carry out caching process.
4. communication means according to claim 1, it is characterized in that, described half-duplex apparatus access control module, for choosing the message of override level in never processing messages set, when half-duplex apparatus is idle, with the very first time, this message is forwarded to half-duplex apparatus by forwarding module, carries out half-duplex apparatus access.
5. half-duplex apparatus communication module according to claim 1, by first request msg of the highest level message data that message access modules is taken out, be sent to half-duplex apparatus end, and the response data that wait-receiving mode half-duplex apparatus is replied, comprising error handling mechanism, timeout mechanism.
6. message back module according to claim 1, for the response data returned by half-duplex apparatus, is sent to the actual request client of these data, when half-duplex apparatus does not return valid data in overtime duration, will informs this client with a time-out information.
7. communication means according to claim 1, it is characterized in that, described message coding module, before client needs to initiate half-duplex apparatus communication, for the request msg by communication, half-duplex apparatus communication protocol is adopted to carry out data encoding process, type of message is comprised in coding, data type, data length, message-length, message addresses, type of message, priority, checking data, requestor's unique identification, only has the data through correct coding process just can enter message transmission module.
8. communication means according to claim 1, is characterized in that, described message transmission module, for the effective half-duplex apparatus visit data after successfully being encoded by client modules, is sent to message server end.
9. communication means according to claim 1, it is characterized in that, described message reception module, after client process successfully sends request msg, enter the response data that this module wait-receiving mode server end is replied, when message server end process this client request msg and after sending response data, this module is that client process receives response data message, the data that user obtains by oneself according to return data type, after successfully receiving correct data, final real data need be obtained through decoding.
10. communication means according to claim 1, it is characterized in that described source codec module is resolved for the reception data obtained for client process, after client process successfully gets correct data from messenger service end, after being resolved by this module, obtain final real data.
11. communication meanss according to claim 1, it is characterized in that, described message collection module, it is characterized in that described message server inside adopts message queue mechanism, and at internal maintenance message chained list, can jump the queue according to message grade, realize the rear to first service strategy of high priority.
12. communication meanss according to claim 11, it is characterized in that, described message chained list, when multi-client process initiates half-duplex apparatus access simultaneously, buffer memory is carried out to the request message not obtaining device access power, and carry out in message buffering process by message ranking compositor, for solving due to half-duplex apparatus hardware characteristics packet loss phenomenon, because the half-duplex apparatus same time only allows response one request, when high-frequency device request, because the device responds cycle is longer, the now request of client can not obtain response in time, there is packet loss phenomenon.
13. communication meanss as claimed in claim 3, it is characterized in that, described half-duplex apparatus access control module, for controlling the concurrent operations of multi-user to message chained list, make multi-user to the different operation of message chained list become in order and synchronous, monitor client's number of requests, pending message number constantly, be convenient to investigate mistake, and when not having client-requested half-duplex apparatus to serve, messenger service end is proceeded to sleep state voluntarily, abdicate CPU, greatly reduce CPU usage, improve overall system performance.
14. communication meanss as claimed in claim 4, is characterized in that, described half-duplex apparatus communication module has retransmitting message mechanism and timeout mechanism, substantially increase communication correctness, reliability.
15. communication meanss as claimed in claim 13, it is characterized in that, described retransmitting message mechanism, when message server is responsible for half-duplex apparatus communication, half-duplex apparatus due to the initial phase after restarting or some electrical principle fault, when failing to reply complete, correct information, the repeatedly trial mechanism of carrying out, according to actual tests, retransmission mechanism be 3 times the most suitable.
16. communication meanss as claimed in claim 13, it is characterized in that, described message timeout mechanism, when message server is responsible for half-duplex apparatus communication, half-duplex apparatus is due to the initial phase after restarting or some electrical principle fault, specified waiting time when failing to reply message, waiting time is not having influence under the prerequisite processing next request message, ensures the response message receiving half-duplex apparatus to greatest extent.
CN201410182537.4A 2014-05-04 2014-05-04 Multi-user concurrent communication method and device based on half-duplex communication device Pending CN105099645A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410182537.4A CN105099645A (en) 2014-05-04 2014-05-04 Multi-user concurrent communication method and device based on half-duplex communication device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410182537.4A CN105099645A (en) 2014-05-04 2014-05-04 Multi-user concurrent communication method and device based on half-duplex communication device

Publications (1)

Publication Number Publication Date
CN105099645A true CN105099645A (en) 2015-11-25

Family

ID=54579294

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410182537.4A Pending CN105099645A (en) 2014-05-04 2014-05-04 Multi-user concurrent communication method and device based on half-duplex communication device

Country Status (1)

Country Link
CN (1) CN105099645A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106060928A (en) * 2016-04-20 2016-10-26 上海斐讯数据通信技术有限公司 Thin AP (Access Point) event notification message processing method and thin AP device
CN110598054A (en) * 2019-08-19 2019-12-20 桂林长海发展有限责任公司 Multithreading linked list processing method and device and computer readable storage medium
WO2022183982A1 (en) * 2021-03-03 2022-09-09 维沃移动通信有限公司 Call establishment method and apparatus, and electronic device and readable storage medium
CN115396258A (en) * 2022-09-05 2022-11-25 山东中康国创先进印染技术研究院有限公司 Adaptive polling software processing method, device and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101316395A (en) * 2007-06-01 2008-12-03 华为技术有限公司 Method and device for scheduling call right in conversation
CN101502012A (en) * 2005-11-04 2009-08-05 思科技术公司 Method and system for providing a push-to-talk communication session
CN101645906A (en) * 2009-09-03 2010-02-10 兰州大学 Realization method and system of computer network security communication
US7848314B2 (en) * 2006-05-10 2010-12-07 Nuance Communications, Inc. VOIP barge-in support for half-duplex DSR client on a full-duplex network
CN102379132A (en) * 2009-04-06 2012-03-14 高通股份有限公司 High-priority communication sessions within a wireless communications system
CN102907122A (en) * 2010-03-22 2013-01-30 高通股份有限公司 High-priority communication sessions within a wireless communications system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101502012A (en) * 2005-11-04 2009-08-05 思科技术公司 Method and system for providing a push-to-talk communication session
US7848314B2 (en) * 2006-05-10 2010-12-07 Nuance Communications, Inc. VOIP barge-in support for half-duplex DSR client on a full-duplex network
CN101316395A (en) * 2007-06-01 2008-12-03 华为技术有限公司 Method and device for scheduling call right in conversation
CN102379132A (en) * 2009-04-06 2012-03-14 高通股份有限公司 High-priority communication sessions within a wireless communications system
CN101645906A (en) * 2009-09-03 2010-02-10 兰州大学 Realization method and system of computer network security communication
CN102907122A (en) * 2010-03-22 2013-01-30 高通股份有限公司 High-priority communication sessions within a wireless communications system

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106060928A (en) * 2016-04-20 2016-10-26 上海斐讯数据通信技术有限公司 Thin AP (Access Point) event notification message processing method and thin AP device
CN110598054A (en) * 2019-08-19 2019-12-20 桂林长海发展有限责任公司 Multithreading linked list processing method and device and computer readable storage medium
CN110598054B (en) * 2019-08-19 2021-11-23 桂林长海发展有限责任公司 Multithreading linked list processing method and device and computer readable storage medium
WO2022183982A1 (en) * 2021-03-03 2022-09-09 维沃移动通信有限公司 Call establishment method and apparatus, and electronic device and readable storage medium
CN115396258A (en) * 2022-09-05 2022-11-25 山东中康国创先进印染技术研究院有限公司 Adaptive polling software processing method, device and storage medium
CN115396258B (en) * 2022-09-05 2024-03-26 山东中康国创先进印染技术研究院有限公司 Self-adaptive polling software processing method, device and storage medium

Similar Documents

Publication Publication Date Title
CN111580995B (en) Synchronous communication method and system of distributed cloud platform and Internet of things intelligent terminal based on MQTT asynchronous communication scene
CN107093138B (en) Auction Ask-Bid System and its operation method based on distributed clog-free asynchronous message tupe
CN104158699B (en) A kind of collecting method based on priority and segmentation
CN102394880B (en) Method and device for processing jump response in content delivery network
US9774651B2 (en) Method and apparatus for rapid data distribution
CN105099645A (en) Multi-user concurrent communication method and device based on half-duplex communication device
CN103957169A (en) Reliable UDP achievement method based on reserve request
Huang et al. ARS: Cross-layer adaptive request scheduling to mitigate TCP incast in data center networks
WO2017128789A1 (en) Communication method and system
CN104735077A (en) Method for realizing efficient user datagram protocol (UDP) concurrence through loop buffers and loop queue
WO2017185615A1 (en) Method for determining service status of service processing device and scheduling device
CN104113599B (en) A kind of caching method, device and proxy server
US20060200828A1 (en) Network element management system and method
CN101902398B (en) Method and system for receiving and transmitting data packet
US11736567B2 (en) Data transmission and network interface controller
CN101207617A (en) Method for data transmission of network storing system
CN112261142B (en) RDMA network data retransmission method, device and FPGA
CN102761608B (en) The method of UDP session multiplexing and load balancing equipment
US8332498B2 (en) Synchronized relay messaging and coordinated network processing using SNMP
CN113596105B (en) Content acquisition method, edge node and computer readable storage medium
CN111526137B (en) Network accelerator compatible with server and client modes and data processing method
CN114153781A (en) SSP connection management method and device
CN111240867B (en) Information communication system and method
CN110809020B (en) High-reliability data transmission method based on redundant network asynchronous communication
CN112286668A (en) Method and system for efficiently processing request data

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20151125