CN107908470A - A kind of queried access method, apparatus and system based on CIM model - Google Patents

A kind of queried access method, apparatus and system based on CIM model Download PDF

Info

Publication number
CN107908470A
CN107908470A CN201710606760.0A CN201710606760A CN107908470A CN 107908470 A CN107908470 A CN 107908470A CN 201710606760 A CN201710606760 A CN 201710606760A CN 107908470 A CN107908470 A CN 107908470A
Authority
CN
China
Prior art keywords
cim
pond
objects
destination object
entry
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
CN201710606760.0A
Other languages
Chinese (zh)
Other versions
CN107908470B (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.)
Information Center of Guangdong Power Grid Co Ltd
Original Assignee
WEIHAI CIMSTECH CO Ltd
Information Center of Guangdong Power Grid 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 WEIHAI CIMSTECH CO Ltd, Information Center of Guangdong Power Grid Co Ltd filed Critical WEIHAI CIMSTECH CO Ltd
Priority to CN201710606760.0A priority Critical patent/CN107908470B/en
Publication of CN107908470A publication Critical patent/CN107908470A/en
Application granted granted Critical
Publication of CN107908470B publication Critical patent/CN107908470B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The present invention discloses a kind of queried access method, apparatus and system based on CIM model, belongs to technical field of data transmission.Its method includes:CIM object class is generated based on CIM model, the wherein CIM object class includes the ID and the markers of record CIM object current accessed times of unique mark CIM objects;Using the ID of the CIM objects as the refined value for quoting pond entry, the two-staged step CIM target caches pond formed by soft reference pond and weak reference pond is established;The queried access request of destination object is received, obtains destination object ID;Whether inquiry destination object ID matches with the ID of the CIM objects cited in CIM target caches pond;If above-mentioned successful inquiring, inquired CIM objects are accessed;If above-mentioned inquiry failure, turns to server and carries out queried access.The present invention solves the problems, such as that the short-term CIM objects that frequently access cause to interact and collecting garbage cannot discharge the CIM objects being cited with the excessive of server.

Description

A kind of queried access method, apparatus and system based on CIM model
Technical field
The present invention relates to technical field of data transmission, more particularly to a kind of queried access method, apparatus based on CIM model And system.
Background technology
The common information model (CIM) that 61970 series standards of IEC propose is widely used in electric system.Adopt The topological analysis of fairly large electric network model is developed with Java, the quality of data is integrally checked when client application, it is necessary to be based on Incidence relation between the level inclusion relation and object of object carries out the traversal processing of more rounds, that is, needs for object point Netted, tree-shaped relation (each object forms the node one by one in data structure) between class set and object, as needed Complete the analysis of breadth-first or depth-first.In the analysis process, can be visited repeatedly in specific stage, some object datas Ask, when handling afterwards other object, these objects will not may be accessed the long period.Requirements for access is with analysis Stress to change and therewith change.
Accessed to complete above-mentioned CIM object datas, existing technical solution mainly there are two kinds, and one kind is that client needs every time When accessing CIM object datas, do not cached in itself from server lookup, client by interface directly.Another kind is client End to needing data to be used to establish complete or collected works, that is, caches whole power grid CIM objects, and establish the reference between object every time.The A kind of scheme interacts frequently with server, causes a large amount of net interactions, on the one hand aggravates server burden, on the other hand right Image data obtains less efficient;Second scheme causes almost all object to be all based on pair due to the network relation of CIM objects As " (StrongReference, when the reference of object is held, collecting garbage cannot discharge pair being cited for strongly reference As) " association, the collecting garbage of Java Virtual Machine can not discharge the object that part is of little use, it is therefore desirable to very big interior of configuration Resource is deposited, otherwise easily triggers low memory (OutOfMemory) abnormal.
The content of the invention
The main object of the present invention is to propose a kind of queried access method based on CIM model, it is intended to is substituted with soft quote Strongly reference relation between CIM objects, is formed the CIM target caches pond of two-staged step by soft reference pond and weak reference pond, solved It is short-term when frequently accessing CIM objects with server is excessive interacts and collecting garbage cannot discharge the CIM objects being cited Problem.
To achieve the above object, the queried access method of the destination object proposed by the present invention based on CIM model, including such as Lower step:
S10 is based on CIM model generation CIM object class, the wherein ID of the CIM object class including unique mark CIM objects and Record the markers of CIM object current accessed times;
S20 establishes soft reference pond and weak reference pond respectively using the ID of the CIM objects as the refined value for quoting pond entry, by Soft reference pond and weak reference pond sequentially form the CIM target caches pond of two-staged step;
S30 receives the queried access request of destination object, obtains destination object ID;
Whether S40 inquiries destination object ID matches with the ID of the CIM objects cited in CIM target caches pond;It is if above-mentioned Successful inquiring, then access inquired CIM objects;
If the above-mentioned inquiry failures of S50, turn to server and carry out queried access.
Preferably, the step of S40 includes:
Whether S401 inquiry destination objects ID matches with the soft entry for quoting pond, if matching, inquires about soft reference pond Entry success, access this it is soft quote pond entry cited in CIM objects, and the CIM objects markers record current accessed Time, if above-mentioned inquiry fails, turn to the entry in inquiry weak reference pond;
If S402 inquires about destination object ID and the entries match success in weak reference pond, the entry in the mobile weak reference pond is drawn CIM objects to soft reference pond, and delete with the ID of the CIM objects refined value weak reference pond entry, obtain this CIM pairs The ID of elephant, the refined entry in soft reference pond for being worth the CIM objects and increase, accesses the refined CIM objects being worth cited in entry of institute, and this The time of the markers record current accessed of CIM objects.
Preferably, the step of S50 includes:
Fail if S501 destination objects ID is inquired about in CIM target caches pond, turn to server and perform inquiry, if passing through target Object ID creates the CIM objects with identical ID with destination object in server lookup success, and ID using the CIM objects is draws With the refined value of pond entry, soft reference pond is stored in, accesses inquired CIM objects, and the current visit of markers record of the CIM objects The time asked;
If S502 is failed by destination object ID in server lookup, the queried access request failure of destination object is returned.
Preferably, described the step of accessing inquired CIM objects, includes:
S601 judges whether inquired CIM objects match with destination object;
If S602 matches, access inquired CIM objects, and the markers record current accessed of the CIM objects when Between;
If S603 is not matched that, the queried access request failure of destination object is returned.
The present invention also proposes a kind of queried access device based on CIM model, including:
Generation module, for generating CIM object class based on CIM model, the wherein CIM object class includes unique mark CIM The ID and the markers of record CIM object current accessed times of object;
Module is established, for using the ID of the CIM objects as the refined value for quoting pond entry, establishing soft reference pond and weak respectively Pond is quoted, the CIM target caches pond of two-staged step is sequentially formed by soft reference pond and weak reference pond;
Acquisition module, the queried access for receiving destination object are asked, and obtain destination object ID;
Cache pool enquiry module, for inquire about destination object ID whether with the CIM objects cited in CIM target caches pond ID matches;If above-mentioned successful inquiring, inquired CIM objects, and the markers record current accessed of the CIM objects are accessed Time;
Server lookup module, if failing for above-mentioned inquiry, turns to server and carries out queried access.
Preferably, the cache pool enquiry module includes:
Soft reference pond query unit, for the entry using the soft reference pond of destination object ID inquiries, if destination object ID is looked into The ID of matched CIM objects is ask, then inquires about the entry success in soft reference pond, the soft entry for quoting pond is accessed and is drawn CIM objects, and the time of the markers record current accessed of the CIM objects, if above-mentioned inquiry fails, turn to inquiry weak reference The entry in pond;
Weak reference pond query unit, for succeeding according to the entry in destination object ID inquiry weak references pond, it is weak to move this The CIM objects cited in the entry in pond are quoted to soft reference pond, and delete with the ID of the CIM objects refined value weak reference pond Entry, obtains the ID of the CIM objects, the refined soft reference for being worth the CIM objects, forms and quote the soft reference pond of pond entry addition, access It is refined value entry in CIM objects, and the CIM objects markers record current accessed time.
Preferably, the server lookup module includes:
Successful inquiring unit, fails if being inquired about for destination object ID in CIM target caches pond, turns to server execution and looks into Ask, if successful in server lookup by destination object ID, the CIM objects of establishment and destination object with identical ID, with the CIM The ID of object is the refined value for quoting pond entry, is stored in soft reference pond, accesses inquired CIM objects, and the CIM objects when The time of mark record current accessed;
Inquiry failure unit, if for failing by destination object ID in server lookup, returns to the inquiry of destination object Access request fails.
Preferably, access logging modle is further included, the access logging modle includes:
Whether judging unit, the CIM object inquired for judgement match with destination object;
Recording unit is accessed, if for matching, accesses inquired CIM objects, and the markers record of the CIM objects The time of current accessed;
Failure unit is accessed, if for not matching that, returns to the queried access request failure of destination object.
The present invention also proposes a kind of queried access system based on CIM model, including server, further includes base described above In the queried access device of the destination object of CIM model, looking into for the destination object based on CIM model described above is used for realization Ask access method.
The technical program discloses a kind of destination object queried access method, apparatus based on CIM model and system and one Kind CIM electric network model object datas go the multi-level buffer method, apparatus and system of strongly reference, and above two method is combined, and is solved A kind of CIM objects of having determined go the problem of dynamic buffering data transfer and processing of strongly reference, the technical program and prior art phase Than beneficial effects of the present invention are embodied in:
The present invention is used in the application software such as power grid CIM model data analysis, especially suitable for needing to carry out the vertical of model To the situation of the analysis of level traversal and horizontal power network topology traversal analysis.For large-scale power grid, because memory source is limited Or data volume is huge, usually whole electric network model can not all be put into memory, in this case, CIM objects of the invention Going the dynamic buffering processing method of strongly reference just has obvious advantage.The present invention is substituted in cache layer with soft reference between CIM objects Strongly reference relation, the CIM target caches pond of two-staged step is formed by soft reference pond and weak reference pond, is solved short-term frequent The problem of excessive interaction of server and collecting garbage cannot discharge the CIM objects being cited when accessing CIM objects.Main body Now:
1) access efficiency and memory usage are balanced.After memory dosage exceedes particular bound (70%), made according to memory Expiration period is set dynamically with rate, memory is effectively maintained to a rational level.Shorten when memory usage is high Expiration period, can rapidly vacate memory from CIM target caches, and empty weak reference buffer pool, and increase can as far as possible Use memory;And do not discharge cache object when memory usage is low, increase buffer data size, improve the hit rate of object retrieval, Reduce server lookup.
2) flexible adaptation is the memory amount of application configuration.If the memory amount of application is allocated to relative to being analyzed Grid model data, its capacity is enough, is just not required to discharge the soft data object for quoting management, need not also repeat to look into server Ask;If grid model data amount to be analyzed is big, memory can not be entirely enclosed in, then program still can normal operation, pass through two The rotation of a buffering area improves object data retrieving efficiency.
3) effectively prevent memory from overflowing.Using it is soft reference and weak reference mechanism, under extreme memory limited case, Will not memory overflow because soft reference and the resource held of weak reference can all be recycled by JVM garbage collectors.
4) using simple.The application end of target cache only needs to access object data on demand, it is not necessary to consider data how from Server loads, it is not required that actively goes to discharge.
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 attached drawing needed 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, without creative efforts, can be with Structure according to these attached drawings obtains other attached drawings.
Fig. 1 is a kind of method flow diagram of one embodiment of queried access method based on CIM model of the present invention;
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Embodiment
Below in conjunction with the attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is carried out clear, complete Site preparation describes, it is clear that described embodiment is only the part of the embodiment of the present invention, instead of all the embodiments.Base Embodiment in the present invention, those of ordinary skill in the art obtained without creative efforts it is all its His embodiment, belongs to the scope of protection of the invention.
If it is to be appreciated that related in the embodiment of the present invention directionality instruction (such as up, down, left, right, before and after ...), Then directionality instruction is only used for explaining that the relative position under a certain particular pose (as shown in drawings) between each component is closed System, motion conditions etc., if the particular pose changes, directionality instruction also correspondingly changes correspondingly.
If in addition, relating to the description of " first ", " second " etc. in the embodiment of the present invention, " first ", " second " etc. are somebody's turn to do Description be only used for description purpose, and it is not intended that instruction or implying its relative importance or implicit indicating indicated skill The quantity of art feature.Thus, " first " is defined, the feature of " second " can be expressed or implicitly includes at least one spy Sign.In addition, the technical solution between each embodiment can be combined with each other, but must be with those of ordinary skill in the art's energy Based on enough realizations, the knot of this technical solution is will be understood that when the combination appearance of technical solution is conflicting or can not realize Conjunction is not present, also not within the protection domain of application claims.
As shown in Figure 1, the present invention proposes a kind of queried access method based on CIM model, include the following steps:
S10 is based on CIM model generation CIM object class, the wherein ID of the CIM object class including unique mark CIM objects and Record the markers of CIM object current accessed times;
S20 establishes soft reference pond and weak reference pond respectively using the ID of the CIM objects as the refined value for quoting pond entry, by Soft reference pond and weak reference pond sequentially form the CIM target caches pond of two-staged step;
S30 receives the queried access request of destination object, obtains destination object ID;
Whether S40 inquiries destination object ID matches with the ID of the CIM objects cited in CIM target caches pond;It is if above-mentioned Successful inquiring, then access inquired CIM objects;
If the above-mentioned inquiry failures of S50, turn to server and carry out queried access.
In the present embodiment, the present invention proposes a kind of queried access method based on CIM model, and the S10, is based on The corresponding JAVA classes of CIM model generation CIM classes, these JAVA classes need directly or indirectly (passing through parent) be inherited from one it is specific Class, i.e. CIM objects (CIMObject), CIM objects include with properties:The unique identification of Id, CIM object, and Timestamp markers, for recording the CIM object current accessed times;The S20, destination object Access Management Access class build CIM pairs As cache pool, it is soft reference pond to build a main pond of quoting with HashMap, and an auxiliary pond of quoting is weak reference pond, by soft reference Pond and weak reference pond form a two-staged step CIM target caches pond, and the key of the entry in two reference ponds is CIMObject ID, it is soft that to quote the value of entry in pond be SoftReference<CIMObject>, the value of entry is in weak reference pond WeakReference<CIMObject>(that is, Data Entry is ID and SoftReference in weak reference pond<CIMObject> Data are to (pair);Data Entry is ID and WeakReference in weak reference pond<CIMObject>Data to);It is described S30, object accesses management class, based on the two-staged step CIM target caches pond formed by soft reference pond and weak reference pond, receives Queried access to destination object is asked, and destination object ID is obtained from received queried access request, this acquisition can To be that an ID being directly transmitted through coming is called or according to filter condition acquisition module from oneself caching acquisition etc. in upper strata Other modes find out the ID of an object, also imply the inquiry a batch, are transformed into by acquisition module for one The inquiry of an a object;The S40, using acquired destination object ID, is drawn with two-staged step CIM target caches pond The ID of CIM objects matches, i.e., the refined value with the soft entry for drawing pond and/or the key of the entry in weak reference pond matches, if Successful match, then obtain the soft reference of the corresponding CIM objects of the id, then with the get methods of soft reference, obtains " strong " of object Quote, obtain the success of CIM objects, then illustrate it is soft to quote this CIM object storage held good, in this CIM pairs of local IP access As;By taking destination object ID is the soft entry for quoting pond of inquiry of 5 object as an example,
Soft reference pond is such:
HashMap<id,SoftReference<CIMObject>>,
The entry of the inside is probably:
<2,SoftReference<CIMObject>obSta2>
<3,SoftReference<CIMObject>obVL0>
<5,SoftReference<CIMObject>obBay1>
<10,SoftReference<CIMObject>obBreaker1>
...
<15,SoftReference<CIMObject>obTransformerX>
Accessed with destination object ID for 5, the entry that key assignments is 5 (i d=5) is retrieved in HashMap, that is, carrying out ID is 5 object matching inquiry, if retrieving the soft reference for successfully, obtaining the object that id is 5, then with the get methods of soft reference, is obtained Take " strong " reference of object;The S50, if above-mentioned inquiry is not into illustrating that the destination object is not stored in the CIM target caches Pond, turns to server and carries out queried access.
The present invention proposes a kind of queried access method based on CIM model, first, CIM pairs is substituted with soft adduction relationship As strongly reference relation, solve due to the network relation of CIM objects, cause almost all object to be all based between object " strongly reference (StrongReference, when the reference of object is held, collecting garbage cannot discharge the object being cited) " closes Connection, the collecting garbage of Java Virtual Machine can not discharge the object that part is of little use, it is therefore desirable to the very big memory source of configuration, Otherwise the problem of easily triggering low memory (OutOfMemory) abnormal;Secondly, establish by soft reference pond (SoftReference, when object reference is held, if collecting garbage judges low memory, can discharge pair being cited As) and weak reference pond (WeakReference, as long as collecting garbage finds weak reference, you can discharge the object of its reference), shape Into two-staged step CIM objects cache pool, for application repeatedly access CIM objects provides quickly localization retrieve.
System in the technical program needs a large amount of CIM objects of Reusability to carry out power grid global analysis, calculate, system Originally need to be analyzed after repeatedly obtaining data from server, handled now by increasing two-staged step CIM target caches To reduce server interaction frequency, lifting object data access efficiency.The present invention is used in the application such as power grid CIM model data analysis In software, the situation of the analysis of longitudinal level traversal and horizontal power network topology traversal analysis especially suitable for needing to carry out model. For large-scale power grid, because memory source is limited or data volume is huge, usually whole electric network model can not all be put into Memory, in this case, CIM objects of the invention go the dynamic buffering processing method of strongly reference just to have obvious advantage.
Further, the step of S40 includes:
Whether S401 inquiry destination objects ID matches with the soft entry for quoting pond, if matching, inquires about soft reference pond Entry success, access this it is soft quote pond entry cited in CIM objects, and the CIM objects markers record current accessed Time, if above-mentioned inquiry fails, turn to the entry in inquiry weak reference pond;
If S402 inquires about destination object ID and the entries match success in weak reference pond, the entry in the mobile weak reference pond is drawn CIM objects to soft reference pond, and delete with the ID of the CIM objects refined value weak reference pond entry, obtain this CIM pairs The ID of elephant, the refined entry in soft reference pond for being worth the CIM objects and increase, accesses the refined CIM objects being worth cited in entry of institute, and this The time of the markers record current accessed of CIM objects.
In the present embodiment, the specific steps of the S40:The S401, first to be closed from the strongly reference between substitution CIM objects The soft reference pond of system starts a query at, netted in cache layer, the strongly reference before the soft soft reference for quoting pond solves between CIM objects Relation, if in soft reference pond successful inquiring, obtains a SoftReference<CIMObject>Value;If in soft reference Do not retrieved in pond with the matched entry of object ID to be visited, continue with object ID retrieval weak reference pond;The S402, if adopting With the entry success in destination object ID inquiry weak references pond, which is moved to soft reference pond from weak reference pond and (deletes weak draw With the id specified in pond ← → WeakReferenct<CIMObject>Entry, it is soft reference pond in increase an id ← → SoftReferenct<CIMObject>);If retrieved in weak reference pond it is unsuccessful, show it is soft reference and weak reference two-stage delay Then start step S50 without destination object in depositing, thus, the different caching levels for quoting intensity are formed, so as to Java Virtual Machine As needed by level recycling memory, reach dynamic control of data buffer memory, reduce the actual memory expense of larger electric network model So as to effectively avoid the effect that memory overflows, while reduce and server interactive quantity, lifting destination object search efficiency.
Further, the step of S50 includes:
S501;Fail if destination object ID is inquired about in CIM target caches pond, turn to server and perform inquiry, if passing through mesh Object ID is marked in server lookup success, establishment has the CIM objects of identical ID with destination object, refined with the ID of the CIM objects The soft reference entry of value CIM objects, soft reference pond quote the CIM objects, access the soft CIM objects quoted cited in pond, and should The time of the markers record current accessed of CIM objects;
If S502 is failed by destination object ID in server lookup, the queried access request failure of destination object is returned.
In the present embodiment, the specific steps of S50 of the present invention:The S501, object accesses management class are asked to clothes Business device inquiry destination object, if successful inquiring, creates CIMObject object instances, with object I D and SoftReference< CIMObject>Data are built to being stored in soft reference pond;The S502, if inquiry is unsuccessful, is deposited in explanation system without the object Return to NULL and give object requests program.
Further, described the step of accessing inquired CIM objects, includes:
S601 judges whether inquired CIM objects match with destination object;
If S602 matches, access inquired CIM objects, and the markers record current accessed of the CIM objects when Between;
If S603 is not matched that, the queried access request failure of destination object is returned.
In the present embodiment, present invention supplementary notes, by soft reference extracting object reference, (CIMObject entities draw With), if success (quoted the object instance held by soft and do not discharged by Java collecting garbages system), at this time target cache in Soft reference pond, returns to CIMObject entity references to visitor;Recorded in the time attribute of the CIMObject objects last Access time;If NULL is returned, then is shown less than object reference, the get methods of soft reference by the soft reference extraction of acquisition The object returns to null reference to visitor since Java collecting garbages have discharged;
The present invention also proposes a kind of queried access device based on CIM model, is somebody's turn to do looking into for the destination object based on CIM model Access mechanism is ask to realize the queried access method of the above-mentioned destination object based on CIM model, due to based on CIM model The queried access device of destination object employs whole technical solutions of above-mentioned all embodiments, therefore at least has above-mentioned implementation All beneficial effects caused by the technical solution of example, this is no longer going to repeat them.Wherein, based on the target pair of CIM model The queried access device of elephant, including:
Generation module 10, for generating CIM object class based on CIM model, the wherein CIM object class includes unique mark The ID and the markers of record CIM object current accessed times of CIM objects;
Establish module 20, for using the ID of the CIM objects as quote pond entry refined value, establish respectively it is soft reference pond and Weak reference pond, the CIM target caches pond of two-staged step is sequentially formed by soft reference pond and weak reference pond;
Acquisition module 30, the queried access for receiving destination object are asked, and obtain destination object ID;
Cache pool enquiry module 40, for inquire about destination object ID whether with CIM target caches pond cited in CIM objects ID match;If above-mentioned successful inquiring, inquired CIM objects, and the current visit of markers record of the CIM objects are accessed The time asked;
Server lookup module 50, if failing for above-mentioned inquiry, turns to server and carries out queried access.
Further, the cache pool enquiry module 40 includes:
Soft reference pond query unit 401, for the entry using the soft reference pond of destination object ID inquiries, if destination object ID The ID of matched CIM objects is inquired, then inquires about the entry success in soft reference pond, accesses the soft entry institute for quoting pond The CIM objects of reference, and the time of the markers record current accessed of the CIM objects, if above-mentioned inquiry fails, turn to and inquire about weak draw With the entry in pond;
Weak reference pond query unit 402, according to the entry success in destination object ID inquiries weak reference pond, mobile this weak draws With the CIM objects cited in the entry in pond to soft reference pond, and delete with the ID of the CIM objects refined value weak reference pond bar Mesh, obtains the ID of the CIM objects, the refined entry for being worth the soft reference pond that the CIM objects increase, access refined be worth in entry CIM objects, and the time of the markers record current accessed of the CIM objects.
Further, the server lookup module 50 includes:
Successful inquiring unit 501, fails if being inquired about for destination object ID in CIM target caches pond, turns to server and holds Row inquiry, if there is the CIM objects of identical ID with destination object in server lookup success, establishment by destination object ID, with The soft reference of the refined value CIM objects of ID of the CIM objects, forms and quotes the soft reference pond of pond entry deposit, access inquired CIM Object, and the time of the markers record current accessed of the CIM objects;
Inquiry failure unit 502, if for failing by destination object ID in server lookup, returns to looking into for destination object Ask access request failure.
Further, further include and access logging modle 60, the access logging modle 60 includes:
Whether judging unit 601, the CIM object inquired for judgement match with destination object;
Recording unit 602 is accessed, if for matching, accesses inquired CIM objects, and the markers of the CIM objects Record the time of current accessed;
Failure unit 603 is accessed, if for not matching that, returns to the queried access request failure of destination object.
The present invention also propose a kind of queried access system based on CIM model, including server, further include it is above-mentioned based on The queried access device of the destination object of CIM model, the inquiry for being used for realization the above-mentioned destination object based on CIM models are visited Ask method.
Server mentioned herein refers to that application software for XRF analysis obtains the source of CIM object datas.
System mentioned herein refers to that any server for being provided with this application software for XRF analysis and any terminal are formed A network system.
In a software process, each thread may serve to caching.Simply these threads be all belong to one into Journey, there is a common process address space.Main thread belongs to a process, this CIM with the expired inspection thread of CIM objects Object is expired to check that thread is the thread of opposite main thread lower priority, this process fetch CIM object datas do analysis should With this two-staged step CIM target caches pond is a cache hierarchy built in this application software for XRF analysis.
Another inventive concept of the technical program:The daemon thread of a lower priority is opened, is periodically analyzed The data in soft reference pond are arranged, with the first threshold of memory usage (program is with the ratio of memory and program free memory) Value, the critical value of soft reference cache region arrangement action is performed as daemon thread.
A kind of CIM electric network models object data goes the multi-level buffer method of strongly reference, and step is as follows:
(1) with soft reference and weak reference structure two-staged step cache pool storage CIM objects, soft reference pond is master cache, Weak reference caches supplemented by pond.
(2) the CIM objects taken out every time from CIM target caches, can all record the time that its last time is drawn.
(3) analysis software is periodically traveled through by the daemon thread of low priority and quotes pond, come according to memory using level Expiration period is set dynamically, outdated object is moved into weak reference pond.
(4) judge whether the CIM objects pointed by current quote are expired, outdated conditions:Used with the memory of master server Whether rate has reached 70%, if greater than 70%, judges again, whether memory usage is more than 85%, if memory uses Rate is more than 85%, then discharges weak with data cached cited in pond, and 85% is less than or equal to if greater than 70%, then is carried out soft The arrangement in pond is quoted, if memory usage is less than 70%, is arranged without soft reference pond.Supplementary notes:Memory usage 70% is the predetermined threshold whether soft reference pond needs housekeeping operation, it can be understood as the empirical value of one of one embodiment, together Reason, memory usage 85% is the predetermined threshold whether weak reference pond needs housekeeping operation.
(5) dynamic expiration period duration used in this housekeeping operation is calculated, inquires about two-staged step cache pool step by step In CIM objects, and obtain the last access time of inquired CIM objects (during last access time, i.e. current accessed Between, it is possible to understand that ground is current CIM objects institute usage time), judge whether the CIM objects pointed by current quote are expired, mistake Phase condition is set up, and object is moved to the management of weak reference pond, according to the relational expression of the dynamic expiration period of memory usage:
(i=1,2,3 ..., T1=0, S1=10)
Wherein, u is memory usage when being arranged;TiProcess spent time is arranged for the last soft reference pond;si For since the last time soft time interval quoted buffering area housekeeping operation terminates to this soft reference buffering area housekeeping operation.Memory When consumption is more than 70% first and performs soft reference pond arrangement, texp is the dynamic expiration period of memory usage, exemplified by 10, Unused object can move to weak reference pond from soft reference pond in namely 10 seconds,
If accessed CIM objects are retrieved in weak reference pond, then this CIM object will be upgraded to soft reference Pond is held, and the access time that timestamp markers record CIM objects are current in soft reference pond.
The present invention above-mentioned queried access operation after, if after memory usage reaches certain limit, by daemon thread " object is expired " inspection is enabled, the object not being accessed in the expiration period duration that dynamic is calculated moves to weak draw by soft reference pond Use pond.The caching level of different reference intensity is formed by soft reference pond and weak reference pond, so that Java Virtual Machine is pressed as needed Level recycles memory, reaches dynamic control of data buffer memory, reduces the actual memory expense of larger electric network model so as to effectively keep away Exempt from the effect of memory spilling, while reduce and server interactive quantity, lifting Object Query efficiency.
The technical program discloses a kind of destination object queried access method, apparatus based on CIM model and system and one Kind CIM electric network model object datas go the multi-level buffer method, apparatus and system of strongly reference, and above two method is combined, and is solved A kind of CIM objects of having determined go the problem of dynamic buffering data transfer and processing of strongly reference, the technical program and prior art phase Than beneficial effects of the present invention are embodied in:
The present invention is used in the application software such as power grid CIM model data analysis, especially suitable for needing to carry out the vertical of model To the situation of the analysis of level traversal and horizontal power network topology traversal analysis.For large-scale power grid, because memory source is limited Or data volume is huge, usually whole electric network model can not all be put into memory, in this case, the technical program just has bright Aobvious advantage.It is mainly reflected in:
1) access efficiency and memory usage are balanced, after memory dosage exceedes particular bound (70%), is made according to memory Expiration period is set dynamically with rate, memory is effectively maintained to a rational level.Shorten when memory usage is high Expiration period, can rapidly vacate memory from CIM target caches, and empty weak reference buffer pool, and increase can as far as possible Use memory;And do not discharge cache object when memory usage is low, increase buffer data size, improve the hit rate of object retrieval, Reduce server lookup.Flexible adaptation is the memory amount of application configuration, if being allocated to the memory amount of application relative to will The grid model data of analysis, its capacity is enough, is just not required to discharge the soft data object for quoting management, need not also think highly of to service Check is ask;If grid model data amount to be analyzed is big, memory can not be entirely enclosed in, then program still can normal operation, lead to The rotation release of two buffering areas is crossed, improves object data retrieving efficiency.
2) flexible adaptation is the memory amount of application configuration.If the memory amount of application is allocated to relative to being analyzed Grid model data, its capacity is enough, is just not required to discharge the soft data object for quoting management, need not also repeat to look into server Ask;If grid model data amount to be analyzed is big, memory can not be entirely enclosed in, then program still can normal operation, pass through two The rotation of a buffering area improves object data retrieving efficiency.
3) effectively prevent memory from overflowing.Using it is soft reference and weak reference mechanism, under extreme memory limited case, Will not memory overflow because soft reference and the resource held of weak reference can all be recycled by JVM garbage collectors.
4) using simple.The application end of target cache only needs to access object data on demand, it is not necessary to consider data how from Server loads, it is not required that actively goes to discharge.
The foregoing is merely the preferred embodiment of the present invention, is not intended to limit the scope of the invention, every at this Under the inventive concept of invention, the equivalent structure transformation made using description of the invention and accompanying drawing content, or directly/use indirectly It is included in other related technical areas in the scope of patent protection of the present invention.

Claims (9)

  1. A kind of 1. queried access method based on CIM model, it is characterised in that include the following steps:
    S10 is based on CIM model generation CIM object class, and the wherein CIM object class includes the ID and record of unique mark CIM objects The markers of CIM object current accessed times;
    S20 establishes soft reference pond and weak reference pond, is drawn by soft respectively using the ID of the CIM objects as the refined value for quoting pond entry The CIM target caches pond of two-staged step is sequentially formed with pond and weak reference pond;
    S30 receives the queried access request of destination object, obtains destination object ID;
    Whether S40 inquiries destination object ID matches with the ID of the CIM objects cited in CIM target caches pond;If above-mentioned inquiry Success, then access inquired CIM objects, and the time of the markers record current accessed of the CIM objects;
    If the above-mentioned inquiry failures of S50, turn to server and carry out queried access.
  2. 2. the queried access method of the destination object based on CIM model as claimed in claim 1, it is characterised in that the S40 The step of include:
    Whether S401 inquiry destination objects ID matches with the soft entry for quoting pond, if matching, inquires about the bar in soft reference pond Mesh success, access this it is soft quote pond entry cited in CIM objects, and the CIM objects markers record current accessed when Between, if above-mentioned inquiry fails, turn to the entry in inquiry weak reference pond;
    If S402 inquires about destination object ID and the entries match in weak reference pond is successful, cited in the entry in the mobile weak reference pond CIM objects to soft reference pond, delete with the ID of the CIM objects refined value weak reference pond entry, obtain the ID of the CIM objects Refined value accesses the CIM objects cited in the refined value entry, and this CIM object in the entry in the soft reference pond that CIM objects increase newly Markers record current accessed time.
  3. 3. the queried access method of the destination object based on CIM model as claimed in claim 1, it is characterised in that the S50 The step of include:
    S501;Fail if destination object ID is inquired about in CIM target caches pond, turn to server and perform inquiry, if passing through target pair As ID server lookup success, generation with destination object have identical ID soft reference pond CIM objects, with the CIM objects The refined soft reference ponds for being worth the CIM objects of ID entry, access inquired CIM objects, and the markers record of the CIM objects The time of current accessed;
    If S502 is failed by destination object ID in server lookup, the queried access request failure of destination object is returned.
  4. 4. the queried access method of the destination object based on CIM model as described in any one in claims 1 to 3, it is special Sign is that described the step of accessing inquired CIM objects includes:
    S601 judges whether inquired CIM objects match with destination object;
    If S602 matches, inquired CIM objects, and the time of the markers record current accessed of the CIM objects are accessed;
    If S603 is not matched that, the queried access request failure of destination object is returned.
  5. A kind of 5. queried access device based on CIM model, it is characterised in that including:
    Generation module, for generating CIM object class based on CIM model, the wherein CIM object class includes unique mark CIM objects ID and record the CIM object current accessed times markers;
    Module is established, for using the ID of the CIM objects as the refined value for quoting pond entry, establishing soft reference pond and weak reference respectively Pond, the CIM target caches pond of two-staged step is sequentially formed by soft reference pond and weak reference pond;
    Acquisition module, the queried access for receiving destination object are asked, and obtain destination object ID;
    Cache pool enquiry module, for inquire about destination object ID whether the ID phases with the CIM objects cited in CIM target caches pond Matching;If above-mentioned successful inquiring, access inquired CIM objects, and the markers record current accessed of the CIM objects when Between;
    Server lookup module, if failing for above-mentioned inquiry, turns to server and carries out queried access.
  6. 6. the queried access device of the destination object based on CIM model as claimed in claim 5, it is characterised in that described slow Depositing pond enquiry module includes:
    Soft reference pond query unit, for the entry using the soft reference pond of destination object ID inquiries, if destination object ID is inquired The ID of matched CIM objects, then inquire about the entry success in soft reference pond, accesses cited in the soft entry for quoting pond CIM objects, and the time of the markers record current accessed of the CIM objects, if above-mentioned inquiry fails, turn to inquiry weak reference pond Entry;
    Weak reference pond query unit, if inquiry destination object ID and the entries match success in weak reference pond, the mobile weak reference pond Entry cited in CIM objects to soft reference pond, delete with the ID of the CIM objects refined value weak reference pond entry, obtain The refined values of ID of the CIM objects are taken to access the CIM cited in the refined value entry in the entry in the soft reference pond that CIM objects increase newly Object, and the time of the markers record current accessed of this CIM object.
  7. 7. the queried access device of the destination object based on CIM model as claimed in claim 5, it is characterised in that the clothes Business device enquiry module includes:
    Successful inquiring unit, fails if being inquired about for destination object ID in CIM target caches pond, turns to server and performs inquiry, If there is the CIM objects in the soft reference pond of identical ID with destination object in server lookup success, generation by destination object ID, With the entry in the refined soft reference ponds for being worth the CIM objects of the ID of the CIM objects, inquired CIM objects, and this CIM pairs are accessed The time of the markers record current accessed of elephant;
    Inquiry failure unit, if for failing by destination object ID in server lookup, returns to the queried access of destination object Request failure.
  8. 8. such as the queried access device of destination object of the claim 5-7 any one of them based on CIM model, its feature exists In further including access logging modle, the access logging modle includes:
    Whether judging unit, the CIM object inquired for judgement match with destination object;
    Recording unit is accessed, if for matching, accesses inquired CIM objects, and the markers record of the CIM objects is current The time of access;
    Failure unit is accessed, if for not matching that, returns to the queried access request failure of destination object.
  9. 9. a kind of queried access system based on CIM model, including server, it is characterised in that further include such as claim 5-8 The queried access device of the destination object based on CIM model, be used for realization as described in claim 1-4 based on CIM The queried access method of the destination object of model.
CN201710606760.0A 2017-07-24 2017-07-24 A kind of queried access method, apparatus and system based on CIM model Active CN107908470B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710606760.0A CN107908470B (en) 2017-07-24 2017-07-24 A kind of queried access method, apparatus and system based on CIM model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710606760.0A CN107908470B (en) 2017-07-24 2017-07-24 A kind of queried access method, apparatus and system based on CIM model

Publications (2)

Publication Number Publication Date
CN107908470A true CN107908470A (en) 2018-04-13
CN107908470B CN107908470B (en) 2019-11-26

Family

ID=61840201

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710606760.0A Active CN107908470B (en) 2017-07-24 2017-07-24 A kind of queried access method, apparatus and system based on CIM model

Country Status (1)

Country Link
CN (1) CN107908470B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021032919A1 (en) * 2019-08-21 2021-02-25 Idemia Identity & Security France Sas Data collector in an electronic device

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7519640B1 (en) * 2004-06-30 2009-04-14 Sun Microsystems, Inc. Better placement of dying objects in a generation managed by the train algorithm
CN101727355A (en) * 2008-10-31 2010-06-09 国际商业机器公司 Handling method and system for memory access events
US8301671B1 (en) * 2009-01-08 2012-10-30 Avaya Inc. Method and apparatus providing removal of replicated objects based on garbage collection
CN104714897A (en) * 2013-12-13 2015-06-17 航天信息股份有限公司 Cache-based list processing method on android platform
US9110790B1 (en) * 2008-06-30 2015-08-18 Emc Corporation Managing memory in displaying data storage system information
CN106156397A (en) * 2015-11-16 2016-11-23 云南电网有限责任公司 A kind of method meeting IEC61970 specification SVG/CIM graphical model file based on the generation of Oracle Spatial spatial data
CN106528444A (en) * 2016-12-05 2017-03-22 北京金和网络股份有限公司 Automatic management method of object cached in memory
CN106802955A (en) * 2017-01-19 2017-06-06 济南浪潮高新科技投资发展有限公司 A kind of image data caching method

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7519640B1 (en) * 2004-06-30 2009-04-14 Sun Microsystems, Inc. Better placement of dying objects in a generation managed by the train algorithm
US9110790B1 (en) * 2008-06-30 2015-08-18 Emc Corporation Managing memory in displaying data storage system information
CN101727355A (en) * 2008-10-31 2010-06-09 国际商业机器公司 Handling method and system for memory access events
US8301671B1 (en) * 2009-01-08 2012-10-30 Avaya Inc. Method and apparatus providing removal of replicated objects based on garbage collection
CN104714897A (en) * 2013-12-13 2015-06-17 航天信息股份有限公司 Cache-based list processing method on android platform
CN106156397A (en) * 2015-11-16 2016-11-23 云南电网有限责任公司 A kind of method meeting IEC61970 specification SVG/CIM graphical model file based on the generation of Oracle Spatial spatial data
CN106528444A (en) * 2016-12-05 2017-03-22 北京金和网络股份有限公司 Automatic management method of object cached in memory
CN106802955A (en) * 2017-01-19 2017-06-06 济南浪潮高新科技投资发展有限公司 A kind of image data caching method

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
DEVDIV移动开发社区: "《Android开发实战体验》", 31 January 2013, 海洋出版社 *
YAROM GABAY, ASSAF J. KFOURY: "A calculus for java"s reference objects", 《AUGUST 2007 ACM SIGPLAN NOTICES》 *
张昊: "Java软引用防止内存泄漏技术的研究", 《安徽教育学院学报》 *
徐正超: "Java虚拟机中内存管理机制研究", 《中南民族大学学报(自然科学版)》 *
高磊,杨诚,元凯: "《Android应用开发精解》", 30 September 2012, 北京航空航天大学出版社 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021032919A1 (en) * 2019-08-21 2021-02-25 Idemia Identity & Security France Sas Data collector in an electronic device
FR3100072A1 (en) * 2019-08-21 2021-02-26 Idemia Identity & Security France Data collector in an electronic device

Also Published As

Publication number Publication date
CN107908470B (en) 2019-11-26

Similar Documents

Publication Publication Date Title
US7979643B2 (en) Method for tuning a cache
CN102542034B (en) A kind of result set cache method of database interface
US6950838B2 (en) Locating references and roots for in-cache garbage collection
US7386673B2 (en) Method for tracking of non-resident pages
CN107122410A (en) A kind of buffering updating method and device
CN104683329B (en) A kind of data cache method and system of mobile device client
KR20150048861A (en) Network service system and method with off-heap caching
CN110232049A (en) A kind of metadata cache management method and device
CN105740445A (en) Database query method and device
CN104123240A (en) System and method for transactional cache
CN101692229A (en) Self-adaptive multilevel cache system for three-dimensional spatial data based on data content
CN100437590C (en) Method for prefetching object
CN106021468A (en) Updating method and system for distributed caches and local caches
CN1278240C (en) High speed buffer storage refresh system and its method
CN105404595B (en) Buffer memory management method and device
CN106777085A (en) A kind of data processing method, device and data query system
CN106599152A (en) Data caching method and system
CN106959928A (en) A kind of stream data real-time processing method and system based on multi-level buffer structure
Meizhen et al. The design and implementation of LRU-based web cache
CN104424119B (en) Memory space configuration method and device
CN104253836A (en) Wireless network based image displaying method and system and mobile terminal
CN108614847A (en) A kind of caching method and system of data
CN114003562B (en) Directory traversal method, device and equipment and readable storage medium
CN107908470B (en) A kind of queried access method, apparatus and system based on CIM model
CN109492020A (en) A kind of data cache method, device, electronic equipment and storage medium

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20191213

Address after: 510080, Guangdong, Guangzhou province Yuexiu District Dongfeng East Road water all Gang No. 8, No. eighteen, building 6

Patentee after: GUANGDONG POWER GRID CO., LTD. INFORMATION CENTER

Address before: 510060 building 6, No. 8, No. eighteen, Dongfeng Road, Dongfeng East Road, Guangzhou, Yuexiu District, Guangdong

Co-patentee before: WeiHai CIMSTech Co., Ltd.

Patentee before: GUANGDONG POWER GRID CO., LTD. INFORMATION CENTER