CN101106550A - Sending method, receiving method and transfer system for large-size message - Google Patents

Sending method, receiving method and transfer system for large-size message Download PDF

Info

Publication number
CN101106550A
CN101106550A CNA2007101476301A CN200710147630A CN101106550A CN 101106550 A CN101106550 A CN 101106550A CN A2007101476301 A CNA2007101476301 A CN A2007101476301A CN 200710147630 A CN200710147630 A CN 200710147630A CN 101106550 A CN101106550 A CN 101106550A
Authority
CN
China
Prior art keywords
data
message
unit
data source
server
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
Application number
CNA2007101476301A
Other languages
Chinese (zh)
Inventor
陈奕文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Kingdee Middleware Co., Ltd.
Original Assignee
Kingdee Software China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kingdee Software China Co Ltd filed Critical Kingdee Software China Co Ltd
Priority to CNA2007101476301A priority Critical patent/CN101106550A/en
Publication of CN101106550A publication Critical patent/CN101106550A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a sending and receiving method of large-sized message, which includes: decide send data source; obtain the data with certain size from the send data source; store the data in memory cache; when the data in memory cache accords with preset size, package the data into information; and send the information to a server. The receiving method includes: decide receive data source; extract information which is packaged by the data with preset size from the server; the data is obtained from designated send data source; de-encapsulate the information and obtain the data; store the data in the memory cache and send the data to receive data source. The invention needs no data reading memory cache in one time and no data storage as special format and can realize varieties of mass data transmission, with the advantages of higher transmission efficiency and simple user operation.

Description

The sending method of large-size message, method of reseptance and transmission system
Technical field
The present invention relates to the mutual field of message data, the particularly method of reseptance of a kind of sending method of large-size message, dispensing device and transmitting system, a kind of large-size message, receiving system and receiving system, and, a kind of transmission system of large-size message.
Background technology
Message-oriented middleware is the class middleware product most widely used in the middleware field, that sales volume is maximum, message-oriented middleware provides reliable message communicating means for application system, can realize the data communication of different operating system platform, database and hardware system platform.In the current information system engineering, for the consideration of aspects such as function, fail safe, reliability, to use the network equipment of router, switch, fire compartment wall in a large number, or use network technologies such as cluster, two-node cluster hot backup, network configuration is increasingly sophisticated.In order to satisfy the requirement that network uses, message-oriented middleware is disposed usually in many ways, construct one to one between the formation system, the tree network structure of one-to-many, many-one, multi-to-multi, system configuration and management are greatly simplified, also can satisfy the requirement of system data transmission simultaneously.Specifically, for message-oriented middleware, most important function is that reliable message communicating means in time are provided.In order to finish the reliable transmission of message, generally speaking, use the mode of formation to carry out message management, that is to say, usually when carrying out transfer of data, data according to user-defined size, are split into some message and put into message queue, and middleware can send or receive message according to synchronous or asynchronous communication mode.
When using prior art to send common message in application, client at first needs the whole threading internal memory of message that will send, and once message is sent on the server by network then.Therefore, once the size of the message that can send depends on the size of client internal memory, and the message size that can send is less, and promptly its transmitted data amount is less, and is low for the efficiency of transmission of large-size message.To this, for transmitting larger-size message, prior art is used big file transfer technology usually, promptly with message-oriented middleware as transmission intermediary, the transmission size bigger, be present in file on the local disk in advance, during transmission whole file is transmitted.Yet, this existing big file transfer technology, can only transmit the single file that is present on the local disk, be the data of the binary form on the local disk, when needing the huge mass data of deal with data amount, for example: satellite cloud picture, file, database batch data etc., use this big file transfer technology these data need be taken out from database or other storage medium, save as file, and then file transfer is arrived the destination, again the data in the file are taken out the recipient at last, store in addition in a database or other storage medium, obviously, the transmission of handling mass data with said process will be very loaded down with trivial details, and cost is higher.
So, those skilled in the art press for develop a kind of simple, effectively utilize method and device that message-oriented middleware carries out the large-size message transmission.
Summary of the invention
Technical problem to be solved by this invention provides a kind of sending method and method of reseptance of large-size message, the message transmission needs the disposable internal memory that reads in the prior art in order to solve, perhaps, need be file with data conversion storage and be reduced into file, the problem that the deal with data type is limited;
The present invention also provides a kind of transmission system of dispensing device and system, receiving system and system and a kind of large-size message of large-size message, in order to guarantee said method realization and application in practice, the large-size message efficiency of transmission is low, the problem of complicated operation thereby solve.
For solving the problems of the technologies described above, the embodiment of the invention discloses a kind of sending method of large-size message, comprising: determine to send data source;
From described transmission data source, obtain a certain size data;
Described data are saved in the core buffer;
When the data fit preset size in the described core buffer, described data encapsulation is become message;
Described message is sent to server.
Preferably, described method also comprises:
Empty the data in the described core buffer.
Preferably, described method also comprises:
Judge whether described transmission data source exists data, if then carry out obtaining step; If not, then the notification application data send end.
The embodiment of the invention also discloses a kind of dispensing device of large-size message, comprising:
Send determining unit, be used for determining to send data source;
Acquiring unit is used for obtaining from described transmission data source a certain size data;
Preserve the unit, be used for described data are saved to core buffer;
Encapsulation unit when being used for the data fit preset size when described core buffer, becomes message with described data encapsulation;
Delivery unit is used for described message is sent to server.
Preferably, described device also comprises:
Empty the unit, be used for emptying the data of described core buffer.
Preferably, described device also comprises:
Judging unit is used to judge whether described transmission data source exists data, if then trigger acquiring unit; If not, then trigger the transmission notification unit;
Send notification unit, be used for the notification application data and send end.
The embodiment of the invention also discloses a kind of transmitting system of large-size message, comprising:
Send determining unit, be used for determining to send data source;
Message-oriented middleware comprises the transmission client and server, and described transmission client comprises:
Acquiring unit is used for obtaining from described transmission data source a certain size data;
Preserve the unit, be used for described data are saved to core buffer;
Encapsulation unit when being used for the data fit preset size when described core buffer, becomes message with described data encapsulation;
Delivery unit is used for described message is sent to described server.
The embodiment of the invention also discloses a kind of method of reseptance of large-size message, comprising:
Determine to receive data source;
Extract message from server, described message is formed by the data encapsulation of preset size, and described data obtain from the transmission data source of appointment;
Described message is carried out the decapsulation operation, obtain described data;
Described data are saved in the core buffer;
Data in the described core buffer are sent to described reception data source.
Preferably, described method also comprises:
Judge whether there is message in the described server, if then empty the data in the described core buffer, and carry out extraction step; If not, then the notification application message sink finishes.
Preferably, described method also comprises:
In described reception data source, store described data according to presetting storage rule.
The embodiment of the invention also discloses a kind of receiving system of large-size message, comprising:
Receive determining unit, be used for determining to receive data source;
Extraction unit is used for extracting message from server, and described message is formed by the data encapsulation of preset size, and described data obtain from the transmission data source of appointment;
Reduction unit is used for described message is carried out the decapsulation operation, obtains described data;
Preserve the unit, be used for described data are saved to core buffer;
Transmitting element: be used for the data of described core buffer are sent to described reception data source.
Preferably, described device also comprises:
Judging unit is used for judging whether described server exists message, if then trigger and empty unit and extraction unit; If not, then trigger the reception notification unit;
Empty the unit, be used for emptying the data of described core buffer;
The reception notification unit is used for the notification application message sink and finishes.
Preferably, described device also comprises:
Memory cell is used for storing described data in described reception data source according to presetting storage rule.
The embodiment of the invention also discloses a kind of receiving system of large-size message, comprising:
Receive determining unit, be used for determining to receive data source;
Message-oriented middleware comprises the reception client and server, and described reception client comprises:
Extraction unit is used for extracting message from server, and described message is formed by the data encapsulation of preset size, and described data obtain from the transmission data source of appointment;
Reduction unit is used for described message is carried out the decapsulation operation, obtains described data;
Preserve the unit, be used for described data are saved to core buffer;
Transmitting element is used for the data of described core buffer are sent to described reception data source.
The embodiment of the invention also discloses a kind of large-size message transmission system, comprising:
Send determining unit, be used for determining to send data source;
Receive determining unit, be used for determining to receive data source;
Message-oriented middleware comprises sending client, reception client and server, and described transmission client comprises:
Acquiring unit is used for obtaining from described transmission data source a certain size data;
Preserve the unit, be used for described data are saved to core buffer;
Encapsulation unit when being used for the data fit preset size when described core buffer, becomes message with described data encapsulation;
Delivery unit is used for described message is sent to described server;
Described reception client comprises:
Extraction unit is used for extracting message from server, and described message is formed by the data encapsulation of preset size, and described data obtain from the transmission data source of appointment;
Reduction unit is used for described message is carried out the decapsulation operation, obtains described data;
Preserve the unit, be used for described data are saved to core buffer;
Transmitting element: be used for the data of described core buffer are sent to described reception data source.
Compared with prior art, the embodiment of the invention has the following advantages:
The present invention sends data source by specifying, from described transmission data source, obtain a certain size data with preset mode, be that information and sending is to server then with these data encapsulation, when receiving data, be sent to the reception data source of appointment after with the message decapsulation, thereby need not data are once read in internal memory, also need not data conversion storage is specific format, can realize the transmission of various types of mass datas, efficiency of transmission is higher, and simple to operate, better user experience, in addition, the present invention is for the service provider, and technology realizes simple, no technology barrier, do not have special secret algorithm, cost and risk is lower.
Description of drawings
Fig. 1 is the flow chart of a kind of large-size message sending method embodiment 1 of the present invention;
Fig. 2 is the flow chart of a kind of large-size message sending method embodiment 2 of the present invention;
Fig. 3 is the structured flowchart of a kind of large-size message dispensing device embodiment of the present invention;
Fig. 4 is the structured flowchart of a kind of large-size message transmitting system embodiment of the present invention;
Fig. 5 is the flow chart of a kind of large-size message method of reseptance embodiment 1 of the present invention;
Fig. 6 is the flow chart of a kind of large-size message method of reseptance embodiment 2 of the present invention;
Fig. 7 is the structured flowchart of a kind of large-size message receiving system embodiment of the present invention;
Fig. 8 is the structured flowchart of a kind of large-size message receiving system embodiment of the present invention;
Fig. 9 is the structured flowchart of a kind of large-size message transmission system embodiment of the present invention;
Figure 10 is a kind of structural representation of message-oriented middleware.
Embodiment
For above-mentioned purpose of the present invention, feature and advantage can be become apparent more, the present invention is further detailed explanation below in conjunction with the drawings and specific embodiments.
One of core idea of the embodiment of the invention is, when carrying out the mass data transmission, transmission client at message-oriented middleware provides transmission interface, with transmission data source and the corresponding data acquisition rule of handled easily personnel by this transmission interface specific data, described transmission client is according to after obtaining rule accordingly obtain a certain size data from this transmission data source, these data are encapsulated as message according to the preliminary dimension size, and described message are sent to the server end of message-oriented middleware.Correspondingly, when receiving these mass datas, the reception client of message-oriented middleware provides receiving interface, specify reception data source that receives data and the rule of in sending data source, storing data with the handled easily personnel by this receiving interface, the reception client of message-oriented middleware extracts needed message from server, data decapsulation from message is come out, again these data are sent described reception data source, the storage rule that provides with receiving interface in sending data source is stored described data, thereby provides a kind of reliable, safety, large-size message transmission method efficiently.
With reference to Fig. 1, show the flow chart of the sending method embodiment 1 of a kind of large-size message of the present invention, specifically may further comprise the steps:
Step 101, definite data source that sends;
Step 102, from described transmission data source, obtain a certain size data;
Step 103, described data are saved in the core buffer;
Step 104, when the data fit preset size in the described core buffer, described data encapsulation is become message;
Step 105, described message is sent to server.
Data source (Data source), index be according to the source, i.e. the data place of storing, and in embodiments of the present invention, described data source can be database, file, internal memory etc., the present invention does not limit this.Need to prove, in the present embodiment, corresponding different transmission data sources, the mode that its data are obtained is also different, for example, is database if send data source, then obtains the data or the pairing data of certain field of certain database table; If sending data source is file, then obtain file behind certain piecemeal etc., in practice, those skilled in the art can determine voluntarily that as required the present invention does not limit this.
The size of data of being obtained can be a prerequisite to guarantee efficiency of transmission according to the big or small respective settings of core buffer, when data reach preset size in the core buffer, is message with these data encapsulation then.Be well known that message is basic data transmission unit, the data of application transport all can be packaged into message and send.Message is made of message header and message body, and wherein, message header comprises the base attribute of message, as destination, transmitting terminal, priority etc.Message body comprises the data that will send.Communication between the program is by pass-along message but not direct caller.Message deposit is in formation, and formation has the characteristics of first in first out, and the message that arrives first during equal priority is sent out earlier, and the message of high priority can be sent out earlier during different priorities.Because message deposit is in formation, so application program can be with different speed, in the different time, in the separate operation in different places, in embodiments of the present invention, after message was sent to server, one time process of transmitting finished.Certainly, the method the present invention who encapsulates, sends for described message need not limit, and it all is feasible that those skilled in the art adopt any method.
Be convenient storage next time, preferably, the embodiment of the invention can also comprise step: empty the data in the described core buffer.
With reference to Fig. 2, show the flow chart of the sending method embodiment 2 of a kind of large-size message of the present invention, specifically may further comprise the steps:
Step 201, definite data source that sends;
Step 202, judge whether described transmission data source exists data, if then carry out obtaining step 203; If not, execution in step 207 then;
Step 203, from described transmission data source, obtain a certain size data;
Step 204, described data are saved in the core buffer;
Step 205, when the data fit preset size in the described core buffer, described data encapsulation is become message;
Step 206, described message is sent to server;
Step 207, notification application data send and finish.
For application program, need be appreciated that application program operates in user model, it can carry out alternately with the user, and each application program runs on independently process, they have oneself independently address space.
For said method embodiment, for simple description, so it all is expressed as a series of combination of actions, but those skilled in the art should know, the present invention is not subjected to the restriction of described sequence of movement, because according to the present invention, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in the specification all belongs to preferred embodiment, and related action and module might not be that the present invention is necessary.
With reference to figure 3, show the structured flowchart of a kind of large-size message dispensing device embodiment of the present invention, comprise with lower unit:
Send determining unit 301, be used for determining to send data source;
Acquiring unit 302 is used for obtaining from described transmission data source a certain size data;
Preserve unit 303, be used for described data are saved to core buffer;
Encapsulation unit 304 when being used for the data fit preset size when described core buffer, becomes message with described data encapsulation;
Delivery unit 305 is used for described message is sent to server.
Preferably, the embodiment of the invention can also comprise and empties the unit, is used for emptying the data of described core buffer.
Preferably, the embodiment of the invention can also comprise:
Judging unit is used for judging whether described transmission data source exists data, if then trigger acquiring unit; If not, then trigger the transmission notification unit;
Send notification unit, be used for the notification application data and send end.
For device embodiment, because it is substantially corresponding to method embodiment, so description is fairly simple, relevant part gets final product referring to the part explanation of method embodiment.
In practice, the embodiment of the invention is preferably based on message-oriented middleware and realizes, with reference to figure 4, shows the structured flowchart of the transmitting system embodiment of a kind of large-size message of the present invention, specifically comprises with lower unit:
Send determining unit 401, be used for determining to send data source;
Message-oriented middleware 402 comprises sending client 4011 and server 4012, and described transmission client 4011 comprises:
Acquiring unit 111 is used for obtaining from described transmission data source a certain size data;
Preserve unit 112, be used for described data are saved to core buffer;
Encapsulation unit 113 when being used for the data fit preset size when described core buffer, becomes message with described data encapsulation;
Delivery unit 114 is used for described message is sent to described server.
Be well known that message-oriented middleware is the generic service that is positioned between platform (hardware and operating system) and the application, these services have the routine interface and the agreement of standard.The data that message-oriented middleware utilizes the high-efficiency reliable message passing mechanism to carry out platform independence exchange, and carry out the integrated of distributed system based on data communication.Transmit and the message queueing model by giving information, can be in the communication between the expansion process under the distributional environment, and support many communications protocol, language, application program, hardware and software platform.In embodiments of the present invention, use message-oriented middleware when carrying out transfer of data, can split into some message and put into message queue with mass data according to user-defined size, message-oriented middleware can send or receive message according to synchronous or asynchronous communication mode.In the operating process of reality, in order to ensure the message reliable transmission, can use, and flow control, build functions such as connection in advance such as technology such as message priority, breakpoint transmission, reliable news formation, memory queues.For satisfying the data communication requirement of heterogeneous platform, the transmission of messages of message-oriented middleware uses the IP of standard to seal dress, in addition, message-oriented middleware can also provide abundant api function interface, can support development languages such as standard C/C++, Microsoft Visual C++, Microsoft Visual Basic, Borland C, PowerBuilder, Java, particularly to the support of the C/C++ and the Java of standard, convenient application and development in different application platforms.
In practice, the expansion interface that described transmission determining unit can adopt message-oriented middleware to send client is realized, by this expansion interface, the associative operation personnel can specify and send data source and corresponding data obtain manner, the acquiring unit of client will be from described transmission data source obtains a certain size data according to this obtain manner, preserving the unit then is saved to these data in the core buffer, when the data in the buffering area reach preset size, then these data encapsulation are become message, be sent to server then, thereby finish process of transmitting one time.
In the above-described embodiments, the description of each embodiment is all emphasized particularly on different fields, do not have the part that describes in detail among certain embodiment, get final product referring to the associated description of other embodiment.
With reference to figure 5, show the flow chart of a kind of large-size message method of reseptance embodiment 1 of the present invention, specifically may further comprise the steps:
Step 501, definite data source that receives;
Step 502, from server, extract message;
Wherein, described message is formed by the data encapsulation of preset size, and described data obtain from the transmission data source of appointment;
Step 503, described message is carried out decapsulation operation, obtain described data;
Step 504, described data are saved in the core buffer;
Step 505, the data in the described core buffer are sent to described reception data source.
The embodiment of the invention is corresponding to the method for reseptance embodiment 1 of aforementioned large-size message, in practice, described reception data source can be specified by the associative operation personnel, for the method for message decapsulation should corresponding its encapsulation method, that is to say, if encapsulation is described as the top-down process that takes place at transmit leg, specific header/trailer information on each layer adds for application data, then be descapsulated into the process from bottom to top that takes place the recipient, promptly successively remove head and trailer information.Certainly, the present invention does not limit the method for described encapsulation and decapsulation.
Because the corresponding different storage mode of different data possibility, in this case, present embodiment can also comprise step: store described data according to presetting storage rule in described reception data source.It all is feasible that those skilled in the art rule of thumb maybe need to be provided with any storage rule, and the present invention does not need this to limit.
With reference to figure 6, show the flow chart of the method for reseptance embodiment 2 of a kind of large-size message of the present invention, specifically may further comprise the steps:
Step 601, definite data source that receives;
Step 602, judge whether there is message in the described server, if then execution in step 603; If not, execution in step 608 then;
Step 603, empty the data in the described core buffer, and execution in step 604
Step 604, from server, extract message;
Wherein, described message is formed by the data encapsulation of preset size, and described data obtain from the transmission data source of appointment;
Step 605, described message is carried out decapsulation operation, obtain described data;
Step 606, described data are saved in the core buffer;
Step 607, the data in the described core buffer are sent to described reception data source.
Step 608, notification application message sink finish.
For said method embodiment, for simple description, so it all is expressed as a series of combination of actions, but those skilled in the art should know, the present invention is not subjected to the restriction of described sequence of movement, because according to the present invention, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in the specification all belongs to preferred embodiment, and related action and module might not be that the present invention is necessary.
With reference to figure 7, show the structured flowchart of the receiving system embodiment of a kind of large-size message of the present invention, comprise with lower unit:
Receive determining unit 701, be used for determining to receive data source;
Extraction unit 702 is used for extracting message from server;
Wherein, described message is formed by the data encapsulation of preset size, and described data obtain from the transmission data source of appointment;
Reduction unit 703 is used for described message is carried out the decapsulation operation, obtains described data;
Preserve unit 704, be used for described data are saved to core buffer;
Transmitting element 705: be used for the data of described core buffer are sent to described reception data source.
Preferably, the embodiment of the invention can also comprise with lower unit:
Judging unit is used for judging whether described server exists message, if then trigger and empty unit and extraction unit; If not, then trigger the reception notification unit;
Empty the unit, be used for emptying the data of described core buffer;
The reception notification unit is used for the notification application message sink and finishes.
Preferably, the embodiment of the invention can also comprise memory cell, is used for storing described data in described reception data source according to presetting storage rule.
For device embodiment, because it is substantially corresponding to method embodiment, so description is fairly simple, relevant part gets final product referring to the part explanation of method embodiment.
In practice, the embodiment of the invention is preferably based on message-oriented middleware and realizes, with reference to figure 8, shows the structured flowchart of a kind of large-size message receiving system embodiment of the present invention, specifically comprises with lower unit:
Receive determining unit 801, be used for determining to receive data source;
Message-oriented middleware 802 comprises receiving client 8021 and server 8022, and described reception client 8021 comprises:
Extraction unit 211 is used for extracting message from server, and described message is formed by the data encapsulation of preset size, and described data obtain from the transmission data source of appointment;
Reduction unit 212 is used for described message is carried out the decapsulation operation, obtains described data;
Preserve unit 213, be used for described data are saved to core buffer;
Transmitting element 214 is used for the data of described core buffer are sent to described reception data source.
In practice, the expansion interface that described reception determining unit can adopt message-oriented middleware to receive client is realized, by this expansion interface, the associative operation personnel can specific data memory location and corresponding storage rule, the extraction unit that receives client extracts from server and sends the message that client sends, by reduction unit to described message decapsulation, to obtain corresponding data, preserving the unit is saved to these data in the core buffer, the reception data source of appointment is stored this data in described reception data source to preset storage rule before by transmitting element the data in this buffering area being sent then.Certainly, for the mode of described storage by those skilled in the art according to actual needs or experience to adopt any mode all be feasible, the present invention does not need this to limit.
In the above-described embodiments, the description of each embodiment is all emphasized particularly on different fields, do not have the part that describes in detail among certain embodiment, get final product referring to the associated description of other embodiment.
Obviously, adopt the present invention to need not data are once read in internal memory, also need not data conversion storage is specific format, can realize the transmission of various types of mass datas, efficiency of transmission is higher, and simple to operate, better user experience, in addition, the present invention is for the service provider, only need expand the message transmission interface, need not complex calculation, technology realizes simple, and cost and risk is lower.
With reference to figure 9, show the structured flowchart of a kind of large-size message transmission system embodiment of the present invention, specifically comprise with lower unit:
Send determining unit 901, be used for determining to send data source;
Receive determining unit 902, be used for determining to receive data source;
Message-oriented middleware 903 comprises sending client 9031, reception client 9032 and server 9033, and described transmission client 9031 comprises:
Acquiring unit 311 is used for obtaining from described transmission data source a certain size data;
Preserve unit 312, be used for described data are saved to core buffer;
Encapsulation unit 313 when being used for the data fit preset size when described core buffer, becomes message with described data encapsulation;
Delivery unit 314 is used for described message is sent to described server;
Described reception client 9032 comprises:
Extraction unit 321 is used for extracting message from server, and described message is formed by the data encapsulation of preset size, and described data obtain from the transmission data source of appointment;
Reduction unit 322 is used for described message is carried out the decapsulation operation, obtains described data;
Preserve unit 323, be used for described data are saved to core buffer;
Transmitting element 324: be used for the data of described core buffer are sent to described reception data source.
Described server can be provided with one or more at sending client and receiving client, for example, a kind of structural representation of message-oriented middleware as shown in figure 10, wherein, message-oriented middleware comprises first server and second server, and, first client and second client, application program is carried out the transmission or the reception of message by client and server communication, and a kind of message transmitting procedure of carrying out based on the server of described client is:
Step S1, application program 1 is sent to first server by first client with message;
Step S2, first server deliver messages to second server;
Step S3, second server deliver messages to second client;
Step S4, second client library send to application program 2 with message.
Present embodiment can realize based on the transmission of messages technology of existing message-oriented middleware, particularly, can be by expansion interface be set realize sending client and receive client respectively, below be elaborated by example code.
One, application program uses client to send the mass data example code:
Main part:
Hashtable<String,String>env=new?Hashtable<String,String>();
env.put(Context.INITIAL_CONTEXT_FACTORY,
″com.apusic.naming.jndi.CNContextFactory″);
env.put(Context.PROVIDER_URL,″iiop://localhost:4888″);
env.put(Context.SECURITY_PRINCIPAL,″admin″);
env.put(Context.SECURITY_CREDENTIALS,″admin″);
Context?ctx=new?InitialContext(env);
QueueConnectionFactory?queueConnFactory=
(QueueConnectionFactory)ctx.lookup(″jms/ConnectionFactory″);
Queue?messageQueue=(Queue)ctx.lookup(″MessageQueue″);
QueueConnection?queueConn=
queueConnFactory.createQueueConnection();
QueueSession?queueSession=queueConn.createQueueSession(false,
Session.AUTO_ACKNOWLEDGE);
The client of // current use connects the server of the message-oriented middleware of appointment, and the address of server is a home server, and port is 4888, and the username and password that uses during connection is: admin, admin;
// and specify the destination of the large scale object message of transmission soon.
LMTSession?lmtSession=(LMTSession)queueSession;
// carry out the spreading code that the large scale object message sends, the session with server that will carry out the common message transmission converts to carries out the session that the large scale object message sends.
LMTSender?sender=lmtSession.createLMTSender(messageQueue);
Transmitter that sends to the suitable large scale object message of named place of destination of // establishment, LargeObjectMessage largeMessage=lmtSession.createLargeObjectMessage ();
Large scale object message that is used to send of // establishment
largeMessage.setSourceDataSource(new?DataBaseDataSource());
The transmission data source of the data that // appointment large scale object message will send
sender.send(largeMessage);
// the large scale object message is sent, from the transmission data source of above-mentioned appointment, obtain data during transmission, and data are sent on the server with a certain size.
The expansion interface part:
public?interface?LMTSession?extends?QueueSession{
// carry out the session that the large scale object message sends, expansion sends the interface of session from common message.
public?LargeObjectMessage?createLargeObjectMessage()?throws
JMSException;
Large scale object message that is used to send of // establishment
public?LMTSender?createLMTSender(Queue?queue)?throws
JMSException;
}
// create a message sender to named place of destination, send common message and large scale object message and all can use.
public?interface?LMTSender?extends?QueueSender{
The transmitter that the large scale object message sends is carried out in // definition, and expansion is from the interface of common message transmitter.
public?void?cancelSending()throws?JMSException;
}
// cancel current transmission
public?interface?LargeObjectMessage?extends?Message{
// expansion is from the large scale object message that is used to send of the interface of common message.
public?void?setSourceDataSource(DataSource?ds)throws?JMSException;
public?DataSource?getSourceDataSource()throws?JMSException;
The transmission data source of the data that // appointment large scale object message will send.
public?void?setDestinationDataSource(DataSource?ds)?throws
JMSException;
public?DataSource?getDestinationDataSource()throws?JMSException;
When discharging the data of carrying, // appointment large scale object message carries out the reception data source that data are preserved.
public?void?releaseData()throws?JMSException;
// begin to discharge the data of carrying in the large scale object message to arrive the reception data source of appointment.
public?void?cancelReleaseData()throws?JMSException;
}
// cancellation is current to receiving the release of data.
public?interface?DataSource{
// be used to obtain the data that will send, perhaps discharge the reception data source of the data that will preserve.
public?InputStream?getInputStream()throws?IOException;
// be used to obtain the inlet flow of the data that will send, from inlet flow, progressively obtain the data that will send.
public?OutputStream?getOutputStream()throws?IOException;
// being used to preserve the output stream of the data that the large scale object message discharges, the data of release progressively are saved in the storage by exporting this stream.
public?String?getContentType();
public?String?getName();
}
// be used to obtain the data that will send, perhaps discharge the realization part of the reception data source of the data that will preserve:
public?class?DataBaseDataSource?implements?DataSource{
public?DataBaseDataSource(){
}
public?String?getContentType(){
return″DataBase″;
}
// this is the realization in a data database data source, its effect is that data are extracted from database, and will discharge data and preserve back in the database.
public?InputStream?getInputStream()throws?IOException{
return?new?DataBaseInputStream();
}
public?String?getName(){
return″DataBaseDataSource″;
}
// be used for obtaining the inlet flow of the data that will send from database, from this inlet flow, progressively from database, obtain the data that will send.
// obtain which data or whether judgment data obtains the concrete means of finishing, in the inlet flow of data, realize.
public?OutputStream?getOutputStream()throws?IOException{
return?new?DataBaseOutputStream();
}
}
// the data that are used for receiving progressively are saved in the output stream of database, and storage is concrete store means such as which position in database;
// realize at the data output stream.
In application program, carry out after the code of above main part, the data that client just will send in the transmission data source with large scale object message appointment in the code reading into by part, just this part data is sent on the server that has connected after reading a part of data, this server again with data passes to the server at place, destination, this process lasts till that always all data reads that will send finish.Afterwards, destination applications uses the message sink DLL (dynamic link library) of client to destination server the Data Receiving of carrying in the large scale object message to be arrived the memory location that receives the appointment of transmission data source.
Two, application program uses client to receive the example code of mass data:
Hashtable<String,String>env=new?Hashtable<String,String>();
env.put(Context.INITIAL_CONTEXT_FACTORY,
″com.apusic.naming.jndi.CNContextFactory″);
env.put(Context.PROVIDER_URL,″iiop://localhost:4888″);
env.put(Context.SECURITY_PRINCIPAL,″admin″);
env.put(Context.SECURITY_CREDENTIALS,″admin″);
Context?ctx=new?InitialContext(env);
QueueConnectionFactory?queueConnFactory=
(QueueConnectionFactory)ctx.lookup(″jms/ConnectionFactory″);
Queue?messageQueue=(Queue)ctx.lookup(″MessageQueue″);
QueueConnection?queueConn=
queueConnFactory.createQueueConnection();
QueueSession?queueSession=queueConn.createQueueSession(false,
Session.AUTO_ACKNOWLEDGE);
// the active client storehouse is connected the upward server of the message-oriented middleware of appointment, the address of server is a home server, and port is 4888, and the username and password that uses during connection is: admin, admin
// and specify the source formation of the large scale object message of reception soon.
LMTSession?lmtSession=(LMTSession)queueSession;
// carry out the spreading code that the large scale object message receives, the session with server that will carry out the common message reception converts to carries out the session that the large scale object message receives.
QueueReceiver?receiver=lmtSession.createReceiver(messageQueue);
// create one to the message receiver of specifying the source formation, receive common message and large scale object message and can use it.
queueConn.start();
// prepare to receive
LargeObj?ectMessagelargeMessage=(LargeObjectMessage)receiver.receive();
// the large scale object message is received
largeMessage.setDestinationDataSource(new?DataBaseDataSource());
When discharging the data of carrying, // appointment large scale object message carries out the reception data source that data are preserved;
largeMessage.releaseData();
// beginning to discharge the data of carrying in the reception data source of appointment, data are that continuous part discharges, and how data are preserved by the specific implementation of memory location and are determined.
In the above-described embodiments, the description of each embodiment is all emphasized particularly on different fields, do not have the part that describes in detail among certain embodiment, get final product referring to the associated description of other embodiment.
Large-size message transmitting system of the present invention, receiving system and transmission system can be used in numerous general or special purpose computingasystem environment or the configuration.For example: personal computer, server computer, handheld device or portable set, plate equipment, multicomputer system, the system based on microprocessor, set top box, programmable consumer-elcetronics devices, network PC, minicom, mainframe computer, comprise distributed computing environment (DCE) of above any system or equipment or the like.In addition, described large-size message transmitting system, receiving system and transmission system system can also describe in the general context of the computer executable instructions of being carried out by computer, for example program module.Usually, program module comprises the routine carrying out particular task or realize particular abstract, program, object, assembly, data structure or the like.Also can in distributed computing environment (DCE), put into practice the present invention, in these distributed computing environment (DCE), by by communication network connected teleprocessing equipment execute the task.In distributed computing environment (DCE), program module can be arranged in the local and remote computer-readable storage medium that comprises memory device.
More than to sending method, dispensing device and the transmitting system of a kind of large-size message provided by the present invention, a kind of method of reseptance of large-size message, receiving system and receiving system, and, a kind of transmission system of large-size message is described in detail, used specific case herein principle of the present invention and execution mode are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (15)

1. the sending method of a large-size message is characterized in that, comprising:
Determine to send data source;
From described transmission data source, obtain a certain size data;
Described data are saved in the core buffer;
When the data fit preset size in the described core buffer, described data encapsulation is become message;
Described message is sent to server.
2. the method for claim 1 is characterized in that, also comprises:
Empty the data in the described core buffer.
3. method as claimed in claim 1 or 2 is characterized in that, also comprises:
Judge whether described transmission data source exists data, if then carry out obtaining step; If not, then the notification application data send end.
4. the dispensing device of a large-size message is characterized in that, comprising:
Send determining unit, be used for determining to send data source;
Acquiring unit is used for obtaining from described transmission data source a certain size data;
Preserve the unit, be used for described data are saved to core buffer;
Encapsulation unit when being used for the data fit preset size when described core buffer, becomes message with described data encapsulation;
Delivery unit is used for described message is sent to server.
5. device as claimed in claim 4 is characterized in that, also comprises:
Empty the unit, be used for emptying the data of described core buffer.
6. as claim 4 or 5 described devices, it is characterized in that, also comprise:
Judging unit is used to judge whether described transmission data source exists data, if then trigger acquiring unit; If not, then trigger the transmission notification unit;
Send notification unit, be used for the notification application data and send end.
7. the transmitting system of a large-size message is characterized in that, comprising:
Send determining unit, be used for determining to send data source;
Message-oriented middleware comprises the transmission client and server, and described transmission client comprises:
Acquiring unit is used for obtaining from described transmission data source a certain size data;
Preserve the unit, be used for described data are saved to core buffer;
Encapsulation unit when being used for the data fit preset size when described core buffer, becomes message with described data encapsulation;
Delivery unit is used for described message is sent to described server.
8. the method for reseptance of a large-size message is characterized in that, comprising:
Determine to receive data source;
Extract message from server, described message is formed by the data encapsulation of preset size, and described data obtain from the transmission data source of appointment;
Described message is carried out the decapsulation operation, obtain described data;
Described data are saved in the core buffer;
Data in the described core buffer are sent to described reception data source.
9. method as claimed in claim 8 is characterized in that, also comprises:
Judge whether there is message in the described server, if then empty the data in the described core buffer, and carry out extraction step; If not, then the notification application message sink finishes.
10. method as claimed in claim 8 or 9 is characterized in that, also comprises:
In described reception data source, store described data according to presetting storage rule.
11. the receiving system of a large-size message is characterized in that, comprising:
Receive determining unit, be used for determining to receive data source;
Extraction unit is used for extracting message from server, and described message is formed by the data encapsulation of preset size, and described data obtain from the transmission data source of appointment;
Reduction unit is used for described message is carried out the decapsulation operation, obtains described data;
Preserve the unit, be used for described data are saved to core buffer;
Transmitting element: be used for the data of described core buffer are sent to described reception data source.
12. device as claimed in claim 11 is characterized in that, also comprises:
Judging unit is used for judging whether described server exists message, if then trigger and empty unit and extraction unit; If not, then trigger the reception notification unit;
Empty the unit, be used for emptying the data of described core buffer;
The reception notification unit is used for the notification application message sink and finishes.
13. as claim 11 or 12 described devices, it is characterized in that, also comprise:
Memory cell is used for storing described data in described reception data source according to presetting storage rule.
14. the receiving system of a large-size message is characterized in that, comprising:
Receive determining unit, be used for determining to receive data source;
Message-oriented middleware comprises the reception client and server, and described reception client comprises:
Extraction unit is used for extracting message from server, and described message is formed by the data encapsulation of preset size, and described data obtain from the transmission data source of appointment;
Reduction unit is used for described message is carried out the decapsulation operation, obtains described data;
Preserve the unit, be used for described data are saved to core buffer;
Transmitting element is used for the data of described core buffer are sent to described reception data source.
15. a large-size message transmission system is characterized in that, comprising:
Send determining unit, be used for determining to send data source;
Receive determining unit, be used for determining to receive data source;
Message-oriented middleware comprises sending client, reception client and server, and described transmission client comprises:
Acquiring unit is used for obtaining from described transmission data source a certain size data;
Preserve the unit, be used for described data are saved to core buffer;
Encapsulation unit when being used for the data fit preset size when described core buffer, becomes message with described data encapsulation;
Delivery unit is used for described message is sent to described server;
Described reception client comprises:
Extraction unit is used for extracting message from server, and described message is formed by the data encapsulation of preset size, and described data obtain from the transmission data source of appointment;
Reduction unit is used for described message is carried out the decapsulation operation, obtains described data;
Preserve the unit, be used for described data are saved to core buffer;
Transmitting element: be used for the data of described core buffer are sent to described reception data source.
CNA2007101476301A 2007-08-31 2007-08-31 Sending method, receiving method and transfer system for large-size message Pending CN101106550A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA2007101476301A CN101106550A (en) 2007-08-31 2007-08-31 Sending method, receiving method and transfer system for large-size message

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2007101476301A CN101106550A (en) 2007-08-31 2007-08-31 Sending method, receiving method and transfer system for large-size message

Publications (1)

Publication Number Publication Date
CN101106550A true CN101106550A (en) 2008-01-16

Family

ID=39000230

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA2007101476301A Pending CN101106550A (en) 2007-08-31 2007-08-31 Sending method, receiving method and transfer system for large-size message

Country Status (1)

Country Link
CN (1) CN101106550A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101527724A (en) * 2008-03-03 2009-09-09 汤姆森许可贸易公司 Data transport container for transferring different data in internet protocol network
CN102289966A (en) * 2011-08-12 2011-12-21 电子科技大学 Radar simulation system
CN102457442A (en) * 2010-10-29 2012-05-16 金蝶软件(中国)有限公司 Message sending and reading methods and devices as well as middleware system
CN102571749A (en) * 2010-12-27 2012-07-11 三星Sds株式会社 Data transmission system and method using relay server
CN103188140A (en) * 2011-12-31 2013-07-03 国民技术股份有限公司 Service request processing system
CN104125283A (en) * 2014-07-30 2014-10-29 中国银行股份有限公司 Message queue receiving method and system for cluster
CN104601451A (en) * 2015-01-27 2015-05-06 深信服网络科技(深圳)有限公司 Instant message communication method and system
CN105282247A (en) * 2015-10-27 2016-01-27 中国人民解放军军械工程学院 Method for transmitting signals among nodes of distributed simulation system
CN103188140B (en) * 2011-12-31 2016-12-14 国民技术股份有限公司 A kind of service request processing system
CN109067733A (en) * 2018-07-27 2018-12-21 成都华为技术有限公司 The method and apparatus for sending data, and the method and apparatus for receiving data
CN110515548A (en) * 2019-08-15 2019-11-29 浙江万朋教育科技股份有限公司 A method of avoiding waste third party cloud memory space
CN114759965A (en) * 2020-12-29 2022-07-15 中国科学院空天信息创新研究院 Data packet transmission method, device and storage medium

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101527724A (en) * 2008-03-03 2009-09-09 汤姆森许可贸易公司 Data transport container for transferring different data in internet protocol network
CN101527724B (en) * 2008-03-03 2014-01-08 汤姆森许可贸易公司 Data transport container for transferring different data in internet protocol network
CN102457442A (en) * 2010-10-29 2012-05-16 金蝶软件(中国)有限公司 Message sending and reading methods and devices as well as middleware system
CN102571749B (en) * 2010-12-27 2015-06-10 三星Sds株式会社 Data transmission system and method using relay server
CN102571749A (en) * 2010-12-27 2012-07-11 三星Sds株式会社 Data transmission system and method using relay server
US9137313B2 (en) 2010-12-27 2015-09-15 Samsung Sds Co., Ltd. Data transmission system and method using relay server
CN102289966A (en) * 2011-08-12 2011-12-21 电子科技大学 Radar simulation system
CN103188140A (en) * 2011-12-31 2013-07-03 国民技术股份有限公司 Service request processing system
CN103188140B (en) * 2011-12-31 2016-12-14 国民技术股份有限公司 A kind of service request processing system
CN104125283A (en) * 2014-07-30 2014-10-29 中国银行股份有限公司 Message queue receiving method and system for cluster
CN104125283B (en) * 2014-07-30 2017-10-03 中国银行股份有限公司 A kind of message queue method of reseptance and system for cluster
CN104601451A (en) * 2015-01-27 2015-05-06 深信服网络科技(深圳)有限公司 Instant message communication method and system
CN104601451B (en) * 2015-01-27 2017-11-28 深信服网络科技(深圳)有限公司 Instant information communication method and system
CN105282247A (en) * 2015-10-27 2016-01-27 中国人民解放军军械工程学院 Method for transmitting signals among nodes of distributed simulation system
CN105282247B (en) * 2015-10-27 2018-10-26 中国人民解放军军械工程学院 Method for transmitting signals based on distributed radar warning receiver analogue system
CN109067733A (en) * 2018-07-27 2018-12-21 成都华为技术有限公司 The method and apparatus for sending data, and the method and apparatus for receiving data
US11405458B2 (en) 2018-07-27 2022-08-02 Huawei Cloud Computing Technologies Co., Ltd. Sending and receiving data using multiple objects with a single storage request
CN110515548A (en) * 2019-08-15 2019-11-29 浙江万朋教育科技股份有限公司 A method of avoiding waste third party cloud memory space
CN114759965A (en) * 2020-12-29 2022-07-15 中国科学院空天信息创新研究院 Data packet transmission method, device and storage medium

Similar Documents

Publication Publication Date Title
CN101106550A (en) Sending method, receiving method and transfer system for large-size message
KR101488268B1 (en) Push message service system and method thereof
CN101179790B (en) Serial port communication method between mobile terminal processor
CN102316160B (en) Website system and communication method thereof
CN102761864A (en) Data transmission method, system and device
CN101122852A (en) On-line business processing system middleware package method
CN104753817A (en) Local analogy method and local analogy system for cloud computing message queue service
WO2011130940A1 (en) Multi-service integration processing method and service integration platform
CN103220206A (en) Message sending method and device and message receiving method and device
CN104486327B (en) Communication means and client between the page and long connection server
WO2010145224A1 (en) Method and system for providing user service data
CN101567861B (en) Data synchronization method and application system between heterogeneous application systems
CN107741884B (en) Method and device for realizing message pushing by hierarchical state machine
RU2007132451A (en) METHOD AND DEVICE FOR INTERACTION BETWEEN THE Push-to-Talk (POS) SYSTEM AND THE IMMEDIATE MESSAGES SYSTEM (IM) IN A CELLULAR COMMUNICATION NETWORK
CN106027534A (en) System for implementing financial message processing based on Netty
CN101631127A (en) File transfer method and clients
CN110120854A (en) The method and apparatus for transmitting data
JP6026992B2 (en) Services and management layer for various data connections
CN101571811B (en) Information transmission method and device thereof
WO2011091731A1 (en) Data transmission device, data transmission method and data synchronization method
CN113254103A (en) Application function implementation method and device and storage medium
CN103782278A (en) System and method for providing dynamic invocation and service interface for use in middleware or other environment
CN100596123C (en) Gateway system and message service processing method thereof
JP2014123363A5 (en)
CN104901865A (en) Mobile-end instant messaging (IM) signal synchronization method based on global monotonic serial number

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
ASS Succession or assignment of patent right

Owner name: SHENZHEN KINGDEE MIDDLEWARE CO.

Free format text: FORMER OWNER: KINGDEE SOFTWARE (CHINA) COMPANY LTD.

Effective date: 20080523

C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20080523

Address after: 1.3.4 District, Shenzhen District, Nanshan District hi tech Industrial Zone, Guangdong Province, second floor, sparrow Hill Industrial Zone, M-6, 518000

Applicant after: Shenzhen Kingdee Middleware Co., Ltd.

Address before: W1-B4, hi tech Industrial Zone, Shennan Avenue, Shenzhen, Guangdong, Nanshan District Province, China: 518057

Applicant before: Kingdee Software (China) Co., Ltd.

C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Open date: 20080116