CN104394204A - Method and system for realizing information interaction in load balancing - Google Patents

Method and system for realizing information interaction in load balancing Download PDF

Info

Publication number
CN104394204A
CN104394204A CN201410645860.0A CN201410645860A CN104394204A CN 104394204 A CN104394204 A CN 104394204A CN 201410645860 A CN201410645860 A CN 201410645860A CN 104394204 A CN104394204 A CN 104394204A
Authority
CN
China
Prior art keywords
memory object
object buffer
request
load equalizer
key assignments
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
CN201410645860.0A
Other languages
Chinese (zh)
Other versions
CN104394204B (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 CN201410645860.0A priority Critical patent/CN104394204B/en
Publication of CN104394204A publication Critical patent/CN104394204A/en
Application granted granted Critical
Publication of CN104394204B publication Critical patent/CN104394204B/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]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
    • 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/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers

Abstract

The invention provides a method and a system for realizing information interaction in load balancing. The method comprises the steps of preprocessing a load balancer and a memory object buffer in advance, enabling the load balancer to obtain key values according to a key value generation rule set by built-in variable parameters after receiving a request sent by a terminal, and enabling the load balancer to perform corresponding operations on the memory object buffer according to the key values and the type of the request. According to the information interaction method and the information interaction system, PHP does not need to run in the process of processing the request of the terminal, and therefore, the request processing efficiency is greatly improved and the time resources are saved.

Description

One realizes information interacting method and system in load balancing
Technical field
The invention belongs to information control field, particularly relate to one and realize information interacting method and system in load balancing.
Background technology
The rise of the Internet brings huge where no matter user is in can obtain info web and web information by browser simultaneously easily, and a large amount of high Concurrency Access proposes requirements at the higher level also to the performance of web server; In order to improving performance, nearly all internet, applications has caching mechanism, wherein, Memcache (memory object cache module) is the distributed memory target cache system used widely, and effectively utilize buffer memory to accelerate user's request is the focus that people pay close attention to always.
But, tradition cache policy still causes inefficiency, because be by PHP (HypertextPreprocessor traditionally, HyperText Preprocessor) operate memcache's, perform PHP code, Nginx (engine x, web page server) just must with FastCGI (Fast Common GatewayInterface/FastCGI, Universal-purpose quick gateway interface) communication, also to enter the life cycle of PHP simultaneously, therefore SAPI (The Microsoft Speech API, speech engine), a series of logics of PHP Core file and Zend Engine can be performed.
Fig. 1 is information interactive architecture figure in prior art, comprises terminal, load equalizer Nginx, PHP manager, memory object buffer memcache; Wherein, described terminal is connected with described PHP manager by described load equalizer Nginx; Described load equalizer Nginx is connected with described memory object buffer memcache by described PHP manager.The operation principle of above-mentioned framework is as follows:
Step 101: described terminal sends request to described load equalizer;
Step 102: described load equalizer sends request to described PHP manager;
Step 103: described PHP manager sends request to described memory object buffer; Wherein, described PHP manager calls PHP function, sends request to described memory object buffer;
Step 104: described memory object buffer sends request response to described PHP manager;
Step 105: described PHP manager sends request of data response to described load equalizer;
Step 106: described load equalizer responds to described terminal feedback described request.
It can thus be appreciated that in the process of terminal request process, need to run PHP, this greatly reduces request treatment effeciency, causes time resource significant wastage.
Summary of the invention
The invention provides one and realize information interacting method and system in load balancing, to solve the problem.
The invention provides one and realize information interacting method in load balancing.Said method comprises the following steps:
In advance preliminary treatment is carried out to load equalizer, memory object buffer;
After the request that described load equalizer receiving terminal sends, the generation key assignments rule set by built-in variable parameter, obtains key assignments;
Described load equalizer, according to described key assignments and request type, carries out corresponding operation to described memory object buffer.
The present invention also provides one to realize information interaction system in load balancing, comprises terminal, load equalizer, memory object buffer; Wherein, described terminal is connected with described memory object buffer by described load equalizer;
In advance preliminary treatment is carried out to load equalizer, memory object buffer;
Described load equalizer, for after the request that receiving terminal sends, the generation key assignments rule set by built-in variable parameter, obtains key assignments;
Described load equalizer, for according to described key assignments and request type, carries out corresponding operation to described memory object buffer.
Compared to prior art, realize information interacting method and system in load balancing according to one provided by the invention, achieve in the process of terminal request process, do not need to run PHP, which greatly enhances request treatment effeciency, saved time resource.
Accompanying drawing explanation
Accompanying drawing described herein is used to provide a further understanding of the present invention, and form a application's part, schematic description and description of the present invention, for explaining the present invention, does not form inappropriate limitation of the present invention.In the accompanying drawings:
Fig. 1 is information interactive architecture figure in prior art;
Fig. 2 be embodiments of the invention 1 realize information interacting method flow chart in load balancing;
What Figure 3 shows that the embodiment of the present invention 2 realizes information interaction system structure chart in load balancing.
Embodiment
Hereinafter also describe the present invention in detail with reference to accompanying drawing in conjunction with the embodiments.It should be noted that, when not conflicting, the embodiment in the application and the feature in embodiment can combine mutually.
Fig. 2 be embodiments of the invention 1 realize information interacting method flow chart in load balancing, comprise the following steps:
Step 201: in advance preliminary treatment is carried out to load equalizer, memory object buffer memcache;
1, carry out preliminary treatment to load equalizer in advance to comprise: configuration set command parameter, configuration add command parameter, configuration delete command parameter; Configure built-in variable parameter $ uri, $ args; Configuration location parameter, allocating cache out-of-service time $ memc_exptime parameter.
Srcache_fetch, srcache_store is contained in location parameter; Srcache_fetch represents that registration one input intercept process device is to location parameter, and this configuration will be performed when location parameter call; And srcache_store represents that registration output blocker is to location parameter, when location parameter is complete and can be performed when exporting.
Key assignments key rule is generated, such as: key assignments key is made up of Uniform Resource Identifier URI and URI query argument (being placed on the parameter transmitted in URI) by built-in variable parameter $ uri, $ args setting.
2, carry out preliminary treatment to internal memory object buffer memcache in advance to comprise:
In memory object buffer memcache, keep-alive module http-upstream-keepalive-module is installed in advance and the upstream in memory object buffer memcache is configured to connect keep-alive lastingly;
Preserve key assignments and data corresponding relation key-data.
Step 202: after the request that load equalizer Nginx receiving terminal sends, by the rule of the generation key assignments key of built-in variable parameter $ uri, $ args setting, generates key assignments key;
Request type comprises: extract a request of data be kept on memory object buffer; Preserve data to ask to memory object buffer; An item request preserved is deleted from memory object buffer; Obtain the status request that current memory object buffer runs; Refresh the item request that all memory object buffers are preserved; Open a connection request to memory object buffer; Open a long connection request to memory object buffer; Close the connection request of a memory object buffer; Replace an item request existed on memory object buffer.
Step 203: load equalizer Nginx, according to the key assignments key generated and described request type, carries out corresponding operation to described memory object buffer; Wherein, described memory object buffer saves key assignments and data corresponding relation key-data.
Step 204: load equalizer is to the operating result of described terminal feedback to described memory object buffer.
Operating result comprises: extract the data be kept on memory object buffer; Preserve data on memory object buffer; A project of preserving is deleted from memory object buffer; Obtain the state that current memory object buffer runs; Refresh the project that all memory object buffers are preserved; Open a connection to memory object buffer; Open one to connect to the long of memory object buffer; Close the connection of a memory object buffer; Replace a project existed on memory object buffer.
What Figure 3 shows that the embodiment of the present invention 2 realizes information interaction system structure chart in load balancing, comprises terminal, load equalizer, memory object buffer; Wherein, described terminal is connected with described memory object buffer by described load equalizer;
In advance preliminary treatment is carried out to load equalizer, memory object buffer;
Described load equalizer, for after the request that receiving terminal sends, the generation key assignments rule set by built-in variable parameter, obtains key assignments;
Described load equalizer, for according to described key assignments and request type, carries out corresponding operation to described memory object buffer.
Described load equalizer, also for the operating result of described terminal feedback to described memory object buffer.
Compared to prior art, realize information interacting method and system in load balancing according to one provided by the invention, achieve in the process of terminal request process, do not need to run PHP, which greatly enhances request treatment effeciency, saved time resource.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (10)

1. realize an information interacting method in load balancing, it is characterized in that, comprise the following steps:
In advance preliminary treatment is carried out to load equalizer, memory object buffer;
After the request that described load equalizer receiving terminal sends, the generation key assignments rule set by built-in variable parameter, obtains key assignments;
Described load equalizer, according to described key assignments and request type, carries out corresponding operation to described memory object buffer.
2. method according to claim 1, is characterized in that: described load equalizer is to the operating result of described terminal feedback to described memory object buffer.
3. method according to claim 2, it is characterized in that, described operating result comprises: extract the data be kept on memory object buffer, preserve data on memory object buffer, a project of preserving is deleted from memory object buffer, obtain the state that current memory object buffer runs, refresh the project that all memory object buffers are preserved, open a connection to memory object buffer, open one to connect to the long of memory object buffer, close the connection of a memory object buffer, replace a project existed on memory object buffer.
4. method according to claim 1, is characterized in that: carry out preliminary treatment to load equalizer in advance and comprise: configuration set command parameter, configuration add command parameter, configuration delete command parameter; Configure built-in variable parameter $ uri, $ args; Configuration location parameter, allocating cache out-of-service time $ memc_exptime parameter.
5. method according to claim 4, is characterized in that: contain srcache_fetch, srcache_store in location parameter; Srcache_fetch represents that registration one input intercept process device is to location parameter, and this configuration will be performed when location parameter call; And srcache_store represents that registration output blocker is to location parameter, when location parameter is complete and can be performed when exporting.
6. method according to claim 4, is characterized in that: generating key assignments key rule by built-in variable parameter $ uri, $ args setting is: key assignments key is made up of Uniform Resource Identifier URI and URI query argument.
7. method according to claim 1, is characterized in that: carry out preliminary treatment to internal memory object buffer memcache in advance and comprise: in memory object buffer memcache, install keep-alive module http-upstream-keepalive-module in advance and be configured to by the upstream in memory object buffer memcache connect keep-alive lastingly and preserve key assignments and data corresponding relation key-data.
8. method according to claim 1, is characterized in that, described request type comprises: extract a request of data be kept on memory object buffer; Preserve data to ask to memory object buffer; An item request preserved is deleted from memory object buffer; Obtain the status request that current memory object buffer runs; Refresh the item request that all memory object buffers are preserved; Open a connection request to memory object buffer; Open a long connection request to memory object buffer; Close the connection request of a memory object buffer; Replace an item request existed on memory object buffer.
9. realize an information interaction system in load balancing, it is characterized in that, comprise terminal, load equalizer, memory object buffer; Wherein, described terminal is connected with described memory object buffer by described load equalizer;
In advance preliminary treatment is carried out to load equalizer, memory object buffer;
Described load equalizer, for after the request that receiving terminal sends, the generation key assignments rule set by built-in variable parameter, obtains key assignments;
Described load equalizer, for according to described key assignments and request type, carries out corresponding operation to described memory object buffer.
10. system according to claim 9, is characterized in that, described load equalizer, also for the operating result of described terminal feedback to described memory object buffer.
CN201410645860.0A 2014-11-12 2014-11-12 Information interacting method and system in a kind of realization load balancing Active CN104394204B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410645860.0A CN104394204B (en) 2014-11-12 2014-11-12 Information interacting method and system in a kind of realization load balancing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410645860.0A CN104394204B (en) 2014-11-12 2014-11-12 Information interacting method and system in a kind of realization load balancing

Publications (2)

Publication Number Publication Date
CN104394204A true CN104394204A (en) 2015-03-04
CN104394204B CN104394204B (en) 2018-06-12

Family

ID=52612039

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410645860.0A Active CN104394204B (en) 2014-11-12 2014-11-12 Information interacting method and system in a kind of realization load balancing

Country Status (1)

Country Link
CN (1) CN104394204B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107967270A (en) * 2016-10-19 2018-04-27 北京京东尚科信息技术有限公司 Realize the method and system of multi-functional caching

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1997000A (en) * 2005-12-31 2007-07-11 腾讯科技(深圳)有限公司 Virtual-host-based web server and method for user obtaining access data
CN101930449A (en) * 2009-06-22 2010-12-29 三星电子株式会社 Client computer, acting server and be used to provide the method for cloud storage
CN102571959A (en) * 2012-01-11 2012-07-11 北京奇虎科技有限公司 System and method for downloading data
CN103023939A (en) * 2011-09-26 2013-04-03 中兴通讯股份有限公司 Method and system for realizing REST (Radar Electronic Scan Technique) interface of cloud cache on Nginx

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1997000A (en) * 2005-12-31 2007-07-11 腾讯科技(深圳)有限公司 Virtual-host-based web server and method for user obtaining access data
CN101930449A (en) * 2009-06-22 2010-12-29 三星电子株式会社 Client computer, acting server and be used to provide the method for cloud storage
CN103023939A (en) * 2011-09-26 2013-04-03 中兴通讯股份有限公司 Method and system for realizing REST (Radar Electronic Scan Technique) interface of cloud cache on Nginx
CN102571959A (en) * 2012-01-11 2012-07-11 北京奇虎科技有限公司 System and method for downloading data

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107967270A (en) * 2016-10-19 2018-04-27 北京京东尚科信息技术有限公司 Realize the method and system of multi-functional caching

Also Published As

Publication number Publication date
CN104394204B (en) 2018-06-12

Similar Documents

Publication Publication Date Title
US9277030B2 (en) Stream processing using a client-server architecture
WO2015027789A1 (en) Language control method, device and terminal
CN105187372A (en) Method for data processing based on mobile application entrance, device and system
CN112988499A (en) Data processing method and device, electronic equipment and storage medium
CN109510714A (en) Invitation method, resource allocation methods and device in instant messaging
CN109918191B (en) Method and device for preventing frequency of service request
CN104159231A (en) Method for optimizing background flow of client, and client
CN110659246A (en) Container-based file mounting method and device and electronic equipment
CN102209115A (en) Method for coordinating different users in virtual desktop system
CN103544016A (en) Service registering configuration method and system based on JAVA reflection technology
CN109600240A (en) Group Communications method and device
CN105847319A (en) Mobile terminal network request method and system
CN115002099A (en) Man-machine interactive file processing method and device for realizing IA (Internet of things) based on RPA (resilient packet Access) and AI (Artificial Intelligence)
CN111767149B (en) Scheduling method, device, equipment and storage equipment
CN110659330A (en) Data processing method, device and storage medium
CN107844363B (en) Business transaction processing method, device, storage medium and equipment
CN104394204A (en) Method and system for realizing information interaction in load balancing
EP2912823B1 (en) Systems and methods for message delivery to mobile devices supporting multiple users
CN115550354A (en) Data processing method and device and computer readable storage medium
CN104410651B (en) A kind of Enterprise information system architecture under mobile internet environment
CN105260179A (en) Method for achieving flex and servlet interaction
CN113760274B (en) Front-end assembly logic injection method and device
CN113055393B (en) Security service method, device and equipment
US11340965B2 (en) Method and system for performing voice activated tasks
CN103034478B (en) A kind of separate traffic threading model implementation method of IM system

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