CN105245588A - Separation processing method of web service port - Google Patents

Separation processing method of web service port Download PDF

Info

Publication number
CN105245588A
CN105245588A CN201510627243.2A CN201510627243A CN105245588A CN 105245588 A CN105245588 A CN 105245588A CN 201510627243 A CN201510627243 A CN 201510627243A CN 105245588 A CN105245588 A CN 105245588A
Authority
CN
China
Prior art keywords
service
data
port
request
service port
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
CN201510627243.2A
Other languages
Chinese (zh)
Other versions
CN105245588B (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.)
Inspur Beijing Electronic Information Industry Co Ltd
Original Assignee
Inspur Beijing Electronic Information Industry 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 Inspur Beijing Electronic Information Industry Co Ltd filed Critical Inspur Beijing Electronic Information Industry Co Ltd
Priority to CN201510627243.2A priority Critical patent/CN105245588B/en
Publication of CN105245588A publication Critical patent/CN105245588A/en
Application granted granted Critical
Publication of CN105245588B publication Critical patent/CN105245588B/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
    • 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]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a separation processing method of a web service port. The method comprises the following steps: a client sends a plurality of data requests carrying service types to a main port; for each data request, the main port carries out service classification processing on the data request, and sends the data request to a service port matched with the service type of the data request; the service port carries out service processing on the data request to obtain a service processing result, and returns the service processing result to the main port; and the main port receives the service processing result after each data request is processed, and sends all service processing results to the client. The method is used for achieving service separation to prevent mutual interference and improving the working efficiency of data processing.

Description

A kind of method of web service port separating treatment
Technical field
The present invention relates to network communication technology field, particularly relate to a kind of method of web service port separating treatment.
Background technology
At present, now most HyperText Preprocessor php is by 80 ports or other ports, be namely exactly only have a web terminal mouth to realize client's request, information processing, information returns and shows whole flow processs.Whole process takes on by this mode completely, to the monitoring of business information and control very unfavorable.Because operation flow goes wrong, cannot know it is the problem of that business module, can only go one by one to find.Such inefficiency, and differ and deal with problems surely, because whole process is cascaded by such flow process, changing a place will modify to whole flow process, very undesirable.General, the data volume arriving port is very large, and a port needs to process a large amount of dissimilar data simultaneously, and data volume is too large, and the efficiency of a port deal with data obviously reduces, and the efficiency of data processing is low-down.
Summary of the invention
The object of this invention is to provide a kind of method of web service port separating treatment, to realize service detach, do not interfere with each other, improve the operating efficiency of data processing.
For solving the problems of the technologies described above, the invention provides a kind of method of web service port separating treatment, the method comprises:
Multiple request of data carrying type of service is sent to master port by client;
For each request of data, described request of data is carried out business categorizing process by described master port, described request of data is sent to the service port mated with the type of service of described request of data;
Described service port carries out Business Processing to described request of data, obtains service processing result, and described service processing result is back to described master port;
Master port receives the service processing result returned after each request of data is processed, and all service processing results are sent to client.
Preferably, described request of data is carried out business categorizing process by described master port, described request of data is sent to the service port mated with the type of service of described request of data, comprises:
Address URL is obtained after described request of data is processed;
Host name address and the service port number of described request of data is obtained by the address URL of described request; The type of service of described service port number handled by corresponding service port is consistent with the type of service that request of data is carried;
Utilize described URL, host name address and service port number to call Stream_FrameWork function, described request of data is sent to the service port mated with the type of service of described request of data; Wherein, the type of service of described service port process is identical with the type of service of described request of data.
Preferably, described Stream_FrameWork function adopts php to simulate way of submission.
Preferably, the parameter of the subfunction fsockopen in described Stream_FrameWork function comprises $ hostname, $ port and $ uri, and these three parameters represent the address URL of host name address, port numbers and request respectively.
Preferably, described Stream_FrameWork function call the service processing result that result is request of data.
Preferably, utilize described URL, host name address and service port number call Stream_FrameWork function before comprise:
In the configuration file of http service, add service port function, create the fictitious host computer virtualhost that service port is corresponding.
Preferably, described method also comprises: described master port display interface information.
Preferably, the number of described service port is at least two; Each service port processes the request msg of different types of service respectively.
Multiple request of data carrying type of service is sent to master port by the method client of a kind of web service port separating treatment provided by the present invention; For each request of data, described request of data is carried out business categorizing process by described master port, described request of data is sent to the service port mated with the type of service of described request of data; Described service port carries out Business Processing to described request of data, obtains service processing result, and described service processing result is back to described master port; Master port receives the service processing result returned after each request of data is processed, and all service processing results are sent to client.Visible, for a large amount of data processings, master port is assigned to after classifying to request of data in the service port of corresponding business, by service port, Business Processing is carried out to request of data, data-handling efficiency is high, after data processing terminates, result is back to master port, so no longer by the master port data that directly process is a large amount of simultaneously, adopt different types of service port to process the request of data of different service types, realize service detach, realize the modularization of each business, do not interfere with each other, improve the operating efficiency of data processing.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only embodiments of the invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to the accompanying drawing provided.
Fig. 1 is the flow chart of the method for a kind of web service port separating treatment provided by the present invention.
Embodiment
Core of the present invention is to provide a kind of method of web service port separating treatment, to realize the efficiency improving data processing.
The present invention program is understood better in order to make those skilled in the art person, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Please refer to Fig. 1, Fig. 1 is the flow chart of the method for a kind of web service port separating treatment provided by the present invention, and the method comprises:
S11: multiple request of data carrying type of service is sent to master port by client;
S12: for each request of data, request of data is carried out business categorizing process by master port, request of data is sent to the service port mated with the type of service of request of data;
S13: service port carries out Business Processing to request of data, obtains service processing result, and service processing result is back to master port;
S14: master port receives the service processing result returned after each request of data is processed, and all service processing results are sent to client.
Concrete, request of data is carried out business categorizing process by master port, and process request of data being sent to the service port mated with the type of service of request of data is: obtain address URL after processing request of data; Host name address and the service port number of request of data is obtained by the address URL of request; Wherein, the type of service of service port number handled by corresponding service port is consistent with the type of service that request of data is carried; Utilize URL, host name address and service port number to call Stream_FrameWork function, request of data is sent to the service port mated with the type of service of request of data; Wherein, the type of service of service port process is identical with the type of service of request of data.
Wherein, Stream_FrameWork function adopts php to simulate way of submission.
The parameter of the subfunction fsockopen in Stream_FrameWork function comprises $ hostname, $ port and $ uri, and these three parameters represent the address URL of host name address, port numbers and request respectively.
Stream_FrameWork function call the service processing result that result is request of data.
Utilize before URL, host name address and service port number call Stream_FrameWork function, need to add service port function in the configuration file of http service, create the fictitious host computer virtualhost that service port is corresponding, namely create each specific service port.
Wherein, master port display interface information.
The number of service port is at least two; Each service port processes the request msg of different types of service respectively, i.e. the type of service of the request msg of each service port process is not identical, the request msg of the type of service that each service port is corresponding different.
Concrete, request of data flow process is as follows:
First, client sends request of data by master port to backstage;
Then, Message Transmission is given specific business by service port conversion by message by backstage;
Then, the message that specific Business Processing transmission comes, returns result to master port;
Finally, result is returned to client by master port.
Be exactly more than whole flow processs of Message Transmission, main is exactly that master port is received information, and passes to corresponding service by service port conversion, and this can be one asks a service port, also can be that a request is to multiple service port.
Specific implementation process is as follows:
Such as, adopt Apache service port to be separated, make each business module, do not associate each other, do not interfere with each other.Adopt Apache Server to be 2.4 versions, operating system is CentOS7.1, and main side slogan is 80, and service port is for an explanation, and can continue if necessary to add, service port number is 47980.
(1) each specific service port is created: create fictitious host computer virtualhost.
In the configuration file/etc/httpd/conf/httpd.conf of http service, following content is added at end:
Wherein 80 is master port, and the catalogue of this fictitious host computer is /usr/share/myphp/; 47980 is service port, and the catalogue of this fictitious host computer is /usr/share/myphp/framework, deposits some Business Processing to this port under this catalogue.Meet the catalogue that each business is corresponding different like this.
(2) service port transformation model is set up: adopt php simulation to submit to.
Php simulation submits to us to adopt function f sockopen.Fsockopen is the tune comparing bottom, and the socket belonging to network system calls, and only has fixing several parameters, fairly simple.Can process according to demand the data message drawing and want to result after obtaining result.The Stream_FrameWork function adopted is as follows:
This function can process from the request of master port to each service port.Have three parameters, be respectively $ hostname, $ port, $ uri, the meaning is the URL of host name address port number and request respectively, and function return value is the result of request.Parameter $ hostname also can be remote host address.
(3) service detach: master port accepts request and passes to service port.
When client is sent a request message to backstage by master port, backstage obtains URL through process, confirm the host name address needed for request message and service port number, call Stream_FrameWork function, this function adopts php simulation to submit to, from business module, obtain process information, return to master port, master port returns to client result again.Whole process is disposed.
Wherein, virtualhost and the php simulation of http submits to fsockopen to combine, and to business flow processing, makes each Service Processing Module.Business module, reduces the cost of business process monitoring and control; Service port can increase multiple, adapts to more business scenario; Business Processing is standardized more, and each business procession carries out under same virtual directory.
Wherein, business Apache port is adopted to be separated, under different catalogues, the service resources that different port process is different.The service port that different catalogues is corresponding different, different ports is corresponding different catalogue also, and namely the division of catalogue is the division of port.
The business that different port process is different, master port is responsible for display interface information, and other ports are responsible for processing service request.Service port can obtain the information of other service request process ports from 80 ports, so that by master port at interface display process information.There is obtaining information between master port and other ports to operate, adopt php simulation to submit to.The number of service port is at least two, service port can also be arranged on a different server, the corresponding service port of each server, each like this request of data is sent to the service port on corresponding server, service port processes request of data, like this because service port is not arrange on the same server, corresponding multiple request of data, multiple server is utilized to carry out the respective handling of request of data, the data processing speed of request of data is faster, more promotes the efficiency of data processing.
Multiple request of data carrying type of service is sent to master port by the method client of a kind of web service port separating treatment provided by the present invention; For each request of data, request of data is carried out business categorizing process by master port, request of data is sent to the service port mated with the type of service of request of data; Service port carries out Business Processing to request of data, obtains service processing result, and service processing result is back to master port; Master port receives the service processing result returned after each request of data is processed, and all service processing results are sent to client.Visible, for a large amount of data processings, master port is assigned to after classifying to request of data in the service port of corresponding business, by service port, Business Processing is carried out to request of data, data-handling efficiency is high, after data processing terminates, result is back to master port, so no longer by the master port data that directly process is a large amount of simultaneously, adopt different types of service port to process the request of data of different service types, realize service detach, realize the modularization of each business, do not interfere with each other, improve the operating efficiency of data processing.
And, the method carries out classification process to request of data, the service port of the identical services type of transference request of data processes request of data, realize the monitoring to business information and control, like this when operation flow goes wrong, can know it is the problem of that service port immediately, search out out that service port problematic, improve the inefficiency of looking up the fault, and, the process of type of service is all classified and is processed, after fault finds, only need to change the corresponding service port broken down, do not need to modify to whole flow process, save manpower.
Above the method for a kind of web service port separating treatment provided by the present invention is described in detail.Apply specific case herein to set forth principle of the present invention and execution mode, the explanation of above embodiment just understands method of the present invention and core concept thereof for helping.It should be pointed out that for those skilled in the art, under the premise without departing from the principles of the invention, can also carry out some improvement and modification to the present invention, these improve and modify and also fall in the protection range of the claims in the present invention.

Claims (8)

1. a method for web service port separating treatment, is characterized in that, comprising:
Multiple request of data carrying type of service is sent to master port by client;
For each request of data, described request of data is carried out business categorizing process by described master port, described request of data is sent to the service port mated with the type of service of described request of data;
Described service port carries out Business Processing to described request of data, obtains service processing result, and described service processing result is back to described master port;
Master port receives the service processing result returned after each request of data is processed, and all service processing results are sent to client.
2. the method for claim 1, is characterized in that, described request of data is carried out business categorizing process by described master port, described request of data is sent to the service port mated with the type of service of described request of data, comprises:
Address URL is obtained after described request of data is processed;
Host name address and the service port number of described request of data is obtained by the address URL of described request; The type of service of described service port number handled by corresponding service port is consistent with the type of service that request of data is carried;
Utilize described URL, host name address and service port number to call Stream_FrameWork function, described request of data is sent to the service port mated with the type of service of described request of data; Wherein, the type of service of described service port process is identical with the type of service of described request of data.
3. method as claimed in claim 2, is characterized in that, described Stream_FrameWork function adopts php to simulate way of submission.
4. method as claimed in claim 3, it is characterized in that, the parameter of the subfunction fsockopen in described Stream_FrameWork function comprises $ hostname, $ port and $ uri, and these three parameters represent the address URL of host name address, port numbers and request respectively.
5. method as claimed in claim 4, is characterized in that, described Stream_FrameWork function call the service processing result that result is request of data.
6. method as claimed in claim 2, is characterized in that, utilize described URL, host name address and service port number call Stream_FrameWork function before comprise:
In the configuration file of http service, add service port function, create the fictitious host computer virtualhost that service port is corresponding.
7. as the method in claim 1 to 6 as described in any one, it is characterized in that, also comprise: described master port display interface information.
8. as the method in claim 1 to 6 as described in any one, it is characterized in that, the number of described service port is at least two; Each service port processes the request msg of different types of service respectively.
CN201510627243.2A 2015-09-28 2015-09-28 A kind of method of web service port separating treatment Active CN105245588B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510627243.2A CN105245588B (en) 2015-09-28 2015-09-28 A kind of method of web service port separating treatment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510627243.2A CN105245588B (en) 2015-09-28 2015-09-28 A kind of method of web service port separating treatment

Publications (2)

Publication Number Publication Date
CN105245588A true CN105245588A (en) 2016-01-13
CN105245588B CN105245588B (en) 2018-12-07

Family

ID=55043086

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510627243.2A Active CN105245588B (en) 2015-09-28 2015-09-28 A kind of method of web service port separating treatment

Country Status (1)

Country Link
CN (1) CN105245588B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106203865A (en) * 2016-07-18 2016-12-07 浪潮软件集团有限公司 Hall management system and method
CN106330769A (en) * 2016-11-15 2017-01-11 腾讯科技(深圳)有限公司 Business processing method and server
CN108965380A (en) * 2018-05-31 2018-12-07 平安医疗科技有限公司 Service request processing method, device, computer equipment and storage medium
CN110166576A (en) * 2019-06-28 2019-08-23 飞天诚信科技股份有限公司 It is a kind of to realize that cloud speaker message mends the method and system pushed away
CN114567416A (en) * 2022-04-06 2022-05-31 西安羚控电子科技有限公司 TCP-based data transmission verification-free method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1501643A (en) * 2002-11-19 2004-06-02 华为技术有限公司 Method and apparatus for implementing simultaneous processing of multiple service logic on server
US20080112400A1 (en) * 2006-11-15 2008-05-15 Futurewei Technologies, Inc. System for Providing Both Traditional and Traffic Engineering Enabled Services
CN101635684A (en) * 2009-08-24 2010-01-27 中兴通讯股份有限公司 Method and system for classifying service flow
CN103702360A (en) * 2013-12-12 2014-04-02 华为技术有限公司 Method and device for determining data flow speed of service access port

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1501643A (en) * 2002-11-19 2004-06-02 华为技术有限公司 Method and apparatus for implementing simultaneous processing of multiple service logic on server
US20080112400A1 (en) * 2006-11-15 2008-05-15 Futurewei Technologies, Inc. System for Providing Both Traditional and Traffic Engineering Enabled Services
CN101635684A (en) * 2009-08-24 2010-01-27 中兴通讯股份有限公司 Method and system for classifying service flow
CN103702360A (en) * 2013-12-12 2014-04-02 华为技术有限公司 Method and device for determining data flow speed of service access port

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106203865A (en) * 2016-07-18 2016-12-07 浪潮软件集团有限公司 Hall management system and method
CN106330769A (en) * 2016-11-15 2017-01-11 腾讯科技(深圳)有限公司 Business processing method and server
CN106330769B (en) * 2016-11-15 2022-03-08 腾讯科技(深圳)有限公司 Service processing method and server
CN108965380A (en) * 2018-05-31 2018-12-07 平安医疗科技有限公司 Service request processing method, device, computer equipment and storage medium
CN110166576A (en) * 2019-06-28 2019-08-23 飞天诚信科技股份有限公司 It is a kind of to realize that cloud speaker message mends the method and system pushed away
CN110166576B (en) * 2019-06-28 2022-07-01 飞天诚信科技股份有限公司 Method and system for realizing message complementary pushing of cloud sound box
CN114567416A (en) * 2022-04-06 2022-05-31 西安羚控电子科技有限公司 TCP-based data transmission verification-free method and system

Also Published As

Publication number Publication date
CN105245588B (en) 2018-12-07

Similar Documents

Publication Publication Date Title
CN105245588A (en) Separation processing method of web service port
CN111934840A (en) Communication method of client and server, gateway, electronic equipment and storage medium
CN105005521A (en) Test method and apparatus
CN107347062A (en) A kind of method, electronic equipment and the readable storage medium storing program for executing of daily record data processing
CN104850560A (en) Method and system for loading business data in webpage in real time
CN114285781B (en) SRV6 service flow statistics method, device, electronic equipment and medium
CN103116655A (en) Clustered data query method, client side and system
CN104683428A (en) Network service processing method and device
CN103401933A (en) Method and system for batch uploading resource information and corresponding resource file
CN107888700B (en) Shared cloud rendering system and processing method thereof
CN104506893A (en) Information updating method, cloud server and CRM (customer relation management) server
CN110460668B (en) File uploading method and device, computer equipment and storage medium
CN105357329A (en) Business data transmission method, device and system for use in cross-Internet data center (IDC) network environment
JP2019525566A (en) Multi-network convergence method and apparatus
CN114697391A (en) Data processing method, device, equipment and storage medium
CN102055620B (en) Method and system for monitoring user experience
CN111711675B (en) Solution for concurrent message transmission in local area network
CN103023765B (en) A kind of message processing method based on script and device
CN105429795A (en) Alarm monitoring system and method
CN112491596B (en) Cloud-based fault processing method and device
CN107749875B (en) Big data artificial intelligence analytic system
CN105516029A (en) Network grouping system and network grouping method thereof
CN113141403A (en) Log transmission method and device
CN113556370A (en) Service calling method and device
CN110995869A (en) Machine data collection method, device, equipment and medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant