CN107301095A - System operation method and operating system - Google Patents

System operation method and operating system Download PDF

Info

Publication number
CN107301095A
CN107301095A CN201710449947.4A CN201710449947A CN107301095A CN 107301095 A CN107301095 A CN 107301095A CN 201710449947 A CN201710449947 A CN 201710449947A CN 107301095 A CN107301095 A CN 107301095A
Authority
CN
China
Prior art keywords
corpse
agent
observer
present
methods described
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
CN201710449947.4A
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 Xiaodu Information Technology Co Ltd
Original Assignee
Beijing Xiaodu Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaodu Information Technology Co Ltd filed Critical Beijing Xiaodu Information Technology Co Ltd
Priority to CN201710449947.4A priority Critical patent/CN107301095A/en
Publication of CN107301095A publication Critical patent/CN107301095A/en
Pending legal-status Critical Current

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/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
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5011Pool

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the present invention provides a kind of system operation method and operating system, is related to field of software development.Wherein, the system operation method includes:The release for preventing object is operated by hook;Judge whether the object can switch to corpse object according to configuration information;In the case where being judged as YES, the object is switched into the corpse object and the corpse object is added to corpse object pool.Technical scheme provided in an embodiment of the present invention can improve the stability of such as IOS systems.

Description

System operation method and operating system
Technical field
The present embodiments relate to field of software development, more particularly to a kind of system operation method and operating system.
Background technology
With the fast development of Internet technology and the communication technology, operating system is general rapidly from pc domain And to field of mobile terminals.In terms of operating system, (opened with microsoft operation system, Android operation system and IOS by Apple Inc. Hair a operating system) operating system be main flow, many other operating systems be tributary, software market is covered rapidly.But It is, the problem of operating system itself has more or less.By taking IOS systems widely loved by consumers as an example, its own there is also Some defects, can have a strong impact on Consumer's Experience.For example, factor causes inside or outside the IOS system programs Chang Yin of existing version Collapse (crash) occurs for running software.
Prior art has attempted to find the reason for operating system is collapsed, still, but gives without good method Improve.
The content of the invention
The embodiment of the present invention provides a kind of system operation method and operating system, unstable to solve existing operating system The problem of.
In a first aspect, a kind of system operation method is provided in the embodiment of the present invention, including:
The release for preventing object is operated by hook;
Judge whether the object can switch to corpse object according to configuration information;
In the case where being judged as YES, the object is switched into the corpse object and the corpse object is added to deadlock Corpse object pool.
It is described that the object is switched into institute with reference in a first aspect, in the first implementation of first aspect present invention Corpse object is stated, including:
Discharge the affiliated partner and attribute of the object;
It is sensing corpse class object by the isa pointer modifieds of the object.
With reference to the first implementation of first aspect or first aspect, in second of realization side of first aspect present invention In formula, in addition to:
Record the object and switch to class name before the corpse object;
By the class name of the object and the corpse object binding.
With reference in a first aspect, in the third implementation of first aspect present invention, methods described also includes:
The second stage forwarded in message creates temporary object, and the temporary object has the empty real that return type is id It is existing, for receiving the method that cannot respond to.
With reference in a first aspect, in the 4th kind of implementation of first aspect present invention, methods described also includes:
Empty and subscript out of bounds is returned in response to the empty object (nil objects) inserted in container class;Or
It is determined that using the object in the subscript reading acquisition container class that crosses the border in the case of subscript out of bounds.
With reference in a first aspect, in the 5th kind of implementation of first aspect present invention, methods described also includes:
Agent object is observed for the observed Object Creation key assignments in key assignments observing pattern, the key assignments observes agent object For:
Mapping table is checked in response to the notice received to determine whether there is observer (observer);
The observer is notified when there is observer.
It is described in the 6th kind of implementation of first aspect present invention with reference to the 5th kind of implementation of first aspect Method also includes:After the observed object is released, observed object the reflecting in the mapping table is removed Penetrate relation.For example, realizing the management to the mapping table using NShashMap containers.
With reference in a first aspect, in the 7th kind of implementation of first aspect present invention, methods described also includes:
Create agent object, and set up timer strongly reference agent object, agent object it is strong/weak reference timer and generation Manage the adduction relationship of object weak reference destination object (target).
With reference to the 7th kind of implementation of first aspect, in the 8th kind of implementation of first aspect present invention, use The timer event of readjustment is transmitted to the destination object by the agent object.
Second aspect, the embodiments of the invention provide a kind of operating system, the operating system uses above-mentioned first aspect Or the operation method operation of its various implementation.
The third aspect, the embodiment of the present invention provides a kind of device end for the operating system for being provided with above-mentioned second aspect.
Fourth aspect, the embodiment of the present invention provides a kind of computer-readable storage medium, and the computer-readable storage medium is stored with One or more computer instruction, realizes following handle when one or more computer instruction is performed:
The release for preventing object is operated by hook;
Judge whether the object can switch to corpse object according to configuration information;
In the case where being judged as YES, the object is switched into the corpse object and the corpse object is added to deadlock Corpse object pool.
With reference to fourth aspect, in the first implementation of fourth aspect present invention, the instruction is realized when being performed Processing by the object so that switch to the corpse object below:
Discharge the affiliated partner and attribute of the object;
It is sensing corpse class object by the isa pointer modifieds of the object.
With reference to the first implementation of fourth aspect or fourth aspect, in second of realization side of fourth aspect present invention In formula, the instruction is performed to realize following processing:
Record the object and switch to class name before the corpse object;
By the class name of the object and the corpse object binding.
With reference to fourth aspect, in the 4th kind of implementation of fourth aspect present invention, the instruction is performed to realize Handle below:
The second stage forwarded in message creates temporary object, and the temporary object has the empty real that return type is id It is existing, for receiving the method that cannot respond to.
With reference to fourth aspect, in the 4th kind of implementation of fourth aspect present invention, the instruction is performed to realize Handle below:
Sky is returned in response to the empty object inserted in container class;Or
It is determined that using the object in the subscript reading acquisition container class that crosses the border in the case of subscript out of bounds.
With reference to fourth aspect, in the 5th kind of implementation of fourth aspect present invention, the instruction is performed to realize Handle below:
Agent object is observed for the observed Object Creation key assignments in key assignments observing pattern, the key assignments observes agent object For:
Check mapping table to determine whether there is observer in response to the notice received;
The observer is notified when there is observer.
In the 5th kind of implementation with reference to fourth aspect, in the 6th kind of implementation of fourth aspect present invention, institute Instruction is stated to be performed to realize following processing:After the observed object is released, the observed object is removed described Mapping relations in mapping table.For example, realizing the management to the mapping table using NShashMap containers.
With reference to fourth aspect, in the 7th kind of implementation of fourth aspect present invention, the instruction is performed to realize Handle below:
Create agent object, and set up timer strongly reference agent object, agent object it is strong/weak reference timer and generation Manage the adduction relationship of object weak reference destination object.
With reference to fourth aspect, in the 8th kind of implementation of fourth aspect present invention, the instruction is performed to realize Handle below:
Create the agent object for the timer event of readjustment to be transmitted to the destination object.
Various embodiments of the invention can improve the stability of operating system, reduce the generation of program crashing phenomenon.
The aspects of the invention or other aspects can more straightforwards in the following description.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is the accompanying drawing used required in technology description to be briefly described, it should be apparent that, drawings in the following description are this hairs Some bright embodiments, for those of ordinary skill in the art, on the premise of not paying creative work, can be with root Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 shows the schematic flow sheet of system operation method according to an embodiment of the invention;
Fig. 2 shows the schematic flow sheet of system operation method in accordance with another embodiment of the present invention;
Fig. 3 shows the schematic flow sheet of the system operation method according to another embodiment of the invention;
Fig. 4 shows the schematic diagram of key assignments observing pattern according to an embodiment of the invention;
Fig. 5 shows that improved kvo according to an embodiment of the invention (see by Key-Value Observing, key assignments Examine) flow chart;
Fig. 6 shows a kind of adduction relationship figure related to agent object according to embodiments of the present invention.
Embodiment
In order that those skilled in the art more fully understand the present invention program, below in conjunction with the embodiment of the present invention Accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described.
In some flows of description in description and claims of this specification and above-mentioned accompanying drawing, contain according to Particular order occur multiple operations, but it should be clearly understood that these operation can not herein occur according to it is suitable Sequence is performed or performed parallel, and the sequence number such as 101,102 etc. of operation is only used for distinguishing each different operation, sequence number Any execution sequence is not represented for itself.In addition, these flows can include more or less operations, and these operations can To perform or perform parallel in order.It should be noted that the description such as " first ", " second " herein, is to be used to distinguish not Same message, equipment, module etc., does not represent sequencing, it is different types also not limit " first " and " second ".
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.It is based on Embodiment in the present invention, the every other implementation that those skilled in the art are obtained under the premise of creative work is not made Example, belongs to the scope of protection of the invention.
First, to the present invention relates to or the term/title that may relate to explain.These explanations are intended to simple language Speech is understood by the present invention, and the protection domain being not intended to limit the invention.
Collapse (Crash):Program causes operation to be collapsed because of internal or external factor, for example, a kind of performance of collapse For splashette.
Runtime:When program is run, the Runtime in OC (Objective-C language) refers mainly to dynamically change during operation The ability of object, method.
KVO:It is a kind of Observer Pattern of apple design, the observer is mainly reflected in utilization not in general mode Runtime Technique dynamics change object, the attribute setting for changing object and acquisition methods.
Timer:Timer/timer, the software abstract layer based on bottom clock hardware, for calculating time, Ke Yifang Readjustment time and readjustment number of times are just set.
addTarget:Relate generally to the destination object in the target-action design patterns in apple design (target), the target-action designs pattern mainly makes message response and message dispatch loose coupling using dependence injection.
BadAccess:The wild pointer exception error type of apple, is referred to have accessed one piece of internal memory being released Location.
Proxy:Agent object is referred to, the task of object in itself is transferred to proxy using agent object and done by the present invention.
Method swizzling:A kind of technology based on Runtime, Chinese entitled method allotment, oneself defines one Method, which is realized, to be interchangeable with the realization of any method.
Hook:Hook, refers to and carries out lower hook to some method, during method call in being hooked can to lower hook one, place it is logical Know, Method swizzling are commonly used in OC and carry out hook operations.
Associated object:Affiliated partner, is mainly used between object.
Tracker:Affiliated partner is commonly used in follower, OC and realizes that follower and associated person have identical Life Cycle Phase, it can be used for eavesdropping target's release.
Isa pointers:Design of the apple to OC, each object has an isa pointer to point to its class object, class object Isa then points to metaclass.So design be convenient for method search call.
retainCount:OC carries out memory management using reference count mode, and retain methods are exactly to make object reference meter + 1, release of number is exactly -1.Release objects internal memory is called to be released again when the reference count of object is 1. RetainCount is used to check the current reference count of object.
observer:Correspondence kvo, is the observer of object.
zombie:The corpse object technology that IOS is used.
Runloop:Each thread of apple has a runloop, a runloop to can be understood as an endless loop While (1) { }, this be also why app program start after will not directly exit.Timer can timing at this Adjusted back in circulation.
Message call:Similar approach is called, and simply possesses more powerful function with reference to IOS characteristics.
Container class:Program language is packaged the class for depositing other objects to data structure.
Fig. 1 is a kind of schematic flow sheet of system operation method according to embodiments of the present invention.Exemplarily, the system Operation method is based on IOS systems and realized.Reference picture 1, methods described includes:
100:The release for preventing object is operated by hook.For example, hooking dealloc (releasing memory) using hook operations Method.
102:Judge whether the object can switch to corpse object according to configuration information, if the judgment is Yes, then perform 104。
Alternatively, in a kind of implementation of the present embodiment, configuration pin is determined prefix and class name in configuration information Inhibition and generation, so as to judge whether existing object is the object that configures in configuration information according to configuration information.In other words, can be in configuration It is self-defined for the object and Rule of judgment progress that can be converted into corpse object in information.
Alternatively, in a kind of implementation of the present embodiment, if it is determined that object cannot switch to corpse object, then release Be rivals in a contest as.
104:The object is switched into the corpse object and the corpse object is added to corpse object pool.
The method provided using the present embodiment, by preventing object releasing memory and being revised as corpse object so that The external reference of existing object can also point to the object and can also receive message when sending message, can solve the problem that because to open country The problem of pointer sends message and causes program crashing.
Alternatively, in a kind of implementation of the present embodiment, in processing 104, object is switched in the following ways Corpse object:The affiliated partner and attribute of releasing object;It is sensing corpse class object by the isa pointer modifieds of object.
Alternatively, in a kind of implementation of the present embodiment, following handle also is carried out:Record the object switch to it is described Class name (className) before corpse object;By the class name of the object and the corpse object binding.Using the realization side Formula, is conducive to producing daily record (log) after message is received, and then be easy to the orientation problem when occurring problem.
Fig. 2 is a kind of schematic flow sheet of system operation method according to embodiments of the present invention.Exemplarily, the system Operation method is based on IOS systems and realized.Reference picture 2, methods described includes:
200:Hook dealloc methods.
202:Judge whether object can switch to corpse object.For example, determining whether object is configuration according to configuration information The object configured in information, if it is, corpse object can be switched to.
204:In the case where object cannot switch to corpse object, releasing memory.
206:In the case where object can switch to corpse object, the class name of existing object is recorded, and continues subsequent treatment.
208:Discharge all affiliated partners and attribute of existing object.For example, calling objc_destructInstance side Method realizes processing 208.
For example, in a kind of implementation of the present embodiment, it can be discharged using processing 208 and be loaded with 100MB (million Byte) object all the elements, then carry out subsequent treatment.
210:Isa pointers are changed to point to corpse class object.In addition, also by affiliated partner by before object corpse Class name is tied to the corpse object.
In the present embodiment, due to change isa mode will not change the member variable of object, so, can avoid because Cause the memory range beyond object application using non-existent attribute and then trigger the problem of collapsing.
212:Corpse object is added to corpse object pool.Now, the retainCount of corpse object is 1, only corpse pair As the corpse object is held in pond.
The method provided using the present embodiment, exemplified by applied to IOS, can solve the problem that IOS because The problem of message is sent to wild pointer and causes program crashing.
Fig. 3 is a kind of schematic flow sheet of system operation method according to embodiments of the present invention.Exemplarily, the system Operation method is based on IOS systems and realized.Reference picture 3, methods described includes following processing procedure:
When object discharges, dealloc methods are hooked.Judge whether existing object can switch to corpse object.Current In the case that object cannot switch to the corpse object, the existing object is discharged.It can switch to corpse object in existing object In the case of, record the class name of existing object;The isa pointers of existing object are changed to point to corpse class object;By obtained institute State corpse object and be added to corpse object pool;Release external reference makes corpse object pool turn into uniquely drawing for the corpse object With;Judge whether to reach corpse object pool threshold value, and old object is eliminated (for example, use is at least used in the recent period when reaching threshold value Algorithm LRU (Least Recently Used) eliminates old object);For response message, it is interim that establishment is associated with corpse object Object response message and log.
In a kind of system operation method according to embodiments of the present invention, by taking IOS systems as an example, second forwarded in message Stage creates temporary object, and there is the temporary object empty real that return type is id to show, for receiving the method that cannot respond to.
The message forwarding mechanism of IOS systems is included several stages.In this implementation, hook is carried out based on second stage Operation, hooks the forwardingTargetForSelector methods in NSObject.Why not to the first stage ResolveInstanceMethod processing, is that dynamic is added because of the method list that can not so change original class Method.When triggering message forwarding, a temporary object is created, the empty real that the object has an id return type shows, Ren Hewu The method of method response is all forwarded to this method of the object.Exemplarily, empty object is defined as follows:
During existing message call, when plain objects receive the message of None- identified, IOS systems can directly make Program crashing.And use this implementation, then it can solve the problem that and collapsed because object is not implemented caused by method but receives message Problem.
In a kind of system operation method according to embodiments of the present invention, exemplified by applied to IOS systems, in response to container The nil objects that are inserted in class and return to sky, or, judge whether subscript out of bounds in the object in obtaining container class, if subscript Cross the border, the object in container class is obtained using subscript of crossing the border.
In a kind of implementation of the present embodiment, more specifically, it is possible to use runtime method Swizzling uses the realization of the method replacement system of its realization, it is to avoid directly invoke system API (Application Programming Interface, application programming interfaces) cause collapse.Wherein, the processing related to array is relatively complicated, Because objectAtIndex can exist in all array types, in the specific implementation, needing to all Array Type carries out hook operations, then, by replacement operation, and correlation technique is revised as directly to return when inserting object and there is nil Make the return trip empty, so as to avoid collapse phenomenon.
Wherein, exemplarily, institute hook privately owned subclass is as shown in the table:
Wherein, exemplarily, the correlation technique for being replaced operation is as follows:
In a kind of system operation method of the embodiment of the present invention, exemplified by applied to IOS systems, in kvo patterns, it is Observed Object Creation key assignments observation agent object (also referred to as kvo agent objects) in key assignments observing pattern, the kvo agencies Object is used for:Mapping table is checked in response to the notice received to determine whether there is observer, and there is observation The observer is notified during person.
Wherein, the kvo agent objects are as unique observer of observed object, and meeting is according to whether addition observer's category Property expand the attribute of oneself observation, unique observer saves the mapping of key (key) and the object of observation array of its observation Table.
More specifically, in a kind of specific implementation of the present embodiment, as shown in figure 4, holding mapping for Object Creation The kvo agent objects of relation table, meanwhile, the kvo agent objects are object unique observers, and other observers are actually A reference is held by kvo agent objects.When kvo agent objects are notified, mapping table can be checked to determine whether There is observer.If there is observer, the observer is noted that.Because mapping structure needs to preserve weak reference, so, this reality Existing mode selects the NSHashMap containers that Foundation is provided, and it can not only deposit weak reference, can also be in weak reference pair As being removed from container from by it automatically after being released.
Using above-mentioned implementation, it can avoid causing null pointer abnormal the object transmission message discharged.
Existing IOS systems do not carry out good optimization processing, but use very sudden and violent when realizing kvo to abnormal The mode of power directly allows its crash.And use the present embodiment, then it can effectively solve the problem that kvo in observer releases, observed person Release repeatedly removes crash issue caused by (remove) observer.
Fig. 5 is a kind of improved kvo according to embodiments of the present invention flow chart, reference picture 5, flow generally comprise with Lower processing procedure:
First, kvo is added.
Afterwards, judge whether observed person binds tracker.If not binding tracker, generation tracker is closed Join object and create mapping structure for tracker, then proceed to the first subsequent treatment.If having bound tracker, directly Carry out the first subsequent treatment.In first subsequent treatment, judge whether tracker has observed corresponding keypath (key roads Footpath, the key assignments encoding mechanism of apple, the attribute of each object has only one path representation), if not observing described Keypath, then observation and continuation second subsequent treatment of the tracker additions to the keypath;If it is observed that described Keypath, then add the object of observation, and carry out the second subsequent treatment in the mapping table.
In the second subsequent treatment, after observed person's notice is received, corresponding key (observations in tracker mapping tables are judged The attribute that persons observe) under observer whether all discharged, and remove in the case where being judged as YES the sight to the key Examine, in the case where being judged as NO, notify all observation key object.
In the second subsequent treatment, in life cycle change, there is situations below:
Observed person discharges (that is, releasing observed person), now, removes tracker and empties all observers;
The object of observation removes (that is, having overflowed the object of observation), now, if tracker has the sight under corresponding keypath The person of examining, then remove the observer under the key.
Using the present embodiment, kvo is can solve the problem that in observer releases, observed person's release or repeatedly removal observer leads The crash issue of cause.
It is according to embodiments of the present invention it is a kind of be that observed Object Creation key assignments in key assignments observing pattern observes agency In object, by creating agent object, and set up timer strongly reference agent object, agent object it is strong/weak reference timer and The adduction relationship of agent object weak reference destination object (target), so that solving existing timer strongly reference destination object causes Cause the problem of destination object can not normally discharge and then cause collapse under maloperation.
Specifically, the adduction relationship figure shown in reference picture 6.Wherein, by introducing agent object so that During addTarget, what is be really added is agent object.Now the adduction relationship of object is:Runloop strongly references timer, Timer strongly reference agent object, agent object be strong/weak reference timer (it is strongly reference or weak reference that it doesn't matter here, because Even being strongly reference, as described below, rear extended meeting releases circulation), agent object weak reference destination object.
When there is timer event to adjust back to agent object, destination object is transmitted to by agent object.Should be noted one Point is whether to need to judge agent object before forwarding for nil, if nil, just by timer invalid (failure) simultaneously Be set to nil (so, also just relieve the problem of agent object is to timer strongly reference, that is, previously described that it doesn't matter is strong Quote or weak reference), now, timer will releasing memory, agent object also just and then releasing memory.
In existing IOS systems, timer strongly reference destination object so, is easily caused in the case where operation is wrong Destination object can not normally discharge and then cause collapse.And the embodiment is used, by creating the agent object, it can avoid Operate it is wrong in the case of caused by destination object can not normally discharge crash issue.
The embodiment and its implementation to the system according to the present invention operation method are described in detail above.This hair Bright also to provide a kind of operating system, the operating system uses operation method as previously described.For example, the operating system is based on IOS systems simultaneously use operation method as previously described.In addition, the present invention also provides a kind of equipment end for installing the operating system End.
System operation method provided by the present invention, can be realized with computer instruction provided by the present invention.Specifically, The embodiment of the present invention also provides a kind of computer-readable storage medium, for storing the computer instruction.The computer instruction quilt Aforementioned system operation method is realized during execution.
Through the above description of the embodiments, those skilled in the art can be understood that each embodiment can The mode of required general hardware platform is added to realize by software or by software.Understood based on such, above-mentioned technical side The part that case substantially contributes to prior art in other words can be embodied in the form of software product, and the computer is soft Part product can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disc, CD, including some instructions are to make Obtain a computer equipment (can be personal computer, server, or network equipment etc.) and perform each embodiment or reality Apply the method described in some parts of example.
Finally it should be noted that:The above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although The present invention is described in detail with reference to the foregoing embodiments, it will be understood by those within the art that:It still may be used To be modified to the technical scheme described in foregoing embodiments, or equivalent substitution is carried out to which part technical characteristic; And these modification or replace, do not make appropriate technical solution essence depart from various embodiments of the present invention technical scheme spirit and Scope.
The present invention discloses A1, a kind of system operation method, including:
The release for preventing object is operated by hook;
Judge whether the object can switch to corpse object according to configuration information;
In the case where being judged as YES, the object is switched into the corpse object and the corpse object is added to deadlock Corpse object pool.
It is described that the object is switched into the corpse object in A2, the method as described in A1, including:
Discharge the affiliated partner and attribute of the object;
It is sensing corpse class object by the isa pointer modifieds of the object.
In A3, the method as described in A1 or A2, methods described also includes:
Record the object and switch to class name before the corpse object;
By the class name of the object and the corpse object binding.
In A4, the method as described in A1, methods described also includes:
The second stage forwarded in message creates temporary object, and the temporary object has the empty real that return type is id It is existing, for receiving the method that cannot respond to.
In A5, the method as described in A1, methods described also includes:
Sky is returned in response to the empty object inserted in container class;Or
It is determined that using the object in the subscript reading acquisition container class that crosses the border in the case of subscript out of bounds.
In A6, the method as described in A1, methods described also includes:
Agent object is observed for the observed Object Creation key assignments in key assignments observing pattern, the key assignments observes agent object For:
Check mapping table to determine whether there is observer in response to the notice received;
The observer is notified when there is observer.
In A7, the method as described in A6, after the observed object is released, the observed object is removed described Mapping relations in mapping table.
In A8, the method as described in A1, in addition to:
Create agent object, and set up agent object described in timer strongly reference, the agent object it is strong/weak reference timing The adduction relationship of device and the agent object weak reference destination object.
In A9, the method as described in A8, in addition to:
The timer event of readjustment is transmitted to by the destination object using the agent object.
Invention additionally discloses B10, a kind of system operation method using as any one of A1-A9 operating system.
Invention additionally discloses C11, a kind of terminal device, the installing terminal equipment is just like the operating system described in B10.
Invention additionally discloses D12, a kind of computer-readable storage medium, the computer-readable storage medium is stored with one or more Computer instruction, realizes the method as any one of foregoing A1-A9 when the instruction is performed.

Claims (10)

1. a kind of system operation method, it is characterised in that including:
The release for preventing object is operated by hook;
Judge whether the object can switch to corpse object according to configuration information;
In the case where being judged as YES, the object is switched into the corpse object and the corpse object is added to corpse pair As pond.
2. according to the method described in claim 1, it is characterised in that methods described also includes:
Record the object and switch to class name before the corpse object;
By the class name of the object and the corpse object binding.
3. according to the method described in claim 1, it is characterised in that methods described also includes:
The second stage forwarded in message creates temporary object, and there is the empty real that return type is id to show, use for the temporary object The method that cannot respond in reception.
4. according to the method described in claim 1, it is characterised in that methods described also includes:
Sky is returned in response to the empty object inserted in container class;Or
It is determined that using the object in the subscript reading acquisition container class that crosses the border in the case of subscript out of bounds.
5. the method as described in claim 1, it is characterised in that methods described also includes:
Agent object is observed for the observed Object Creation key assignments in key assignments observing pattern, the key assignments observation agent object is used In:
Check mapping table to determine whether there is observer in response to the notice received;
The observer is notified when there is observer.
6. method as claimed in claim 5, it is characterised in that methods described also includes:
After the observed object is released, mapping relations of the observed object in the mapping table are removed.
7. the method as described in claim 1, it is characterised in that methods described also includes:
Create agent object, and set up agent object described in timer strongly reference, the agent object it is strong/weak reference timer, And the adduction relationship of the agent object weak reference destination object.
8. method as claimed in claim 7, it is characterised in that
The timer event of readjustment is transmitted to by the destination object using the agent object.
9. a kind of operating system of system operation method using as any one of claim 1-8.
10. a kind of terminal device for installing operating system as claimed in claim 9.
CN201710449947.4A 2017-06-14 2017-06-14 System operation method and operating system Pending CN107301095A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710449947.4A CN107301095A (en) 2017-06-14 2017-06-14 System operation method and operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710449947.4A CN107301095A (en) 2017-06-14 2017-06-14 System operation method and operating system

Publications (1)

Publication Number Publication Date
CN107301095A true CN107301095A (en) 2017-10-27

Family

ID=60135765

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710449947.4A Pending CN107301095A (en) 2017-06-14 2017-06-14 System operation method and operating system

Country Status (1)

Country Link
CN (1) CN107301095A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108052407A (en) * 2017-12-13 2018-05-18 深圳乐信软件技术有限公司 A kind of application crash means of defence, device, equipment and storage medium
CN108469993A (en) * 2018-04-04 2018-08-31 武汉斗鱼网络科技有限公司 Message forwarding method, computer readable storage medium and electronic equipment
CN109992482A (en) * 2019-04-11 2019-07-09 广州华多网络科技有限公司 Observe the destructed method, apparatus of middleware, computer equipment and storage medium
CN111522645A (en) * 2020-04-29 2020-08-11 北京字节跳动网络技术有限公司 Object processing method and device, electronic equipment and computer-readable storage medium
CN111694676A (en) * 2020-04-30 2020-09-22 北京奇艺世纪科技有限公司 Processing method and device for key value observation mode
CN112052054A (en) * 2020-09-02 2020-12-08 北京奇艺世纪科技有限公司 Function calling method and device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150370553A1 (en) * 2014-06-24 2015-12-24 International Business Machines Corporation Wrapping computer software applications
CN106557300A (en) * 2015-09-24 2017-04-05 腾讯科技(深圳)有限公司 A kind of function stack information of wild pointer determines method, device and electronic equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150370553A1 (en) * 2014-06-24 2015-12-24 International Business Machines Corporation Wrapping computer software applications
CN106557300A (en) * 2015-09-24 2017-04-05 腾讯科技(深圳)有限公司 A kind of function stack information of wild pointer determines method, device and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JINGXIANLI0922: "好想法---抓取 crash,我们要在crash产生的时候直接自动修复它!", 《HTTPS://BLOG.CSDN.NET/JASONJWL/ARTICLE/DETAILS/54016750》 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108052407A (en) * 2017-12-13 2018-05-18 深圳乐信软件技术有限公司 A kind of application crash means of defence, device, equipment and storage medium
CN108469993A (en) * 2018-04-04 2018-08-31 武汉斗鱼网络科技有限公司 Message forwarding method, computer readable storage medium and electronic equipment
CN109992482A (en) * 2019-04-11 2019-07-09 广州华多网络科技有限公司 Observe the destructed method, apparatus of middleware, computer equipment and storage medium
CN109992482B (en) * 2019-04-11 2023-10-31 广州方硅信息技术有限公司 Method, device, computer equipment and storage medium for observing middleware destructor
CN111522645A (en) * 2020-04-29 2020-08-11 北京字节跳动网络技术有限公司 Object processing method and device, electronic equipment and computer-readable storage medium
CN111522645B (en) * 2020-04-29 2023-09-12 抖音视界有限公司 Object processing method and device, electronic equipment and computer readable storage medium
CN111694676A (en) * 2020-04-30 2020-09-22 北京奇艺世纪科技有限公司 Processing method and device for key value observation mode
CN111694676B (en) * 2020-04-30 2024-03-05 北京奇艺世纪科技有限公司 Processing method and device for key value observation mode
CN112052054A (en) * 2020-09-02 2020-12-08 北京奇艺世纪科技有限公司 Function calling method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107301095A (en) System operation method and operating system
CN107562513B (en) Intelligent contract life cycle management method based on JAVA
Parrington et al. The design and implementation of Arjuna
Miller et al. Concurrency among strangers: Programming in E as plan coordination
CN110392052A (en) A kind of block chain intelligence contract processing system and method
CN107105061A (en) A kind of service registry method and device
WO1999050743A1 (en) Process and system related to software platforms
Mei et al. PKUAS: An architecture-based reflective component operating platform
CN109213462B (en) Android horizontal and vertical screen data synchronization method and device, terminal and readable medium
CN106296135A (en) Event-prompting method, device and terminal
CN104408073B (en) Data manipulation method and device
CN108446149A (en) A kind of third party's dynamic bank interface hold-up interception method and system
CN110244990A (en) Application component call method, device, electronic equipment and storage medium
CN108229107A (en) A kind of hulling method and container of Android platform application program
CN113722754B (en) Method, device and server for generating privacy executable file
van Glabbeek et al. On characterising distributability
CN109977093A (en) More virtual systems based on LXC check the method and device of container log
CN109343983A (en) Information interacting method, device, equipment and storage medium between functional module
CN106897610A (en) A kind of method and apparatus for positioning protection
CN111126977A (en) Transaction processing method of block chain system
CN108875381A (en) A kind of design scheme for the messaging service module for supporting kernel module to be isolated
CN106293679B (en) A kind of element term conflict processing method and device
CN107145390A (en) Android service lifecycle management method, service management object and Android system
Clark et al. Multi-threading and message communication in Qu-Prolog
Gomes et al. Architecting dynamic reconfiguration in dependable systems

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: 20171027

RJ01 Rejection of invention patent application after publication