CN102769546A - Method and system for message segmentation storage - Google Patents
Method and system for message segmentation storage Download PDFInfo
- Publication number
- CN102769546A CN102769546A CN2012102723025A CN201210272302A CN102769546A CN 102769546 A CN102769546 A CN 102769546A CN 2012102723025 A CN2012102723025 A CN 2012102723025A CN 201210272302 A CN201210272302 A CN 201210272302A CN 102769546 A CN102769546 A CN 102769546A
- Authority
- CN
- China
- Prior art keywords
- message
- internal memory
- segmentation
- file
- preserving
- 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
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The invention relates to the technical field of automatic control systems of computers, and discloses a method and a system for message segmentation storage. The method includes: receiving messages transmitted on a bus, and storing the messages into an internal memory; judging whether the messages in the internal memory meet the segmentation record condition or not, wherein the segmentation record condition refers to that the messages in the internal memory reach a preset quantity or internal memory consumption reaches a preset numerical value; when the segmentation record condition is not met, continuing receiving the messages transmitted on the bus, and storing the messages into the internal memory; and when the segmentation record condition is met, recording segmentation information of the messages, pre-generating segmentation record files for storing the messages, and storing the messages in the internal memory into the segmentation record files. By the aid of the method and the system, low system internal memory occupancy of a message storage function, short record process and free selection of file save path by users are guaranteed, and software performance and user experience are greatly improved.
Description
Technical field
The present invention relates to the computer automatic control system technical field, in particular, relate to the method and system that a kind of message fragment is preserved.
Background technology
Field bus control system is the communication system of digital, the two-way and multistation of connection of intelligent field apparatus and automated system, mainly solves digital communication and the information problem of transmission between these field control equipment and the advanced control system (ACS) between the field apparatuss such as intelligent instrumentation, controller and actuator of industry spot.
At present, in the exploitation and test process of the electronic controller of bus and bus network, all need use the host computer tool software that the message on the bus is monitored and record, at the scene so that data are analyzed.Current monitoring and logging software adopt following dual mode to the record of message is general: first kind is in the process of monitoring, the bus message that receives to be kept in the internal memory, when the user of tool using need preserve again hereof with message accounting; Second kind is to need the user that the path of file logging is set, software can be after receiving message immediately with message accounting in file.This dual mode all exists certain problem and defective; When adopting first kind of mode, when message amount is a lot, will consume a large amount of Installed System Memories; Influence the performance of software; And if the PC internal memory is less serious problems such as software can not use will occur, the disposable process that all messages are write file also can spend great amount of time, influences user experience; When adopting the second way; Solved the problem of first kind of mode; But because the path of file logging need be set in advance; Therefore flexibility will reduce, and when file had write down a large number of message, the message accounting that will newly receive again also can spend great amount of time in file.
Therefore; The method and system that provide a kind of message fragment to preserve; Guaranteeing that the message accounting function takies that Installed System Memory is low, recording process short and the user can free select File storing path, software performance and user experience are greatly improved, is those skilled in the art's problem demanding prompt solutions.
Summary of the invention
In view of this; The invention provides the method and system that a kind of message fragment is preserved; To overcome in the prior art because the path of file logging need be set in advance; Flexibility reduces, and when file has write down a large number of message, and the message accounting that will newly receive again also can time-consuming problem in the file.
For realizing above-mentioned purpose, the present invention provides following technical scheme:
The method that a kind of message fragment is preserved comprises:
Receive the message that transmits on the bus, and said message is stored in the internal memory;
Judge whether the message in the said internal memory satisfies the segmentation record condition, said segmentation record condition is that the message in the said internal memory reaches preset quantity or memory consumption and reaches preset numerical value;
When not satisfying said segmentation record condition, continue to receive the message that transmits on the bus, and said message is stored in the internal memory;
When satisfying said segmentation record condition; Write down the segment information of said message; Generate the segmentation log file that is used to preserve said message in advance; And the said message in the internal memory is saved in the said segmentation log file, said segment information comprises file path, filename, file size and the message amount of the segmentation log file of automatic generation.
Preferably, this method also comprises:
Judge whether to satisfy the monitoring condition that stops, the said monitoring condition that stops is that the user initiatively stops or said system occurs unusual;
Said when stopping to monitor condition when not satisfying, then continue to receive the message that transmits on the bus, and said message is stored in the internal memory;
Said when stopping to monitor condition when satisfying, then all messages in the said internal memory are carried out file and preserve.
Preferably, this method also comprises:
After the message in the said internal memory carries out file preservation completion, the message of having preserved in the said internal memory is removed.
Preferably, this method also comprises:
When receiving the user when preserving the instruction of said segmentation log file, said segmentation log file packing is generated a compressed file, be kept under the file path of user's appointment.
Preferably, said with also comprising before compressed file step of said segmentation log file packing generation:
Judge whether there is the message of not preserving in the said internal memory,, then the said message of not preserving is carried out file and preserve if also have the message of not preserving in the internal memory;
If message of not preserving or said file fragmentation are preserved and be finished, then obtain the segmentation log file information of all preservations.
The present invention also discloses the system that a kind of message fragment is preserved on the basis of above-mentioned disclosed method, comprising:
Receiving element is used to receive the message that transmits on the bus, and said message is stored in the internal memory;
Judging unit is used for judging whether the message of said internal memory satisfies the segmentation record condition, and said segmentation record condition is that the message in the said internal memory reaches preset quantity or memory consumption and reaches preset numerical value;
The unit is preserved in segmentation, is used for when satisfying said segmentation record condition, writing down the segment information of said message, and generation in advance is used to preserve the segmentation log file of said message, and the said message in the internal memory is saved in the said segmentation log file.
Preferably, this system also comprises:
First judging unit is used to judge whether satisfy the monitoring condition that stops, and the said monitoring condition that stops is that the user initiatively stops or said system occurs unusual;
Memory cell is used for when satisfying saidly when stopping to monitor condition, then all messages in the said internal memory is carried out file and preserves.
Preferably, this system also comprises:
Remove the unit, be used for after the message of said internal memory carries out file preservation completion, the message of having preserved in the said internal memory being removed.
Preferably, this system also comprises:
The packing unit is used for, being kept under the file path of user's appointment compressed file of said segmentation log file packing generation when receiving the user when preserving the instruction of said segmentation log file.
Preferably, before the said packing unit, also comprise:
Second judging unit is used for judging whether said internal memory exists the message of not preserving, if also have the message of not preserving in the internal memory, then the said message of not preserving is carried out file and preserves;
Acquiring unit if the message or the preservation of said file fragmentation that are used for not preserving are finished, then obtains the segmentation log file information of all preservations.
Can know that via above-mentioned technical scheme compared with prior art, the invention discloses the method and system that a kind of message fragment is preserved, this method comprises: receive the message that transmits on the bus, and said message is stored in the internal memory; Judge whether the message in the said internal memory satisfies the segmentation record condition, said segmentation record condition is that the message in the said internal memory reaches preset quantity or memory consumption and reaches preset numerical value; When not satisfying said segmentation record condition, continue to receive the message that transmits on the bus, and said message is stored in the internal memory; When satisfying said segmentation record condition, write down the segment information of said message, generate the segmentation log file that is used to preserve said message in advance, and the said message in the internal memory is saved in the said segmentation log file.Through in the bus message testing process; According to the segmentation record condition message that receives is recorded as a plurality of files automatically; And when the user need preserve, a plurality of file packings are generated a compressed file, be kept under the path of user's appointment; Guaranteed that the message memory function takies that Installed System Memory is low, recording process is short and the user can free select File storing path, software performance and user experience are greatly improved.
In addition, after the message in the internal memory is preserved completion, the message of having preserved in the internal memory is removed, releasing memory has further improved memory usage.
Description of drawings
In order to be illustrated more clearly in the embodiment of the invention or technical scheme of the prior art; To do to introduce simply to the accompanying drawing of required use in embodiment or the description of the Prior Art below; Obviously, the accompanying drawing in describing below only is embodiments of the invention, for those of ordinary skills; Under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to the accompanying drawing that provides.
Fig. 1 is the method flow diagram that the disclosed a kind of message fragment of the embodiment of the invention is preserved;
Fig. 2 is the method flow diagram that the disclosed another kind of message fragment of the embodiment of the invention is preserved;
Fig. 3 is the system configuration sketch map that the disclosed a kind of message fragment of the embodiment of the invention is preserved;
Fig. 4 is the system configuration sketch map that the disclosed another kind of message fragment of the embodiment of the invention is preserved.
Embodiment
To combine the accompanying drawing in the embodiment of the invention below, the technical scheme in the embodiment of the invention is carried out clear, intactly description, 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 are not making the every other embodiment that is obtained under the creative work prerequisite, all belong to the scope of the present invention's protection.
The invention discloses the method and system that a kind of message fragment is preserved, this method comprises: this method comprises: receive the message that transmits on the bus, and said message is stored in the internal memory; Judge whether the message in the said internal memory satisfies the segmentation record condition, said segmentation record condition is that the message in the said internal memory reaches preset quantity or memory consumption and reaches preset numerical value; When not satisfying said segmentation record condition, continue to receive the message that transmits on the bus, and said message is stored in the internal memory; When satisfying said segmentation record condition, write down the segment information of said message, generate the file that is used to preserve said message in advance, and the message fragment in the said internal memory is saved in the said file.The present invention has guaranteed that the message memory function takies that Installed System Memory is low, recording process is short and the user can free select File storing path, and software performance and user experience are greatly improved.
See also accompanying drawing 1, be the method flow diagram of the disclosed a kind of message fragment preservation of the embodiment of the invention.The embodiment of the invention discloses the method that a kind of message fragment is preserved, the method comprising the steps of as follows:
Step 101: receive the message that transmits on the bus, and said message is stored in the internal memory.
Step 102: judge whether the message in the said internal memory satisfies the segmentation record condition, when not satisfying said segmentation record condition, return step 101; When satisfying said segmentation record condition, get into step 103.
Said segmentation record condition is that the message in the said internal memory reaches preset quantity or memory consumption and reaches preset numerical value.
Step 103: write down the segment information of said message, generate the segmentation log file that is used to preserve said message in advance, and the said message in the internal memory is saved in the said segmentation log file.
Said segment information comprises file path, filename, file size and the message amount of the segmentation log file of automatic generation.
Through in the bus message testing process; According to the segmentation record condition message that receives is recorded as a plurality of files automatically; And when the user need preserve, a plurality of file packings are generated a compressed file, be kept under the path of user's appointment; Guaranteed that the message memory function takies that Installed System Memory is low, recording process is short and the user can free select File storing path, software performance and user experience are greatly improved.
On the basis of the disclosed embodiment of the invention described above, the embodiment of the invention discloses the method that a kind of message fragment is preserved, see also accompanying drawing 2, be the method flow diagram of the disclosed another kind of message fragment preservation of the embodiment of the invention.The method comprising the steps of as follows:
Step 201: receive the message that transmits on the bus, and said message is stored in the internal memory.
Step 202: judge whether the message in the said internal memory satisfies the segmentation record condition, when not satisfying said segmentation record condition, return step 201; When satisfying said segmentation record condition, get into step 203.
Said segmentation record condition is that the message in the said internal memory reaches preset quantity or memory consumption and reaches preset numerical value.
Step 203: write down the segment information of said message, generate the segmentation log file that is used to preserve said message in advance, and the said message in the internal memory is saved in the said segmentation log file.
Said segment information comprises file path, filename, file size and the message amount of the segmentation log file of automatic generation.
Step 204: judge whether to satisfy the monitoring condition that stops, said when stopping to monitor condition when not satisfying, then return step 201; Said when stopping to monitor condition when satisfying, then get into step 205.
The said monitoring condition that stops is that the user initiatively stops or said system occurs unusual.
Step 205: all messages in the said internal memory are carried out file preserve, after the message in the said internal memory carries out file preservation completion, the message of having preserved in the said internal memory is removed.
Step 206:, judge whether there is the message of not preserving in the said internal memory, if then get into step 207, if not, directly get into step 208 when receiving the user when preserving the instruction of said segmentation log file.
Step 207: the said message of not preserving is carried out file preserve, after said message is preserved completion, get into step 208.
Step 208: the segmentation log file information of obtaining all preservations.
Step 209: said segmentation log file packing is generated a compressed file, be kept under the file path of user's appointment.
In sum; The invention discloses the method that a kind of message fragment is preserved; Through in the bus message testing process; According to the segmentation record condition message that receives is recorded as a plurality of files automatically, has guaranteed that the message memory function takies that Installed System Memory is low, recording process is short and the user can free select File storing path, software performance and user experience are greatly improved.When the user need preserve the message that receives, can file that preserve message packed to compress generates a file, is kept under the file path of user's appointment.In addition, after the message in the internal memory is preserved completion, the message of having preserved in the internal memory is removed, releasing memory has further improved memory usage.
Describe method in detail among the disclosed embodiment of the invention described above, can adopt the system of various ways to realize, therefore the invention also discloses a kind of system, provide concrete embodiment below and be elaborated for method of the present invention.
See also accompanying drawing 3, be the system configuration sketch map of the disclosed a kind of message fragment preservation of the embodiment of the invention.The embodiment of the invention discloses the system that a kind of message fragment is preserved, this system specifically comprises: receiving element 301 is used to receive the message that transmits on the bus, and said message is stored in the internal memory; Judging unit 302 is used for judging whether the message of said internal memory satisfies the segmentation record condition, and said segmentation record condition is that the message in the said internal memory reaches preset quantity or memory consumption and reaches preset numerical value; Unit 303 is preserved in segmentation, is used for when satisfying said segmentation record condition, writing down the segment information of said message, and generation in advance is used to preserve the segmentation log file of said message, and the said message in the internal memory is saved in the said segmentation log file.
In the bus message observation process; Software will generate a plurality of files automatically with the message that receives according to preset condition and preserve; When the user need preserve the message file, said message file packing is compressed into a file, be kept under the file path of user's appointment; Guaranteed that the message memory function takies that Installed System Memory is low, recording process is short and the user can free select File storing path, software performance and user experience are greatly improved.
Further, on the basis of the foregoing description, the embodiment of the invention also discloses the system that another kind of message fragment is preserved, see also accompanying drawing 4, be the system configuration sketch map of the disclosed another kind of message fragment preservation of the embodiment of the invention.This system specifically also comprises: first judging unit 401, be used to judge whether satisfy the monitoring condition that stops, and the said monitoring condition that stops is that the user initiatively stops or said system occurs unusual; Memory cell 402 is used for when satisfying saidly when stopping to monitor condition, then all messages in the said internal memory is carried out file and preserves; Remove unit 403, be used for after the message of said internal memory carries out file preservation completion, the message of having preserved in the said internal memory being removed; Second judging unit 404 is used for judging whether said internal memory exists the message of not preserving, if also have the message of not preserving in the internal memory, then the said message of not preserving is carried out file and preserves; Acquiring unit 405 if the message or the preservation of said file fragmentation that are used for not preserving are finished, then obtains the segmentation log file information of all preservations; Packing unit 406 is used for, being kept under the file path of user's appointment compressed file of said segmentation log file packing generation when receiving the user when preserving the instruction of said segmentation log file.
In sum: the invention discloses the method and system that a kind of message fragment is preserved, this method comprises: receive the message that transmits on the bus, and said message is stored in the internal memory; Judge whether the message in the said internal memory satisfies the segmentation record condition, said segmentation record condition is that the message in the said internal memory reaches preset quantity or memory consumption and reaches preset numerical value; When not satisfying said segmentation record condition, continue to receive the message that transmits on the bus, and said message is stored in the internal memory; When satisfying said segmentation record condition, write down the segment information of said message, generate the segmentation log file that is used to preserve said message in advance, and the said message in the internal memory is saved in the said segmentation log file.Through in the bus message testing process; According to the segmentation record condition message that receives is recorded as a plurality of files automatically; And when the user need preserve, a plurality of file packings are generated a compressed file, be kept under the path of user's appointment; Guaranteed that the message memory function takies that Installed System Memory is low, recording process is short and the user can free select File storing path, software performance and user experience are greatly improved.In addition, after the message in the internal memory is preserved completion, the message of having preserved in the internal memory is removed, releasing memory has further improved memory usage.
Each embodiment adopts the mode of going forward one by one to describe in this specification, and what each embodiment stressed all is and the difference of other embodiment that identical similar part is mutually referring to getting final product between each embodiment.For the disclosed system of embodiment, because it is corresponding with the embodiment disclosed method, so description is fairly simple, relevant part is partly explained referring to method and is got 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 will be conspicuous concerning those skilled in the art, and defined General Principle can realize under the situation that does not break away from the spirit or scope of the present invention in other embodiments among this paper.Therefore, the present invention will can not be restricted to these embodiment shown in this paper, but will meet and principle disclosed herein and features of novelty the wideest corresponding to scope.
Claims (10)
1. the method that message fragment is preserved is characterized in that, comprising:
Receive the message that transmits on the bus, and said message is stored in the internal memory;
Judge whether the message in the said internal memory satisfies the segmentation record condition, said segmentation record condition is that the message in the said internal memory reaches preset quantity or memory consumption and reaches preset numerical value;
When not satisfying said segmentation record condition, continue to receive the message that transmits on the bus, and said message is stored in the internal memory;
When satisfying said segmentation record condition; Write down the segment information of said message; Generate the segmentation log file that is used to preserve said message in advance; And the said message in the internal memory is saved in the said segmentation log file, said segment information comprises file path, filename, file size and the message amount of the segmentation log file of automatic generation.
2. method according to claim 1 is characterized in that, also comprises:
Judge whether to satisfy the monitoring condition that stops, the said monitoring condition that stops is that the user initiatively stops or said system occurs unusual;
Said when stopping to monitor condition when not satisfying, then continue to receive the message that transmits on the bus, and said message is stored in the internal memory;
Said when stopping to monitor condition when satisfying, then all messages in the said internal memory are carried out file and preserve.
3. method according to claim 1 is characterized in that, also comprises:
After the message in the said internal memory carries out file preservation completion, the message of having preserved in the said internal memory is removed.
4. method according to claim 3 is characterized in that, also comprises:
When receiving the user when preserving the instruction of said segmentation log file, said segmentation log file packing is generated a compressed file, be kept under the file path of user's appointment.
5. method according to claim 4 is characterized in that, and is said with also comprising before compressed file step of said segmentation log file packing generation:
Judge whether there is the message of not preserving in the said internal memory,, then the said message of not preserving is carried out file and preserve if also have the message of not preserving in the internal memory;
If message of not preserving or said file fragmentation are preserved and be finished, then obtain the segmentation log file information of all preservations.
6. the system that message fragment is preserved is characterized in that, comprising:
Receiving element is used to receive the message that transmits on the bus, and said message is stored in the internal memory;
Judging unit is used for judging whether the message of said internal memory satisfies the segmentation record condition, and said segmentation record condition is that the message in the said internal memory reaches preset quantity or memory consumption and reaches preset numerical value;
The unit is preserved in segmentation, is used for when satisfying said segmentation record condition, writing down the segment information of said message, and generation in advance is used to preserve the segmentation log file of said message, and the said message in the internal memory is saved in the said segmentation log file.
7. system according to claim 6 is characterized in that, also comprises:
First judging unit is used to judge whether satisfy the monitoring condition that stops, and the said monitoring condition that stops is that the user initiatively stops or said system occurs unusual;
Memory cell is used for when satisfying saidly when stopping to monitor condition, then all messages in the said internal memory is carried out file and preserves.
8. system according to claim 6 is characterized in that, also comprises:
Remove the unit, be used for after the message of said internal memory carries out file preservation completion, the message of having preserved in the said internal memory being removed.
9. system according to claim 8 is characterized in that, also comprises:
The packing unit is used for, being kept under the file path of user's appointment compressed file of said segmentation log file packing generation when receiving the user when preserving the instruction of said segmentation log file.
10. system according to claim 9 is characterized in that, before the said packing unit, also comprises:
Second judging unit is used for judging whether said internal memory exists the message of not preserving, if also have the message of not preserving in the internal memory, then the said message of not preserving is carried out file and preserves;
Acquiring unit if the message or the preservation of said file fragmentation that are used for not preserving are finished, then obtains the segmentation log file information of all preservations.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2012102723025A CN102769546A (en) | 2012-08-01 | 2012-08-01 | Method and system for message segmentation storage |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2012102723025A CN102769546A (en) | 2012-08-01 | 2012-08-01 | Method and system for message segmentation storage |
Publications (1)
Publication Number | Publication Date |
---|---|
CN102769546A true CN102769546A (en) | 2012-11-07 |
Family
ID=47096804
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2012102723025A Pending CN102769546A (en) | 2012-08-01 | 2012-08-01 | Method and system for message segmentation storage |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102769546A (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101072124A (en) * | 2007-06-22 | 2007-11-14 | 中兴通讯股份有限公司 | Log obtaining method |
CN101742263A (en) * | 2009-12-08 | 2010-06-16 | 北京互信互通信息技术股份有限公司 | Method for storing surveillance video data |
-
2012
- 2012-08-01 CN CN2012102723025A patent/CN102769546A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101072124A (en) * | 2007-06-22 | 2007-11-14 | 中兴通讯股份有限公司 | Log obtaining method |
CN101742263A (en) * | 2009-12-08 | 2010-06-16 | 北京互信互通信息技术股份有限公司 | Method for storing surveillance video data |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103023693B (en) | A kind of user behaviors log data management system and method | |
CN105335277A (en) | Fault information processing method and device as well as terminal | |
CN105049290B (en) | Page access monitoring method and device | |
CN107589916A (en) | A kind of entangling based on correcting and eleting codes deletes the creation method and relevant apparatus in pond | |
CN104503840A (en) | Method and device for optimizing terminal resources | |
CN103268183A (en) | Processing method and device for information report | |
CN104216740A (en) | Application software management method and device and terminal | |
CN108132868A (en) | A kind of data monitoring method, device, computing device and storage medium | |
CN105207832A (en) | Server stress testing method and device | |
CN106549807A (en) | A kind of classification report method of daily record and system | |
CN110493302A (en) | A kind of document transmission method, equipment and computer readable storage medium | |
CN107562494A (en) | A kind of method for updating memory SPD firmware | |
CN110147203A (en) | A kind of file management method, device, electronic equipment and storage medium | |
CN101827120A (en) | Cluster storage method and system | |
CN108255659A (en) | A kind of application program capacity monitoring method and its system | |
CN105068760B (en) | Date storage method, data storage device and storage device | |
CN105868121B (en) | A kind of information processing method and electronic equipment | |
CN104965862A (en) | Main memory database cluster synchronization method and main memory database host | |
CN104536926A (en) | Control method and device of serial devices | |
CN106708445A (en) | Link selection method and device | |
CN102231684B (en) | Interface board state detection method, multi-core central processing unit, interface board and router | |
CN104601489A (en) | Log block transmitting method and apparatus | |
CN103457996A (en) | Method and system for storing internal data of protocol conformance testing system | |
KR20180024360A (en) | Method and system for management of collecting bulk data using data agent container | |
CN102769546A (en) | Method and system for message segmentation storage |
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: 20121107 |