CN101296130A - System and method for multi-process sharing port receiving network message - Google Patents

System and method for multi-process sharing port receiving network message Download PDF

Info

Publication number
CN101296130A
CN101296130A CNA2008101139285A CN200810113928A CN101296130A CN 101296130 A CN101296130 A CN 101296130A CN A2008101139285 A CNA2008101139285 A CN A2008101139285A CN 200810113928 A CN200810113928 A CN 200810113928A CN 101296130 A CN101296130 A CN 101296130A
Authority
CN
China
Prior art keywords
network
message queue
notice
network notice
consumer
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
CNA2008101139285A
Other languages
Chinese (zh)
Other versions
CN101296130B (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.)
Beijing Itsync Technology Co Ltd
Original Assignee
Beijing Itsync 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 Beijing Itsync Technology Co Ltd filed Critical Beijing Itsync Technology Co Ltd
Priority to CN2008101139285A priority Critical patent/CN101296130B/en
Publication of CN101296130A publication Critical patent/CN101296130A/en
Application granted granted Critical
Publication of CN101296130B publication Critical patent/CN101296130B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The invention discloses a system for realizing the receiving of network notification for a multi-process shared port, which comprises a sending end and a receiving end. The system is characterized in that: the receiving end comprises the shared port, a listening process, a message queue and a plurality of user processes; the shared port, under the control of the listening process, receives network notifications from the network; the listening process stores the network notifications received from the network in the message queue; all the user processes are connected with the message queue to copy the network notifications in the message queue. By the system and the method thereof provided by the invention, different processes of the same computer share the same network port to receive network notifications, thus not needing to arrange an independent receiving port for every process, reducing resource waste caused by repeated transmission of the same network notification.

Description

A kind of multi-process shared port of realizing receives the system and the method thereof of network notice
Technical field
The present invention relates to system and method thereof that a kind of computer processes receives the network notice, particularly a kind of different processes in same computer belong to the computer network communication technology field by the communication system and the means of communication of shared network port reception network notification message.
Background technology
In a network application system, all need a plurality of work stations or the work of network application module cooperative to finish certain affairs usually.After a module is finished a certain work, to send the module of message usually to other, operating state is notified to other module.If application module then needs to transmit these notification messages by network not on same computer.In most of the cases, everybody is based on ICP/IP protocol, designs and realize the communication of these notification messages.
In ICP/IP protocol, certain application program is often only carried out network communication by certain particular network port, promptly the all-network packet that receives of this network port all will go to pairing application program by operating system and handle, and other application programs can't be used this network port simultaneously.
Yet in some network applications, the multiple utility program process that can occur moving simultaneously on same the computer need receive the situation of same notification message.As previously mentioned, after the network port that next process of normal conditions is opened, other program can't be used this port, thereby just produce the situation of network port conflict.For network port conflict is avoided in solution, as shown in Figure 1, common solution is to distribute a network port respectively for each process, sends data to each port respectively by transmit leg.Obviously, may need to take a large amount of network bandwidths and computer network port, be easy to cause the waste of Internet resources and resource for computer system by this means of communication consolidated network notice.
Summary of the invention
Goal of the invention of the present invention is to solve the problems of the prior art, provide a kind of different processes in the same computer have been shared system and the method thereof that the consolidated network port receives the network notification message, thereby do not need for each process is provided with independently receiving port, reduced the consolidated network notice and repeated to transmit the wasting of resources that causes.
Goal of the invention of the present invention is achieved by following technical proposals:
A kind of multi-process shared port of realizing receives the system of network notice, comprises transmitting terminal and receiving terminal, and feature just is: described receiving terminal comprises shared port, monitor process, message queue and some consumer process; Described shared port receives the network notice of sending from network under the control of monitor process; Described monitor process is kept at the network notice that is received in the described message queue; Described each consumer process links to each other with this message queue, the network notice in the copy message formation.
Described message queue is a round-robin queue.
A kind of multi-process shared port of realizing receives the method for network notice, realizes based on the communication system of described claim 1, it is characterized in that:
1) when starting a consumer process, at first detects receiving terminal and whether have available monitor process;
2) if available monitor process is arranged, then this consumer process interrelates with the corresponding message queue of this monitor process; If there is not available monitor process, then starts monitor process as required automatically, and set up corresponding message queue;
3) monitor process is opened the shared port of appointment, notifies by the network that the ICP/IP protocol receiving end/sending end sends;
4) monitor process is stored in the network notice that shared port receives in the described message queue;
5) consumer process constantly carries out poll to message queue, to obtain new network notice and to handle;
6) when all consumer process withdrawed from, monitor process was closed automatically.
Described step 3,4 comprises following concrete steps:
31) monitor process is opened the shared port of appointment;
32) monitor process checks whether this shared port receives network notification message bag;
33) if receive network notification message bag, then this message bag is stamped the time, be stored in then in the message queue; If do not receive network notification message bag, then execution in step 34;
34) whether the monitor process inspection still has consumer process in operation, if all consumer process all withdraw from, then quits a program; Otherwise execution in step 32.
Described step 5 comprises following concrete steps:
51) the message sink thread between consumer process startup and the message queue;
52) the message sink thread searches from message queue whether the network notice that does not receive is arranged by poll;
53) if find the network notice that does not receive, then consumer process duplicates this network notice and carry out step 54; If do not find the network notice that does not receive, return step 52;
54) consumer process checks whether institute's duplicate network notice is the network notice that originally sends to this consumer process, if then carry out corresponding operating and return step 52; If not then abandoning this network notice and returning step 52;
55) when consumer process finishes, finish receiving thread.
The invention has the beneficial effects as follows: the present invention shares system and the method thereof that the consolidated network port receives the network notification message by providing a kind of to the different processes in the same computer, thereby do not need for each process is provided with independently receiving port, reduced the consolidated network notice and repeated to transmit the wasting of resources that causes.
Description of drawings
Fig. 1 is the network port distribution structure schematic diagram of prior art to the receiving terminal multi-process;
Fig. 2 receives the structural representation of network reporting system for the multi-process shared port;
Fig. 3 receives the method flow diagram of network notice for the multi-process shared port;
Fig. 4 is a first embodiment of the invention system configuration schematic diagram.
Embodiment
Below in conjunction with drawings and Examples the present invention is further described.
The present invention is directed to exist in the aforementioned prior art consolidated network is notified and repeat to send, take the problem of a large amount of network bandwidths and system resource.Receiving terminal in the communication system has been done certain improvement, the unified shared port of course allocation that often needs on the same computer to receive the identical network notice has been received the network notice, to alleviate the pressure that brings because of resource multiplex.
As shown in Figure 2, the system of multi-process shared port reception network notice of the present invention comprises transmitting terminal and receiving terminal.Because transmitting terminal and prior art and indistinction just no longer are described in detail at this.Comprise the shared port of an appointment, a monitor process, a message queue and some program process in this receiving terminal.This shared port receives from network and is sent to local network notice under the control of monitor process.After shared port receives the network notice, this network notice is kept in the message queue by monitor process.Each program process links to each other with this message queue, and message queue is carried out poll, when the network notice that did not receive is arranged in finding formation, is about to this network notice and duplicates.Each process is unpacked the network notice of being duplicated, and whether identification is the notice that sends to this process, if not then this network notice being abandoned, if then carry out corresponding operating.Described message queue is a round-robin queue.
Below for adopting above-mentioned multi-process shared port to receive the concrete means of communication of the system of network notice.As shown in Figure 3, its concrete communication step is as follows:
1) when starting a consumer process, at first detects receiving terminal and whether have available monitor process;
2) if available monitor process is arranged, then this consumer process interrelates with the corresponding message queue of this monitor process; If there is not available monitor process, then starts monitor process as required automatically, and set up corresponding message queue;
3) monitor process is opened the shared port of appointment, notifies by the network that the ICP/IP protocol receiving end/sending end sends;
4) monitor process is stored in the network notice that shared port receives in the described message queue;
5) consumer process constantly carries out poll to message queue, to obtain new network notice and to handle;
6) when all consumer process withdrawed from, monitor process was closed automatically.
As seen, by the above-mentioned means of communication, receiving terminal receives the network notice by unified network interface, and each different consumer process is by duplicating the corresponding network notice from message queue, realizes receiving message.This greatly reduces the consolidated network notice and repeats to transmit the wasting of resources that causes, and has improved communication efficiency.
In the above-mentioned means of communication, the method for the reception message of step 3,4 monitor process control shared port can specifically comprise the steps:
31) monitor process is opened the shared port of appointment;
32) monitor process checks whether this shared port receives network notification message bag;
33) if receive network notification message bag, then this message bag is stamped the time, be stored in then in the message queue; If do not receive network notification message bag, then execution in step 34;
34) whether the monitor process inspection still has consumer process in operation, if all consumer process all withdraw from, then quits a program; Otherwise execution in step 32.
In the above-mentioned means of communication, the method that the consumer process of step 5 is handled the network notice can specifically comprise the steps:
51) the message sink thread between consumer process startup and the message queue;
52) the message sink thread searches from message queue whether the network notice that does not receive is arranged by poll;
53) if find the network notice that does not receive, then consumer process duplicates this network notice and carry out step 54; If do not find the network notice that does not receive, return step 52;
54) consumer process checks whether institute's duplicate network notice is the network notice that originally sends to this consumer process, if then carry out corresponding operating and return step 52; If not then abandoning this network notice and returning step 52;
55) when consumer process finishes, finish receiving thread.
This communication system is particularly suitable for and need carries out the frequent communication field that upgrades synchronously, for example medium information management system to a plurality of modules.Fig. 4 has promptly provided a kind of like this medium information management system.Its transmitting terminal is pressed the program catalogue and is sent media information, receiving terminal needs the module of corresponding renewal to comprise automatic transcoding module, material filing module, program release module and other program catalogue module, and these modules all need to upgrade according to the media information that transmitting terminal sends.Adopt communication system of the present invention can reduce greatly, improved the efficient of communication because of repeating to send the shared network bandwidth of described media information.

Claims (5)

1, a kind of multi-process shared port of realizing receives the system of network notice, comprises transmitting terminal and receiving terminal, and feature just is: described receiving terminal comprises shared port, monitor process, message queue and some consumer process; Described shared port receives the network notice of sending from network under the control of monitor process; Described monitor process is kept at the network notice that is received in the described message queue; Described each consumer process links to each other with this message queue, the network notice in the copy message formation.
2, communication system as claimed in claim 1 is characterized in that: described message queue is a round-robin queue.
3, a kind of multi-process shared port of realizing receives the method for network notice, realizes based on the communication system of described claim 1, it is characterized in that:
1) when starting a consumer process, at first detects receiving terminal and whether have available monitor process;
2) if available monitor process is arranged, then this consumer process interrelates with the corresponding message queue of this monitor process; If there is not available monitor process, then starts monitor process as required automatically, and set up corresponding message queue;
3) monitor process is opened the shared port of appointment, notifies by the network that the ICP/IP protocol receiving end/sending end sends;
4) monitor process is stored in the network notice that shared port receives in the described message queue;
5) consumer process constantly carries out poll to message queue, to obtain new network notice and to handle;
6) when all consumer process withdrawed from, monitor process was closed automatically.
4, the means of communication as claimed in claim 3 is characterized in that: described step 3,4 comprises following concrete steps:
31) monitor process is opened the shared port of appointment;
32) monitor process checks whether this shared port receives network notification message bag;
33) if receive network notification message bag, then this message bag is stamped the time, be stored in then in the message queue; If do not receive network notification message bag, then execution in step 34;
34) whether the monitor process inspection still has consumer process in operation, if all consumer process all withdraw from, then quits a program; Otherwise execution in step 32.
5, the means of communication as claimed in claim 3 is characterized in that: described step 5 comprises following concrete steps:
51) the message sink thread between consumer process startup and the message queue;
52) the message sink thread searches from message queue whether the network notice that does not receive is arranged by poll;
53) if find the network notice that does not receive, then consumer process duplicates this network notice and carry out step 54; If do not find the network notice that does not receive, return step 52;
54) consumer process checks whether institute's duplicate network notice is the network notice that originally sends to this consumer process, if then carry out corresponding operating and return step 52; If not then abandoning this network notice and returning step 52;
55) when consumer process finishes, finish receiving thread.
CN2008101139285A 2008-05-30 2008-05-30 System and method for multi-process sharing port receiving network message Expired - Fee Related CN101296130B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008101139285A CN101296130B (en) 2008-05-30 2008-05-30 System and method for multi-process sharing port receiving network message

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008101139285A CN101296130B (en) 2008-05-30 2008-05-30 System and method for multi-process sharing port receiving network message

Publications (2)

Publication Number Publication Date
CN101296130A true CN101296130A (en) 2008-10-29
CN101296130B CN101296130B (en) 2011-04-06

Family

ID=40066157

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008101139285A Expired - Fee Related CN101296130B (en) 2008-05-30 2008-05-30 System and method for multi-process sharing port receiving network message

Country Status (1)

Country Link
CN (1) CN101296130B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103297245A (en) * 2013-06-21 2013-09-11 苏州鼎富软件科技有限公司 Network server
WO2015070769A1 (en) * 2013-11-18 2015-05-21 Tencent Technology (Shenzhen) Company Limited Data transfer method and apparatus
CN104702534A (en) * 2015-03-30 2015-06-10 无锡天脉聚源传媒科技有限公司 Method and device for processing data of multi-process sharing port
CN106921751A (en) * 2017-04-07 2017-07-04 广东浪潮大数据研究有限公司 A kind of communication means and device being reliably connected
CN106936827A (en) * 2017-03-10 2017-07-07 广东欧珀移动通信有限公司 A kind of broadcast recipients' queue regulation method, device and terminal
CN107977267A (en) * 2016-10-25 2018-05-01 航天信息股份有限公司 For improving the method and apparatus of one process network program performance
CN111966476A (en) * 2020-08-16 2020-11-20 云知声智能科技股份有限公司 Multi-process evaluation method and device, terminal and computer storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE3850881T2 (en) * 1988-10-28 1995-03-09 Ibm Method and device for transmitting messages between source and target users through a shared memory.
CN100362803C (en) * 2004-10-15 2008-01-16 华中科技大学 Network safety warning system based on cluster and relavance
CN101188570B (en) * 2006-11-17 2011-05-04 鸿富锦精密工业(深圳)有限公司 Instant message processing system and method

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103297245A (en) * 2013-06-21 2013-09-11 苏州鼎富软件科技有限公司 Network server
WO2015070769A1 (en) * 2013-11-18 2015-05-21 Tencent Technology (Shenzhen) Company Limited Data transfer method and apparatus
CN104702534A (en) * 2015-03-30 2015-06-10 无锡天脉聚源传媒科技有限公司 Method and device for processing data of multi-process sharing port
CN104702534B (en) * 2015-03-30 2018-02-06 无锡天脉聚源传媒科技有限公司 A kind of method and device for the data processing for realizing multi-process shared port
CN107977267A (en) * 2016-10-25 2018-05-01 航天信息股份有限公司 For improving the method and apparatus of one process network program performance
CN106936827A (en) * 2017-03-10 2017-07-07 广东欧珀移动通信有限公司 A kind of broadcast recipients' queue regulation method, device and terminal
WO2018161588A1 (en) * 2017-03-10 2018-09-13 广东欧珀移动通信有限公司 Broadcast receiver queue adjustment method, apparatus, storage medium, and electronic device
US11160052B2 (en) 2017-03-10 2021-10-26 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Method for adjusting broadcast receiver queue, storage medium and electronic device
CN106921751A (en) * 2017-04-07 2017-07-04 广东浪潮大数据研究有限公司 A kind of communication means and device being reliably connected
CN111966476A (en) * 2020-08-16 2020-11-20 云知声智能科技股份有限公司 Multi-process evaluation method and device, terminal and computer storage medium

Also Published As

Publication number Publication date
CN101296130B (en) 2011-04-06

Similar Documents

Publication Publication Date Title
CN101296130B (en) System and method for multi-process sharing port receiving network message
CN103312528A (en) Heartbeat message sending method and user terminal
CN105472042A (en) WEB terminal controlled message middleware system and data transmission method thereof
US10230807B2 (en) Method and apparatus for energy-optimized data transmission using the OPC UA protocol in radio networks
CN102025616B (en) Method, device and switch for realizing BFD (Bidirectional Forwarding Detection)
CN104811459A (en) Processing method, processing device and system for message services and message service system
CN101883108B (en) Document transmission method and system of dynamic authentication
CN106302536B (en) The method and apparatus communicated between all-in-one machine multisystem based on interchanger
CN105450779B (en) The method of one household appliance connection multiserver
CN102664947B (en) Notice distribution method in distributed system
CN103997539A (en) Radar operation state collecting and distributing system and method based on web service
CN101369987B (en) Method and apparatus for establishing communication channel
CN104092666A (en) File transmission method and device
CN104486443A (en) Message pushing system and method
CN101267435A (en) An implementation method for address parsing protocol
CN102238505B (en) Method and system for processing multi-user parallel signalling tracking at client
CN114900558B (en) Universal equipment management protocol control method and device
CN101834880B (en) System and method for realizing service of converging address books
CN109936603B (en) Non-direct connection network communication method based on HTTP
CN101150443A (en) Processing method for telecommunication network management message
CN103428028A (en) Service quality maintenance method and system for heterogeneous network
CN100589642C (en) Method for reducing information load of packet service control channel
CN105516097A (en) Mixed-architecture message system and message transmission method based on Thrift data format
CN101453445B (en) Response method and apparatus for terminal service condition change indication
CN101170817A (en) Method for reducing information load of packet service control channel

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: 20110406

Termination date: 20210530

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