CN107295045A - A kind of message treatment method and device - Google Patents
A kind of message treatment method and device Download PDFInfo
- Publication number
- CN107295045A CN107295045A CN201610202818.0A CN201610202818A CN107295045A CN 107295045 A CN107295045 A CN 107295045A CN 201610202818 A CN201610202818 A CN 201610202818A CN 107295045 A CN107295045 A CN 107295045A
- Authority
- CN
- China
- Prior art keywords
- message
- virtual machine
- pulled
- untreated
- caching
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
- H04L67/1004—Server selection for load balancing
- H04L67/1008—Server selection for load balancing based on parameters of servers, e.g. available memory or workload
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45504—Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/16—Threshold monitoring
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/568—Storing data temporarily at an intermediate stage, e.g. caching
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Information Transfer Between Computers (AREA)
Abstract
This application provides a kind of message treatment method and device.Methods described includes:Untreated message to virtual machine is monitored;When detecting untreated message beyond the upper loading limit of the virtual machine, cut-out message is pulled.According to the embodiment of the present application, the untreated message of real-time statistics virtual machine, if detecting the upper loading limit that untreated message exceeds virtual machine, handover request is pulled, it is to avoid occur message accumulation on a virtual machine.Accordingly, if detecting the load lower limit that untreated message is less than virtual machine, recover message and pull, virtual machine process resource is made full use of with realizing.Message can be carried out by such scheme according to the actual loading ability of each virtual machine in server cluster to pull, message can be more assigned to the preferable virtual machine of load capacity, while fully effectively using process resource, the overall treatment efficiency of message can be improved.
Description
Technical field
The application is related to data processing field, and more particularly to a kind of message treatment method, and one kind disappear
Cease processing unit.
Background technology
At present, server cluster is directed to extensive message generally by the way of asynchronous process.This mode
It is primarily present problems with:
On the one hand, because the disposal ability of each virtual machine in cluster is variant, with identical speed from Message
When Broker pull-up takes message, it is easy to have begun to occur slowly on the low virtual machine of disposal ability
Accumulation, but the remarkable virtual machine of process performance is again in idle state, therefore there is message unreasonable distribution,
The problem of utilization of resources is insufficient.
On the other hand, in the processing framework of asynchronous message, often there is message handling ability and lag behind to disappear
The situation of generation ability is ceased, so that can be in storage and the message-oriented middleware Message Broker of dispatch messages
On there is message accumulation, or even Message Broker can make it that in order to ensure that its own running is normal, it is main
It is dynamic to carry out message discarding, cause message to be missed untreated.
The content of the invention
In view of the above problems, it is proposed that the embodiment of the present application so as to provide one kind overcome above mentioned problem or
The message treatment method and device solved the above problems at least in part.
In order to solve the above problems, this application discloses a kind of message treatment method, including:
Untreated message to virtual machine is monitored;
When detecting untreated message beyond the upper loading limit of the virtual machine, cut-out message is pulled.
Preferably, before the untreated message to virtual machine is monitored, methods described also includes:
Message is pulled from the message-oriented middleware of dispatch messages.
Preferably, it is described pull message from the message-oriented middleware of dispatch messages before, methods described is also wrapped
Include:
Subscribe to the message caching major queue of the message-oriented middleware;
It is described to pull message from the message-oriented middleware of dispatch messages and include:
After the message informing of the message caching major queue is received, from message caching major queue
Pull message.
Preferably, it is described cut-out message pull including:
The message subscribing that major queue is cached to the message is cut off, is pulled with cutting off message.
Preferably, methods described also includes:
When detect the untreated message be less than the virtual machine load lower limit when, recover message draw
Take.
Preferably, it is described recovery message pull including:
Recover the message subscribing to message caching major queue, pulled with recovering message.
Preferably, it is described to detect the untreated message and include beyond the upper loading limit of the virtual machine:
Detect the shared caching of the untreated message and exceed the first Configuration Values;
It is described to detect the untreated message and include less than the load lower limit of the virtual machine:
Detect the shared caching of the untreated message and be less than the second Configuration Values.
Preferably, described after the message-oriented middleware of dispatch messages pulls message, methods described is also wrapped
Include:
The multiple message pulled are stored into the message caching subqueue built in advance.
Preferably, methods described also includes:
Message Processing is carried out using multiple asynchronous threads.
Preferably, described after the message-oriented middleware of dispatch messages pulls message, methods described is also wrapped
Include:
The message-oriented middleware is notified to delete the untreated message pulled;
Or, notify the message-oriented middleware to add processed mark to the untreated message pulled.
Preferably, methods described also includes:
Detect every resource parameters of the virtual machine, and the is set to the virtual machine according to testing result
One Configuration Values and the second Configuration Values.
Present invention also provides a kind of message processing apparatus, including:
Message monitoring module, is monitored for the untreated message to virtual machine.
Message pulls control module, and the load that untreated message exceeds the virtual machine is detected for working as
In limited time, cut-out message is pulled.
Preferably, described device also includes:
Message pulls module, for before the untreated message to virtual machine is monitored, from point
The message-oriented middleware of hair message pulls message;
Preferably, described device also includes:
Message subscribing module, for it is described pull message from the message-oriented middleware of dispatch messages before, order
Read the message caching major queue of the message-oriented middleware;
The message pulls module, specifically for receiving the message informing of the message caching major queue
Afterwards, message is pulled from message caching major queue.
Preferably, the message pulls control module and included:
Cut-out submodule is subscribed to, the message subscribing of major queue is cached to the message for cutting off, to cut off
Message is pulled.
Preferably, the message pulls control module, is additionally operable to be less than when detecting the untreated message
During the load lower limit of the virtual machine, recover message and pull.
Preferably, the message pulls control module and also included:
Subscribe to and recover submodule, for recovering the message subscribing to message caching major queue, to recover
Message is pulled.
Preferably, the message pulls control module, and the untreated message institute is detected specifically for working as
When taking caching beyond the first Configuration Values, cut-out message is pulled;When detecting shared by the untreated message
When being less than the second Configuration Values with caching, recover message and pull.
Preferably, described device also includes:
Message storage module, for after the message-oriented middleware of dispatch messages pulls message, being incited somebody to action described
The multiple message pulled are stored into the message caching subqueue built in advance.
Preferably, described device also includes:
Message processing module, for carrying out Message Processing using multiple asynchronous threads.
The embodiment of the present application includes advantages below:
According to the embodiment of the present application, the untreated message of real-time statistics virtual machine, if detecting untreated disappear
Breath exceeds the upper loading limit of virtual machine, then handover request is pulled, it is to avoid occur message accumulation on a virtual machine.
Accordingly, if detecting the load lower limit that untreated message is less than virtual machine, recover message and pull, with
Realization makes full use of to virtual machine process resource.Can be according to each in server cluster by such scheme
The actual loading ability of virtual machine carries out message and pulled, message can be more assigned to load capacity compared with
Good virtual machine, while fully effectively using process resource, can improve the disposed of in its entirety effect of message
Rate.
Also, in the embodiment of the present application, it can also be cached using message caching subqueue from message-oriented middleware
Message caching major queue in the message that pulls, and after message is pulled, notification message middleware is deleted
The message pulled, or labeled as processed, so that the storage pressure of message-oriented middleware is effectively alleviated,
Avoid occurring message accumulation on message-oriented middleware and message misses untreated problem.
Brief description of the drawings
Fig. 1 is a kind of step flow chart of message treatment method embodiment 1 of the application;
Fig. 2 is a kind of step flow chart of message treatment method embodiment 2 of the application;
Fig. 3 is the asynchronous message processing framework figure of background technology;
Fig. 4 is the asynchronous message processing framework figure using the embodiment of the present application;
Fig. 5 is the schematic diagram of cut-out message subscribing in the embodiment of the present application;
Fig. 6 is the schematic diagram of recovery message subscribing in the embodiment of the present application;
Fig. 7 is a kind of structured flowchart of message processing apparatus embodiment of the application.
Embodiment
To enable above-mentioned purpose, the feature and advantage of the application more obvious understandable, with reference to attached
Figure and embodiment are described in further detail to the application.
Embodiment 1
Reference picture 1, shows a kind of step flow chart of message treatment method embodiment 1 of the application,
Specifically it may include steps of:
Step 101, the untreated message to virtual machine is monitored.
The embodiment of the present application can apply in server cluster to perform asynchronous message processing each is virtual
Multiple virtual machines are deployed with machine, server cluster, for entering line asynchronous to pending extensive message
Processing.The embodiment of the present application is monitored for the untreated message of each virtual machine, for further
Judgement.
Step 102, when detecting untreated message beyond the upper loading limit of the virtual machine, cut-out disappears
Breath is pulled.
The upper loading limit of virtual machine can characterize the average load ability or maximum load of virtual machine herein
Ability, can be configured according to virtual machine present load ability, such as according to the current items of virtual machine
The testing result of resource parameters configures the upper loading limit;Can also be according to the history normal load energy of virtual machine
Power is configured, and specifically can be obtained the upper loading limit to historic load statistics by message, for example, be taken
The average or maximum of historic load;It can be the desired value rule of thumb set, can also adopt
Configured with other any suitable modes.
Upper loading limit can have multiform expression.For example, being represented using the number of message, or use
The resource occupation amount of message represents that the cpu resource, storage resource shared by such as message be (for example
Cache resources), at least one such as bandwidth resources.Other any suitable representations are can also be, this
Application is not limited to this.
When being represented using message number, directly untreated message and upper loading limit can be compared.
When being represented using resource occupation amount, when being compared with specific reference to untreated message, it can calculate not
The actual resource occupation amount of processing message or the resource occupation amount estimated, and by result of calculation with loading
Limit is compared, and result of calculation is higher than the upper loading limit, that is to say that untreated message is higher than upper loading limit;
Or corresponding message number is calculated according to upper loading limit, by the number of untreated message and the message of calculating
Number is compared, and the number of untreated message that is to say untreated message higher than the message number calculated
Higher than upper loading limit.
If detecting the upper loading limit that untreated message exceeds virtual machine, cut-out message is pulled, to avoid
Occurs message accumulation on a virtual machine.Cut-out message, which is pulled, can a variety of implementations, for example cut-out pair
The subscription of message-oriented middleware, or intercept or action etc. is pulled to message by setting to limit.
In the preferred embodiment of the application, it can also work as and detect untreated message less than the virtual machine
Load lower limit when, recover message pull.
The load lower limit of virtual machine can characterize the average load ability or minimum load of virtual machine herein
Ability is, it is necessary to ensure that it is less than upper loading limit.Can be specifically to be matched somebody with somebody according to virtual machine present load ability
Put, for example, the load lower limit is configured according to the testing result of every resource parameters current to virtual machine;Also may be used
Configured with the history normal load ability according to virtual machine, specifically can be by message to historic load number
The load lower limit is obtained according to statistics, for example, take the average or minimum value of historic load;It can be root
The desired value set according to experience, can also be configured by the way of other are any suitable.
Load lower limit can have multiform expression, for example, being represented using the number of message, or use
The resource occupation amount of message represents that the cpu resource, storage resource shared by such as message be (for example
Cache resources), at least one such as bandwidth resources.Other any suitable representations are can also be, this
Application is not limited to this.
When being represented using message number, directly untreated message can be compared with load lower limit.
When being represented using resource occupation amount, when being compared with specific reference to untreated message, it can calculate not
The actual resource occupation amount of processing message or the resource occupation amount estimated, and by under result of calculation and load
Limit is compared, and result of calculation is less than the load lower limit, that is to say untreated message less than load lower limit;
Or corresponding message number is calculated according to load lower limit, by the number of untreated message and the message of calculating
Number is compared, and the number of untreated message that is to say untreated message less than the message number calculated
Less than load lower limit.
According to the embodiment of the present application, if detecting the load lower limit that untreated message is less than the virtual machine,
Then recover message to pull, virtual machine process resource is made full use of with realizing.
Wherein, recovery message, which is pulled, can a variety of implementations, for example, recover to order message-oriented middleware
Read, or releasing pulls interception or limitation of action etc. to message.
It can be disappeared by such scheme according to the actual loading ability of each virtual machine in server cluster
Breath is pulled, and message can be more assigned to the preferable virtual machine of load capacity, is fully effectively being utilized
While process resource, the overall treatment efficiency of message can be improved.
In the embodiment of the present application, it is preferred that the message of virtual machine processing can derive from message-oriented middleware,
The message-oriented middleware is used for each virtual machine dispatch messages into server cluster.Specifically can be from distribution
The message-oriented middleware of message pulls message.
Pending message is stored to message-oriented middleware after generation, and each is distributed to by message-oriented middleware
Virtual machine.Wherein, message can be extracted to virtual machine in the access request of procedure service, or be had
Others source, the application is not limited to this.
In the embodiment of the present application, each virtual machine pulls message from message-oriented middleware, and the message pulled can be with
It is the message that message-oriented middleware distributes to virtual machine processing, specific method of salary distribution the application is not limited
System, for example, can according to each virtual machine numbering or each virtual machine that is ranked in advance priority,
Pending task is sequentially assigned to each virtual machine, or according to type of message set in advance and void
The corresponding relation of plan machine is allocated, and can also be allocated according to default algorithm;The message pulled
Can be the request that message is pulled according to virtual machine, implementation, which is arrived first, first to be obtained, and pending message is distributed to
First send the virtual machine of request.
Virtual machine, which is pulled, just can further perform the processing to message after message, at extensive message
The scene of reason, the message pulled is more, and the mode of preferred process is to use multiple asynchronous in asynchronous thread pond
Thread carries out Message Processing, and the mode compared to synchronization process can greatly improve the efficiency of Message Processing.
Wherein, message-oriented middleware can be Message Broker or other are any suitable,
Realize the message-oriented middleware of message distribution function, such as Active Messenger.
Embodiment 2
Reference picture 2, shows a kind of step flow chart of message treatment method embodiment 2 of the application,
Applied to each virtual machine that asynchronous message processing is performed in server cluster, it can specifically include following step
Suddenly:
Step 201, the message caching major queue of message-oriented middleware is subscribed to.
Message-oriented middleware can cache major queue using message and preserve pending all message, can pass through
Message caching major queue is subscribed to know new information.
Subscription is a kind of pass through mechanism of message, includes the publisher and multiple subscribers of a message, should
Use the embodiment of the present application, that is to say that message issuer that is to say message-oriented middleware, message subscribing person namely
It is each virtual machine.Preferably, when subscribing to message, the message class of specific preferred process can also be subscribed to
Type, so that message-oriented middleware notifies corresponding virtual machine when detecting the message of the type.
Step 202, it is slow from the message after the message informing of the message caching major queue is received
Deposit and message is pulled in major queue, the multiple message pulled are stored to the message built in advance and cache subqueue
In.
After the message caching major queue for subscribing to the message-oriented middleware, message buffer queue carries out new information
Notify, host team is cached after the message informing of the message caching major queue is received, then from the message
Message is pulled in row.
In the embodiment of the present application, by the way of layering caching, host team is cached from the message of message-oriented middleware
The message pulled in row caches to the local message of virtual machine and caches subqueue.
Step 203, the message-oriented middleware is notified to delete the untreated message pulled;Or, notify institute
State message-oriented middleware and processed mark is added to the untreated message pulled.
Message is cached to the local message caching subqueue of virtual machine, can be further in notification message
Between part delete the message that has pulled, or labeled as processed, so as to effectively alleviate message-oriented middleware
Store pressure, it is to avoid occur message accumulation on message-oriented middleware and message misses untreated problem.
In another preferred embodiment of the present application, this step can also actively be held by message-oriented middleware
OK, the request for pulling message according to virtual machine distributes message to virtual machine, can cache and lead from message
Allocated message is deleted in team, or allocation identification is added to allocated message.
Step 204, Message Processing is performed.
Step 205, the untreated message to the virtual machine is monitored.
It can be specifically to cache the untreated message in subqueue to message to be monitored, can be specifically prison
The number of untreated message or the resource occupation amount of the untreated message of monitoring are controlled, specifically can be with
The representation of upper loading limit or load lower limit can be consistent, can also be inconsistent., can when being compared
It is compared with the number for being scaled correspondence message, corresponding resource occupation amount can also be scaled and compared
Compared with.
Step 206, cached described in message caching subqueue shared by untreated message when detecting
During beyond the first Configuration Values, the message subscribing that major queue is cached to the message is cut off, to cut off message drawing
Take.
In the present embodiment, upper loading limit is expressed as the cache size of message occupancy, is designated as the first Configuration Values,
Accordingly, it is described to detect untreated message and include beyond the upper loading limit of virtual machine:Detect institute
State the shared caching of untreated message described in message caching subqueue and exceed the first Configuration Values.
In the present embodiment, cut-out message pulls the subscription realization for caching major queue to message by cutting off.
Step 207, cached described in message caching subqueue shared by untreated message when detecting
During less than the second Configuration Values, recover to cache the message message subscribing of major queue, to recover message drawing
Take.
In the present embodiment, load lower limit is expressed as the cache size of message occupancy, is designated as the second Configuration Values,
Accordingly, it is described to detect untreated message and include less than the load lower limit of the virtual machine:Detection
It is less than the second Configuration Values to caching shared by untreated message described in message caching subqueue.
In the present embodiment, recover message and pull by recovering the subscription realization to message caching major queue.
It is further preferred that can by detecting every resource parameters of the virtual machine, such as CPU,
At least one memory space (such as spatial cache), bandwidth.Further according to testing result to described
Virtual machine sets the first Configuration Values and the second Configuration Values, and specific set-up mode can be selected according to the actual requirements
Select, such as the first Configuration Values are set to the 80% of resource parameters, and the second Configuration Values are set to resource parameters
30%.For example, the spatial cache for detecting virtual machine is 100M, then corresponds to the first Configuration Values and be set to
80M, the second Configuration Values are set to 30M.
According to the embodiment of the present application, the untreated message of real-time statistics virtual machine, if detecting untreated disappear
Breath exceeds the upper loading limit of virtual machine, then handover request is pulled, it is to avoid occur message accumulation on a virtual machine.
Accordingly, if detecting the load lower limit that untreated message is less than the virtual machine, recover message and pull,
Virtual machine process resource is made full use of with realizing.Can be according in server cluster by such scheme
The actual loading ability of each virtual machine carries out message and pulled, and message can be more assigned into load capacity
Preferable virtual machine, while fully effectively using process resource, can improve the disposed of in its entirety of message
Efficiency.
Also, in the embodiment of the present application, it can also be cached using message caching subqueue from message-oriented middleware
Message caching major queue in the message that pulls, and after message is pulled, notification message middleware is deleted
The message pulled, or labeled as processed, so that the storage pressure of message-oriented middleware is effectively alleviated,
Avoid occurring message accumulation on message-oriented middleware and message misses untreated problem.
For the embodiment of the present application is better described, below to the scheme progress pair of the application and background technology
Than.As Fig. 3 shows the asynchronous message processing framework figure of background technology.By Message Broker to
Multiple virtual machine (vm_1~vm_n) dispatch messages, Message Broker, which are used, concentrates buffer memory not
All message of processing.This scheme has that message unreasonable distribution, the utilization of resources be insufficient, message heap
Long-pending and possible message misses untreated problem.
As Fig. 4 shows the asynchronous message processing framework figure using the embodiment of the present application.On the one hand, pass through
The design of buffer queue is layered, local cache queue, Message Broker concentration are built in consumption terminal
Caching is moved to locally, so as to effectively alleviate the storage pressure of message-oriented middleware, it is to avoid on message-oriented middleware
There is message accumulation and message misses untreated problem.
Fig. 5 shows the schematic diagram that message subscribing is cut off in the embodiment of the present application, goes out when on some virtual machine
Existing message accumulation, it is determined that the local message total amount cached, i.e., when cache size is more than Configuration Values 1, then
Dynamic cut-out message subscribing, it is to avoid occur message accumulation on a virtual machine.Fig. 6 shows that the application is implemented
Recover the schematic diagram of message subscribing in example, after cut-out is subscribed to, message will not be pulled from Message Broker,
But it can continue to handle the message of local cache queue, when the local message cached is total on some virtual machine
When amount, i.e. cache size are less than default Configuration Values 2, then Dynamic- Recovery message subscribing, as shown in dotted line,
Virtual machine process resource is made full use of with realizing.As can be seen here, compared to the scheme of background technology,
The application can carry out message according to the actual loading ability of each virtual machine in server cluster and pull, can be with
Message is more assigned to the preferable virtual machine of load capacity, the same of process resource is fully effectively being utilized
When, the overall treatment efficiency of message can be improved.
It should be noted that for embodiment of the method, in order to be briefly described, therefore it is all expressed as into one
The combination of actions of series, but those skilled in the art should know, the embodiment of the present application is not by institute
The limitation of the sequence of movement of description, because according to the embodiment of the present application, some steps can use other
Order is carried out simultaneously.Secondly, those skilled in the art should also know, described in the specification
Embodiment belong to preferred embodiment, involved action not necessarily the embodiment of the present application must
Must.
Embodiment 3
Reference picture 7, shows a kind of structured flowchart of message processing apparatus embodiment of the application, deployment
Each virtual machine of asynchronous message processing is performed in server cluster, can specifically include following module:
Message monitoring module 301, is monitored for the untreated message to virtual machine.
Message pulls control module 302, and untreated message is detected beyond the negative of the virtual machine for working as
When carrying the upper limit, cut-out message is pulled.
In the embodiment of the present application, it is preferable that described device also includes:
Message pulls module, for before the untreated message to virtual machine is monitored, from point
The message-oriented middleware of hair message pulls message;
In the embodiment of the present application, it is preferable that described device also includes:
Message subscribing module, for it is described pull message from the message-oriented middleware of dispatch messages before, order
Read the message caching major queue of the message-oriented middleware;
The message pulls module, specifically for receiving the message informing of the message caching major queue
Afterwards, message is pulled from message caching major queue.
In the embodiment of the present application, it is preferable that the message, which pulls control module, to be included:
Cut-out submodule is subscribed to, the message subscribing of major queue is cached to the message for cutting off, to cut off
Message is pulled.
In the embodiment of the present application, it is preferable that the message pulls control module, it is additionally operable to that institute ought be detected
State untreated message be less than the virtual machine load lower limit when, recover message pull.
In the embodiment of the present application, it is preferable that the message, which pulls control module, also to be included:
Subscribe to and recover submodule, for recovering the message subscribing to message caching major queue, to recover
Message is pulled.
In the embodiment of the present application, it is preferable that the message pulls control module, detected specifically for working as
When the shared caching of the untreated message exceeds the first Configuration Values, cut-out message is pulled;When detecting
When stating the shared caching of untreated message less than the second Configuration Values, recover message and pull.
In the embodiment of the present application, it is preferable that described device also includes:
Message storage module, for after the message-oriented middleware of dispatch messages pulls message, being incited somebody to action described
The multiple message pulled are stored into the message caching subqueue built in advance.
In the embodiment of the present application, it is preferable that described device also includes:
Message processing module, for carrying out Message Processing using multiple asynchronous threads.
In the embodiment of the present application, it is preferable that described device also includes:
Notification module, for after message-oriented middleware pulls message, being notified described in the middle of the message
Part deletes the untreated message pulled;Or, notify the message-oriented middleware untreated to disappear to what is pulled
The processed mark of breath addition.
In the embodiment of the present application, it is preferable that described device also includes:
Parameter detection module, every resource parameters for detecting the virtual machine, and according to testing result
First Configuration Values and the second Configuration Values are set to the virtual machine.
According to the embodiment of the present application, the untreated message of real-time statistics virtual machine, if detecting untreated disappear
Breath exceeds the upper loading limit of virtual machine, then handover request is pulled, it is to avoid occur message accumulation on a virtual machine.
Accordingly, if detecting the load lower limit that untreated message is less than the virtual machine, recover message and pull,
Virtual machine process resource is made full use of with realizing.Can be according in server cluster by such scheme
The actual loading ability of each virtual machine carries out message and pulled, and message can be more assigned into load capacity
Preferable virtual machine, while fully effectively using process resource, can improve the disposed of in its entirety of message
Efficiency.
Also, in the embodiment of the present application, it can also be cached using message caching subqueue from message-oriented middleware
Message caching major queue in the message that pulls, and after message is pulled, notification message middleware is deleted
The message pulled, or labeled as processed, so that the storage pressure of message-oriented middleware is effectively alleviated,
Avoid occurring message accumulation on message-oriented middleware and message misses untreated problem.
For device embodiment, because it is substantially similar to embodiment of the method, so the ratio of description
Relatively simple, the relevent part can refer to the partial explaination of embodiments of method.
Each embodiment in this specification is described by the way of progressive, and each embodiment is stressed
Be all between difference with other embodiment, each embodiment identical similar part mutually referring to
.
It should be understood by those skilled in the art that, the embodiment of the embodiment of the present application can be provided as method, dress
Put or computer program product.Therefore, the embodiment of the present application can using complete hardware embodiment, completely
The form of embodiment in terms of software implementation or combination software and hardware.Moreover, the embodiment of the present application
Can use can be situated between in one or more computers for wherein including computer usable program code with storage
The computer journey that matter is implemented on (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of sequence product.
In a typical configuration, the computer equipment includes one or more processors
(CPU), input/output interface, network interface and internal memory.Internal memory potentially includes computer-readable Jie
Volatile memory in matter, the shape such as random access memory (RAM) and/or Nonvolatile memory
Formula, such as read-only storage (ROM) or flash memory (flash RAM).Internal memory is showing for computer-readable medium
Example.Computer-readable medium includes permanent and non-permanent, removable and non-removable media can
To realize that information is stored by any method or technique.Information can be computer-readable instruction, number
According to structure, the module of program or other data.The example of the storage medium of computer includes, but not
It is limited to phase transition internal memory (PRAM), static RAM (SRAM), dynamic randon access to deposit
Reservoir (DRAM), other kinds of random access memory (RAM), read-only storage (ROM),
Electrically Erasable Read Only Memory (EEPROM), fast flash memory bank or other memory techniques,
Read-only optical disc read-only storage (CD-ROM), digital versatile disc (DVD) or other optical storages,
Magnetic cassette tape, the storage of tape magnetic rigid disk or other magnetic storage apparatus or any other non-transmitting are situated between
Matter, the information that can be accessed by a computing device available for storage.Define, calculate according to herein
Machine computer-readable recording medium does not include the computer readable media (transitory media) of non-standing, such as the number of modulation
It is believed that number and carrier wave.
The embodiment of the present application is with reference to according to the method for the embodiment of the present application, terminal device (system) and meter
The flow chart and/or block diagram of calculation machine program product is described.It should be understood that can be by computer program instructions
Each flow and/or square frame and flow chart and/or square frame in implementation process figure and/or block diagram
The combination of flow and/or square frame in figure.Can provide these computer program instructions to all-purpose computer,
The processor of special-purpose computer, Embedded Processor or other programmable data processing terminal equipments is to produce
One machine so that pass through the computing devices of computer or other programmable data processing terminal equipments
Instruction produce be used to realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or
The device for the function of being specified in multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable datas to handle
In the computer-readable memory that terminal device works in a specific way so that be stored in this computer-readable
Instruction in memory, which is produced, includes the manufacture of command device, and command device realization is in flow chart one
The function of being specified in flow or multiple flows and/or one square frame of block diagram or multiple square frames.
These computer program instructions can also be loaded into computer or other programmable data processing terminals are set
It is standby upper so that series of operation steps is performed on computer or other programmable terminal equipments in terms of producing
The processing that calculation machine is realized, so that the instruction performed on computer or other programmable terminal equipments provides use
In realization in one flow of flow chart or multiple flows and/or one square frame of block diagram or multiple square frames
The step of function of specifying.
Although having been described for the preferred embodiment of the embodiment of the present application, those skilled in the art are once
Basic creative concept is known, then other change and modification can be made to these embodiments.So,
Appended claims are intended to be construed to include preferred embodiment and fall into the institute of the embodiment of the present application scope
Have altered and change.
Finally, in addition it is also necessary to explanation, herein, such as first and second or the like relation art
Language is used merely to make a distinction an entity or operation with another entity or operation, and not necessarily
It is required that or implying between these entities or operation there is any this actual relation or order.And
And, term " comprising ", "comprising" or its any other variant are intended to the bag of nonexcludability
Contain, so that process, method, article or terminal device including a series of key elements not only include
Those key elements, but also other key elements including being not expressly set out, or also include being this mistake
Journey, method, article or the intrinsic key element of terminal device.In the absence of more restrictions,
The key element limited by sentence "including a ...", it is not excluded that the process including the key element,
Also there is other identical element in method, article or terminal device.
Above to a kind of message treatment method provided herein and device, it is described in detail,
Specific case used herein is set forth to the principle and embodiment of the application, and the above is implemented
The explanation of example is only intended to help and understands the present processes and its core concept;Simultaneously for ability
The those skilled in the art in domain, the thought of foundation the application, in specific embodiments and applications
It will change, in summary, this specification content should not be construed as the limitation to the application.
Claims (20)
1. a kind of message treatment method, it is characterised in that including:
Untreated message to virtual machine is monitored;
When detecting untreated message beyond the upper loading limit of the virtual machine, cut-out message is pulled.
2. according to the method described in claim 1, it is characterised in that in not the locating to virtual machine
Before reason message is monitored, methods described also includes:
Message is pulled from the message-oriented middleware of dispatch messages.
3. method according to claim 2, it is characterised in that in the disappearing from dispatch messages
Breath middleware is pulled before message, and methods described also includes:
Subscribe to the message caching major queue of the message-oriented middleware;
It is described to pull message from the message-oriented middleware of dispatch messages and include:
After the message informing of the message caching major queue is received, from message caching major queue
Pull message.
4. method according to claim 3, it is characterised in that the cut-out message pull including:
The message subscribing that major queue is cached to the message is cut off, is pulled with cutting off message.
5. method according to claim 3, it is characterised in that methods described also includes:
When detect the untreated message be less than the virtual machine load lower limit when, recover message draw
Take.
6. method according to claim 5, it is characterised in that the recovery message pull including:
Recover the message subscribing to message caching major queue, pulled with recovering message.
7. method according to claim 5, it is characterised in that it is described detect it is described untreated
Message includes beyond the upper loading limit of the virtual machine:
Detect the shared caching of the untreated message and exceed the first Configuration Values;
It is described to detect the untreated message and include less than the load lower limit of the virtual machine:
Detect the shared caching of the untreated message and be less than the second Configuration Values.
8. method according to claim 2, it is characterised in that in the disappearing from dispatch messages
Breath middleware is pulled after message, and methods described also includes:
The multiple message pulled are stored into the message caching subqueue built in advance.
9. according to the method described in claim 1, it is characterised in that methods described also includes:
Message Processing is carried out using multiple asynchronous threads.
10. method according to claim 2, it is characterised in that in the disappearing from dispatch messages
Breath middleware is pulled after message, and methods described also includes:
The message-oriented middleware is notified to delete the untreated message pulled;
Or, notify the message-oriented middleware to add processed mark to the untreated message pulled.
11. method according to claim 7, it is characterised in that methods described also includes:
Detect every resource parameters of the virtual machine, and the is set to the virtual machine according to testing result
One Configuration Values and the second Configuration Values.
12. a kind of message processing apparatus, it is characterised in that including:
Message monitoring module, is monitored for the untreated message to virtual machine.
Message pulls control module, and the load that untreated message exceeds the virtual machine is detected for working as
In limited time, cut-out message is pulled.
13. device according to claim 12, it is characterised in that described device also includes:
Message pulls module, for before the untreated message to virtual machine is monitored, from point
The message-oriented middleware of hair message pulls message;
14. device according to claim 13, it is characterised in that described device also includes:
Message subscribing module, for it is described pull message from the message-oriented middleware of dispatch messages before, order
Read the message caching major queue of the message-oriented middleware;
The message pulls module, specifically for receiving the message informing of the message caching major queue
Afterwards, message is pulled from message caching major queue.
15. device according to claim 14, it is characterised in that the message pulls control mould
Block includes:
Cut-out submodule is subscribed to, the message subscribing of major queue is cached to the message for cutting off, to cut off
Message is pulled.
16. device according to claim 14, it is characterised in that the message pulls control mould
Block, be additionally operable to when detect the untreated message be less than the virtual machine load lower limit when, recover to disappear
Breath is pulled.
17. device according to claim 16, it is characterised in that the message pulls control mould
Block also includes:
Subscribe to and recover submodule, for recovering the message subscribing to message caching major queue, to recover
Message is pulled.
18. device according to claim 16, it is characterised in that the message pulls control mould
Block, specifically for when detecting shared by the untreated message caching and exceeding the first Configuration Values, cut-out
Message is pulled;When detecting shared by the untreated message caching and being less than the second Configuration Values, recover to disappear
Breath is pulled.
19. device according to claim 13, it is characterised in that described device also includes:
Message storage module, for after the message-oriented middleware of dispatch messages pulls message, being incited somebody to action described
The multiple message pulled are stored into the message caching subqueue built in advance.
20. device according to claim 12, it is characterised in that described device also includes:
Message processing module, for carrying out Message Processing using multiple asynchronous threads.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610202818.0A CN107295045A (en) | 2016-03-31 | 2016-03-31 | A kind of message treatment method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610202818.0A CN107295045A (en) | 2016-03-31 | 2016-03-31 | A kind of message treatment method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107295045A true CN107295045A (en) | 2017-10-24 |
Family
ID=60087511
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610202818.0A Pending CN107295045A (en) | 2016-03-31 | 2016-03-31 | A kind of message treatment method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107295045A (en) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108052400A (en) * | 2017-12-21 | 2018-05-18 | 深圳Tcl新技术有限公司 | Message immediate processing method, intelligent terminal and computer readable storage medium |
US10972535B2 (en) | 2018-08-20 | 2021-04-06 | Beijing Baidu Netcom Science And Technology Co., Ltd. | Method and device for load balancing, and storage medium |
CN113467969A (en) * | 2021-06-22 | 2021-10-01 | 上海星融汽车科技有限公司 | Method for processing message accumulation |
CN113965624A (en) * | 2020-06-29 | 2022-01-21 | 中国电信股份有限公司 | Method for processing message, message caching middleware and service system |
CN114490112A (en) * | 2021-12-20 | 2022-05-13 | 阿里巴巴(中国)有限公司 | Message processing method, device and system |
CN115134320A (en) * | 2022-08-25 | 2022-09-30 | 四川汉唐云分布式存储技术有限公司 | Transaction system for determining time sequence based on message distribution |
WO2023093016A1 (en) * | 2021-11-26 | 2023-06-01 | 北京百度网讯科技有限公司 | Cloud code development system, method, and apparatus, device, and storage medium |
CN116643870A (en) * | 2023-07-24 | 2023-08-25 | 北方健康医疗大数据科技有限公司 | Method, system and device for processing long-time task distribution and readable storage medium |
CN117914933A (en) * | 2024-03-20 | 2024-04-19 | 福建时代星云科技有限公司 | Internet of things networking method and terminal |
CN117914933B (en) * | 2024-03-20 | 2024-06-28 | 福建时代星云科技有限公司 | Internet of things networking method and terminal |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101001255A (en) * | 2006-12-19 | 2007-07-18 | 华为技术有限公司 | Method and device for load control of session initial protocol stack |
CN101765225A (en) * | 2008-12-24 | 2010-06-30 | 华为技术有限公司 | Virtual cluster management system and cluster node |
CN102096603A (en) * | 2009-12-14 | 2011-06-15 | 中国移动通信集团公司 | Task decomposition control method in MapReduce system and scheduling node equipment |
CN102811157A (en) * | 2011-06-01 | 2012-12-05 | 阿尔卡特朗讯公司 | Method and device for flow control |
CN102904746A (en) * | 2012-09-13 | 2013-01-30 | 曙光信息产业(北京)有限公司 | Cluster task self-dispatching system and method based on information mechanism |
CN103746839A (en) * | 2013-12-27 | 2014-04-23 | 新浪网技术(中国)有限公司 | PaaS (Platform-as-a-Server) system and VM (Virtual Machine) node scheduling method in PaaS application pool |
US20150234673A1 (en) * | 2014-02-19 | 2015-08-20 | Fujitsu Limited | Information processing system |
CN105338061A (en) * | 2015-09-29 | 2016-02-17 | 华中科技大学 | Lightweight message oriented middleware realization method and system |
-
2016
- 2016-03-31 CN CN201610202818.0A patent/CN107295045A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101001255A (en) * | 2006-12-19 | 2007-07-18 | 华为技术有限公司 | Method and device for load control of session initial protocol stack |
CN101765225A (en) * | 2008-12-24 | 2010-06-30 | 华为技术有限公司 | Virtual cluster management system and cluster node |
CN102096603A (en) * | 2009-12-14 | 2011-06-15 | 中国移动通信集团公司 | Task decomposition control method in MapReduce system and scheduling node equipment |
CN102811157A (en) * | 2011-06-01 | 2012-12-05 | 阿尔卡特朗讯公司 | Method and device for flow control |
CN102904746A (en) * | 2012-09-13 | 2013-01-30 | 曙光信息产业(北京)有限公司 | Cluster task self-dispatching system and method based on information mechanism |
CN103746839A (en) * | 2013-12-27 | 2014-04-23 | 新浪网技术(中国)有限公司 | PaaS (Platform-as-a-Server) system and VM (Virtual Machine) node scheduling method in PaaS application pool |
US20150234673A1 (en) * | 2014-02-19 | 2015-08-20 | Fujitsu Limited | Information processing system |
CN105338061A (en) * | 2015-09-29 | 2016-02-17 | 华中科技大学 | Lightweight message oriented middleware realization method and system |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108052400A (en) * | 2017-12-21 | 2018-05-18 | 深圳Tcl新技术有限公司 | Message immediate processing method, intelligent terminal and computer readable storage medium |
US10972535B2 (en) | 2018-08-20 | 2021-04-06 | Beijing Baidu Netcom Science And Technology Co., Ltd. | Method and device for load balancing, and storage medium |
CN113965624A (en) * | 2020-06-29 | 2022-01-21 | 中国电信股份有限公司 | Method for processing message, message caching middleware and service system |
CN113467969A (en) * | 2021-06-22 | 2021-10-01 | 上海星融汽车科技有限公司 | Method for processing message accumulation |
CN113467969B (en) * | 2021-06-22 | 2024-01-23 | 上海星融汽车科技有限公司 | Method for processing message accumulation |
WO2023093016A1 (en) * | 2021-11-26 | 2023-06-01 | 北京百度网讯科技有限公司 | Cloud code development system, method, and apparatus, device, and storage medium |
CN114490112A (en) * | 2021-12-20 | 2022-05-13 | 阿里巴巴(中国)有限公司 | Message processing method, device and system |
CN115134320B (en) * | 2022-08-25 | 2023-01-03 | 四川汉唐云分布式存储技术有限公司 | Transaction system for determining time sequence based on message distribution |
CN115134320A (en) * | 2022-08-25 | 2022-09-30 | 四川汉唐云分布式存储技术有限公司 | Transaction system for determining time sequence based on message distribution |
CN116643870A (en) * | 2023-07-24 | 2023-08-25 | 北方健康医疗大数据科技有限公司 | Method, system and device for processing long-time task distribution and readable storage medium |
CN116643870B (en) * | 2023-07-24 | 2023-11-10 | 北方健康医疗大数据科技有限公司 | Method, system and device for processing long-time task distribution and readable storage medium |
CN117914933A (en) * | 2024-03-20 | 2024-04-19 | 福建时代星云科技有限公司 | Internet of things networking method and terminal |
CN117914933B (en) * | 2024-03-20 | 2024-06-28 | 福建时代星云科技有限公司 | Internet of things networking method and terminal |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107295045A (en) | A kind of message treatment method and device | |
CN107197015B (en) | Message processing method and device based on message queue system | |
EP3129880B1 (en) | Method and device for augmenting and releasing capacity of computing resources in real-time stream computing system | |
Wang et al. | Consolidating virtual machines with dynamic bandwidth demand in data centers | |
US8954971B2 (en) | Data collecting method, data collecting apparatus and network management device | |
US10666758B2 (en) | Browser resource pre-pulling method, terminal and storage medium | |
CN110362401A (en) | Data run the member host in batch method, apparatus, storage medium and cluster | |
CN106201443B (en) | A kind of method and system based on the mostly concurrent written document of Storm streaming computing frame | |
CN109710716A (en) | Map smoothness rendering method, terminal device and computer readable storage medium | |
CN112650575B (en) | Resource scheduling method, device and cloud service system | |
CN109347757A (en) | Message congestion control method, system, equipment and storage medium | |
CN109726004B (en) | Data processing method and device | |
CN103631873B (en) | A kind of data compression method and storage system | |
CN106980579A (en) | A kind of picture loading method and device | |
CN104199912B (en) | A kind of method and device of task processing | |
CN103853621A (en) | Inter-process interactive method and relevant terminal equipment | |
CN105262680A (en) | Multi-threaded NAS Gateway applied to cloud storage system | |
CN108073580A (en) | A kind of processing method and processing device based on page concurrent request | |
CN107872517A (en) | A kind of data processing method and device | |
CN113238861A (en) | Task execution method and device | |
CN109117291A (en) | Data dispatch processing method, device and computer equipment based on multi-core processor | |
CN115277577A (en) | Data processing method, data processing device, computer equipment and computer readable storage medium | |
CN113626151B (en) | Container cloud log collection resource control method and system | |
CN105208111B (en) | A kind of method and physical machine of information processing | |
CN109471989A (en) | A kind of page request processing method and relevant apparatus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171024 |
|
RJ01 | Rejection of invention patent application after publication |