CN102868564A - Information persistence method and system - Google Patents

Information persistence method and system Download PDF

Info

Publication number
CN102868564A
CN102868564A CN2012103809220A CN201210380922A CN102868564A CN 102868564 A CN102868564 A CN 102868564A CN 2012103809220 A CN2012103809220 A CN 2012103809220A CN 201210380922 A CN201210380922 A CN 201210380922A CN 102868564 A CN102868564 A CN 102868564A
Authority
CN
China
Prior art keywords
message
station location
location marker
module
journal file
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
CN2012103809220A
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.)
CVIC Software Engineering Co Ltd
Original Assignee
CVIC Software Engineering 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 CVIC Software Engineering Co Ltd filed Critical CVIC Software Engineering Co Ltd
Priority to CN2012103809220A priority Critical patent/CN102868564A/en
Publication of CN102868564A publication Critical patent/CN102868564A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses an information persistence method and system. The information persistence method is characterized in that all concentrated information of received information transmitted by a client side is sequentially analyzed to obtain position identifiers contained in each information, all concentrated information of received information is serialized, and all the serialized information is written into a journal file according to the position identifiers contained in the serialized information. By applying the information persistence method to a system, when a server is halted, the information stored in the journal file cannot not lost and can restore to the operation state before the server is halted, and therefore the problem of not high information transmission stability can be solved.

Description

A kind of message persistence method and system
Technical field
The present invention relates to computer realm, particularly a kind of message persistence method and system.
Background technology
At present, the message transmitting of message-oriented middleware server is an extremely important index weighing the message-oriented middleware product, how to store message that client sends to message server and be an important link wherein, because how to relate to storing message, sender, sender's the related news such as destination, and how from memory lasting message to be replaced memory headroom fast and bring in this information of consumption in order to the client.
Realize at present the most frequently used method of message stores: the message that all clients are sent to server end is kept among the internal memory, because all message all operate in internal memory, adopt the message-oriented middleware throughput performance of this mode very high, wherein there is following problem in this kind method: the machine if server is delayed, all message that are kept in the internal memory will be lost, and therefore can cause the not high problem of transmission of messages stability.
Summary of the invention
Problem to be solved by this invention is: a kind of message persistence method and system are provided, and to solve in the prior art when generation server is delayed machine, the message in the internal memory can be lost the not high problem of stability that causes transmission of messages.
The invention provides a kind of message persistence method, comprising:
Receive the message set that client sends;
Each message in the described message set is resolved successively, obtain the station location marker that comprises in each message;
Each message in the described message set is carried out serializing, described each message through serializing is write journal file according to the station location marker that it comprises.
Preferably, also comprise: obtain the result that writes who writes journal file, and judge whether the said write result writes successfully, if so, generate response data, and described response data is sent to client.
Preferably, also comprise: the station location marker of each message in the described message set is stored in the server memory.
Preferably, also comprise: when server memory receives when reading the message instruction, according to the station location marker of described message, obtain to be stored in the message in the described journal file.
Preferably, described described each comprised according to the process that its station location marker that comprises writes journal file through serializing message:
Described serializing message is write journal file with the form of byte stream according to the station location marker that it was comprised.
A kind of message persistent object system, described system comprises: receiver module, processing module and the first memory module;
Described receiver module is used for, and receives the message set that client sends;
Described processing module is used for, and each message in the described message set is resolved successively, obtains the station location marker that comprises in each message;
Described the first memory module is used for, and each message in the described message set is carried out serializing, and described each message through serializing is write journal file according to the station location marker that it comprises.
Preferably, also comprise: judge module and respond module;
Described judge module is used for, and whether that judges that the said write journal file obtains writes the result and write successfully, if so, then generates response data, if not, and failed regeneration response data then;
Described respond module is used for, and described response data or failure response data are sent to client.
Preferably, also comprise: the second memory module:
Described the second memory module is used for, and each message station location marker in the described message set is stored in the server memory.
Preferably, also comprise: read module;
Described read module is used for, and when server memory receives when reading the message instruction, according to the station location marker of described message, obtains to be stored in the message in the described journal file.
As can be seen from the above technical solutions, the invention provides a kind of message persistence method and system, described method comprises: receive the message set that client sends, each message in the described message set is resolved successively, obtain the station location marker that comprises in each message, each message in the described message set is carried out serializing, described each write journal file through serializing message according to the station location marker that it comprises, described method is applied in the system, can be implemented in server delays in the situation of machine, be kept at message in the journal file and can not lose the running status that can also return to before the machine of delaying, therefore can not cause the not high problem of transmission of messages stability.
Description of drawings
In order to be illustrated more clearly in the embodiment of the invention or technical scheme of the prior art, the below will do to introduce simply to the accompanying drawing of required use in embodiment or the description of the Prior Art, apparently, the accompanying drawing that the following describes only is some embodiment that put down in writing among the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is the schematic flow sheet of the embodiment of the invention one disclosed a kind of message persistence method;
Fig. 2 is the schematic flow sheet of the embodiment of the invention two disclosed a kind of message persistence methods;
Fig. 3 is the schematic flow sheet of the embodiment of the invention three disclosed a kind of message persistence methods;
Fig. 4 is the structural representation of the embodiment of the invention four disclosed a kind of message persistent object systems;
Fig. 5 is the structural representation of the embodiment of the invention five disclosed a kind of message persistent object systems;
Fig. 6 is the structural representation of the embodiment of the invention six disclosed a kind of message persistent object systems.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to protection scope of the present invention not making the every other embodiment that obtains under the creative work prerequisite.
The embodiment of the invention one discloses a kind of message persistence method schematic flow sheet, and referring to shown in Figure 1, described method is applied in the message-oriented middleware, and step comprises:
Step S101: receive the message set that client sends;
Step S102: each message in the described message set is resolved successively, obtain the station location marker that comprises in each message;
Wherein, each message is resolved, can obtain message content, destination locations, sender's title and the message identifier etc. of each message.
Step S103: each message in the described message set is carried out serializing, described each message through serializing is write journal file according to the station location marker that it comprises;
Wherein, described serializing message writes in the journal file according to different destination locations with the form of byte stream.
Present embodiment discloses a kind of message persistence method, described method comprises: receive the message set that client sends, each message in the described message set is resolved successively, obtain the station location marker that comprises in each message, each message in the described message set is carried out serializing, described each message through serializing is write journal file according to the station location marker that it comprises, described method writes in the journal file after with described information sequence, after machine recovers even can guarantee like this to delay, described information also can keep, thereby has improved the stability of transmission of messages.
Present embodiment two discloses a kind of method of message persistence, and referring to shown in Figure 2, described method comprises:
Step S201: receive the message set that client sends;
Step S202: each message in the described message set is resolved successively, obtain the station location marker that comprises in each message;
Step S203: each message in the described message set is carried out serializing, described each message through serializing is write journal file according to the station location marker that it comprises;
Wherein, described serializing message writes in the journal file according to different destination locations with the form of byte stream.
Step S204: judge whether the said write result writes successfully, if so, execution in step S205, if not, execution in step S206 then;
Step S205: generate response data, and described response data is sent to client;
Step S206: the failed regeneration response data, and described failure response data are sent to client.
Present embodiment is on the basis of embodiment one, increased the deterministic process that to whether message is write journal file, when writing successfully, generate response data, and described response data is sent to client, if not success sends failure information to client, can confirm effectively that whether each information through serializing has write in the journal file, has avoided occurring invalid operation.
Present embodiment three discloses a kind of method of message persistence, and referring to shown in Figure 3, described method comprises:
Step S301: receive the message set that client sends;
Step S302: each message in the described message set is resolved successively, obtain the station location marker that comprises in each message;
Step S303: each message in the described message set is carried out serializing, described each message through serializing is write journal file according to the station location marker that it comprises;
Step S304: the station location marker of each message in the described message set is stored in the server memory;
Step S305: when server memory receives when reading the message instruction, according to the station location marker of described message, obtain to be stored in the message in the described journal file.
Present embodiment discloses a kind of method of message persistence, described method is on the basis of embodiment one, the station location marker of each message in the described message set is stored in the server memory, when server memory receives the reading information instruction, according to the station location marker of described message, obtain to be stored in the message in the described journal file, in the situation of the machine of not delaying, described method has realized the high-throughput of the message of message-oriented middleware by message index sign, has improved the efficient of message retrieval.
Present embodiment four discloses a kind of system of message persistence, and referring to shown in Figure 4, described system comprises: receiver module 101, processing module 102, the first memory module 103;
Described receiver module 101 is used for, and receives the message set that client sends;
Described processing module 102 is used for, and each message in the described message set is resolved successively, obtains the station location marker that comprises in each message;
Described the first memory module 103 is used for, and each message in the described message set is carried out serializing, and described each message through serializing is write journal file according to the station location marker that it comprises.
Present embodiment discloses a kind of system of message persistence, described system comprises: receiver module, processing module, memory module, described receiver module receives the message set that client sends, described processing module is resolved each message in the described message set successively, obtain the station location marker that comprises in each message, described the first memory module is carried out serializing to each message in the described message set, described each message through serializing is write journal file according to the station location marker that it comprises, described system with described serializing message stores in journal file, even guaranteed in the situation of the machine of delaying, the situation that message can not be lost has improved the stability of transmission of messages.
Present embodiment five discloses a kind of system of message persistence, and referring to shown in Figure 5, on the basis of embodiment four, described system also comprises: judge module 104 and respond module 105;
Described judge module 104 is used for, and judges whether the said write result shows to write successfully, if so, then generates response data, if not, and failed regeneration response data then;
Described respond module 105 is used for, and described response data or failure response data are sent to client.
Present embodiment discloses a kind of system of message persistence, described system also comprises: judge module, respond module, described judge module is judged whether the said write result shows and is write successfully, if, then generate response data, if not, failed regeneration response data then, described respond module is sent to client with described response data or failure response data, described system can confirm effectively that whether each message through serializing has write in the journal file, has avoided occurring invalid operation.
The embodiment of the invention six discloses a kind of system of message persistence, and on the basis of embodiment four, described system also comprises: the second memory module 106 and read module 107;
Described the second memory module 106 is used for, and each message station location marker in the described message set is stored in the server memory;
Described read module 107 is used for, and when server memory receives when reading the message instruction, according to the station location marker of described message, obtains to be stored in the message in the described journal file.
Present embodiment discloses a kind of system of message persistence, described system has increased the second memory module and read module on the basis of embodiment four, described the second memory module is used for described each message station location marker is stored in server memory, described read module is used for receiving when reading the message instruction when server memory, station location marker according to described message, acquisition is stored in the message in the described journal file, in the situation of high capacity, can rely on each message station location marker in the second memory module in the described system, improve the message throughput of message-oriented middleware, realize efficient message retrieval.
Each embodiment adopts the mode of going forward one by one to describe in this specification, and what each embodiment stressed is and the difference of other embodiment that identical similar part is mutually referring to getting final product between each embodiment.For the disclosed device of embodiment, because it is corresponding with the disclosed method of embodiment, so description is fairly simple, relevant part partly illustrates referring to method and gets final product.
To the above-mentioned explanation of the disclosed embodiments, make this area professional and technical personnel can realize or use the present invention.Multiple modification to these embodiment is apparent to those skilled in the art, and General Principle as defined herein can in the situation that does not break away from the spirit or scope of the present invention, realize in other embodiments.Therefore, the present invention will can not be restricted to these embodiment shown in this article, but will meet the wide region consistent with principle disclosed herein and features of novelty.

Claims (9)

1. a message persistence method is characterized in that, described method comprises:
Receive the message set that client sends;
Each message in the described message set is resolved successively, obtain the station location marker that comprises in each message;
Each message in the described message set is carried out serializing, described each message through serializing is write journal file according to the station location marker that it comprises.
2. method according to claim 1 is characterized in that, also comprises:
Obtain the result that writes who writes journal file, and judge whether the said write result writes successfully, if so, generate response data, and described response data is sent to client.
3. method according to claim 1 is characterized in that, also comprises:
The station location marker of each message in the described message set is stored in the server memory.
4. method according to claim 3 is characterized in that, also comprises:
When server memory receives when reading the message instruction, according to the station location marker of described message, obtain to be stored in the message in the described journal file.
5. method according to claim 1 is characterized in that, described described each is comprised according to the process that its station location marker that comprises writes journal file through serializing message:
Described serializing message is write journal file with the form of byte stream according to the station location marker that it was comprised.
6. a message persistent object system is characterized in that, described system comprises: receiver module, processing module and the first memory module;
Described receiver module is used for, and receives the message set that client sends;
Described processing module is used for, and each message in the described message set is resolved successively, obtains the station location marker that comprises in each message;
Described the first memory module is used for, and each message in the described message set is carried out serializing, and described each message through serializing is write journal file according to the station location marker that it comprises.
7. method according to claim 6, its feature with, also comprise: judge module and respond module;
Described judge module is used for, and whether that judges that the said write journal file obtains writes the result and write successfully, if so, then generates response data, if not, and failed regeneration response data then;
Described respond module is used for, and described response data or failure response data are sent to client.
8. system according to claim 6 is characterized in that, also comprises: the second memory module:
Described the second memory module is used for, and each message station location marker in the described message set is stored in the server memory.
9. system according to claim 8 is characterized in that, also comprises: read module;
Described read module is used for, and when server memory receives when reading the message instruction, according to the station location marker of described message, obtains to be stored in the message in the described journal file.
CN2012103809220A 2012-10-10 2012-10-10 Information persistence method and system Pending CN102868564A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2012103809220A CN102868564A (en) 2012-10-10 2012-10-10 Information persistence method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2012103809220A CN102868564A (en) 2012-10-10 2012-10-10 Information persistence method and system

Publications (1)

Publication Number Publication Date
CN102868564A true CN102868564A (en) 2013-01-09

Family

ID=47447169

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2012103809220A Pending CN102868564A (en) 2012-10-10 2012-10-10 Information persistence method and system

Country Status (1)

Country Link
CN (1) CN102868564A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106598473A (en) * 2015-10-15 2017-04-26 中兴通讯股份有限公司 Message persistence method and device
CN110442461A (en) * 2019-07-11 2019-11-12 福建天泉教育科技有限公司 A kind of message dilivery method, storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060277319A1 (en) * 2005-06-03 2006-12-07 Microsoft Corporation Optimizing message transmission and delivery in a publisher-subscriber model
CN101510893A (en) * 2008-12-25 2009-08-19 北京大学 Method, device and transmission system for sending, transferring and receiving message document
CN101686209A (en) * 2008-09-24 2010-03-31 阿里巴巴集团控股有限公司 Method and device for storing message in message retransmission system
CN101707633A (en) * 2009-11-27 2010-05-12 山东中创软件商用中间件股份有限公司 Message-oriented middleware persistent message storing method based on file system
CN102355342A (en) * 2011-10-19 2012-02-15 山东中创软件工程股份有限公司 Method for sending and receiving message and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060277319A1 (en) * 2005-06-03 2006-12-07 Microsoft Corporation Optimizing message transmission and delivery in a publisher-subscriber model
CN101686209A (en) * 2008-09-24 2010-03-31 阿里巴巴集团控股有限公司 Method and device for storing message in message retransmission system
CN101510893A (en) * 2008-12-25 2009-08-19 北京大学 Method, device and transmission system for sending, transferring and receiving message document
CN101707633A (en) * 2009-11-27 2010-05-12 山东中创软件商用中间件股份有限公司 Message-oriented middleware persistent message storing method based on file system
CN102355342A (en) * 2011-10-19 2012-02-15 山东中创软件工程股份有限公司 Method for sending and receiving message and device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106598473A (en) * 2015-10-15 2017-04-26 中兴通讯股份有限公司 Message persistence method and device
CN106598473B (en) * 2015-10-15 2020-09-04 南京中兴新软件有限责任公司 Message persistence method and device
CN110442461A (en) * 2019-07-11 2019-11-12 福建天泉教育科技有限公司 A kind of message dilivery method, storage medium
CN110442461B (en) * 2019-07-11 2022-10-21 福建天泉教育科技有限公司 Message delivery method and storage medium

Similar Documents

Publication Publication Date Title
US10592464B2 (en) Methods for enabling direct memory access (DMA) capable devices for remote DMA (RDMA) usage and devices thereof
CN102857554B (en) Data redundancy processing method is carried out based on distributed memory system
CN102142032B (en) Method and system for reading and writing data of distributed file system
CN103051681B (en) Collaborative type log system facing to distribution-type file system
CN102467408A (en) Method and device for accessing data of virtual machine
CN103209214A (en) Not only structured query language (NoSQL)-based method for realizing message-oriented middleware
CN102843396A (en) Data writing and reading method and device in distributed caching system
CN103761141A (en) Method and device for realizing message queue
CN105760467A (en) Real-time data read-write method, device and system and NFS server
CN102395958B (en) Concurrent processing method and device for data packet
CN107608627B (en) Remote data hierarchical storage method, electronic equipment and storage medium
CN111049765B (en) Aggregation port switching method, device, chip, switch and storage medium
CN102088490A (en) Data storage method, device and system
CN103793291A (en) Distributed data copying method and device
CN112559476B (en) Log storage method for improving performance of target system and related equipment thereof
CN107632780A (en) A kind of roll of strip implementation method and its storage architecture based on distributed memory system
CN103605630A (en) Virtual server system and data reading-writing method thereof
CN104780190A (en) Data read-write control method and data read-write control device
CN102868564A (en) Information persistence method and system
CN107391672A (en) The reading/writing method of data and the distributed file system of message
CN103002038B (en) The processing method of elastic load equilibrium and device
CN111984198A (en) Message queue implementation method and device and electronic equipment
CN108306926B (en) Method and device for pushing gateway service data of Internet of vehicles equipment
CN102868739A (en) Switching equipment applied to Internet protocol (IP) storage area network (SAN) cluster storage system
CN102750342A (en) Method for maintaining data consistency for cluster file system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20130109