CN107643942A - The storage method and device of a kind of status information - Google Patents

The storage method and device of a kind of status information Download PDF

Info

Publication number
CN107643942A
CN107643942A CN201610586057.3A CN201610586057A CN107643942A CN 107643942 A CN107643942 A CN 107643942A CN 201610586057 A CN201610586057 A CN 201610586057A CN 107643942 A CN107643942 A CN 107643942A
Authority
CN
China
Prior art keywords
status information
information
read
shared drive
currently
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201610586057.3A
Other languages
Chinese (zh)
Other versions
CN107643942B (en
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.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology 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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201610586057.3A priority Critical patent/CN107643942B/en
Publication of CN107643942A publication Critical patent/CN107643942A/en
Application granted granted Critical
Publication of CN107643942B publication Critical patent/CN107643942B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Computer And Data Communications (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a kind of storage method of status information and device, method includes:The business process establishment currently run writes into journey for the status information of shared drive, and the shared drive is created by the business process of first operation;Judge currently to read process with the presence or absence of status information;When judging to be not present, creation state information reads process;Journey is write into by the status information status information that the business process that this currently runs generates is written in the shared drive;The status information that process or establishment are read by the status information currently existed reads process read status information from the shared drive, and stores into default memory space.Any business process can be read process with creation state information using the embodiment of the present invention, avoid missing status information, ensure the full storage of status information.

Description

The storage method and device of a kind of status information
Technical field
The present invention relates to Computer Science and Technology field, the storage method and device of more particularly to a kind of status information.
Background technology
In business process running, it usually needs by business state information storage into default memory space.
Current storage method is:The status information created by business process writes into journey by caused state in running Information is written in shared drive, then the status information created by operating system reads process, and reading state is believed from shared drive Breath, is stored into default memory space.
In the prior art, when an operating system starts, required status information is read when can create business process operation simultaneously Process, and status information reading process is arranged to a finger daemon.So, when business process is run, the conduct is run The status information of finger daemon reads process, realizes and stores status information into default memory space.
However, in the prior art, it is possible that mistake, may result in conduct when operating system is safeguarded or script is changed The status information of finger daemon reads process can not be by normal operation, when status information reading process of the off-duty as finger daemon When, the reading and storage operation of status information can not be undoubtedly carried out, and then cause the loss of status information.
The content of the invention
The embodiment of the invention discloses a kind of storage method of status information and device, preferably to ensure status information Storage.Concrete scheme is as follows:
On the one hand, the embodiments of the invention provide a kind of storage method of status information, methods described to include:
The business process establishment currently run writes into journey for the status information of shared drive, and the shared drive is by first The business process of individual operation creates;
Judge currently to read process with the presence or absence of status information;
When judging to be not present, creation state information reads process;
By the status information write into journey the status information that the business process that currently runs generates is written to it is described In shared drive;
The status information reading process that process or establishment are read by the status information currently existed is read from the shared drive Status information is taken, and is stored into default memory space.
Optionally, before the business process of first operation creates shared drive, famous semaphore is further created;
It is described journey is write into by the status information to be written to the status information that the business process that currently runs generates In the shared drive, including:
Journey is write into after the famous semaphore is obtained by the status information, by what is generated in business process running Status information is written in the shared drive, and after the completion of write-in, discharges the famous semaphore;
The status information that process or establishment are read by the status information currently existed reads process from the shared drive Middle read status information, including:
The status information reading process that process or the establishment are read by the status information currently existed is described famous in acquisition After semaphore, the read status information from the shared drive, and after the completion of reading, discharge the famous semaphore.
Optionally, the business process currently run in the process of running, currently with the presence or absence of state believe by real-time judge Reading process is ceased, when judging to be not present, creation state information reads process.
Optionally, the shared drive includes status information buffer area and shared drive information storage area, the state Information cache area is used for buffer status information, and the shared drive information storage area is used to store the status information buffer area Space hold label information;
By the status information write into journey the status information that the business process that currently runs generates is written to it is described In shared drive, including:
By the status information write into journey the status information that the business process that currently runs generates is written to it is described Status information buffer area;
And change the space hold label information;
The status information that process or establishment are read by the status information currently existed reads process from the shared drive Middle read status information, including:
The status information that process or the establishment are read by the status information currently existed reads process, from the status information Buffer area reads cached status information;
And change the space hold label information.
Optionally, the shared drive information storage area is also stored with the identification information that process is read on status information;
The judgement currently reads process with the presence or absence of status information, including:
Judge whether the identification information is predetermined value;
When the identification information is predetermined value, then judge that existence information reads process;When the identification information not For predetermined value when, then judge be not present status information read process.
Optionally, after the creation state information reading process, methods described also includes:The identification information is changed For the predetermined value;
Methods described also includes:
The status information of the establishment reads process before being exited with the business process currently run, and the mark is believed Breath is revised as the non-predetermined value.
Optionally, the default memory space includes predetermined quantity storage subspace;
The status information that process or establishment are read by the status information currently existed reads process from the shared drive Middle read status information, and be stored in default memory space, including:
The status information reading process that process or establishment are read by the status information currently existed is read from the shared drive Take status information;
According to storage order corresponding to the storage subspace, the status information read is stored to corresponding storage Space.
On the other hand, the embodiments of the invention provide a kind of storage device of status information, described device to include:First wound Model block, judge module, the second creation module, writing module and read module;
First creation module, the status information for creating for shared drive write into journey, the shared drive by The business process of first operation creates;
The judge module, for judging that currently whether there is status information reads process;
Second creation module, for when judging to there is currently no status information and reading process, creation state information Reading process;
Said write module, for writing into journey by the shape of the business process generation currently run by the status information State information is written in the shared drive;
The read module, the status information for reading process or establishment by the status information that currently exists read process from Read status information in the shared drive, and be stored in default memory space.
Optionally, before the business process of first operation creates shared drive, famous semaphore is further created;
Said write module, specifically for writing into journey after the famous semaphore is obtained by the status information, by industry The status information generated in business process running is written in the shared drive, and after the completion of write-in, is had described in release Name semaphore;
The read module, process or the status information of the establishment are read specifically for the status information by currently existing Reading process is after the famous semaphore is obtained, the read status information from the shared drive, and after the completion of reading, release The famous semaphore.
Optionally, the judge module, it is additionally operable in the business process running currently run, real-time judge Currently process is read with the presence or absence of status information;
Second creation module, it is additionally operable to when judging that there is currently no status information reads process, creation state letter Cease reading process.
Optionally, the shared drive includes status information buffer area and shared drive information storage area, the state Information cache area is used for buffer status information, and the shared drive information storage area is used to store the status information buffer area Space hold label information;
Said write module includes writing unit and modification unit;
Said write unit, for writing into journey by the shape of the business process generation currently run by the status information State information is written to the status information buffer area;
The modification unit, for changing the space hold label information;
The read module includes reading unit;
The reading unit, the status information for reading process or the establishment by the status information that currently exists read into Journey, cached status information is read from the status information buffer area, and trigger the first modification unit.
Optionally, the shared drive information storage area is also stored with the identification information that process is read on status information;
The judge module, specifically for judging whether the identification information is predetermined value;
When the identification information is predetermined value, then judge that existence information reads process;When the identification information not For predetermined value when, then judge be not present status information read process.
Optionally, described device also includes modified module;
The modified module, after the creation state information reading process, the identification information is revised as described Predetermined value;
The status information of the establishment reads process before being exited with the business process currently run, and the mark is believed Breath is revised as the non-predetermined value.
Optionally, the default memory space includes predetermined quantity storage subspace;
The read module, the status information specifically for reading process or establishment by the status information that currently exists read into Journey read status information from the shared drive;
According to storage order corresponding to the storage subspace, the status information read is stored to corresponding storage Space.
In this programme, the business process establishment currently run writes into journey for the status information of shared drive, and this is shared Internal memory is created by the business process of first operation;Judge currently to read process with the presence or absence of status information;Judging to be not present When, creation state information reads process;Journey is write into by the status information of the business process generation currently run by the status information It is written in the shared drive;The status information reading process that process or establishment are read by the status information currently existed is shared from this Read status information in internal memory, and store into default memory space.It can be seen that when multiple business process in operating system being present When needing to use same shared drive, it can be entered for the status information reading process of the shared drive by the business of any operation Journey creates, and without taking notice of the boot sequence of each business process, can guarantee that in operating system that a status information be present reads process And status information corresponding to each business process writes into journey, avoid missing status information, preferably to ensure the complete of status information Whole deposit is stored up.Certainly, any product or method for implementing the present invention must be not necessarily required to reach all the above advantage simultaneously.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are only this Some embodiments of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can be with Other accompanying drawings are obtained according to these accompanying drawings.
A kind of schematic flow sheet of the storage method for status information that Fig. 1 is provided by the embodiment of the present invention;
A kind of status information that Fig. 2 a are provided by the embodiment of the present invention writes into journey and status information reads the establishment of process The schematic diagram of journey;
Fig. 2 b a kind of write into journey and status information by what the embodiment of the present invention provided based on the status information that 2a is created The schematic diagram of reading process read-write state information;
A kind of structural representation of the storage device for status information that Fig. 3 is provided by the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.It is based on Embodiment in the present invention, those of ordinary skill in the art are obtained every other under the premise of creative work is not made Embodiment, belong to the scope of protection of the invention.
The embodiments of the invention provide a kind of storage method of status information and device, and any business process can be caused to exist During operation, process can be read with creation state information, avoid missing status information, preferably to ensure that the complete of status information is deposited Storage.
A kind of storage method of the status information provided first below the embodiment of the present invention is introduced.
Wherein, a kind of storage method for status information that the embodiment of the present invention is provided can be applied to multi-service process simultaneously In the case of operation, in the case of the operation of single business process can also be applied to.
As shown in figure 1, a kind of storage method for status information that the embodiment of the present invention is provided, can include following step Suddenly:
S101:The status information that the business process that currently runs creates for shared drive writes into journey, the shared drive by The business process of first operation creates;
It should be noted that the status information that business process of each operation can create for shared drive is write into Journey, to ensure in the status information write-in shared drive itself generated in the process of running.If the business process currently run For the business process of first operation of operating system, when the business process currently run is run, shared drive is also created.
If the business process currently run is not the business process of first operation in operating system, it is not required to create again Shared drive, a shared drive can be shared with the business process of first operation in operating system, will can run Status information generated in journey is write in the existing shared drive.
S102:Judge currently to read process with the presence or absence of status information;
It is understood that the business process currently run is not the business process of first operation in operating system, The business process currently run is being created after completion status information writes into journey, judge it is current with the presence or absence of status information read into Journey, it is to be understood that if existence information reads process, may indicate that in the presence of other business process being currently running, should Target service process can share a status information with the business process that the others are currently running and read process, completion status letter The reading of breath.Wherein, it is the status information reading process for the shared drive that the status information, which reads process,.
S103:When judging to be not present, creation state information reads process;
It is emphasized that when judging that there is currently no status information reads process, the business process currently run Meeting creation state information reads process, to ensure that the business process currently run writes the normal of the status information of the shared drive Read, further, ensure the reading of the status information of the business process for sharing the shared drive of follow-up operation.
In embodiments of the present invention, without one status information reading as finger daemon of operation in os starting Process, to complete the reading of the status information stored in shared drive, any business process may determine that currently whether deposit Read process in status information, and when judging that non-existence information reads process, can active creation state information read into Journey, you can with realize any business process can creation state information read process, and need not take notice of that the operation of business process is suitable Sequence, it is further ensured that the status information for being capable of existence anduniquess in the operating system when there is business process operation reads process, with energy Enough read the status information in the shared drive.
S104:Journey is write into by the status information status information that business process that this currently runs generates is written to this and be total to Enjoy in internal memory;
It should be noted that the business process of each operation creates a corresponding status information and writes into journey, will In the status information write-in shared drive that business process generates in the process of running.The status information of the establishment writes into journey by business The status information that process generates in the process of running is written in shared drive.Wherein, for the status information in shared drive For, typically first write and first read, read after rear write-in.
In a kind of specific implementation, a shared drive, and the plurality of industry are shared when multiple business process be present In the process of running, that is, the business process of the multiple operations write state information into shared drive be present in business process, share in Time correlation of the order of the status information of write-in only with status information write-in is stored, also, the reading of status information is also only With the time correlation of status information write-in.In addition, the label information of corresponding business process is all included in per bar state information, with Which business process derived from for distinguishing status information.
S105:The status information that process or establishment are read by the status information currently existed reads process from the shared drive Read status information, and store into default memory space.
It is understood that when there is currently status information reading process, the status information currently existed can be used Reading process, the read status information from shared drive, and the status information of the reading is stored in default memory space.When When there is currently no status information reading process, the status information that the business process currently run can be used to create reads process, from Read status information in shared drive, and the status information of reading is stored in default memory space.
Using the embodiment of the present invention, the business process establishment currently run writes into journey for the status information of shared drive, The shared drive is created by the business process of first operation;Judge currently to read process with the presence or absence of status information;Judging In the absence of when, creation state information read process;Journey is write into by the shape of the business process generation currently run by the status information State information is written in the shared drive;By the status information that currently exists read process or establishment status information read process from Read status information in the shared drive, and store into default memory space.
It can be seen that when multiple business process in operating system be present and need to use same shared drive, it is shared for this The status information of internal memory, which reads process, to be created by the business process of any operation, without taking notice of that the startup of each business process is suitable Sequence, it can guarantee that in operating system that status information corresponding to a status information reading process and each business process being present is write into Journey, avoid missing status information, preferably to ensure the full storage of status information.
In a kind of specific implementation, before the business process establishment shared drive of this first operation, further create Have a semaphore;
It is described journey write into by the status information status information that business process that this currently runs generates is written to this be total to Enjoy in internal memory, including:
Journey is write into after the famous semaphore is obtained by the status information, the state that will be generated in business process running Information is written in the shared drive, and after the completion of write-in, discharges the famous semaphore;
The status information that process or establishment are read by the status information currently existed reads process from the shared drive Read status information, including:
The status information that process or the establishment are read by the status information currently existed reads process in the acquisition famous signal After amount, the read status information from the shared drive, and after the completion of reading, discharge the famous semaphore.
It should be noted that first business process run in operating system, before shared drive is created, also needs to create Famous semaphore, it is to be understood that status information write into journey by status information write-in shared drive neutral condition information read into Journey read status information from shared drive, the famous semaphore is all relied on, creates famous semaphore, to ensure status information Write-in and reading.Create after completing shared drive, also need to carry out initialization process to shared drive, initialize the shared drive Can be status information write-in allocation space and obtain the relevant information of the shared drive, such as the initial address of the shared drive Deng as shown in Figure 2 a.Other, generally, created when being run except the business process of first operation in the operating system The business process for sharing the shared drive of successfully outer, follow-up operation can be created in the famous signal of establishment by having a semaphore During amount, the operating system can be informed in the business process shared drive by way of returning to famous semaphore and mistake being present Famous semaphore be present, the business process creates famous semaphore failure, and as shown in Figure 2 a, follow-up business process creates shared Internal memory can also fail.Wherein, as shown in Figure 2 b, business process when existence information needs to write shared drive, enter by business Status information corresponding to journey, which writes into journey, can directly obtain famous semaphore, and after famous semaphore success is obtained, be based on The famous semaphore writes the status information generated in the business process running in shared drive, is write in status information After the completion of, discharge famous semaphore.
As shown in Figure 2 b, when the business process of operation, stateful information needs to write in the shared drive in the process of running When, status information corresponding to the business process of the operation writes into journey and obtains famous semaphore, and will be certainly based on the famous semaphore In the status information write-in shared drive that body generates in the process of running, and after the completion of write-in, discharge the famous semaphore.When When needing to read the status information stored in the shared drive, the status information reads process and obtains the famous semaphore, when this After status information reading process obtains the successfully famous semaphore, based on the famous semaphore, reading state is believed from the shared drive Breath, and after the completion of reading, discharge the famous semaphore.
Wherein, the status information read process can the periodically read status information from the shared drive.
When multiple status informations be present and write into journey, only obtain famous semaphore status information write into journey can be to altogether Internal memory write state information is enjoyed, only after the famous semaphore is released, other status informations write into journey or status information is read Process can just get the famous semaphore.It is understood that by obtaining and discharging famous semaphore, each shape is realized Mutual exclusion between state information writing/reading process.I.e. when there is a status information to write into journey write state information into shared drive, Other status informations write into journey and status information reads the status information that process cannot write/read in the shared drive.Similarly, When status information reads process read status information from shared drive, each status information writes into journey all can not be to shared drive Middle write state information.
In a kind of specific implementation, in view of the situation of at least two business process while operation occurs, i.e., at least Two business process need into shared drive write state information, for example:Business process 1 and business process 2 be present, and The status information that there is currently is read process and created by business process 1.When business process 1 exits, the shape that is created by business process 1 State information, which reads process, can also exit, but now, business process 2 still in operation, i.e., still has the state letter of write-in shared drive Breath needs to read, if creation state information reads process not in time, Partial State Information just has the danger of loss.In order to avoid going out Present condition information lose situation, each business process currently run in the process of running, all can real-time judge it is current Process is read with the presence or absence of status information, when judging that there is currently no status information reads process, creation state information reads process. That is, the meeting real-time judge of business process 2 reads process with the presence or absence of status information, cause when business process 1 exits by business When the status information reading process that process 1 creates exits, business process 2 can interpolate that out that there is currently no status information reads process, Process is read so as to create a status information, to continue to complete the read operation of status information.
In a kind of specific implementation, the shared drive includes status information buffer area and shared drive information is deposited Storage area, the status information buffer area are used for storage state information, and the shared drive information storage area is used to store the status information The space hold label information of buffer area;
Journey is write into by the status information status information that the business process that currently runs generates is written to this and shared In internal memory, including:
Journey is write into by the status information status information that the business process that this currently runs generates is written to state letter Cease buffer area;
And change the space hold label information;
The status information that process or establishment are read by the status information currently existed reads process from the shared drive Read status information, including:
The status information that process or the establishment are read by the status information currently existed reads process, is cached from the status information Read cached status information in area;
And change the space hold label information.
It is emphasized that for the ease of the management of the shared drive, it is divided into buffer status information again in the shared drive Status information buffer area, and store the status information buffer area space hold label information shared drive information storage Area.Write-in and reading for status information are carried out in status information buffer area, in write-in with reading the same of the status information When, change the space hold label information of the status information buffer area in the shared drive information storage area.Such as, when state is believed The status information that caches is read completion in breath buffer area, and this is read space shared by the status information of completion then can be by Labeled as that can cover, i.e., the space can be used for the other status informations newly write of caching.When a certain spatial cache enters state Information, the space can then be marked as covering, i.e., the space cannot cache other status informations newly write again, Until after the status information that the space is cached is read, the space could be utilized again.Wherein, the status information buffer area Can be with " LOG BUFFER " represent that the shared drive information storage area can use " LOG INFO " expressions.
In a kind of specific implementation, the shared drive information storage area is also stored with reads process on status information Identification information;
The judgement currently reads process with the presence or absence of status information, including:
Judge whether the identification information is predetermined value;
When the identification information is predetermined value, then judge that existence information reads process;When the identification information is not pre- During definite value, then judge that status information, which is not present, reads process.
It is understood that the shared drive information storage area is also stored with the mark letter that process is read on status information Breath, the shared drive are that (including business process, status information write into journey and shape for the process that is directed in the operating system and thread State information reads process) visible, the business process of the operation, the identification information can be read in real time, according to the identification information It then may determine that and currently read process with the presence or absence of status information, wherein, when the identification information is predetermined value, then judge exist Status information reads process;When the identification information is not predetermined value, then judge that status information, which is not present, reads process.
In a kind of specific implementation, after the creation state information reading process, the embodiment of the present invention is provided The storage method of status information a kind of can also include:The identification information is revised as the predetermined value;
A kind of storage method for status information that the embodiment of the present invention is provided can also include:
The status information of the establishment reads process before the business process currently run with this exits, and the identification information is changed For the non-predetermined value.
It should be noted that when non-existence information reads process, what the shared drive information storage area was stored, close The identification information that process is read in status information is non-predetermined value, and when existence information reads process, the identification information is predetermined Value.It should be understood that after creation state information reading process, the business process currently run can be by the identification information from non- Predetermined value is revised as predetermined value.Similarly, the status information read process can before the business process currently run with this exits, The identification information is revised as the non-predetermined value.
In a kind of specific implementation, the default memory space includes predetermined quantity storage subspace;
The status information that process or establishment are read by the status information currently existed reads process from the shared drive Read status information, and be stored in default memory space, including:
The status information reading process that process or establishment are read by the status information currently existed is read from the shared drive Status information;
According to storage order corresponding to the storage subspace, the status information read is stored empty to corresponding storage Between.
It is understood that read process by status information after read status information, can read this from shared drive Status information be stored in default memory space, to realize monitoring to each business process running, and realize to Family is visible, and user can enter according to the status information (each business process) being stored in default memory space to each business Journey or operating system carry out Analysis on Fault Diagnosis.
Wherein, the default memory space includes predetermined quantity storage subspace, the predetermined quantity storage subspace Storage location sequencing be present, the status information read is first stored in storage location is forward to be come first and deposit Store up in subspace, after the forward storage subspace for coming first of storage location is filled with, be stored in next storage location Forward storage subspace, until after all storage subspaces are all taken, since first stores subspace, carry out Covering is deleted, and stores the status information newly read.Wherein, the memory capacity of the storage subspace can independently be set by user Put, can also be by equipment default setting.
In addition, in a kind of specific implementation, the storage subspace can be shown in the form of journal file, can be adopted It is named that (e.g., predetermined quantity 5, journal file are entitled to journal file with name plus the mode for counting index value:Daily record text Part 1, journal file 2, journal file 3, journal file 4 and journal file 5).When storing read status information, first store In journal file 1, after journal file 1 is filled with, it is stored in journal file 2, by that analogy, when journal file 5 is also filled with Afterwards, covering can be proceeded by from journal file 1 or is deleted, stores the status information newly read again.It is other, can be with Journal file 1 is directly deleted, then, journal file 2 journal file 1 is revised as respectively, journal file 3 is revised as to daily record text Part 2, journal file 4 are revised as journal file 3, journal file 5 is revised as journal file 4, finally, re-create journal file 5, The status information that can so ensure to be stored in the maximum file of index value is newest status information forever.
Corresponding to above method embodiment, the embodiments of the invention provide a kind of storage device of status information, such as Fig. 3 institutes Show, described device includes:First creation module 301, judge module 302, the second creation module 303, writing module 304 and reading Module 305;
First creation module 301, the status information for creating for shared drive write into journey, the shared drive Created by the business process of first operation;
The judge module 302, for judging that currently whether there is status information reads process;
Second creation module 303, for when judging that there is currently no status information reads process, creation state to be believed Cease reading process;
Said write module 304, the business process currently run is generated for writing into journey by the status information Status information be written in the shared drive;
The read module 305, the status information for reading process or establishment by the status information that currently exists read into Journey read status information from the shared drive, and be stored in default memory space.
Using the embodiment of the present invention, the business process establishment currently run writes into journey for the status information of shared drive, The shared drive is created by the business process of first operation;Judge currently to read process with the presence or absence of status information;Judging In the absence of when, creation state information read process;Journey is write into by the shape of the business process generation currently run by the status information State information is written in the shared drive;By the status information that currently exists read process or establishment status information read process from Read status information in the shared drive, and store into default memory space.It can be seen that when multiple industry in operating system being present , can be by any operation for the status information reading process of the shared drive when business process needs to use same shared drive Business process creates, and without taking notice of the boot sequence of each business process, can guarantee that a status information in operating system be present Status information corresponding to reading process and each business process writes into journey, avoids missing status information, preferably to ensure that state is believed The full storage of breath.
In a kind of specific implementation, before the business process establishment shared drive of first operation, further Create famous semaphore;
Said write module 304, will specifically for writing into journey after the famous semaphore is obtained by the status information The status information generated in business process running is written in the shared drive, and after the completion of write-in, described in release Famous semaphore;
The read module 305, process or the state of the establishment are read specifically for the status information by currently existing Information reads process after the famous semaphore is obtained, the read status information from the shared drive, and after the completion of reading, Discharge the famous semaphore.
In a kind of specific implementation, the judge module 302, it is additionally operable in the business process fortune currently run During row, real-time judge currently reads process with the presence or absence of status information;
Second creation module 303, it is additionally operable to when judging that there is currently no status information reads process, creation state Information reads process.
In a kind of specific implementation, the shared drive includes status information buffer area and shared drive information is deposited Storage area, the status information buffer area are used for buffer status information, and the shared drive information storage area is used to store the shape The space hold label information in state information cache area;
Said write module 304 includes writing unit and modification unit;
Said write unit, for writing into journey by the shape of the business process generation currently run by the status information State information is written to the status information buffer area;
The modification unit, for changing the space hold label information;
The read module 305 includes reading unit;
The reading unit, the status information for reading process or the establishment by the status information that currently exists read into Journey, cached status information is read from the status information buffer area, and trigger the first modification unit.
In a kind of specific implementation, the shared drive information storage area is also stored with reads process on status information Identification information;
The judge module 302, specifically for judging whether the identification information is predetermined value;
When the identification information is predetermined value, then judge that existence information reads process;When the identification information not For predetermined value when, then judge be not present status information read process.
In a kind of specific implementation, a kind of storage device for status information that the embodiment of the present invention is provided also includes Modified module;
The modified module, after the creation state information reading process, the identification information is revised as described Predetermined value;
The status information of the establishment reads process before being exited with the business process currently run, and the mark is believed Breath is revised as the non-predetermined value.
In a kind of specific implementation, the default memory space includes predetermined quantity storage subspace;
The read module 305, process or the status information of establishment are read specifically for the status information by currently existing Reading process read status information from the shared drive;
According to storage order corresponding to the storage subspace, the status information read is stored to corresponding storage Space.
For systems/devices embodiment, because it is substantially similar to embodiment of the method, so the comparison of description is simple Single, the relevent part can refer to the partial explaination of embodiments of method.
It should be noted that herein, such as first and second or the like relational terms are used merely to a reality Body or operation make a distinction with another entity or operation, and not necessarily require or imply and deposited between these entities or operation In any this actual relation or order.Moreover, term " comprising ", "comprising" or its any other variant are intended to Nonexcludability includes, so that process, method, article or equipment including a series of elements not only will including those Element, but also the other element including being not expressly set out, or it is this process, method, article or equipment also to include Intrinsic key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that Other identical element also be present in process, method, article or equipment including the key element.
Can one of ordinary skill in the art will appreciate that realizing that all or part of step in above method embodiment is To instruct the hardware of correlation to complete by program, described program can be stored in computer read/write memory medium, The storage medium designated herein obtained, such as:ROM/RAM, magnetic disc, CD etc..
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all Any modification, equivalent substitution and improvements made within the spirit and principles in the present invention etc., are all contained in protection scope of the present invention It is interior.

Claims (14)

1. a kind of storage method of status information, it is characterised in that methods described includes:
The business process establishment currently run writes into journey for the status information of shared drive, and the shared drive is by first fortune Capable business process creates;
Judge currently to read process with the presence or absence of status information;
When judging to be not present, creation state information reads process;
Journey is write into by the status information status information that the business process currently run generates is written to described share In internal memory;
The status information reading process that process or establishment are read by the status information currently existed reads shape from the shared drive State information, and store into default memory space.
2. storage method according to claim 1, it is characterised in that the business process of first operation creates shared Before internal memory, famous semaphore is further created;
It is described by the status information write into journey the status information that the business process that currently runs generates is written to it is described In shared drive, including:
Journey is write into after the famous semaphore is obtained by the status information, the state that will be generated in business process running Information is written in the shared drive, and after the completion of write-in, discharges the famous semaphore;
The status information reading process that process or establishment are read by the status information currently existed is read from the shared drive Status information is taken, including:
The status information that process or the establishment are read by the status information currently existed reads process in the acquisition famous signal After amount, the read status information from the shared drive, and after the completion of reading, discharge the famous semaphore.
3. storage method according to claim 1, it is characterised in that the business process currently run is in running In, real-time judge currently reads process with the presence or absence of status information, and when judging to be not present, creation state information reads process.
4. according to the method for claim 1, it is characterised in that the shared drive includes status information buffer area and is total to Memory information memory block is enjoyed, the status information buffer area is used for buffer status information, and the shared drive information storage area is used In the space hold label information for storing the status information buffer area;
Journey is write into by the status information status information that the business process currently run generates is written to described share In internal memory, including:
Journey is write into by the status information status information that the business process currently run generates is written to the state Information cache area;
And change the space hold label information;
The status information reading process that process or establishment are read by the status information currently existed is read from the shared drive Status information is taken, including:
The status information that process or the establishment are read by the status information currently existed reads process, is cached from the status information Read cached status information in area;
And change the space hold label information.
5. according to the method for claim 4, it is characterised in that the shared drive information storage area is also stored with shape State information reads the identification information of process;
The judgement currently reads process with the presence or absence of status information, including:
Judge whether the identification information is predetermined value;
When the identification information is predetermined value, then judge that existence information reads process;When the identification information is not pre- During definite value, then judge that status information, which is not present, reads process.
6. according to the method for claim 5, it is characterised in that
After the creation state information reading process, methods described also includes:The identification information is revised as described predetermined Value;
Methods described also includes:
The status information of the establishment reads process before being exited with the business process currently run, and the identification information is repaiied It is changed to the non-predetermined value.
7. according to the method described in claim any one of 1-6, it is characterised in that the default memory space includes predetermined number Amount storage subspace;
The status information reading process that process or establishment are read by the status information currently existed is read from the shared drive Status information is taken, and is stored in default memory space, including:
The status information reading process that process or establishment are read by the status information currently existed reads shape from the shared drive State information;
According to storage order corresponding to the storage subspace, the status information read is stored empty to corresponding storage Between.
8. a kind of storage device of status information, it is characterised in that described device includes:First creation module, judge module, Two creation modules, writing module and read module;
First creation module, the status information for creating for shared drive write into journey, and the shared drive is by first The business process of individual operation creates;
The judge module, for judging that currently whether there is status information reads process;
Second creation module, for when judging to there is currently no status information and reading process, creation state information read into Journey;
Said write module, the state that the business process currently run generates is believed for writing into journey by the status information Breath is written in the shared drive;
The read module, the status information for reading process or establishment by the status information that currently exists read process from described Read status information in shared drive, and be stored in default memory space.
9. device according to claim 8, it is characterised in that the business process of first operation creates shared drive Before, famous semaphore is further created;
Said write module, specifically for writing into journey after the famous semaphore is obtained by the status information, business is entered The status information generated in journey running is written in the shared drive, and after the completion of write-in, discharges the famous letter Number amount;
The read module, the status information specifically for reading process or the establishment by the status information that currently exists read into Journey is after the famous semaphore is obtained, the read status information from the shared drive, and after the completion of reading, described in release Famous semaphore.
10. device according to claim 8, it is characterised in that
The judge module, it is additionally operable in the business process running currently run, whether real-time judge currently deposits Process is read in status information;
Second creation module, it is additionally operable to when judging that there is currently no status information reads process, creation state information is read Process.
11. device according to claim 8, it is characterised in that the shared drive include status information buffer area and Shared drive information storage area, the status information buffer area are used for buffer status information, the shared drive information storage area For storing the space hold label information of the status information buffer area;
Said write module includes writing unit and modification unit;
Said write unit, the state that the business process currently run generates is believed for writing into journey by the status information Breath is written to the status information buffer area;
The modification unit, for changing the space hold label information;
The read module includes reading unit;
The reading unit, the status information that process or the establishment are read for the status information by currently existing read process, Cached status information is read from the status information buffer area, and triggers the first modification unit.
12. device according to claim 11, it is characterised in that the shared drive information storage area be also stored with Status information reads the identification information of process;
The judge module, specifically for judging whether the identification information is predetermined value;
When the identification information is predetermined value, then judge that existence information reads process;When the identification information is not pre- During definite value, then judge that status information, which is not present, reads process.
13. device according to claim 12, it is characterised in that described device also includes modified module;
The modified module, after the creation state information reading process, the identification information is revised as described predetermined Value;
The status information of the establishment reads process before being exited with the business process currently run, and the identification information is repaiied It is changed to the non-predetermined value.
14. according to the device described in claim any one of 8-13, it is characterised in that the default memory space includes predetermined Quantity stores subspace;
The read module, the status information specifically for reading process or establishment by the status information that currently exists read process from Read status information in the shared drive;
According to storage order corresponding to the storage subspace, the status information read is stored empty to corresponding storage Between.
CN201610586057.3A 2016-07-21 2016-07-21 State information storage method and device Active CN107643942B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610586057.3A CN107643942B (en) 2016-07-21 2016-07-21 State information storage method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610586057.3A CN107643942B (en) 2016-07-21 2016-07-21 State information storage method and device

Publications (2)

Publication Number Publication Date
CN107643942A true CN107643942A (en) 2018-01-30
CN107643942B CN107643942B (en) 2020-11-03

Family

ID=61109614

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610586057.3A Active CN107643942B (en) 2016-07-21 2016-07-21 State information storage method and device

Country Status (1)

Country Link
CN (1) CN107643942B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110399264A (en) * 2019-06-27 2019-11-01 苏州浪潮智能科技有限公司 A kind of FRU approaches to IM, device and equipment
CN113407414A (en) * 2021-06-24 2021-09-17 厦门科灿信息技术有限公司 Program operation monitoring method, device, terminal and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6161169A (en) * 1997-08-22 2000-12-12 Ncr Corporation Method and apparatus for asynchronously reading and writing data streams into a storage device using shared memory buffers and semaphores to synchronize interprocess communications
CN1740978A (en) * 2004-08-23 2006-03-01 华为技术有限公司 Method for realing sharing internal stored data base and internal stored data base system
CN101470632A (en) * 2007-12-24 2009-07-01 华为软件技术有限公司 Sharing internal memory management method and apparatus
CN102693162A (en) * 2011-12-29 2012-09-26 中国科学技术大学苏州研究院 Method for process communication among multiple virtual machines on multi-core platform based on shared memory and intercore interruption
CN103514053A (en) * 2013-09-22 2014-01-15 中国科学院信息工程研究所 Shared-memory-based method for conducting communication among multiple processes
CN104252405A (en) * 2013-06-26 2014-12-31 腾讯科技(深圳)有限公司 Log information output method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6161169A (en) * 1997-08-22 2000-12-12 Ncr Corporation Method and apparatus for asynchronously reading and writing data streams into a storage device using shared memory buffers and semaphores to synchronize interprocess communications
CN1740978A (en) * 2004-08-23 2006-03-01 华为技术有限公司 Method for realing sharing internal stored data base and internal stored data base system
CN101470632A (en) * 2007-12-24 2009-07-01 华为软件技术有限公司 Sharing internal memory management method and apparatus
CN102693162A (en) * 2011-12-29 2012-09-26 中国科学技术大学苏州研究院 Method for process communication among multiple virtual machines on multi-core platform based on shared memory and intercore interruption
CN104252405A (en) * 2013-06-26 2014-12-31 腾讯科技(深圳)有限公司 Log information output method and device
CN103514053A (en) * 2013-09-22 2014-01-15 中国科学院信息工程研究所 Shared-memory-based method for conducting communication among multiple processes

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
董玉杰: "UNIX系统中多任务结构软件的设计与实现", 《计算机工程与应用》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110399264A (en) * 2019-06-27 2019-11-01 苏州浪潮智能科技有限公司 A kind of FRU approaches to IM, device and equipment
CN110399264B (en) * 2019-06-27 2022-06-07 苏州浪潮智能科技有限公司 FRU information management method, device and equipment
CN113407414A (en) * 2021-06-24 2021-09-17 厦门科灿信息技术有限公司 Program operation monitoring method, device, terminal and storage medium

Also Published As

Publication number Publication date
CN107643942B (en) 2020-11-03

Similar Documents

Publication Publication Date Title
US8762672B2 (en) Storage system and storage migration method
CN102150131B (en) Managing cache data and metadata
CN105843749B (en) A kind of NAND Flash fault-tolerance approach based on FPGA
CN103150125B (en) Method for prolonging service life of power-down protection date buffer memory and smart card
CN106708424A (en) Apparatus and method for performing selective underlying exposure mapping on user data
CN106227621B (en) The data back up method and system of logic-based volume management simplification volume
CN107357666A (en) A kind of multi-core parallel concurrent system processing method based on hardware protection
CN104021089B (en) Flash memory control chip, storage device and flash memory control method
CN101369245A (en) System and method for implementing a memory defect map
CN104216796B (en) A kind of data backup, restoration methods and electronic equipment
CN103514249A (en) Method and system for automatic data reduction and storage device
CN106126374B (en) Method for writing data, method for reading data and device
CN104424122B (en) A kind of electronic equipment and memory division methods
CN106682492B (en) A kind of management method and device of memory overwriting
CN108399050B (en) Data processing method and device
CN106959907A (en) A kind of cloud platform fragmentation data backup and reduction system
CN109522154A (en) Data reconstruction method and relevant device and system
CN102209957A (en) Storage system comprising raid group
CN1332320C (en) Method, system, and article of manufacture for reserving memory
CN107643942A (en) The storage method and device of a kind of status information
CN101295281A (en) Memory device and method for limiting access authority of the same
CN116719484A (en) Method, device, equipment and medium for processing write data of disk array
CN107533524A (en) Configuration for the Memory Controller of copy-on-write
CN107967118A (en) A kind of method and apparatus realized hard disc data high speed dump and checked
CN109215171A (en) A kind of storage method of cab signaling equipment data record

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant