CN108848039A - The method and storage medium that server, message are distributed - Google Patents
The method and storage medium that server, message are distributed Download PDFInfo
- Publication number
- CN108848039A CN108848039A CN201810370069.1A CN201810370069A CN108848039A CN 108848039 A CN108848039 A CN 108848039A CN 201810370069 A CN201810370069 A CN 201810370069A CN 108848039 A CN108848039 A CN 108848039A
- Authority
- CN
- China
- Prior art keywords
- client
- message
- message queue
- queue
- consumption
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/50—Queue scheduling
-
- 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/53—Network services using third party service providers
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The present invention relates to a kind of server, the method for message distribution and storage medium, this method to include:After the operation system of each message consumer accesses message system, starting scan procedure is scanned the overstocked value of client consumption message queue and the size of message of consumption per second of each operation system;When the overstocked value for the client consumption message queue for having operation system is greater than predetermined threshold, and after the ratio of the overstocked value of the consumption message queue and the size of message of consumption per second is greater than predetermined ratio, it is marked the client of the operation system as the first client, and mark information is sent to first client;After receiving the balance request for redistributing message queue of first client, the connection for controlling first client and the message queue in the given time disconnects, and the message queue is distributed to the client that other each operation systems of the message queue are consumed in addition to first client.The present invention can prevent message from accumulating, and avoid the occurrence of disk I/O problem.
Description
Technical field
The present invention relates to the methods and storage medium of field of communication technology more particularly to a kind of server, message distribution.
Background technique
Currently, message system is more more and more universal, message producer producer can use the message producer in message system
Relevant message topic topic is issued in producer identity application, and message consumer consumer can use message in message system
Relevant message subject topic is subscribed in consumer's consumer identity application.Consumer is usually a cluster of more machines
Consumption queue is consumed.Resource is occupied since consumer's cluster can be accessed by the user thread, part machine is caused to disappear
It ceases very slow.When news release speed quickly, and it is another straight when occupying message queue to consume slow machine, will lead to message
It is deposited in message system always, message system is easy to appear disk I/O problem, such as disk space is not enough or loses number
According to the problems such as, system performance is low.
Summary of the invention
The method and storage medium distributed the purpose of the present invention is to provide a kind of server, message, it is intended to prevent message
Accumulation avoids the occurrence of disk I/O problem, improves system performance.
To achieve the above object, the present invention provides a kind of server, the server include memory and with the storage
The processor of device connection, is stored with the processing system that can be run on the processor, the processing system in the memory
Following steps are realized when being executed by the processor:
Scanning step starts scan procedure to each business after the operation system of each message consumer accesses message system
The overstocked value of client consumption message queue and the size of message of consumption per second of system are scanned;
Markers step, when the overstocked value for the client consumption message queue for having operation system is greater than predetermined threshold, and this disappears
Take the overstocked value of message queue and the size of message of consumption per second ratio be greater than predetermined ratio after, by the client of the operation system
It is marked as the first client, and mark information is sent to first client;
Step is redistributed, after receiving the balance request for redistributing message queue of first client, predetermined
The connection that first client and the message queue are controlled in time disconnects, and the message queue is distributed to except first client
The client of outer other each operation systems for consuming the message queue in end.
Preferably, when the processing system is executed by the processor, following steps are also realized:
In the client of other each operation systems, when the overstocked value for the client consumption message queue for having operation system is big
In predetermined threshold, and the ratio of the overstocked value of the consumption message queue and the size of message of consumption per second is incited somebody to action greater than after predetermined ratio
The client of the operation system is marked as the second client, and this mark information is sent to second client;
After receiving the balance request for redistributing message queue of second client, analyze first client with
Whether the time that the connection of the message queue disconnects is more than or equal to the predetermined time;
If so, the connection for controlling second client and the message queue in the given time disconnects, and by the message
Queue assignment gives the client that other each operation systems of the message queue are consumed in addition to second client;
If it is not, the connection for then controlling second client and the message queue in the given time disconnects, and by the message
Queue assignment gives the client that other each operation systems of the message queue are consumed in addition to first client, the second client.
Preferably, when the processing system is executed by the processor, following steps are also realized:
The quantity of the client for the operation system that statistics has currently been labeled calculates the operation system being currently labeled
Client accounts for the ratio for consuming the client of all operation systems of the message queue;
Analyze whether the ratio is greater than preset ratio;
If so, send reminder message to message management system, for message management system reminder message is sent to it is pre-
Fixed terminal.
Preferably, when the processing system is executed by the processor, following steps are also realized:
When receiving the message for restarting example for the message queue, by the client of all labeled operation systems
The label and mark information at end are deleted, and the message queue is distributed to the visitor for consuming each operation system of the message queue again
Family end.
To achieve the above object, the present invention also provides a kind of method of message distribution, the method for the message distribution includes:
S1 starts scan procedure to each operation system after the operation system of each message consumer accesses message system
The overstocked value of client consumption message queue and the size of message of consumption per second are scanned;
S2, when the overstocked value for the client consumption message queue for having operation system is greater than predetermined threshold, and the consumption message
After the ratio of the size of message of the overstocked value and consumption per second of queue is greater than predetermined ratio, using the client of the operation system as the
One client is marked, and mark information is sent to first client;
S3 is controlled in the given time after receiving the balance request for redistributing message queue of first client
The connection of first client and the message queue disconnects, and the message queue is distributed to the consumption in addition to first client should
The client of other each operation systems of message queue.
Preferably, after the step S3, further include:
In the client of other each operation systems, when the overstocked value for the client consumption message queue for having operation system is big
In predetermined threshold, and the ratio of the overstocked value of the consumption message queue and the size of message of consumption per second is incited somebody to action greater than after predetermined ratio
The client of the operation system is marked as the second client, and this mark information is sent to second client;
After receiving the balance request for redistributing message queue of second client, analyze first client with
Whether the time that the connection of the message queue disconnects is more than or equal to the predetermined time;
If so, the connection for controlling second client and the message queue in the given time disconnects, and by the message
Queue assignment gives the client that other each operation systems of the message queue are consumed in addition to second client;
If it is not, the connection for then controlling second client and the message queue in the given time disconnects, and by the message
Queue assignment gives the client that other each operation systems of the message queue are consumed in addition to first client, the second client.
Preferably, the method for message distribution further includes:
The quantity of the client for the operation system that statistics has currently been labeled calculates the operation system being currently labeled
Client accounts for the ratio for consuming the client of all operation systems of the message queue;
Analyze whether the ratio is greater than preset ratio;
If so, send reminder message to message management system, for message management system reminder message is sent to it is pre-
Fixed terminal.
Preferably, the method for message distribution further includes:
When receiving the message for restarting example for the message queue, by the client of all labeled operation systems
The label and mark information at end are deleted, and the message queue is distributed to the visitor for consuming each operation system of the message queue again
Family end.
Preferably, the predetermined threshold is 100,000, and the predetermined ratio is 10800.
The present invention also provides a kind of computer readable storage medium, processing is stored on the computer readable storage medium
The step of system, the processing system realizes the method for above-mentioned message distribution when being executed by processor.
The beneficial effects of the invention are as follows:The present invention passes through scanning when the client of each operation system consumes message queue
Its overstocked value for consuming message queue and the size of message of consumption per second, consume slow client if it find that having, are then stamped
Slow label is consumed, then operation is redistributed in starting, and the message queue can not be consumed by controlling the client in the given time,
And the message queue is distributed to other each clients that the message queue is consumed in addition to the client, in this way, and
Shi Faxian consumes slow client, and controls and consume slow client and can not temporarily consume message queue, so that message queue is most
Fast consumption, prevents from accumulating, and avoids the occurrence of disk I/O problem, improves system performance.
Detailed description of the invention
Fig. 1 is the optional application environment schematic diagram of each embodiment one of the invention;
Fig. 2 is the schematic diagram that client of the present invention consumes message queue first embodiment;
Fig. 3 is the schematic diagram that client of the present invention consumes message queue second embodiment;
Fig. 4 is the schematic diagram that client of the present invention consumes message queue 3rd embodiment;
Fig. 5 is the schematic diagram that client of the present invention consumes message queue fourth embodiment;
Fig. 6 is the flow diagram of one embodiment of method of message of the present invention distribution.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right
The present invention is further elaborated.It should be appreciated that described herein, specific examples are only used to explain the present invention, not
For limiting the present invention.Based on the embodiments of the present invention, those of ordinary skill in the art are not before making creative work
Every other embodiment obtained is put, shall fall within the protection scope of the present invention.
It should be noted that the description for being related to " first ", " second " etc. in the present invention is used for description purposes only, and cannot
It is interpreted as its relative importance of indication or suggestion or implicitly indicates the quantity of indicated technical characteristic.Define as a result, " the
One ", the feature of " second " can explicitly or implicitly include at least one of the features.In addition, the skill between each embodiment
Art scheme can be combined with each other, but must be based on can be realized by those of ordinary skill in the art, when technical solution
Will be understood that the combination of this technical solution is not present in conjunction with there is conflicting or cannot achieve when, also not the present invention claims
Protection scope within.
As shown in fig.1, being the application environment schematic diagram of the preferred embodiment of the method for message distribution of the present invention.The application
Environment schematic includes server 1, the client 2 of each operation system and message management system 3.Server 1 can by network,
The client 2 and message management system 3 of the suitable technology such as near-field communication technology and each operation system carry out data interaction.
Terminal where the client 2 of operation system, which includes, but are not limited to any one, to pass through keyboard, mouse with user
The modes such as mark, remote controler, touch tablet or voice-operated device carry out the electronic product of human-computer interaction, for example, personal computer, plate
Computer, smart phone, personal digital assistant (Personal Digital Assistant, PDA), game machine, interactive network
TV (Internet Protocol Television, IPTV), intellectual wearable device, navigation device etc. move
Equipment, or the fixed terminal of such as number TV, desktop computer, notebook, server etc..
The server 1 be it is a kind of can according to the instruction for being previously set or store, automatic progress numerical value calculating and/or
The equipment of information processing.The server 1 can be computer, be also possible to single network server, multiple network servers
The server group of composition or the cloud being made of a large amount of hosts or network server based on cloud computing, wherein cloud computing is point
One kind that cloth calculates, a super virtual computer consisting of a loosely coupled set of computers.
In the present embodiment, server 1 may include, but be not limited only to, and depositing for connection can be in communication with each other by system bus
Reservoir 11, processor 12, network interface 13, memory 11 are stored with the processing system that can be run on the processor 12.It needs to refer to
Out, Fig. 1 illustrates only the server 1 with component 11-13, it should be understood that being not required for implementing all show
Component, the implementation that can be substituted is more or less component.
Wherein, memory 11 includes the readable storage medium storing program for executing of memory and at least one type.Inside save as the operation of server 1
Caching is provided;Readable storage medium storing program for executing can be for if flash memory, hard disk, multimedia card, card-type memory are (for example, SD or DX memory
Deng), random access storage device (RAM), static random-access memory (SRAM), read-only memory (ROM), electric erasable can compile
Journey read-only memory (EEPROM), programmable read only memory (PROM), magnetic storage, disk, CD etc. it is non-volatile
Storage medium.In some embodiments, readable storage medium storing program for executing can be the internal storage unit of server 1, such as the server 1
Hard disk;In further embodiments, which is also possible to the External memory equipment of server 1, such as
The plug-in type hard disk being equipped on server 1, intelligent memory card (Smart Media Card, SMC), secure digital (Secure
Digital, SD) card, flash card (Flash Card) etc..In the present embodiment, the readable storage medium storing program for executing of memory 11 is commonly used in
Storage is installed on the operating system and types of applications software of server 1, such as the journey of the processing system in one embodiment of the invention
Sequence code etc..In addition, memory 11 can be also used for temporarily storing the Various types of data that has exported or will export.
The processor 12 can be in some embodiments central processing unit (Central Processing Unit,
CPU), controller, microcontroller, microprocessor or other data processing chips.The processor 12 is commonly used in the control clothes
Be engaged in the overall operation of device 1, for example, execute with the client 2 of each operation system carry out data interaction or communication it is relevant control and
Processing etc..In the present embodiment, the processor 12 is for running the program code stored in the memory 11 or processing number
According to, such as operation processing system etc..
The network interface 13 may include radio network interface or wired network interface, which is commonly used in
Communication connection is established between the server 1 and other electronic equipments.In the present embodiment, network interface 13 is mainly used for service
Device 1 is connected with the client 2 of multiple operation systems, and data biography is established between server 1 and the client 2 of multiple operation systems
Defeated channel and communication connection.
The processing system is stored in memory 11, is stored in including at least one computer-readable in memory 11
Perhaps program at least one computer-readable instruction or program can be executed by processor device 12 for instruction, to realize the application
The method of each embodiment;And the function that at least one computer-readable instruction is realized according to its each section is different, it can quilt
Divide different logic modules into.
In one embodiment, following steps are realized when above-mentioned processing system is executed by the processor 12:
Scanning step starts scan procedure to each business after the operation system of each message consumer accesses message system
The overstocked value of client consumption message queue and the size of message of consumption per second of system are scanned;
Wherein, operation system can be system used in each department, such as financial system etc. in enterprise.Message system peace
Dress in the server, realizes the distribution of message queue.After the client access message system of each operation system, message queue can
It is consumed with distributing to the client of one or more operation systems.
In process of consumption, start a scan procedure, it is in real time or fixed to carry out to the client of each operation system of access
When scan, including scanning the overstocked value of the client consumption message queue of each operation system and the size of message tps of consumption per second, with
Whether the client consumption message queue for analyzing each operation system is relatively slow.
Markers step, when the overstocked value for the client consumption message queue for having operation system is greater than predetermined threshold, and this disappears
Take the overstocked value of message queue and the size of message of consumption per second ratio be greater than predetermined ratio after, by the client of the operation system
It is marked as the first client, and mark information is sent to first client;
In the present embodiment, when have operation system client consumption message queue overstocked value it is larger, be greater than predetermined threshold,
And the ratio of the size of message of the overstocked value and consumption per second of the client consumption message queue of the operation system is greater than predetermined ratio,
Illustrate that the speed of the client consumption message queue of the operation system is slower than the overstocked speed of message queue, i.e. consumption message team
The speed of column is slower.Preferably, predetermined threshold is 100,000, predetermined ratio 10800.
The client of the slow operation system of above-mentioned consumption message queue is marked, record tag information,
The mark information include client identification, with the message queue connection disconnect time, consume message queue overstocked value and
The ratio etc. of the size of message of consumption per second, and mark information is sent to the client of the operation system.
Step is redistributed, after receiving the balance request for redistributing message queue of first client, predetermined
The connection that first client and the message queue are controlled in time disconnects, and the message queue is distributed to except first client
The client of outer other each operation systems for consuming the message queue in end.
After the first client receives mark information, starting rebalence process is redistributed to message system transmission
The balance request of message queue, after message system receives the balance request, in the predetermined time (for example, the predetermined time is 10 points
Clock) in control the connection of first client and the message queue and disconnect, and only message queue is distributed to except first client
The client of outer other each operation systems for consuming the message queue in end, such message queue, which is reassigned to, consumes fast client
End.
In a specific example, as shown in Fig. 2, message queue the initial stage distribute to operation system client 1,
Client 2, the client of operation system 3, the client of operation system 4 of operation system are consumed.When scan procedure finds business
The overstocked value that the client 1 of system consumes message queue is greater than predetermined threshold, and the overstocked value of the consumption message queue with it is per second
It after the ratio of the size of message of consumption is greater than predetermined ratio, is stamped to the client 1 of operation system and consumes slow label, label is believed
Breath is sent to the client 1 of operation system.In the balance request that the client 1 for receiving operation system is sent, carry out again
Batch operation, as shown in figure 3, at this point, the client 1 of operation system will acquire less than consumption queue consumed, the consumption team
Column consume the client 2, the client of operation system 3, the client of operation system 4 of distributing to operation system.
Compared with prior art, the present embodiment is when the client of each operation system consumes message queue, by scanning it
The overstocked value of message queue and the size of message of consumption per second are consumed, slow client is consumed if it find that having, is then stamped and disappeared
Take slow label, then operation is redistributed in starting, and the message queue can not be consumed by controlling the client in the given time, and
The message queue is distributed to other each clients that the message queue is consumed in addition to the client, in this way, in time
It was found that the slow client of consumption, and control and consume slow client and can not temporarily consume message queue, so that message queue is as early as possible
Consumption, prevents from accumulating, and avoids the occurrence of disk I/O problem, improves system performance.
In a preferred embodiment, on the basis of the above embodiments, when processing system is executed by the processor, also
Realize following steps:
In the client of other each operation systems, when the overstocked value for the client consumption message queue for having operation system is big
In predetermined threshold, and the ratio of the overstocked value of the consumption message queue and the size of message of consumption per second is incited somebody to action greater than after predetermined ratio
The client of the operation system is marked as the second client, and this mark information is sent to second client;
After receiving the balance request for redistributing message queue of second client, analyze first client with
Whether the time that the connection of the message queue disconnects is more than or equal to the predetermined time;
If so, the connection for controlling second client and the message queue in the given time disconnects, and by the message
Queue assignment gives the client that other each operation systems of the message queue are consumed in addition to second client;
If it is not, the connection for then controlling second client and the message queue in the given time disconnects, and by the message
Queue assignment gives the client that other each operation systems of the message queue are consumed in addition to first client, the second client.
Wherein, after the connection of above-mentioned first client and the message queue disconnects, if scan procedure discovery is also
The client consumption message queue of operation system is slower, then marks the client of the operation system as the second client
Note, and the message queue is redistributed again.
Before dispensing, whether the time that the connection of the first client of analysis and the message queue disconnects is more than or equal to pre- timing
Between, i.e., it is no longer valid that consumption was slow mark whether, if failure, which can consume message queue, if do not had
There is failure, then the first client, the second client cannot consume message queue.In this way, the client slow to consumption
End is flexibly controlled, and is enabled the first client to consume message queue again, so that message queue is consumed as early as possible, is prevented heap
Product, further avoids disk I/O problem occur, improves system performance.
In a specific example, as shown in figure 4, when the client 2 of scan procedure discovery operation system consumes message team
Column are slow, then the client 2 of operation system is labeled, if analyzing the client 1 and the message queue of operation system at this time
The time that connection disconnects is more than or equal to the predetermined time, then the connection of client 1 of the operation system message queue, and operation system
Client 2 is labeled then to be disconnected;If the connection of the client 1 and the message queue that analyze operation system at this time disconnects
Time be less than the predetermined time, as shown in figure 5, then the client 1 of operation system, the client of operation system 2 disconnect,
The message queue is only consumed by the client of operation system 3, the client of operation system 4.
In a preferred embodiment, on the basis of the above embodiments, when processing system is executed by the processor, also
Realize following steps:
The quantity of the client for the operation system that statistics has currently been labeled calculates the operation system being currently labeled
Client accounts for the ratio for consuming the client of all operation systems of the message queue;
Analyze whether the ratio is greater than preset ratio;
If so, send reminder message to message management system, for message management system reminder message is sent to it is pre-
Fixed terminal.
Wherein, during the client of scan procedure scanning operation system, the business system being currently labeled is calculated
The client of system accounts for the ratio for consuming the client of all operation systems of the message queue, if the ratio is greater than default ratio
Example, it is preferable that preset ratio 2/3 then sends reminder message to message management system, by message management system according to the prompting
Message will notify FTP client FTP responsible person, for example, sending reminder message to FTP client FTP responsible person's with lettergram mode
Terminal, whether the performance to check these clients consumption message queue is normal, further avoids disk I/O problem occur, mentions
High system performance.
In a preferred embodiment, on the basis of the above embodiments, when processing system is executed by the processor, also
Realize following steps:
When receiving the message for restarting example for the message queue, by the client of all labeled operation systems
The label and mark information at end are deleted, and the message queue is distributed to the visitor for consuming each operation system of the message queue again
Family end.
Wherein, if message system restarts example, the slow mark of the consumption of the client of all labeled operation systems
Note will be deleted, and the client of each operation system can consume the message queue again, scan hair by scan procedure again later
The client for now consuming slow operation system, without waiting the client for receiving operation system after balance request just to have an opportunity
Again message queue is consumed, flexibility is improved.
As shown in fig. 6, Fig. 6 is the flow diagram of one embodiment of method of message of the present invention distribution, message distribution
Method includes the following steps:
Step S1 starts scan procedure to each business system after the operation system of each message consumer accesses message system
The overstocked value of client consumption message queue and the size of message of consumption per second of system are scanned;
Wherein, operation system can be system used in each department, such as financial system etc. in enterprise.Message system peace
Dress in the server, realizes the distribution of message queue.After the client access message system of each operation system, message queue can
It is consumed with distributing to the client of one or more operation systems.
In process of consumption, start a scan procedure, it is in real time or fixed to carry out to the client of each operation system of access
When scan, including scanning the overstocked value of the client consumption message queue of each operation system and the size of message tps of consumption per second, with
Whether the client consumption message queue for analyzing each operation system is relatively slow.
Step S2, when the overstocked value for the client consumption message queue for having operation system is greater than predetermined threshold, and the consumption
After the ratio of the size of message of the overstocked value and consumption per second of message queue is greater than predetermined ratio, the client of the operation system is made
It is marked for the first client, and mark information is sent to first client;
In the present embodiment, when have operation system client consumption message queue overstocked value it is larger, be greater than predetermined threshold,
And the ratio of the size of message of the overstocked value and consumption per second of the client consumption message queue of the operation system is greater than predetermined ratio,
Illustrate that the speed of the client consumption message queue of the operation system is slower than the overstocked speed of message queue, i.e. consumption message team
The speed of column is slower.Preferably, predetermined threshold is 100,000, predetermined ratio 10800.
The client of the slow operation system of above-mentioned consumption message queue is marked, record tag information,
The mark information include client identification, with the message queue connection disconnect time, consume message queue overstocked value and
The ratio etc. of the size of message of consumption per second, and mark information is sent to the client of the operation system.
Step S3, after receiving the balance request for redistributing message queue of first client, in the given time
The connection for controlling first client and the message queue disconnects, and the message queue is distributed to and is disappeared in addition to first client
Take the client of other each operation systems of the message queue.
After the first client receives mark information, starting rebalence process is redistributed to message system transmission
The balance request of message queue, after message system receives the balance request, in the predetermined time (for example, the predetermined time is 10 points
Clock) in control the connection of first client and the message queue and disconnect, and only message queue is distributed to except first client
The client of outer other each operation systems for consuming the message queue in end, such message queue, which is reassigned to, consumes fast client
End.
Compared with prior art, the present embodiment is when the client of each operation system consumes message queue, by scanning it
The overstocked value of message queue and the size of message of consumption per second are consumed, slow client is consumed if it find that having, is then stamped and disappeared
Take slow label, then operation is redistributed in starting, and the message queue can not be consumed by controlling the client in the given time, and
The message queue is distributed to other each clients that the message queue is consumed in addition to the client, in this way, in time
It was found that the slow client of consumption, and control and consume slow client and can not temporarily consume message queue, so that message queue is as early as possible
Consumption, prevents from accumulating, and avoids the occurrence of disk I/O problem, improves system performance.
It in a preferred embodiment, further include following after the step S3 on the basis of above-mentioned Fig. 6 embodiment
Step:
In the client of other each operation systems, when the overstocked value for the client consumption message queue for having operation system is big
In predetermined threshold, and the ratio of the overstocked value of the consumption message queue and the size of message of consumption per second is incited somebody to action greater than after predetermined ratio
The client of the operation system is marked as the second client, and this mark information is sent to second client;
After receiving the balance request for redistributing message queue of second client, analyze first client with
Whether the time that the connection of the message queue disconnects is more than or equal to the predetermined time;
If so, the connection for controlling second client and the message queue in the given time disconnects, and by the message
Queue assignment gives the client that other each operation systems of the message queue are consumed in addition to second client;
If it is not, the connection for then controlling second client and the message queue in the given time disconnects, and by the message
Queue assignment gives the client that other each operation systems of the message queue are consumed in addition to first client, the second client.
Wherein, after the connection of above-mentioned first client and the message queue disconnects, if scan procedure discovery is also
The client consumption message queue of operation system is slower, then marks the client of the operation system as the second client
Note, and the message queue is redistributed again.
Before dispensing, whether the time that the connection of the first client of analysis and the message queue disconnects is more than or equal to pre- timing
Between, i.e., it is no longer valid that consumption was slow mark whether, if failure, which can consume message queue, if do not had
There is failure, then the first client, the second client cannot consume message queue.In this way, the client slow to consumption
End is flexibly controlled, and is enabled the first client to consume message queue again, so that message queue is consumed as early as possible, is prevented heap
Product, further avoids disk I/O problem occur, improves system performance.
In a preferred embodiment, on the basis of the above embodiments, the method for the message distribution further includes:
The quantity of the client for the operation system that statistics has currently been labeled calculates the operation system being currently labeled
Client accounts for the ratio for consuming the client of all operation systems of the message queue;
Analyze whether the ratio is greater than preset ratio;
If so, send reminder message to message management system, for message management system reminder message is sent to it is pre-
Fixed terminal.
Wherein, during the client of scan procedure scanning operation system, the business system being currently labeled is calculated
The client of system accounts for the ratio for consuming the client of all operation systems of the message queue, if the ratio is greater than default ratio
Example, it is preferable that preset ratio 2/3 then sends reminder message to message management system, by message management system according to the prompting
Message will notify FTP client FTP responsible person, for example, sending reminder message to FTP client FTP responsible person's with lettergram mode
Terminal, whether the performance to check these clients consumption message queue is normal, further avoids disk I/O problem occur, mentions
High system performance.
In a preferred embodiment, on the basis of the above embodiments, the method for the message distribution further includes:
When receiving the message for restarting example for the message queue, by the client of all labeled operation systems
The label and mark information at end are deleted, and the message queue is distributed to the visitor for consuming each operation system of the message queue again
Family end.
Wherein, if message system restarts example, the slow mark of the consumption of the client of all labeled operation systems
Note will be deleted, and the client of each operation system can consume the message queue again, scan hair by scan procedure again later
The client for now consuming slow operation system, without waiting the client for receiving operation system after balance request just to have an opportunity
Again message queue is consumed, flexibility is improved.
The present invention also provides a kind of computer readable storage medium, processing is stored on the computer readable storage medium
The step of system, the processing system realizes the method for above-mentioned message distribution when being executed by processor.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art
The part contributed out can be embodied in the form of software products, which is stored in a storage medium
In (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be mobile phone, computer, clothes
Business device, air conditioner or the network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair
Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills
Art field, is included within the scope of the present invention.
Claims (10)
1. a kind of server, which is characterized in that the server includes memory and the processor that connect with the memory, institute
The processing system for being stored with and being run in memory on the processor is stated, when the processing system is executed by the processor
Realize following steps:
Scanning step starts scan procedure to each operation system after the operation system of each message consumer accesses message system
Client consumption message queue overstocked value and the size of message of consumption per second be scanned;
Markers step, when the overstocked value for the client consumption message queue for having operation system is greater than predetermined threshold, and the consumption disappears
Cease queue overstocked value and consumption per second size of message ratio be greater than predetermined ratio after, using the client of the operation system as
First client is marked, and mark information is sent to first client;
Step is redistributed, after receiving the balance request for redistributing message queue of first client, in the predetermined time
The interior connection disconnection for controlling first client and the message queue, and the message queue is distributed in addition to first client
Consume the client of other each operation systems of the message queue.
2. server according to claim 1, which is characterized in that when the processing system is executed by the processor, also
Realize following steps:
In the client of other each operation systems, when the overstocked value for the client consumption message queue for having operation system is greater than in advance
Threshold value is determined, and after the ratio of the overstocked value of the consumption message queue and the size of message of consumption per second is greater than predetermined ratio, by the industry
The client of business system is marked as the second client, and this mark information is sent to second client;
After receiving the balance request for redistributing message queue of second client, analyzes first client and disappear with this
Whether the time that the connection of breath queue disconnects is more than or equal to the predetermined time;
If so, the connection for controlling second client and the message queue in the given time disconnects, and by the message queue
Distribute to the client that other each operation systems of the message queue are consumed in addition to second client;
If it is not, the connection for then controlling second client and the message queue in the given time disconnects, and by the message queue
Distribute to the client that other each operation systems of the message queue are consumed in addition to first client, the second client.
3. server according to claim 1 or 2, which is characterized in that when the processing system is executed by the processor,
Also realize following steps:
The quantity of the client for the operation system that statistics has currently been labeled calculates the client for the operation system being currently labeled
End accounts for the ratio for consuming the client of all operation systems of the message queue;
Analyze whether the ratio is greater than preset ratio;
If so, send reminder message to message management system, for message management system reminder message is sent to it is scheduled
Terminal.
4. server according to claim 1 or 2, which is characterized in that when the processing system is executed by the processor,
Also realize following steps:
When receiving the message for restarting example for the message queue, by the client of all labeled operation systems
Label and mark information are deleted, and the message queue is distributed to the client for consuming each operation system of the message queue again
End.
5. a kind of method of message distribution, which is characterized in that the method for the message distribution includes:
S1, after the operation system of each message consumer accesses message system, client of the starting scan procedure to each operation system
The overstocked value of end consumption message queue and the size of message of consumption per second are scanned;
S2, when the overstocked value for the client consumption message queue for having operation system is greater than predetermined threshold, and the consumption message queue
Overstocked value and consumption per second size of message ratio be greater than predetermined ratio after, using the client of the operation system as first visitor
Family end is marked, and mark information is sent to first client;
S3, after receiving the balance request for redistributing message queue of first client, control in the given time this
The connection of one client and the message queue disconnects, and the message queue is distributed to and consumes the message in addition to first client
The client of other each operation systems of queue.
6. the method for message distribution according to claim 5, which is characterized in that after the step S3, further include:
In the client of other each operation systems, when the overstocked value for the client consumption message queue for having operation system is greater than in advance
Threshold value is determined, and after the ratio of the overstocked value of the consumption message queue and the size of message of consumption per second is greater than predetermined ratio, by the industry
The client of business system is marked as the second client, and this mark information is sent to second client;
After receiving the balance request for redistributing message queue of second client, analyzes first client and disappear with this
Whether the time that the connection of breath queue disconnects is more than or equal to the predetermined time;
If so, the connection for controlling second client and the message queue in the given time disconnects, and by the message queue
Distribute to the client that other each operation systems of the message queue are consumed in addition to second client;
If it is not, the connection for then controlling second client and the message queue in the given time disconnects, and by the message queue
Distribute to the client that other each operation systems of the message queue are consumed in addition to first client, the second client.
7. the method for message distribution according to claim 5 or 6, which is characterized in that the method for the message distribution is also wrapped
It includes:
The quantity of the client for the operation system that statistics has currently been labeled calculates the client for the operation system being currently labeled
End accounts for the ratio for consuming the client of all operation systems of the message queue;
Analyze whether the ratio is greater than preset ratio;
If so, send reminder message to message management system, for message management system reminder message is sent to it is scheduled
Terminal.
8. the method for message distribution according to claim 5 or 6, which is characterized in that the method for the message distribution is also wrapped
It includes:
When receiving the message for restarting example for the message queue, by the client of all labeled operation systems
Label and mark information are deleted, and the message queue is distributed to the client for consuming each operation system of the message queue again
End.
9. the method for message distribution according to claim 5 or 6, which is characterized in that the predetermined threshold is 100,000, institute
Stating predetermined ratio is 10800.
10. a kind of computer readable storage medium, which is characterized in that be stored with processing system on the computer readable storage medium
System, the method that the message as described in any one of claim 5 to 9 is distributed is realized when the processing system is executed by processor
Step.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810370069.1A CN108848039B (en) | 2018-04-24 | 2018-04-24 | Server, message distribution method and storage medium |
PCT/CN2018/102090 WO2019205371A1 (en) | 2018-04-24 | 2018-08-24 | Server, message allocation method, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810370069.1A CN108848039B (en) | 2018-04-24 | 2018-04-24 | Server, message distribution method and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108848039A true CN108848039A (en) | 2018-11-20 |
CN108848039B CN108848039B (en) | 2021-11-02 |
Family
ID=64212225
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810370069.1A Active CN108848039B (en) | 2018-04-24 | 2018-04-24 | Server, message distribution method and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN108848039B (en) |
WO (1) | WO2019205371A1 (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110502402A (en) * | 2019-08-28 | 2019-11-26 | 中国联合网络通信集团有限公司 | Message treatment method, equipment and terminal device |
CN110515746A (en) * | 2019-08-22 | 2019-11-29 | 北京宝兰德软件股份有限公司 | A kind of method and device handling slow consumer |
CN111045837A (en) * | 2019-11-26 | 2020-04-21 | 福建天泉教育科技有限公司 | Cross-service consumption method and storage medium |
CN112181737A (en) * | 2020-09-25 | 2021-01-05 | 中国建设银行股份有限公司 | Message processing method and device, electronic equipment and medium |
CN112612607A (en) * | 2020-12-16 | 2021-04-06 | 平安消费金融有限公司 | Data processing method, device, computer equipment and medium based on message queue |
CN112764892A (en) * | 2019-10-21 | 2021-05-07 | 伊姆西Ip控股有限责任公司 | Method, apparatus and computer program product for managing processes |
CN115174682A (en) * | 2022-06-17 | 2022-10-11 | 中国银联股份有限公司 | Data distribution method, system, center, device and computer readable storage medium |
CN112612607B (en) * | 2020-12-16 | 2024-07-09 | 平安消费金融有限公司 | Data processing method, device, computer equipment and medium based on message queue |
Families Citing this family (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111008087B (en) * | 2019-12-25 | 2024-03-15 | 上海众源网络有限公司 | Message processing method and device |
CN111475313B (en) * | 2020-03-04 | 2023-06-27 | 江苏理工学院 | Message queue construction method and device suitable for forward propagation of convolutional neural network |
CN113806102B (en) * | 2020-06-15 | 2023-11-21 | 中国移动通信集团浙江有限公司 | Message queue processing method and device and computing equipment |
CN111858099B (en) * | 2020-07-24 | 2024-05-28 | 海尔优家智能科技(北京)有限公司 | Message subscription method and device |
CN111930533A (en) * | 2020-07-28 | 2020-11-13 | 银盛支付服务股份有限公司 | Method and system for orderly processing production and consumption same data based on kafka |
CN112000476A (en) * | 2020-08-21 | 2020-11-27 | 南京星邺汇捷网络科技有限公司 | Queue-based task execution flow control method and system |
CN112612631B (en) * | 2020-12-29 | 2024-04-02 | 杭州涂鸦信息技术有限公司 | Message queue accumulation detection method and related device |
CN114584625B (en) * | 2022-01-24 | 2024-03-26 | 北京达佳互联信息技术有限公司 | Message processing method and device, electronic equipment and storage medium |
CN114827033B (en) * | 2022-04-15 | 2024-04-19 | 咪咕文化科技有限公司 | Data flow control method, device, equipment and computer readable storage medium |
CN115412208A (en) * | 2022-08-09 | 2022-11-29 | 唯阜德(武汉)科技有限公司 | Message transmission method and system for message queue management system |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102457906A (en) * | 2010-10-26 | 2012-05-16 | 中国移动通信集团河南有限公司 | Load balancing control method and system of message queues |
CN106385375A (en) * | 2015-07-31 | 2017-02-08 | 北京国双科技有限公司 | Load balancing method used for message queues and apparatus thereof |
KR20180058880A (en) * | 2016-11-24 | 2018-06-04 | (주)케이아이엔엑스 | Load balancing and performance optimizing methods of message queues in the distributed openstack cloud data centers |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9807015B2 (en) * | 2014-03-19 | 2017-10-31 | Dell Products L.P. | Message processing using dynamic load balancing queues in a messaging system |
CN105786909A (en) * | 2014-12-25 | 2016-07-20 | 北京东方通科技股份有限公司 | Message queue backlog load self-adaptive application triggering method and system |
CN106656760B (en) * | 2016-12-28 | 2018-02-06 | 广州赛意信息科技股份有限公司 | A kind of message delivery method and system based on message queue |
-
2018
- 2018-04-24 CN CN201810370069.1A patent/CN108848039B/en active Active
- 2018-08-24 WO PCT/CN2018/102090 patent/WO2019205371A1/en active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102457906A (en) * | 2010-10-26 | 2012-05-16 | 中国移动通信集团河南有限公司 | Load balancing control method and system of message queues |
CN106385375A (en) * | 2015-07-31 | 2017-02-08 | 北京国双科技有限公司 | Load balancing method used for message queues and apparatus thereof |
KR20180058880A (en) * | 2016-11-24 | 2018-06-04 | (주)케이아이엔엑스 | Load balancing and performance optimizing methods of message queues in the distributed openstack cloud data centers |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110515746A (en) * | 2019-08-22 | 2019-11-29 | 北京宝兰德软件股份有限公司 | A kind of method and device handling slow consumer |
CN110502402A (en) * | 2019-08-28 | 2019-11-26 | 中国联合网络通信集团有限公司 | Message treatment method, equipment and terminal device |
CN110502402B (en) * | 2019-08-28 | 2023-03-21 | 中国联合网络通信集团有限公司 | Message processing method and device and terminal device |
CN112764892A (en) * | 2019-10-21 | 2021-05-07 | 伊姆西Ip控股有限责任公司 | Method, apparatus and computer program product for managing processes |
CN111045837A (en) * | 2019-11-26 | 2020-04-21 | 福建天泉教育科技有限公司 | Cross-service consumption method and storage medium |
CN111045837B (en) * | 2019-11-26 | 2023-10-20 | 福建天泉教育科技有限公司 | Cross-service consumption method and storage medium |
CN112181737A (en) * | 2020-09-25 | 2021-01-05 | 中国建设银行股份有限公司 | Message processing method and device, electronic equipment and medium |
CN112612607A (en) * | 2020-12-16 | 2021-04-06 | 平安消费金融有限公司 | Data processing method, device, computer equipment and medium based on message queue |
CN112612607B (en) * | 2020-12-16 | 2024-07-09 | 平安消费金融有限公司 | Data processing method, device, computer equipment and medium based on message queue |
CN115174682A (en) * | 2022-06-17 | 2022-10-11 | 中国银联股份有限公司 | Data distribution method, system, center, device and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
WO2019205371A1 (en) | 2019-10-31 |
CN108848039B (en) | 2021-11-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108848039A (en) | The method and storage medium that server, message are distributed | |
CN109451051B (en) | Service request processing method and device, electronic equipment and storage medium | |
CN102890643B (en) | Resource scheduling system based on immediate feedback of application effect under display card virtualization | |
US10505832B2 (en) | Resource coordinate system for data centers | |
CN107729137B (en) | Server, block chain signature verification decryption method and storage medium | |
CN108462760A (en) | Electronic device, cluster access domain name automatic generation method and storage medium | |
CN109376011B (en) | Method and device for managing resources in virtualization system | |
CN114096953A (en) | Memory management method and device, electronic equipment and computer readable medium | |
CN111930525B (en) | GPU resource use method, electronic device and computer readable medium | |
CN113452774B (en) | Message pushing method, device, equipment and storage medium | |
CN107682391B (en) | Electronic device, server allocation control method, and computer-readable storage medium | |
CN110580195B (en) | Memory allocation method and device based on memory hot plug | |
CN108563472B (en) | Service plug-in loading method and device based on multi-open application | |
CN110287007A (en) | Data call response method, server and computer readable storage medium | |
CN103428260A (en) | System and method for allocating server to terminal and efficiently delivering messages to the terminal | |
CN111432019B (en) | Cloud game device distribution method and system based on edge cloud cooperation mode | |
CN108491466A (en) | Electronic device, access instruction information acquisition method and storage medium | |
CN112114959B (en) | Resource scheduling method, distributed system, computer device and storage medium | |
CN114146406A (en) | Method and device for allocating operation resources, electronic equipment and storage medium | |
CN113094165A (en) | Method for increasing speed of loading application program at cloud end | |
CN110069493B (en) | Data processing method, device, computer equipment and storage medium | |
CN112181737A (en) | Message processing method and device, electronic equipment and medium | |
CN105930397B (en) | A kind of message treatment method and system | |
CN110737320A (en) | Power consumption detection method and device, electronic equipment and storage medium | |
CN111984273B (en) | Application program management method, device and system based on embedded operating system |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |