CN110162410A - A kind of message treatment method and device - Google Patents
A kind of message treatment method and device Download PDFInfo
- Publication number
- CN110162410A CN110162410A CN201810144874.2A CN201810144874A CN110162410A CN 110162410 A CN110162410 A CN 110162410A CN 201810144874 A CN201810144874 A CN 201810144874A CN 110162410 A CN110162410 A CN 110162410A
- Authority
- CN
- China
- Prior art keywords
- message
- subregion
- segmentation
- location information
- user
- 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
- 238000000034 method Methods 0.000 title claims abstract description 44
- 230000011218 segmentation Effects 0.000 claims abstract description 86
- 238000012545 processing Methods 0.000 claims abstract description 31
- 238000005192 partition Methods 0.000 claims abstract description 12
- 238000012790 confirmation Methods 0.000 claims description 47
- 239000012634 fragment Substances 0.000 claims description 24
- 238000004590 computer program Methods 0.000 claims description 8
- 238000000151 deposition Methods 0.000 claims 1
- 235000013399 edible fruits Nutrition 0.000 claims 1
- 230000005540 biological transmission Effects 0.000 abstract description 6
- 238000010586 diagram Methods 0.000 description 16
- 230000006870 function Effects 0.000 description 9
- 230000006854 communication Effects 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 230000007246 mechanism Effects 0.000 description 4
- 230000008929 regeneration Effects 0.000 description 4
- 238000011069 regeneration method Methods 0.000 description 4
- 230000008901 benefit Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 230000005291 magnetic effect Effects 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 239000003795 chemical substances by application Substances 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 210000003127 knee Anatomy 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
Classifications
-
- 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/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/546—Message passing systems or structures, e.g. queues
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a kind of message treatment method and devices, are related to field of computer technology.One specific embodiment of this method includes: message-oriented middleware according to the acquisition request received, finds out subregion identical with the type of message of the acquisition request;Wherein, the acquisition request includes the type of message of user's mark and institute's request, and the subregion preserves the storage location information of message;The message-oriented middleware selects a segmentation according to the consumption location information of the subregion from the subregion;Wherein, the subregion includes at least one described segmentation;The message-oriented middleware exports message corresponding with the segmentation to message user according to user mark and the storage location information.For the embodiment by the way that each subregion to be segmented, parallel processed messages between difference segmentation, so that the message number of processing is double, reduce message transmission time delay in the case where not increasing number of partitions.
Description
Technical field
The present invention relates to computer field more particularly to a kind of message treatment methods and device.
Background technique
Data interaction is carried out between different applications at present, in order to reach the purpose of using decoupling, can introduce a message
Middleware.Assuming that disposing one in first computer room applies A, as message generation side;One is disposed in second computer room and applies B, as disappearing
Cease user.Message generation side the message of generation is sent to message-oriented middleware Broker (Broker be receive, save, point
Send out message application, the agent side as Message Processing) in keep in;Message user obtains message from Broker, it
After execute corresponding service logic.In above-mentioned message processing procedure, one side message generation side want can it is fast and reliable general
Message is sent to Broker and stores, another aspect message user again requirement can with most fast speed by message from Broker
It pulls and then is consumed.Therefore, either sending message, still to pull message slowly slow, can all cause the delay of message transmission.
The prior art passes through ROKETMQ (be a distributed message-oriented middleware, only this one mode of distribution subscription)
Carry out Message Processing, provide individual log file (Journal) be synchronously written, multi partition (Partition) asynchronous index
Function.Individual log file is synchronously written, and guarantees the fast and reliable write-in Broker of the message energy that message generation side is sent;
The asynchronous index of multi partition improves the speed that message user concurrently pulls message to a certain extent.
In realizing process of the present invention, at least there are the following problems in the prior art for inventor's discovery:
(1) although index file is asynchronous write disk, it will do it brush operation in write-in, if subregion
Quantity will lead to the problem of disk random write too much, influence being synchronously written for journal file, and then lead to message sending performance
Decline.
(2) since the quantity of subregion is fixed, and the per thread of each message user is limited to the processing capacity of message, when
When a large amount of overstock occurs in message, it can not dispose in time and overstock ground message.
Summary of the invention
In view of this, the embodiment of the present invention provides a kind of message treatment method and device, by being divided each subregion
Section, parallel processed messages between difference segmentation, in the case where not increasing number of partitions, so that the message number of processing is double,
Reduce message transmission time delay.
Realize that above-mentioned purpose provides a kind of message treatment method according to an aspect of an embodiment of the present invention.
A kind of message treatment method of the embodiment of the present invention, comprising: message-oriented middleware is searched according to the acquisition request received
Subregion identical with the type of message of the acquisition request out;Wherein, the acquisition request includes user's mark and is requested
The type of message of acquisition, the subregion preserve the storage location information of message;The message-oriented middleware is according to the subregion
Location information is consumed, a segmentation is selected from the subregion;Wherein, the subregion includes at least one described segmentation;Institute
Message-oriented middleware is stated according to user mark and the storage location information, message corresponding with the segmentation is exported
To message user.
Optionally, the message-oriented middleware finds out the message class with the acquisition request according to the acquisition request received
Before the step of type identical subregion, further includes: an at least segmentation is respectively set for each subregion;Wherein, one
Message number corresponding to number of fragments and a segmentation on a subregion determines according to demand, and all subregions
Number of fragments be greater than all number of partitions.
Optionally, the message-oriented middleware, will be with described point according to user mark and the storage location information
After the step of corresponding message of section is exported to message user, further includes: received in scheduled time-out time with it is described
The corresponding confirmation message of message, if the location information of the confirmation message is continuous in the segmentation and from the segmentation pair
The head for the subregion answered starts in the subregion continuously, then using the last one location information continuously confirmed as the subregion
Confirmation location information;Location information is consumed according to the confirmation updating location information of the subregion.
Optionally, the message-oriented middleware, will be with described point according to user mark and the storage location information
After the step of corresponding message of section is exported to message user, further includes: if do not received in the time-out time with
The corresponding confirmation message of the message, then export the message again.
Optionally, after described the step of finding out subregion identical with the type of message of the acquisition request and described
Message-oriented middleware is gone back before the step of selecting a segmentation in the subregion according to the consumption location information of the subregion
If include: in the subregion message corresponding with all segmentations all consumed, reset in the subregion
The segmentation.
To achieve the above object, other side according to an embodiment of the present invention provides a kind of message processing apparatus.
A kind of message processing apparatus of the embodiment of the present invention, comprising: searching module, for according to the acquisition request that receives,
Find out subregion identical with the type of message of the acquisition request;Wherein, the acquisition request includes user's mark and institute
The type of message of request, the subregion preserve the storage location information of message;Module is chosen, for according to the subregion
Consumption location information, a segmentation is selected from the subregion;Wherein, the subregion includes at least one described segmentation;
Output module is used for according to user mark and the storage location information, will be defeated with the corresponding message of the segmentation
Out to message user.
Optionally, described device further include: setup module, for being respectively set at least described in one for each subregion
Segmentation;Wherein, message number corresponding to the number of fragments and a segmentation on a subregion is true according to demand
It is fixed, and the number of fragments of all subregions is greater than all number of partitions.
Optionally, described device further include: update module, for being received and the message phase in scheduled time-out time
Corresponding confirmation message, if the location information of the confirmation message is continuous in the segmentation and is segmented corresponding point from described
The head in area starts in the subregion continuously, then using the last one location information continuously confirmed as the confirmation of the subregion
Location information;And location information is consumed according to the confirmation updating location information of the subregion.
Optionally, described device further include: output module again, if for not received in the time-out time and institute
The corresponding confirmation message of message is stated, then exports the message again.
Optionally, described device further include: module is reset, if for corresponding with all segmentations in the subregion
Message all consumed, then the segmentation is reset in the subregion.
To achieve the above object, according to an embodiment of the present invention in another aspect, providing a kind of electronic equipment.
The a kind of electronic equipment of the embodiment of the present invention, comprising: one or more processors;Storage device, for storing one
A or multiple programs, when one or more of programs are executed by one or more of processors, so that one or more
A processor realizes a kind of message treatment method of the embodiment of the present invention.
To achieve the above object, according to an embodiment of the present invention in another aspect, providing a kind of computer-readable medium.
A kind of computer-readable medium of the embodiment of the present invention, is stored thereon with computer program, and described program is processed
A kind of message treatment method of the embodiment of the present invention is realized when device executes.
One embodiment in foregoing invention has the following advantages that or the utility model has the advantages that by the way that each subregion to be segmented,
Parallel processed messages between difference segmentation, so that the message number of processing is double, reduces and disappear in the case where not increasing subregion
Cease delivery lag;The number of fragments of the on-demand each subregion of flexible setting and it is respectively segmented corresponding message number, has both supported high property
The highly reliable carry out message write-in of energy, and can guarantee that high-performance carries out message and pulls;According to the consumption of confirmation message regeneration block
Location information and overtime affirmation mechanism, can ensure that will not lose message the case where supporting high concurrent;It is adjusted by dynamic
The number of fragments of each subregion improves whole Message Processing speed.
Further effect possessed by above-mentioned non-usual optional way adds hereinafter in conjunction with specific embodiment
With explanation.
Detailed description of the invention
Attached drawing for a better understanding of the present invention, does not constitute an undue limitation on the present invention.Wherein:
Fig. 1 is the schematic diagram of the key step of message treatment method according to an embodiment of the present invention;
Fig. 2 is the architecture diagram of message treatment method in the prior art;
Fig. 3 is the architecture diagram of message treatment method according to an embodiment of the present invention;
Fig. 4 is the main flow schematic diagram of message treatment method according to an embodiment of the present invention;
Fig. 5 is the schematic diagram of the main modular of message processing apparatus according to an embodiment of the present invention;
Fig. 6 is that the embodiment of the present invention can be applied to exemplary system architecture figure therein;
Fig. 7 is the structural schematic diagram for being suitable for the computer installation of the electronic equipment to realize the embodiment of the present invention.
Specific embodiment
Below in conjunction with attached drawing, an exemplary embodiment of the present invention will be described, including the various of the embodiment of the present invention
Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize
It arrives, it can be with various changes and modifications are made to the embodiments described herein, without departing from scope and spirit of the present invention.Together
Sample, for clarity and conciseness, descriptions of well-known functions and structures are omitted from the following description.
Below to the present embodiments relate to word be explained.
Message generation side: message is generated, the message of generation is sent to the application of Broker.
Message user: subscribing to message, obtains the message subscribed to and the application handled from Broker.
Message: the data transmitted between message generation side and message user.
Fig. 1 is the schematic diagram of the key step of message treatment method according to an embodiment of the present invention.As shown in Figure 1, this hair
The message treatment method of bright embodiment, mainly includes the following steps:
Step S101: message-oriented middleware finds out the type of message with the acquisition request according to the acquisition request received
Identical subregion;Wherein, the acquisition request includes the type of message of user's mark and institute's request, and the subregion saves
There is the storage location information of message.User's mark is used to unique identification message user.Message generator generates message
After send a message to message-oriented middleware;Message-oriented middleware stores the message, and saves the storage location information of the message.Message
Middleware receives the acquisition request from message user, finds out corresponding subregion, embodiment according to the type of message in request
In the type of message be the theme.
Step S102: the message-oriented middleware is selected from the subregion according to the consumption location information of the subregion
One segmentation;Wherein, the subregion includes at least one described segmentation.Message-oriented middleware is that each subregion is respectively provided in advance
Few one is segmented, and message number corresponding to the number of fragments and each segmentation on each subregion determines according to actual needs.
The message that the consumption location information of the subregion is used to indicate that the subregion has been consumed (is pulled and is located by message user
The message of reason), it (is not point consumed that a freed segment is selected from the message that the subregion is not consumed
Section).
Step S103: the message-oriented middleware according to the user mark and the storage location information, will with it is described
Corresponding message is segmented to export to message user.Message-oriented middleware is right according to storage location acquisition of information segmentation institute
The entire message or part messages answered are exported later to corresponding message user.
Fig. 2 is the architecture diagram of message treatment method in the prior art.As shown in Fig. 2, the message treatment method is by Broker
It realizes.The Journal of Broker is written in the message synchronization of generation by message generation side.Broker is asynchronous to establish index file, should
Include 5 subregions in index file, is Partition1 to Partition5 respectively;Each small cube correspondence preserves one and disappears
Cease the location information in Journal.Message user is pulled to Broker respectively by 5 threads (thread 1 to thread 5)
Message is simultaneously handled.
Fig. 3 is the architecture diagram of message treatment method according to an embodiment of the present invention.As shown in figure 3, the embodiment of the present invention
Message treatment method is realized by the Broker of message-oriented middleware.Message generation side is by the message synchronization write-in Broker's of generation
Journal.Broker is asynchronous to establish index file, in the index file include 5 subregions, be respectively Partition1 extremely
Partition5;Each subregion is provided with 2 segmentations, Partition1 be segmented into P1_ be segmented 1 and P1_ segmentation 2,
Partition2 be segmented into P2_ be segmented 1 and P2_ segmentation 2, Partition3 be segmented into P3_ be segmented 1 and P3_ segmentation 2,
Partition4 be segmented into P4_ be segmented 1 and P4_ segmentation 2, Partition5 be segmented into P5_ be segmented 1 and P5_ segmentation 2;Often
A small cube correspondence preserves storage location information of the message in Journal.Message user passes through 10 thread (lines
Journey 1 is to thread 10), message is pulled to Broker respectively and is handled.The embodiment of the present invention in the case where not increasing number of partitions,
By setting segmentation so that more threads can be used to pull message for message user in the same time, compared to the mode in Fig. 2
The speed for pulling message is double.
Fig. 4 is the main flow schematic diagram of message treatment method according to an embodiment of the present invention.As shown in figure 4, of the invention
The message treatment method of embodiment, mainly comprises the steps that
Step S401: message generation side connects Broker, and Journal is written in each message synchronization of generation later.
The original contents of message are saved in Journal.In the embodiment of the present invention, synchronize after referring to that a thread is finished, ability
Execute next thread;It is asynchronous to refer to while executing a thread, another thread can be executed.Which takes full advantage of
The sequence write attribute of disk, and realize the message write-in of reliable low delay.It include theme (Topic) and subregion in message.Wherein,
Topic is the logical division of message, for example includes inventory's class message and order class message in message, then can be used Topic1 to store library
Deposit class message, Topic2 storage order class message.
The asynchronous creation index file of step S402:Broker.Wherein, every message is preserved in the index file to exist
Storage location information in Journal, the index file include at least one Topic, and each Topic includes at least one point
Area.Storage location information of the every message in Journal is written in the subregion of specified Topic.
Step S403:Broker is that at least one segmentation is respectively set in each subregion in advance.Each point is determined according to demand
Message number corresponding to number of fragments and each segmentation in area, and the number of fragments of all subregions is greater than all subregions
Quantity.Number of partitions can not increased so that 2 segmentations are arranged in each subregion as an example with parallel processed messages between difference segmentation
In the case where, the quantity of concurrent processing message can be double.Corresponding to number of fragments and each segmentation on each subregion
Message number can dynamically adjust, by taking order as an example, businessman is promoted within certain time, then order numbers can be a large amount of
Increase, then can increase the message number in number of fragments and segmentation, specific value is artificially specified.
Step S404: message user connects Broker, sends to obtain to Broker by one or more thread and ask
It asks.Wherein, include in the acquisition request user's mark and institute's request message theme, in the acquisition request
User's mark such as can be Consumer1, Consumer2, and theme can be Topic1, Topic2.As message user
When being multiple, each message user is separately connected Broker, and sends acquisition request to Broker by respective thread.
After step S405:Broker receives acquisition request, subregion identical with the theme of the acquisition request is found out.
Assuming that Topic1 correspond to subregion be Partition1 to Partition5, Topic2 correspond to subregion be Partition6 extremely
Partition10, theme is Topic1 in the acquisition request that message user 1 is sent by thread 1 to thread 10 to Broker,
Theme is Topic2 in the acquisition request that message user 2 is sent by thread 11 to thread 15 to Broker, then for disappearing
User 1 is ceased, the subregion that Broker is found out is Partition1 to Partition5, and for message user 2, Broker is found out
Subregion be Partition6 to Partition10.
Step S406:Broker selects a segmentation according to the consumption location information of the subregion from the subregion.
Broker safeguards a consumption location information for each message user respectively, respectively disappears for recording in the subregion of each Topic
The message that breath user has consumed.When the subregion where the message that message user request pulls in Topic is multiple, by
Broker randomly chooses a subregion.Assuming that the consumption location information of the Partition1 of Topic1 (consumes position in embodiment
Information is Offset, offset) it is 4, then a free time point can be selected since the 5th location information of Partition1
Section, it is P1_ segmentation 2 in embodiment.
Step S407:Broker, will be opposite with the segmentation according to user mark and the storage location information
The message answered is exported to message user.By taking message user 1 as an example, Broker is according to the messaging capabilities of thread 2 and deposits
It stores up location information and obtains entire message or part messages corresponding to P1_ segmentation 2, exported later to message user 1.
Step S408: it after message user receives message, is handled according to corresponding service logic, after the completion of processing
It will confirm that information feeds back to Broker.After the completion of each message user receives message and handles, the message is returned to Broker
Confirmation message.Wherein, the confirmation message includes theme, subregion serial number and location information.By taking message user 1 as an example, really
Recognize information be 5, by taking the 5th storage location information corresponds to the confirmation message of message as an example, including Topic1, Partition1 and
5。
Step S409:Broker judge whether to have received in scheduled time-out time it is corresponding with the message really
Recognize information, if had received, thens follow the steps S410;If do not received, the message is exported again, executes step
S408.Broker presets time-out time, if not receiving the confirmation message of some message during this period of time, passes through it
His thread exports the message to handle.
Step S410:Broker judge the location information of the confirmation message in the segmentation and from it is described segmentation pair
Continuously whether the head for the subregion answered start in the subregion, if continuously, thening follow the steps S411;Otherwise, it does not do any
Processing.It exports assuming that the 5-7 storage location information is corresponded to message by Broker to message user 1, and has received this 3 and disappear
The confirmation message of breath then illustrates to be segmented interior confirmation continuously;Judge Partition1 whether from the 1st storage location information again later
Start, forms continuous confirmation and (disappear corresponding to from the 1st storage location information to the 4th storage location information if had received
The confirmation message of breath then illustrates that confirmation is continuous in subregion).If it is corresponding only to have received the 5th and the 7th this 2 storage location information
The confirmation message of message, then confirmation is discontinuous in segmentation, waits the confirmation message of the 6th corresponding message of storage location information.
Step S411:Broker believes the last one location information continuously confirmed as the confirmation position of the subregion
Breath, consumes location information according to the confirmation updating location information of the subregion, terminates this process.Assuming that Broker was received
In confirmation message, the continuous confirmation from the 1st storage location information to the 7th storage location information is formd, then by 7 conducts
The confirmation location information of Partition1, and the consumption location information of Broker is updated to 7 by 4.
In a preferred embodiment, between step S405 and step S406, also need to judge in the subregion with all points
Whether the corresponding message of section has all been consumed.If Topic's corresponding to the message to be pulled with message user is all
In subregion, the corresponding message of all segmentations is all consumed, then segmentation need to be reset in the subregion of the theme.Assuming that
Message corresponding to all segmentations of Topic1 is all consumed, then new point need to be arranged again in 5 subregions of Topic1
Section.
Message treatment method through the embodiment of the present invention can be seen that by the way that each subregion to be segmented, difference point
Parallel processed messages between section, so that the message number of processing is double, reduce message transmission in the case where not increasing subregion
Time delay;The number of fragments of the on-demand each subregion of flexible setting and it is respectively segmented corresponding message number, has both supported that high-performance height can
The carry out message write-in leaned on, and can guarantee that high-performance carries out message and pulls;Believed according to the consumption position of confirmation message regeneration block
Breath and overtime affirmation mechanism, can ensure that will not lose message the case where supporting high concurrent;Each point is adjusted by dynamic
The number of fragments in area improves whole Message Processing speed.
Fig. 5 is the schematic diagram of the main modular of message processing apparatus according to an embodiment of the present invention.As shown in figure 5, this hair
The message processing apparatus 500 (i.e. message-oriented middleware) of bright embodiment, specifically includes that
Searching module 501, for finding out identical as the type of message of the acquisition request according to the acquisition request received
Subregion;Wherein, the acquisition request includes the type of message of user's mark and institute's request, and the subregion, which is preserved, to disappear
The storage location information of breath.Message generator sends a message to message-oriented middleware after generating message;Message-oriented middleware storage should
Message, and save the storage location information of the message.Message-oriented middleware receives the acquisition request from message user, according to asking
Type of message in asking finds out corresponding subregion.
It chooses module 502 and selects one point from the subregion for the consumption location information according to the subregion
Section;Wherein, the subregion includes at least one described segmentation.Message-oriented middleware is that each subregion is respectively set at least one in advance
It is segmented, message number corresponding to the number of fragments and each segmentation on each subregion determines according to actual needs.Described point
The consumption location information in area is used to indicate the message that the subregion has been consumed, select from the message that the subregion is not consumed
One freed segment (not being the segmentation consumed).
Output module 503, for that will be segmented relatively with described according to user mark and the storage location information
The message answered is exported to message user.Message-oriented middleware whole according to corresponding to described storage location acquisition of information segmentation
Message or part messages are exported later to corresponding message user.
In addition, the message processing apparatus 500 of the embodiment of the present invention can also include: setup module, it is update module, again defeated
Module and reset module (not shown) out.Wherein, setup module, for being respectively provided to for each subregion
A few segmentation;Wherein, message number corresponding to the number of fragments and a segmentation on a subregion
It determines according to demand, and the number of fragments of all subregions is greater than all number of partitions.Update module, in scheduled time-out
Confirmation message corresponding with the message is received in time, if the location information of the confirmation message connects in the segmentation
It is continuous and continuous in the subregion since the head of the corresponding subregion of the segmentation, then the last one position that will continuously confirm
Confirmation location information of the information as the subregion;And position is consumed according to the confirmation updating location information of the subregion
Information.Again output module, if for not receiving confirmation message corresponding with the message in the time-out time,
Again the message is exported.Module is reset, if whole for message corresponding with all segmentations in the subregion
It is consumed, then resets the segmentation in the subregion.
From the above, it can be seen that by the way that each subregion to be segmented, parallel processed messages between difference segmentation,
In the case where not increasing subregion, so that the message number of processing is double, message transmission time delay is reduced;On-demand flexible setting is each
The number of fragments of subregion and it is respectively segmented corresponding message number, has not only supported the carry out message write-in that high-performance is highly reliable, but also energy
Guarantee that high-performance carries out message and pulls;According to the consumption location information of confirmation message regeneration block and overtime affirmation mechanism,
Can ensure that will not lose message the case where supporting high concurrent;By dynamically adjusting the number of fragments of each subregion, improve whole
The Message Processing speed of body.
Fig. 6 is shown can be using the message treatment method of the embodiment of the present invention or the exemplary system of message processing apparatus
Framework 600.
As shown in fig. 6, system architecture 600 may include terminal device 601,602,603, network 604 and server 605.
Network 604 between terminal device 601,602,603 and server 605 to provide the medium of communication link.Network 604 can be with
Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be used terminal device 601,602,603 and be interacted by network 604 with server 605, to receive or send out
Send message etc..Various telecommunication customer end applications, such as the application of shopping class, net can be installed on terminal device 601,602,603
(merely illustrative) such as the application of page browsing device, searching class application, instant messaging tools, mailbox client, social platform softwares.
Terminal device 601,602,603 can be the various electronic equipments with display screen and supported web page browsing, packet
Include but be not limited to smart phone, tablet computer, pocket computer on knee and desktop computer etc..
Server 605 can be to provide the server of various services, such as utilize terminal device 601,602,603 to user
The shopping class website browsed provides the back-stage management server (merely illustrative) supported.Back-stage management server can be to reception
To the data such as information query request analyze etc. processing, and by processing result (such as target push information, product letter
Breath -- merely illustrative) feed back to terminal device.
It should be noted that message treatment method provided by the embodiment of the present application is generally executed by server 605, accordingly
Ground, message processing apparatus are generally positioned in server 605.
It should be understood that the number of terminal device, network and server in Fig. 6 is only schematical.According to realization need
It wants, can have any number of terminal device, network and server.
According to an embodiment of the invention, the present invention also provides a kind of electronic equipment and a kind of computer-readable medium.
Electronic equipment of the invention includes: one or more processors;Storage device, for storing one or more journeys
Sequence, when one or more of programs are executed by one or more of processors, so that one or more of processors are real
A kind of message treatment method of the existing embodiment of the present invention.
Computer-readable medium of the invention is stored thereon with computer program, real when described program is executed by processor
A kind of message treatment method of the existing embodiment of the present invention.
Below with reference to Fig. 7, it illustrates the computer systems 700 being suitable for realize the electronic equipment of the embodiment of the present invention
Structural schematic diagram.Electronic equipment shown in Fig. 7 is only an example, function to the embodiment of the present invention and should not use model
Shroud carrys out any restrictions.
As shown in fig. 7, computer system 700 includes central processing unit (CPU) 701, it can be read-only according to being stored in
Program in memory (ROM) 702 or be loaded into the program in random access storage device (RAM) 703 from storage section 708 and
Execute various movements appropriate and processing.In RAM 703, also it is stored with computer system 700 and operates required various programs
And data.CPU 701, ROM 702 and RAM 703 are connected with each other by bus 704.Input/output (I/O) interface 705
It is connected to bus 704.
I/O interface 705 is connected to lower component: the importation 706 including keyboard, mouse etc.;It is penetrated including such as cathode
The output par, c 707 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 708 including hard disk etc.;
And the communications portion 709 of the network interface card including LAN card, modem etc..Communications portion 709 via such as because
The network of spy's net executes communication process.Driver 710 is also connected to I/O interface 705 as needed.Detachable media 711, such as
Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 710, in order to read from thereon
Computer program be mounted into storage section 708 as needed.
Particularly, disclosed embodiment, the process of key step figure description above may be implemented as counting according to the present invention
Calculation machine software program.For example, embodiment disclosed by the invention includes a kind of computer program product comprising be carried on computer
Computer program on readable medium, the computer program include the program generation for executing method shown in key step figure
Code.In such embodiments, which can be downloaded and installed from network by communications portion 709, and/or
It is mounted from detachable media 711.When the computer program is executed by central processing unit (CPU) 701, execute of the invention
The above-mentioned function of being limited in system.
It should be noted that computer-readable medium shown in the present invention can be computer-readable signal media or meter
Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not
Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter
The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires
Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage
Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device,
Or above-mentioned any appropriate combination.In the present invention, computer readable storage medium can be it is any include or storage journey
The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this
In invention, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal,
Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited
In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can
Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for
By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium
Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc. are above-mentioned
Any appropriate combination.
Flow chart and block diagram in attached drawing are illustrated according to the system of various embodiments of the invention, method and computer journey
The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation
A part of one unit of table, program segment or code, a part of said units, program segment or code include one or more
Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box
The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical
On can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it wants
It is noted that the combination of each box in block diagram or flow chart and the box in block diagram or flow chart, can use and execute rule
The dedicated hardware based systems of fixed functions or operations is realized, or can use the group of specialized hardware and computer instruction
It closes to realize.
Being described in module involved in the embodiment of the present invention can be realized by way of software, can also be by hard
The mode of part is realized.Described module also can be set in the processor, for example, can be described as: a kind of processor packet
It includes searching module, choose module and output module.Wherein, the title of these modules is not constituted under certain conditions to the module
The restriction of itself, for example, searching module is also described as " according to the acquisition request received, finding out and asking with the acquisition
The module of the identical subregion of the type of message asked ".
As on the other hand, the present invention also provides a kind of computer-readable medium, which be can be
Included in equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying equipment.Above-mentioned calculating
Machine readable medium carries one or more program, when said one or multiple programs are executed by the equipment, makes
Obtaining the equipment includes: message-oriented middleware according to the acquisition request received, is found out identical as the type of message of the acquisition request
Subregion;Wherein, the acquisition request includes the type of message of user's mark and institute's request, and the subregion, which is preserved, to disappear
The storage location information of breath;The message-oriented middleware is selected from the subregion according to the consumption location information of the subregion
One segmentation;Wherein, the subregion includes at least one described segmentation;The message-oriented middleware according to the user mark and
The storage location information exports message corresponding with the segmentation to message user.
From the above, it can be seen that by the way that each subregion to be segmented, parallel processed messages between difference segmentation,
In the case where not increasing subregion, so that the message number of processing is double, message transmission time delay is reduced;On-demand flexible setting is each
The number of fragments of subregion and it is respectively segmented corresponding message number, has not only supported the carry out message write-in that high-performance is highly reliable, but also energy
Guarantee that high-performance carries out message and pulls;According to the consumption location information of confirmation message regeneration block and overtime affirmation mechanism,
Can ensure that will not lose message the case where supporting high concurrent;By dynamically adjusting the number of fragments of each subregion, improve whole
The Message Processing speed of body.
Method provided by the embodiment of the present invention can be performed in the said goods, has the corresponding functional module of execution method and has
Beneficial effect.The not technical detail of detailed description in the present embodiment, reference can be made to method provided by the embodiment of the present invention.
Above-mentioned specific embodiment, does not constitute a limitation on the scope of protection of the present invention.Those skilled in the art should be bright
It is white, design requirement and other factors are depended on, various modifications, combination, sub-portfolio and substitution can occur.It is any
Made modifications, equivalent substitutions and improvements etc. within the spirit and principles in the present invention, should be included in the scope of the present invention
Within.
Claims (12)
1. a kind of message treatment method characterized by comprising
Message-oriented middleware finds out subregion identical with the type of message of the acquisition request according to the acquisition request received;Its
In, the acquisition request includes the type of message of user's mark and institute's request, and the subregion preserves the storage of message
Location information;
The message-oriented middleware selects a segmentation according to the consumption location information of the subregion from the subregion;Wherein,
The subregion includes at least one described segmentation;
The message-oriented middleware corresponding with the segmentation will disappear according to user mark and the storage location information
Breath is exported to message user.
2. the method according to claim 1, wherein the message-oriented middleware is looked into according to the acquisition request received
Before the step of finding out subregion identical with the type of message of the acquisition request, further includes: set respectively for each subregion
Set at least one described segmentation;Wherein, message corresponding to the number of fragments and a segmentation on a subregion
Quantity determines according to demand, and the number of fragments of all subregions is greater than all number of partitions.
3. the method according to claim 1, wherein the message-oriented middleware is identified according to the user and institute
Storage location information is stated, it will be after message corresponding with segmentation the step of exporting to message user, further includes:
Confirmation message corresponding with the message is received in scheduled time-out time, if the position of the confirmation message is believed
Breath is continuous in the segmentation and continuous in the subregion since the head of the corresponding subregion of the segmentation, then will be continuously true
Confirmation location information of the last one location information recognized as the subregion;
Location information is consumed according to the confirmation updating location information of the subregion.
4. according to the method described in claim 3, it is characterized in that, the message-oriented middleware is identified according to the user and institute
Storage location information is stated, it will be after message corresponding with segmentation the step of exporting to message user, further includes: if
Confirmation message corresponding with the message is not received in the time-out time, then exports the message again.
5. the method according to claim 1, wherein the type of message phase found out with the acquisition request
With subregion the step of after and the message-oriented middleware according to the consumption location information of the subregion, selected from the subregion
Before the step of taking out a segmentation, further includes: if message corresponding with all segmentations has all been disappeared in the subregion
Take, then resets the segmentation in the subregion.
6. a kind of message processing apparatus characterized by comprising
Searching module, for finding out subregion identical with the type of message of the acquisition request according to the acquisition request received;
Wherein, the acquisition request includes the type of message of user's mark and institute's request, and the subregion preserves depositing for message
Store up location information;
It chooses module and selects a segmentation from the subregion for the consumption location information according to the subregion;Wherein,
The subregion includes at least one described segmentation;
Output module, for that corresponding with the segmentation will disappear according to user mark and the storage location information
Breath is exported to message user.
7. device according to claim 6, which is characterized in that described device further include: setup module is used for as each institute
It states subregion and an at least segmentation is respectively set;Wherein, the number of fragments and a segmentation on a subregion
Corresponding message number determines according to demand, and the number of fragments of all subregions is greater than all number of partitions.
8. device according to claim 6, which is characterized in that described device further include: update module, for scheduled
Confirmation message corresponding with the message is received in time-out time, if the location information of the confirmation message is in the segmentation
It is interior continuous and continuous in the subregion since the head of the corresponding subregion of the segmentation, then by continuously confirm the last one
Confirmation location information of the location information as the subregion;And
Location information is consumed according to the confirmation updating location information of the subregion.
9. device according to claim 8, which is characterized in that described device further include: output module again, if for
Confirmation message corresponding with the message is not received in the time-out time, then exports the message again.
10. device according to claim 6, which is characterized in that described device further include: module is reset, for such as
Message corresponding with all segmentations has all been consumed in subregion described in fruit, then described point is reset in the subregion
Section.
11. a kind of electronic equipment characterized by comprising
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors are real
Now such as method as claimed in any one of claims 1 to 5.
12. a kind of computer-readable medium, is stored thereon with computer program, which is characterized in that described program is held by processor
Such as method as claimed in any one of claims 1 to 5 is realized when row.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810144874.2A CN110162410A (en) | 2018-02-12 | 2018-02-12 | A kind of message treatment method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810144874.2A CN110162410A (en) | 2018-02-12 | 2018-02-12 | A kind of message treatment method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110162410A true CN110162410A (en) | 2019-08-23 |
Family
ID=67634983
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810144874.2A Pending CN110162410A (en) | 2018-02-12 | 2018-02-12 | A kind of message treatment method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110162410A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111638980A (en) * | 2020-05-25 | 2020-09-08 | 北京青云科技股份有限公司 | Message processing method, device and system based on memory mapping and storage medium |
CN112087501A (en) * | 2020-08-28 | 2020-12-15 | 北京明略昭辉科技有限公司 | Transmission method and system for keeping data consistency |
CN112583931A (en) * | 2020-12-25 | 2021-03-30 | 北京百度网讯科技有限公司 | Message processing method, message middleware, electronic device and storage medium |
CN114401269A (en) * | 2021-12-08 | 2022-04-26 | 国电南瑞科技股份有限公司 | Business data distribution method and system and Internet of things management platform |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102955717A (en) * | 2012-11-05 | 2013-03-06 | 北京奇虎科技有限公司 | Message management equipment and method in distributed message processing system |
CN102981911A (en) * | 2012-11-05 | 2013-03-20 | 北京奇虎科技有限公司 | Distributed message handling system and device and method thereof |
US20160094640A1 (en) * | 2014-09-25 | 2016-03-31 | International Business Machines Corporation | Processing a message received by a message server |
CN106603689A (en) * | 2016-12-26 | 2017-04-26 | 努比亚技术有限公司 | Data processing method and device based on distributed message releasing and subscribing system |
CN106953901A (en) * | 2017-03-10 | 2017-07-14 | 重庆邮电大学 | A kind of trunked communication system and its method for improving message transmission performance |
-
2018
- 2018-02-12 CN CN201810144874.2A patent/CN110162410A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102955717A (en) * | 2012-11-05 | 2013-03-06 | 北京奇虎科技有限公司 | Message management equipment and method in distributed message processing system |
CN102981911A (en) * | 2012-11-05 | 2013-03-20 | 北京奇虎科技有限公司 | Distributed message handling system and device and method thereof |
CN104932941A (en) * | 2012-11-05 | 2015-09-23 | 北京奇虎科技有限公司 | Distributed message processing system and device and method thereof |
US20160094640A1 (en) * | 2014-09-25 | 2016-03-31 | International Business Machines Corporation | Processing a message received by a message server |
CN106603689A (en) * | 2016-12-26 | 2017-04-26 | 努比亚技术有限公司 | Data processing method and device based on distributed message releasing and subscribing system |
CN106953901A (en) * | 2017-03-10 | 2017-07-14 | 重庆邮电大学 | A kind of trunked communication system and its method for improving message transmission performance |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111638980A (en) * | 2020-05-25 | 2020-09-08 | 北京青云科技股份有限公司 | Message processing method, device and system based on memory mapping and storage medium |
CN112087501A (en) * | 2020-08-28 | 2020-12-15 | 北京明略昭辉科技有限公司 | Transmission method and system for keeping data consistency |
CN112087501B (en) * | 2020-08-28 | 2023-10-24 | 北京明略昭辉科技有限公司 | Transmission method and system for maintaining data consistency |
CN112583931A (en) * | 2020-12-25 | 2021-03-30 | 北京百度网讯科技有限公司 | Message processing method, message middleware, electronic device and storage medium |
CN114401269A (en) * | 2021-12-08 | 2022-04-26 | 国电南瑞科技股份有限公司 | Business data distribution method and system and Internet of things management platform |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108062246B (en) | Resource regulating method and device for deep learning frame | |
CN110162410A (en) | A kind of message treatment method and device | |
CN110019125A (en) | The method and apparatus of data base administration | |
CN109257320A (en) | Message storage method and device | |
CN109033001A (en) | Method and apparatus for distributing GPU | |
CN109308214A (en) | Data task processing method and system | |
CN108933822B (en) | Method and apparatus for handling information | |
CN110413384A (en) | Delayed tasks processing method and processing device, storage medium, electronic equipment | |
CN110262807A (en) | Cluster creates Progress Log acquisition system, method and apparatus | |
CN109995801A (en) | A kind of method for message transmission and device | |
CN109657174A (en) | Method and apparatus for more new data | |
CN110377416A (en) | Distributed subregion method for scheduling task and device | |
CN110334036A (en) | A kind of method and apparatus for realizing data cached scheduling | |
CN110334145A (en) | The method and apparatus of data processing | |
CN110166507A (en) | More resource regulating methods and device | |
CN109542352A (en) | Method and apparatus for storing data | |
CN108965098A (en) | Based on information push method, device, medium and the electronic equipment being broadcast live online | |
CN109976919A (en) | A kind of transmission method and device of message request | |
CN109597810A (en) | A kind of task cutting method, device, medium and electronic equipment | |
CN110019310A (en) | Data processing method and system, computer system, computer readable storage medium | |
CN109885593A (en) | Method and apparatus for handling information | |
CN110399394A (en) | The data traversal method, apparatus and calculate node of calculate node | |
CN113760638A (en) | Log service method and device based on kubernets cluster | |
CN109947736A (en) | The method and system calculated in real time | |
CN110119418A (en) | Data export method and device |
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 |