CN109697036A - Information processing method and device - Google Patents

Information processing method and device Download PDF

Info

Publication number
CN109697036A
CN109697036A CN201811646184.3A CN201811646184A CN109697036A CN 109697036 A CN109697036 A CN 109697036A CN 201811646184 A CN201811646184 A CN 201811646184A CN 109697036 A CN109697036 A CN 109697036A
Authority
CN
China
Prior art keywords
object identity
data
storage
identity
cryptographic hash
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811646184.3A
Other languages
Chinese (zh)
Inventor
廖彦文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Internet Security Software Co Ltd
Original Assignee
Beijing Kingsoft Internet Security Software 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 Beijing Kingsoft Internet Security Software Co Ltd filed Critical Beijing Kingsoft Internet Security Software Co Ltd
Priority to CN201811646184.3A priority Critical patent/CN109697036A/en
Publication of CN109697036A publication Critical patent/CN109697036A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0625Power saving in storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • 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

Abstract

The embodiment of the application provides an information processing method and device, which are used for solving the problem that resources are wasted due to the fact that the same observer can send messages for multiple times when the messages for updating data are sent. Wherein, the method comprises the following steps: receiving an object identifier, wherein the object identifier is an identifier of an object used for monitoring data change; judging whether an object identifier identical to the object identifier exists in the stored object identifiers or not; and storing the object identifier when judging that the same object identifier does not exist in the stored object identifiers. By implementing the embodiment of the application, resources can be saved.

Description

A kind of information processing method and device
Technical field
This application involves field of computer technology more particularly to a kind of information processing methods and device.
Background technique
With the continuous development of computer technology, need application to be installed more and more on electronic equipment, such as various Androids Using.In Android application development process, usually by Observer Pattern come the variation in monitored data source.In Observer Pattern In, observed person can store the address of observer, and when the data in observed person change, observed person can pass through sight The message that data update is sent to observer by the address for the person of examining.However, since observed person can repeatedly receive the same sight The person of examining send address information and storage, thus for the same observer address can by storage repeatedly, therefore, send number According to update message when, can be sent repeatedly for the same observer, so that causing the waste of resource.
Summary of the invention
The embodiment of the present application provides a kind of information processing method, for solving when sending the message that data update, for The same observer can send repeatedly, so that the problem of causing the waste of resource.
In a first aspect, providing a kind of information processing method and including:
Object identity is received, the object identity is the mark of the object changed for monitored data;
Judge to whether there is object identity identical with the object identity in the object identity of storage;
There is no in the case where object identity identical with the object identity in the object identity for judging storage, deposit Store up the object identity.
In a kind of possible embodiment, it whether there is and the object identity in the object identity of the judgement storage Identical object identity, comprising:
Cryptographic Hash is determined according to the object identity;
Judge to whether there is cryptographic Hash identical with the cryptographic Hash in the cryptographic Hash of storage;
There is no in the case where cryptographic Hash identical with the cryptographic Hash in the cryptographic Hash for judging storage, storage is determined Object identity in be not present object identity identical with the object identity.
In a possible embodiment, the reception object identity includes:
Receive the information including object identity and Data Identification;
The method also includes:
Monitor whether the data that the Data Identification is identified change;
When listening to the data that the Data Identification is identified and changing, to the corresponding object hair of the first object identity Data are sent to change message, first object identity is any in the corresponding all object identities of the Data Identification of storage Object identity.
In a possible embodiment, when listening to the data that the Data Identification is identified and changing, institute State method further include:
Judge whether the corresponding object of the first object identity survives;
In the case where judging that the corresponding object of first object identity is survived, execute described to the first object identity Corresponding object sends the step of data change message.
In a possible embodiment, the method also includes:
In the case where judging that the corresponding object of first object identity is not survived, delete storage described first pair As mark.
In a possible embodiment, the method also includes:
When the corresponding data of the Data Identification are deleted or are removed, the corresponding institute of the Data Identification of storage is deleted There is object identity.
Second aspect provides a kind of information processing unit, comprising:
Receiving unit, for receiving object identity, the object identity is the mark of the object changed for monitored data;
First judging unit, with the presence or absence of object identical with the object identity in the object identity for judging storage Mark;
Storage unit, for there is no object marks identical with the object identity in the object identity for judging storage In the case where knowledge, the object identity is stored.
In a kind of possible embodiment, first judging unit is specifically used for:
Cryptographic Hash is determined according to the object identity;
Judge to whether there is cryptographic Hash identical with the cryptographic Hash in the cryptographic Hash of storage;
There is no in the case where cryptographic Hash identical with the cryptographic Hash in the cryptographic Hash for judging storage, storage is determined Object identity in be not present object identity identical with the object identity.
In a kind of possible embodiment, the receiving unit, being specifically used for receiving includes object identity and data mark The information of knowledge;
Described device further include:
Monitoring unit, for monitoring whether the data that the Data Identification is identified change;
Transmission unit, for when listening to the data that the Data Identification is identified and changing, to the first object mark Know corresponding object and send data change message, first object identity is that the Data Identification of storage is corresponding all right As any object mark in mark.
In a kind of possible embodiment, described device further include:
Second judgment unit, for judging first when listening to the data that the Data Identification is identified and changing Whether the corresponding object of object identity survives, in the case where judging that the corresponding object of first object identity is survived, institute It states transmission unit and sends data change message to the corresponding object of the first object identity.
In a kind of possible embodiment, described device further include:
Unit is deleted, in the case where judging that the corresponding object of first object identity is not survived, deletion to be deposited First object identity of storage.
In a kind of possible embodiment, the deletion unit is also used to when the corresponding data quilt of the Data Identification When deleting or removing, the corresponding all object identities of the Data Identification of storage are deleted.
The third aspect provides a kind of information processing method, comprising:
Monitored data identifies whether identified data change;
When listening to the data that the Data Identification is identified and changing, to the corresponding object hair of the first object identity Data are sent to change message, first object identity is any in the corresponding all object identities of the Data Identification of storage Object identity.
Fourth aspect provides a kind of information processing unit, comprising:
Monitoring unit identifies whether identified data change for monitored data;
Transmission unit, for when listening to the data that the Data Identification is identified and changing, to the first object mark Know corresponding object and send data change message, first object identity is that the Data Identification of storage is corresponding all right As any object mark in mark.
5th aspect, provides a kind of electronic equipment, including processor, memory, input equipment and output equipment, described Processor, the memory, the input equipment and the output equipment are connected with each other, wherein the memory is for storing The electronic equipment is supported to execute the computer program of the progress recognizing method, the computer program includes program instruction, institute It states processor to be configured for calling described program instruction, executes first aspect or any possible embodiment of first aspect mentions The information processing method of confession, or execute the information processing method that the third aspect provides.
6th aspect, the embodiment of the present application provide a kind of computer readable storage medium, which is characterized in that the medium It is stored with computer program, the computer program includes program instruction, and described program instruction makes institute when being executed by a processor It states processor and executes first aspect or any possible embodiment information processing method of first aspect, or execute the third aspect The information processing method of offer.
7th aspect, the embodiment of the present application provides a kind of computer program product comprising instruction, when it is in computer When upper operation, so that computer executes method described in the various aspects.
In the embodiment of the present application, object identity is received, judges to whether there is and the object identity in the object identity of storage The case where identical object identity, there is no object identities identical with the object identity in the object identity for judging storage Under, store the object identity.As it can be seen that after receiving an object identity, be not store the object identity immediately, but In the case where object identity identical with the object identity is not present in the object identity for determining storage, the object mark is just stored Know, can carry out repeating storage to avoid the object identity to the same observer, so as to when sending data update message, for The same observer repeats to send repeatedly, so as to economize on resources.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to needed in the embodiment Attached drawing is briefly described, it should be apparent that, drawings in the following description are some embodiments of the invention, general for this field For logical technical staff, without creative efforts, it is also possible to obtain other drawings based on these drawings.
Fig. 1 is a kind of flow diagram of information processing method provided by the embodiments of the present application;
Fig. 2 is the flow diagram of another information processing method provided by the embodiments of the present application;
Fig. 3 is a kind of structural schematic diagram of information processing unit provided by the embodiments of the present application;
Fig. 4 is the structural schematic diagram of a kind of electronic equipment provided by the embodiments of the present application.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete Site preparation description.
It should be appreciated that ought use in this specification and in the appended claims, term " includes " and "comprising" instruction Described feature, entirety, step, operation, the presence of element and/or component, but one or more of the other feature, whole is not precluded Body, step, operation, the presence or addition of element, component and/or its set.
It is also understood that mesh of the term used in this present specification merely for the sake of description specific embodiment And be not intended to limit the application.As present specification and it is used in the attached claims, unless on Other situations are hereafter clearly indicated, otherwise " one " of singular, "one" and "the" are intended to include plural form.
It will be further appreciated that the term "and/or" used in present specification and the appended claims is Refer to any combination and all possible combinations of one or more of associated item listed, and including these combinations.
As used in this specification and in the appended claims, term " if " can be according to context quilt Be construed to " when ... " or " once " or " in response to determination " or " in response to detecting ".Similarly, phrase " if it is determined that " or " if detecting [described condition or event] " can be interpreted to mean according to context " once it is determined that " or " in response to true It is fixed " or " once detecting [described condition or event] " or " in response to detecting [described condition or event] ".
Referring to Fig. 1, Fig. 1 is a kind of flow diagram of information processing method provided by the embodiments of the present application.Such as Fig. 1 institute Show, which may include:
101, object identity is received.
(be otherwise known as Observer Pattern model (Model) view (View) mode, source listener (Listener) mould sometimes Formula or subordinate's mode) be software design pattern one kind.In such mode, a target piece management is all to depend upon it Observer's object, and the state of itself change when actively give notice.This is usually mentioned through each observer of calling The method of confession is realized.Such mode is usually used to realization event handling system.Observer Pattern has many implementations, from It fundamentally says, which must include two roles: observer and observed person.
In a kind of possible embodiment, the observed person (Subject) in same software can be business number According to, picture etc., observer (Observer) can be user interface etc., in the presence of " observation " between observer and observed person Logic association, when observed person changes, observer will observe such variation, and make corresponding sound It answers.It is understood that the interactive relationship between observer and observed object cannot be embodied as calling directly between class, it is no It then will just make closely to be coupled together between observer and observed object, and fundamentally violate the original of object oriented designing Then.Before the variation of observer " observation " observed person, the monitoring register method of observed person need to be called, by pair of observer As mark passes to observed person, i.e. observed person's object identity for receiving observer, the step be before realizing and monitoring, it is complete At the process of registration.Specifically, the object identity be observer reference, reference be in java, the operation of object all with Association is generated therewith by means of reference, by operating associated reference, to achieve the purpose that object needed for operating, that is, is quoted, is It, can be with analogy pointer, address for operation object.Wherein, it may include the identity of observer in above-mentioned reference, connect Mouth, the definition of event (event), event action (action) etc..
Wherein, the information processing unit in the application may include mobile phone based on android system, tablet computer, palm electricity Brain, laptop, mobile internet device MID (mobile internet devices, MID) or wearable device etc. can To install the electronic equipment of application software, above- mentioned information processing unit is only citing, and non exhaustive, including but not limited to above-mentioned letter Cease processing unit.Certainly in practical applications, above- mentioned information processing unit is also not necessarily limited to above-mentioned realization form, such as can also wrap It includes: car-mounted terminal.
102, it whether there is object identity identical with the object identity in the object identity of judgement storage, judging to deposit There is no in the case where object identity identical with the object identity in the object identity of storage, step 103 is executed.
In a kind of possible embodiment, after the object identity that observer's transmitting is received based on observed person, it is observed The object identity is stored in set by person.Wherein, collection is combined into the set of weak reference, is come in a manner of key-value (key-value) Storage object mark.
Specifically, when Android is developed, there are four types of references, and the performance in order to optimization application can be used, these four draw With are as follows: strongly reference, (StrongRefernce), soft reference (SoftReference), weak reference (WeakReference), void are drawn With (PhantomReference).Wherein, strongly reference can direct access target object, object associated by strongly reference is in office When wait all will not by Memory recycle, no matter and whether weak reference memory sufficient, find certain an object reference only have it is weak Quoting current weak reference will be recovered.The problem of in order to evade RAM leakage, observed person will in the embodiment of the present application The mark of the observer is stored in the array of strongly reference, and is stored in the sparse array of weak reference (SparseWeakArray), not only RAM leakage will not be caused because of strongly reference in this way, but also SparseWeakArray ratio It plays other chained list hash and more saves memory headroom.
In above-mentioned set, i.e., stored in a manner of key-value in the sparse array (SparseWeakArray) of weak reference The object identity of one or more observers, wherein in the cryptographic Hash of the position of key (key) storage observer, it is to be appreciated that The cryptographic Hash of different observers is different, and in the position of value (value), the corresponding identification information of storage observer's cryptographic Hash, that is, draw With.When some observer delivers the object identity, observed person takes the Kazakhstan of the object of the currently monitored data variation first Uncommon value, object, that is, observer of monitoring data variation.After receiving object identity, the object identity of storage can be first judged In whether there is object identity identical with the object identity, can be and cryptographic Hash first determined according to the object identity, sentence later Whether there is cryptographic Hash identical with the cryptographic Hash in the cryptographic Hash of disconnected storage, in the cryptographic Hash for judging storage there is no with In the case where the identical cryptographic Hash of the cryptographic Hash, determines and object identical with the object identity is not present in the object identity of storage Mark will execute step 103.There are the feelings of object identity identical with the object identity in the object identity for judging storage Under condition, the object identity can be abandoned.There are the feelings of cryptographic Hash identical with the cryptographic Hash in the cryptographic Hash for judging storage Under condition, the corresponding object identity of the cryptographic Hash of object identity replacement storage can be used.
It should be noted that including object identity in the information that observer transmits to observed person, received in observed person After the object identity transmitted to observer, in the corresponding set of data observed by the object identity of observer is stored in.Its In, an observer includes multiple data, each data is corresponding with the set of a weak reference.
103, the object identity is stored.
Based in step 102 judgement when front transfer object identity observer cryptographic Hash whether with have stored in set In cryptographic Hash inquired, shown by query result, if the not observer with the transmitting object identity in current collection The same cryptographic Hash of cryptographic Hash, then store the object identity.Wherein, it is still and is stored according to the structure of key-value, that is, breathe out Uncommon value is used as key, which is that the corresponding value of the cryptographic Hash stores.
Whether identical it is possible to further compare the address in new object mark and old object identity, address here is Address in the corresponding object identity of cryptographic Hash, can not also compare, and new object identity can be replaced directly to old pair As mark, if finding after the comparison, new object identity as old object identity, can not also be replaced, and it is new right directly to delete As mark.
It is not that storage should immediately after receiving an object identity in the information processing method described in Fig. 1 Object identity, but determine storage object identity in be not present object identity identical with the object identity in the case where, The object identity is just stored, can carry out repeating storage to avoid the object identity to the same observer, to send data When update message, repeat to send repeatedly, so as to economize on resources for the same observer.
Referring to Fig. 2, Fig. 2 is the flow diagram of another information processing method provided by the embodiments of the present application.Such as Fig. 2 Shown, which includes:
201, the information including object identity and Data Identification is received.
It, can be to observed person in the case that observer needs monitored data to change in a kind of possible embodiment The information including object identity and Data Identification is sent, observed person can receive the information later.It is understood that one A Data Identification can correspond to multiple object identities, i.e. a data can be monitored by multiple observers.Wherein, object identity refers to The mark of observer, the event action to be monitored and monitor, monitor are used to after event occurs execute the interface of operation Definition, it should be noted that in developer develops and realizes, the event interface to be monitored need to be realized in this side of observer, it is complete Operation content after occurring at the time a, it can event interface is defined to be abstracted all event types by observer, works as quilt After data in observer change, it can actively be adjusted back to observed person by interface.It is understood that different data Source variation is adjusted back by different interfaces to observer.Object identity can be address, be also possible to title, can also be other Information, this embodiment is not limited.
It should be noted that the object identity for receiving an observer can be primary received, it is also possible to repeatedly connect It receives, there are a kind of situations, and after observer is broken down, the same observer may be repeatedly to observed person's transmitting pair As mark.
In the realization of software development for example, now with observer A registration monitored in data source two data x and The variation of y, then observer need to not only write itself " address " in object identity, also write the mark of x and y, Yi Jiyao Realize two interfaces of x and y variation.
202, cryptographic Hash is determined according to the object identity.
Wherein, cryptographic Hash is also known as hash function or hashing algorithm, also known as hash function, and cryptographic Hash is a kind of from any one The method of small number " fingerprint " is created in data.Hashed value usually uses the character string of a short random letters and number composition To represent.In fact, default that object class provides is realized guarantees that the cryptographic Hash of each object is different (in the memory of object really A cryptographic Hash is returned by special algorithm on the basis of location).So can store in the position of key, new observation is being received When the mark of person, whether the cryptographic Hash for capableing of cryptographic Hash and current observer in set in comparison sheet is identical.
In a kind of possible embodiment, the Hash of observer can be obtained by the hashCode () method of object class Value.It wherein, is the address value of the object in memory using the cryptographic Hash that this method returns, cryptographic Hash is also that object is stored to Kazakhstan The important evidence of uncommon table.
After receiving the information including object identity and Data Identification, cryptographic Hash can be determined according to the object identity, Hash operation is carried out to the object identity and obtains cryptographic Hash.
203, it whether there is cryptographic Hash identical with the cryptographic Hash in the cryptographic Hash of judgement storage, in the Kazakhstan for judging storage In the case where there is cryptographic Hash identical with the cryptographic Hash in uncommon value, step 204 is executed, in the cryptographic Hash for judging storage not In the case where cryptographic Hash identical with the cryptographic Hash, step 205 is executed.
Wherein, the specific implementation process of step 203 can be found in the description in embodiment corresponding to above-mentioned Fig. 1 to step 102, Here it will not continue to repeat.
204, using the corresponding object identity of the cryptographic Hash of object identity replacement storage.
In a kind of possible embodiment, it can be in above-mentioned set based on step 202 and step 203 and pass through meter Length (length gathered) the progress complementation operation for calculating cryptographic Hash and table obtains an integer value, which is exactly that new element will be deposited The position (being index value) put, if without storing any element on the corresponding position of index value, it can be directly by the Hash The corresponding object identity of cryptographic Hash is stored on the position of the corresponding value of cryptographic Hash by the storage of value in this position.It can also In the case where to have stored element on the corresponding position of index value, existing object cryptographic Hash, judgement are inquired in set In table whether there is cryptographic Hash identical with the cryptographic Hash the case where, can also inquire at the very start in current table and whether deposit The cryptographic Hash identical with the cryptographic Hash the case where.
In the case where there is cryptographic Hash identical with the cryptographic Hash in the cryptographic Hash for judging storage, the object mark is used Know the corresponding object identity of the cryptographic Hash for directly replacing storage.It is possible to further to the object mark stored on value Knowledge is compared, and in the identical situation of the object identity of the object identity and storage, can directly abandon the object identity, and It does not need to replace.
Specifically, it can be determined in the cryptographic Hash for judging storage there is no after cryptographic Hash identical with the cryptographic Hash Object identity identical with the object identity is not present in the object identity of storage, executes step 205.
205, the object identity is stored.
Wherein, the specific implementation process of step 205 can be found in the description in embodiment corresponding to the Fig. 1 to step 103, this In will not continue to repeat.
206, monitored data identifies whether identified data change.
After receiving the information including object identity and Data Identification, monitored data it can be identified in real time Whether data change.Step 206 can execute parallel with step 202, can also serially execute.
In the realization of software development, for data x in a data source, if data x is changed, data x hair Send Data Identification to data source, i.e. observed person, after observed person receives Data Identification, traversal current data x is corresponding The set of observer is stored with the observer for determining survival of observer in set, and sends data to observer and change message.
207, when listening to the data that Data Identification is identified and changing, judge the corresponding object of the first object identity Whether survive, in the case where judging that the corresponding object of the first object identity is survived, executes step 208, judging first In the case that the corresponding object of object identity is not survived, step 209 is executed.
In a possible embodiment, it changes when observed person listens to the data that Data Identification is identified When, it can first judge whether the corresponding object of the first object identity survives, judge that the corresponding object of the first object identity deposits In the case where work, step 208 can be executed, it, can be in the case where judging that the corresponding object of the first object identity is not survived Execute step 209.First object identity is any right in the corresponding all object identities of Data Identification of observed person's storage It is any object identity in the entire set of traversal in the corresponding all object identities of Data Identification as mark.Work as prison When the data for hearing that Data Identification is identified do not change, continue to monitor.Whether judge the corresponding object of the first object identity Reference count method (Reference Counting) can be used in survival, and Reachability Analysis Algorithm also can be used (Reachability Analysis), the application is without limitation herein.Reference counting algorithm shows object and adds a reference Counter, as soon as when there is a place to quote it, counter adds one;When quoting failure, just subtract one;When counter is not 0, Judge that the object is survived;Otherwise it is judged as dead (counter=0).This method realizes that simply, judgement is efficient, and the disadvantage is that nothing Mutual circulation is quoted between method solves the problems, such as object.And Reachability Analysis Algorithm also referred to as quotes chain method, by a series of The object of GC Roots is searched for downwards since these nodes as starting point, is searched for the path passed by and is known as quoting chain, when one Object to GC Roots do not have any reference chain be connected (i.e. from GC Roots to this object unreachable) when, it was demonstrated that this object is not It can use.The GC Roots can be the object quoted in Java Virtual Machine stack (the local variable table of stack frame), be also possible to local JNI reference object can also be the object of the middle constant in method area, the reference of class static attribute in method stack.
208, data are sent to the corresponding object of the first object identity and changes message.
In a possible embodiment, in the case where judging that the corresponding object of the first object identity is survived, table There is also can send data change to the corresponding object of the first object identity and disappear the corresponding observer of bright first object identity Breath.Wherein, data change message may include the Data Identification, for showing data change message for which data Data change message;, data, which change message, to include data information, and data information may include that the Data Identification is corresponding The information of changed data in data, data information can also include the content before the corresponding data of the information change And/or the content after changing.It is understood that when storing the object identity of observer, observer's Object identity actually only stores in set once, so, when sending, data change only is sent to observer and is disappeared When breath, a data only are sent to the same observer and change message.
209, the first object identity of storage is deleted.
In a possible embodiment, in the case where judging that the corresponding object of the first object identity is not survived, Show that the corresponding observer of the first object identity has been not present, the first object identity of storage is nonsensical, therefore, can be with The first object identity for deleting or removing storage in corresponding set, can be to avoid the waste of memory, so as to save memory.
Further, if observer cancels observation, i.e., observer tells observed person to cancel observation, observed person Remove or delete from this collection the mark of observer.
210, when the corresponding data of the Data Identification are deleted or are removed, the corresponding institute of the Data Identification of storage is deleted There is object identity.
In a kind of possible embodiment, when the corresponding data of the Data Identification are deleted or are removed, i.e., at one A data in data source are recovered, and delete the corresponding all object identities of the Data Identification of storage, i.e., traversal is observed The object identity of person's storage deletes being recovered in the corresponding object identity of all Data Identifications, namely current observed person The corresponding set of data in the object identity of observer that stores can all be deleted, the method for deletion can be remove it is all Cryptographic Hash and corresponding objects mark, it is consistent with the mark for the object that the removal is not survived, it is also possible to directly empty set, this Apply herein without limitation.If with the mark of the storage of array of strongly reference, then current data source or data source wherein When one data is recovered, reference will not be recycled, is easy to happen RAM leakage, and the embodiment of the present application uses weak reference The problem of set storage, observer can be recovered in the system, evade RAM leakage.
It is not that storage should immediately after receiving an object identity in the information processing method described in Fig. 2 Object identity, but determine storage object identity in be not present object identity identical with the object identity in the case where, The object identity is just stored, can carry out repeating storage to avoid the object identity to the same observer, to send data When update message, repeat to send repeatedly, so as to economize on resources for the same observer.
Referring to Fig. 3, Fig. 3 is a kind of structural schematic diagram of information processing unit provided in an embodiment of the present invention.Such as Fig. 3 institute Show, which may include:
Receiving unit 301, for receiving object identity, which is the mark of the object changed for monitored data Know;
First judging unit 302, with the presence or absence of identical with the object identity right in the object identity for judging storage As mark;
Storage unit 303, for there is no objects identical with the object identity in the object identity for judging storage In the case where mark, the object identity is stored.
As a kind of possible embodiment, which is specifically used for:
Cryptographic Hash is determined according to the object identity;
Judge to whether there is cryptographic Hash identical with the cryptographic Hash in the cryptographic Hash of storage;
There is no in the case where cryptographic Hash identical with the cryptographic Hash in the cryptographic Hash for judging storage, storage is determined Object identity identical with the object identity is not present in object identity.
As a kind of possible embodiment, it includes object identity and data mark which, which is specifically used for receiving, The information of knowledge;
The information processing unit can also include:
Monitoring unit 304, for monitoring whether the data that the Data Identification is identified change;
Transmission unit 305, for when listening to the data that the Data Identification is identified and changing, to the first object mark Know corresponding object and send data change message, the first object identity is the corresponding all object identities of the Data Identification of storage In any object mark.
As a kind of possible embodiment, which can also include:
Second judgment unit 306, for judging first when listening to the data that the Data Identification is identified and changing Whether the corresponding object of object identity survives, and in the case where judging that the corresponding object of the first object identity is survived, sends single Member 305 sends data to the corresponding object of the first object identity and changes message.
As a kind of possible embodiment, which can also include:
Unit 307 is deleted, for deleting storage in the case where judging that the corresponding object of the first object identity is not survived The first object identity.
As a kind of possible embodiment, unit 307 is deleted, is also used to be deleted when the corresponding data of the Data Identification Or when removing, delete the corresponding all object identities of the Data Identification of storage.
It is not that storage should immediately after receiving an object identity in the information processing unit described in Fig. 3 Object identity, but determine storage object identity in be not present object identity identical with the object identity in the case where, The object identity is just stored, can carry out repeating storage to avoid the object identity to the same observer, to send data When update message, repeat to send repeatedly, so as to economize on resources for the same observer.
It is understood that the receiving unit 301 of the information processing unit of the present embodiment, the first judging unit 302, storage Unit 303, monitoring unit 304, transmission unit 305, second judgment unit 306 and delete unit 307 function can basis Method specific implementation in this method embodiment, specific implementation process are referred to the associated description of this method embodiment, this Place repeats no more.
Referring to Fig. 4, Fig. 4 is a kind of electronic equipment provided by the embodiments of the present application.As shown in figure 4, the electronic equipment can To include processor 401, input equipment 402, output equipment 403 and memory 404.Memory 404 is for storing computer journey Sequence, computer program include program instruction, and processor 401 is used to execute the program instruction of the storage of memory 404.Wherein, it handles Device 401 is configured for caller instruction execution following steps:
Object identity is received, which is the mark of the object changed for monitored data;
Judge to whether there is object identity identical with the object identity in the object identity of storage;
There is no in the case where object identity identical with the object identity in the object identity for judging storage, store The object identity.
As a kind of possible embodiment, whether there is and the object in the object identity of the judgement of processor 401 storage Identify identical object identity, comprising:
Cryptographic Hash is determined according to the object identity;
Judge to whether there is cryptographic Hash identical with the cryptographic Hash in the cryptographic Hash of storage;
There is no in the case where cryptographic Hash identical with the cryptographic Hash in the cryptographic Hash for judging storage, storage is determined Object identity identical with the object identity is not present in object identity.
As a kind of possible embodiment, the reception of processor 401 object identity includes:
Receive the information including object identity and Data Identification;
Processor 401 is additionally configured to caller instruction execution following steps:
Monitor whether the data that the Data Identification is identified change;
When listening to the data that the Data Identification is identified and changing, sent to the corresponding object of the first object identity Data change message, and the first object identity is any object mark in the corresponding all object identities of the Data Identification of storage Know.
As a kind of possible embodiment, processor 401 is additionally configured to that the program instruction is called to execute following step It is rapid:
When listening to the data that the Data Identification is identified and changing, judge that the corresponding object of the first object identity is No survival;
In the case where judging that the corresponding object of the first object identity is survived, it is corresponding right to the first object identity to execute As the step of sending data change message.
As a kind of possible embodiment, processor 401 is additionally configured to that the program instruction is called to execute following step It is rapid:
In the case where judging that the corresponding object of the first object identity is not survived, the first object identity of storage is deleted.
As a kind of possible embodiment, processor 401 is additionally configured to that the program instruction is called to execute following step It is rapid:
When the corresponding data of the Data Identification are deleted or are removed, the Data Identification for deleting storage is corresponding all Object identity.
It is not to store the object immediately after receiving an object identity in the electronic equipment described in Fig. 4 Mark, but just deposited in the object identity for determining storage there is no in the case where object identity identical with the object identity The object identity is stored up, can carry out repeating storage to avoid the object identity to the same observer, to send data update When message, repeat to send repeatedly, so as to economize on resources for the same observer.
Wherein, step S101-S103 can by electronic equipment processor 401 and memory 404 execute.
Wherein, receiving unit 301, the first judging unit 302, storage unit 303, transmission unit 304, second judgment unit 305 and delete unit 306 can by electronic equipment processor 401 and memory 404 realize.
It should be appreciated that in the embodiment of the present application, alleged processor 401 can be central processing unit (Central Processing Unit, CPU), which can also be other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic Device, discrete gate or transistor logic, discrete hardware components etc..General processor can be microprocessor or this at Reason device is also possible to any conventional processor etc..
Output equipment 402 is for sending data, and input equipment 403 is for receiving data.
The memory 404 may include read-only memory and random access memory, and to processor 401 provide instruction and Data.The a part of of memory 404 can also include nonvolatile RAM.For example, memory 404 can also be deposited Store up the information of device type.
In the specific implementation, processor 401, output equipment 402 described in the embodiment of the present application, input equipment 403 can The embodiment for the information processing method that Fig. 1 or Fig. 2 is provided is executed, details are not described herein.
A kind of storage medium is provided in one embodiment, which is stored with computer program, computer journey Sequence includes program instruction, and program instruction makes processor execute the module information processing side of Fig. 1 or Fig. 2 when being executed by a processor Method.
A kind of application program is provided in one embodiment, and the application program for executing Fig. 1 or Fig. 2 at runtime Information processing method.
In several embodiments provided herein, it should be understood that disclosed systems, devices and methods, it can be with It realizes by another way.For example, the division of the unit, only a kind of logical function partition, can have in actual implementation Other division mode, for example, multiple units or components can be combined or can be integrated into another system or some features It can ignore, or not execute.Shown or discussed mutual coupling or direct-coupling or communication connection can be logical Some interfaces are crossed, the indirect coupling or communication connection of device or unit can be electrical property, mechanical or other forms.
Unit may or may not be physically separated as illustrated by the separation member, shown as a unit Component may or may not be physical unit, it can and it is in one place, or may be distributed over multiple networks On unit.It can some or all of the units may be selected to achieve the purpose of the solution of this embodiment according to the actual needs.
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or any combination thereof real It is existing.When implemented in software, it can entirely or partly realize in the form of a computer program product.The computer program produces Product include one or more computer instructions.It is all or part of when loading and execute on computers the computer program instructions Ground generates the process or function according to the embodiment of the present application.The computer can be general purpose computer, special purpose computer, computer Network or other programmable devices.The computer instruction may be stored in a computer readable storage medium, or by being somebody's turn to do Computer readable storage medium is transmitted.The computer instruction can be from a web-site, computer, server or data Center passes through wired (such as coaxial cable, optical fiber, Digital Subscriber Line (digital subscriber line, DSL)) or wireless (such as infrared, wireless, microwave etc.) mode is transmitted to another web-site, computer, server or data center.It should Computer readable storage medium can be any usable medium that computer can access or include one or more available The data storage devices such as medium integrated server, data center.The usable medium can be read-only memory (read-only Memory, ROM) or random access memory (random access memory, RAM) or magnetic medium, for example, floppy disk, Hard disk, tape, magnetic disk or optical medium, for example, digital versatile disc (digital versatile disc, DVD) or half Conductive medium, for example, solid state hard disk (solid state disk, SSD) etc..

Claims (10)

1. a kind of information processing method characterized by comprising
Object identity is received, the object identity is the mark of the object changed for monitored data;
Judge to whether there is object identity identical with the object identity in the object identity of storage;
There is no in the case where object identity identical with the object identity in the object identity for judging storage, institute is stored State object identity.
2. the method according to claim 1, wherein whether there is and institute in the object identity of the judgement storage State the identical object identity of object identity, comprising:
Cryptographic Hash is determined according to the object identity;
Judge to whether there is cryptographic Hash identical with the cryptographic Hash in the cryptographic Hash of storage;
There is no in the case where cryptographic Hash identical with the cryptographic Hash in the cryptographic Hash for judging storage, pair of storage is determined As object identity identical with the object identity is not present in mark.
3. the method according to claim 1, wherein the reception object identity includes:
Receive the information including object identity and Data Identification;
The method also includes:
Monitor whether the data that the Data Identification is identified change;
When listening to the data that the Data Identification is identified and changing, number is sent to the corresponding object of the first object identity According to change message, first object identity is any object in the corresponding all object identities of the Data Identification of storage Mark.
4. according to the method described in claim 3, it is characterized in that, occurring when listening to the data that the Data Identification is identified When variation, the method also includes:
Judge whether the corresponding object of the first object identity survives;
In the case where judging that the corresponding object of first object identity is survived, execute described corresponding to the first object identity Object send data change message the step of.
5. according to the method described in claim 4, it is characterized in that, the method also includes:
In the case where judging that the corresponding object of first object identity is not survived, the first object mark of storage is deleted Know.
6. a kind of information processing method characterized by comprising
Monitored data identifies whether identified data change;
When listening to the data that the Data Identification is identified and changing, number is sent to the corresponding object of the first object identity According to change message, first object identity is any object in the corresponding all object identities of the Data Identification of storage Mark.
7. a kind of information processing unit characterized by comprising
Receiving unit, for receiving object identity, the object identity is the mark of the object changed for monitored data;
First judging unit, with the presence or absence of object mark identical with the object identity in the object identity for judging storage Know;
Storage unit, for there is no object identities identical with the object identity in the object identity for judging storage In the case of, store the object identity.
8. a kind of information processing unit characterized by comprising
Monitoring unit identifies whether identified data change for monitored data;
Transmission unit, for when listening to the data that the Data Identification is identified and changing, to the first object identity pair The object answered sends data change message, and first object identity is the corresponding all object marks of the Data Identification of storage Any object mark in knowledge.
9. a kind of electronic equipment, which is characterized in that including processor, memory, input equipment and output equipment, the processing Device, the memory, the input equipment and the output equipment are connected with each other, wherein the memory is supported for storing The electronic equipment executes the computer program of the progress recognizing method, and the computer program includes program instruction, the place Reason device is configured for calling described program instruction, executes information processing method as claimed in any one of claims 1 to 6.
10. a kind of storage medium, which is characterized in that the media storage has computer program, and the computer program includes journey Sequence instruction, it is as claimed in any one of claims 1 to 6 that described program instruction when being executed by a processor executes the processor Information processing method.
CN201811646184.3A 2018-12-29 2018-12-29 Information processing method and device Pending CN109697036A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811646184.3A CN109697036A (en) 2018-12-29 2018-12-29 Information processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811646184.3A CN109697036A (en) 2018-12-29 2018-12-29 Information processing method and device

Publications (1)

Publication Number Publication Date
CN109697036A true CN109697036A (en) 2019-04-30

Family

ID=66233082

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811646184.3A Pending CN109697036A (en) 2018-12-29 2018-12-29 Information processing method and device

Country Status (1)

Country Link
CN (1) CN109697036A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111552616A (en) * 2020-04-30 2020-08-18 汉海信息技术(上海)有限公司 Memory monitoring method and device
CN112354189A (en) * 2020-11-23 2021-02-12 腾讯科技(深圳)有限公司 Game data object matching method, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070282841A1 (en) * 2006-06-01 2007-12-06 Vugranam Chakravarthy Sreedhar System and method for role based analysis and access control
CN106227736A (en) * 2016-07-11 2016-12-14 乐视控股(北京)有限公司 A kind of logic flow implementation method based on list structure and device
CN106844143A (en) * 2016-12-27 2017-06-13 微梦创科网络科技(中国)有限公司 A kind of daily record duplicate removal treatment method and device
CN107544846A (en) * 2017-08-08 2018-01-05 武汉斗鱼网络科技有限公司 A kind of EMS memory management process, device and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070282841A1 (en) * 2006-06-01 2007-12-06 Vugranam Chakravarthy Sreedhar System and method for role based analysis and access control
CN106227736A (en) * 2016-07-11 2016-12-14 乐视控股(北京)有限公司 A kind of logic flow implementation method based on list structure and device
CN106844143A (en) * 2016-12-27 2017-06-13 微梦创科网络科技(中国)有限公司 A kind of daily record duplicate removal treatment method and device
CN107544846A (en) * 2017-08-08 2018-01-05 武汉斗鱼网络科技有限公司 A kind of EMS memory management process, device and electronic equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
CODERZHY: "《KVOController分析》", 《博客园》 *
左潇龙: "《(六)观察者模式详解(包含观察者模式JDK的漏洞以及事件驱动模型)》", 《博客园》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111552616A (en) * 2020-04-30 2020-08-18 汉海信息技术(上海)有限公司 Memory monitoring method and device
CN112354189A (en) * 2020-11-23 2021-02-12 腾讯科技(深圳)有限公司 Game data object matching method, device, equipment and storage medium
CN112354189B (en) * 2020-11-23 2022-05-20 腾讯科技(深圳)有限公司 Game data object matching method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US10237295B2 (en) Automated event ID field analysis on heterogeneous logs
US8671313B2 (en) Management apparatus and management method
EP3152869B1 (en) Real-time model of states of monitored devices
US8938489B2 (en) Monitoring system performance changes based on configuration modification
WO2016095516A1 (en) Complex event processing method, apparatus and system
JP6747287B2 (en) Information processing apparatus and monitoring method
US10623235B2 (en) Correlating computing network events
CN104636437B (en) A kind of processing method and processing device of event notification method, monitor
EP2453397A1 (en) Systems and methods for business network management discovery and consolidation
WO2020015115A1 (en) Fault alarm method and terminal device
US11138060B2 (en) Application performance management system with dynamic discovery and extension
CN108289034A (en) A kind of fault discovery method and apparatus
JP2017069895A (en) Fault separation method and administrative server for performing fault separation
CN109697036A (en) Information processing method and device
CN109213604A (en) A kind of management method and device of data source
TW201812607A (en) Representation of servers in a distributed network information management system for efficient aggregation of information
CN109462507A (en) Configure update method, device, system and electronic equipment
US10924365B2 (en) Method and system for generating directed graphs
CN109391658A (en) A kind of account data synchronous method and its equipment, storage medium, terminal
CN115794064B (en) Configuration method and device of task processing flow, electronic equipment and storage medium
CN114756301B (en) Log processing method, device and system
US20160125330A1 (en) Rolling upgrade of metric collection and aggregation system
CN103970860B (en) Method, device and system for processing data
CN114201449A (en) Log monitoring method and device, computer equipment and storage medium
US20200304539A1 (en) Detecting denial of service attacks in serverless computing

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20190430

RJ01 Rejection of invention patent application after publication