CN108710534A - The tune of multi-process plays method, apparatus, terminal device and computer storage media - Google Patents

The tune of multi-process plays method, apparatus, terminal device and computer storage media Download PDF

Info

Publication number
CN108710534A
CN108710534A CN201810494582.1A CN201810494582A CN108710534A CN 108710534 A CN108710534 A CN 108710534A CN 201810494582 A CN201810494582 A CN 201810494582A CN 108710534 A CN108710534 A CN 108710534A
Authority
CN
China
Prior art keywords
service
primary api
android system
api
disconnected event
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
CN201810494582.1A
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.)
Alibaba China Co Ltd
Original Assignee
Guangzhou Youshi Network 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 Guangzhou Youshi Network Technology Co Ltd filed Critical Guangzhou Youshi Network Technology Co Ltd
Priority to CN201810494582.1A priority Critical patent/CN108710534A/en
Publication of CN108710534A publication Critical patent/CN108710534A/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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • 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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues

Abstract

The present invention relates to Internet technical fields, method, apparatus, terminal device and computer storage media are played more particularly to a kind of tune of multi-process, the primary API of Android system setting includes the first primary API and the second primary API, multiple application programs are installed on the Android system, each application program corresponds to multiple processes, and multiple services are run in each process.This method includes:First service monitors the connection disconnected event for the second service that binding relationship is established with first service, first service and second service are located at the different processes of same application, when the connection disconnected event of second service is triggered, first service calls the first primary API to start second service, and Android system has adjusted the process where second service by according to the correspondence for the service and process stated in advance.In the present solution, the mutual binding between service, the process where a side services is killed by force, another party's service can quick response, to guarantee the process where the service that fast velocity modulation is killed by force.

Description

The tune of multi-process plays method, apparatus, terminal device and computer storage media
Technical field
The present invention relates to Internet technical fields, and method, apparatus, terminal are played in particular to a kind of tune of multi-process Equipment and computer storage media.
Background technology
When mobile phone or other electronic equipment memories very in short supply, system by the application installed on strong killer's machine into Journey, and limit the process and be again started up, so as to cause the serv-fail run in process.Therefore keep-alive is carried out to process very must It wants, the experience sense of user can be greatlyd improve.Mainly there are three classes to the mode of process keep-alive at present, respectively:Raising process is excellent First grade allows system to kill the low process of priority as far as possible, but when Installed System Memory is more and more in short supply, can take turns to always preferential The high process of grade;Or Accreditation System timer or system account synchronizer, allow timing tune to play corresponding process, but this do It is primary that method needs a period of time that could adjust, and does not have real-time, and be applicable in for part system;Or allow other processes using wheel The mode of inquiry monitors corresponding process, when finding that there are tune when process death to rise, but this way need to not stop to check it is corresponding into Whether journey is dead, wastes system resource.It is very necessary to provide a kind of method that can have efficiently adjusted process as a result,.
Invention content
The purpose of the present invention is to provide a kind of tune of multi-process to play method, so that process can be fast after being killed by force by system Speed has been adjusted startup to service, and then promotes user experience.
Another object of the present invention is to provide a kind of tune lifting devices of multi-process, so that process by system after being killed by force Startup can have been adjusted to service rapidly, and then promoted user experience.
Another object of the present invention is to provide a kind of terminal devices, so that process can be promptly after being killed by force by system It has been adjusted startup to service, and then has promoted user experience.
Another object of the present invention is to provide a kind of computer storage medias, so that process energy after being killed by force by system It has promptly been adjusted startup to service, and then has promoted user experience.
To achieve the goals above, technical solution used in the embodiment of the present invention is as follows:
In a first aspect, an embodiment of the present invention provides a kind of tune of multi-process to play method, it is applied to Android system, the peace The primary API of tall and erect system setting includes the first primary API and the second primary API, and multiple applications are equipped on the Android system Program, each application program correspond to multiple processes, multiple services are run in each process, the method includes:First service is supervised The connection disconnected event for the second service for establishing binding relationship with first service, the first service and second service is listened to be located at same The different processes of one application program;When the connection disconnected event of the second service is triggered, the first service calls institute It states the first primary API and starts the second service, and the Android system will be corresponding with process according to the service stated in advance Relationship has adjusted the process where the second service.
Second aspect, the embodiment of the present invention additionally provide a kind of tune lifting device of multi-process, are applied to Android system, described The primary API of Android system setting includes the first primary API and the second primary API, and multiple answer is equipped on the Android system With program, each application program corresponds to multiple processes, multiple services is run in each process, and described device includes:First monitors Module, for first service monitor with first service establish binding relationship second service connection disconnected event, described first Service and second service are located at the different processes of same application;First calling module, for the company when the second service When connecing disconnected event and being triggered, the first service calls the described first primary API to start the second service, and the Android System has adjusted the process where the second service by according to the correspondence for the service and process stated in advance.
The third aspect, the embodiment of the present invention additionally provide a kind of terminal device, Android system are equipped on the terminal device System, the terminal device include memory and processor, and the memory is for storing computer program code, the processor For executing the computer program code being stored in the memory, to realize that the tune of the multi-process plays method.
Fourth aspect, the embodiment of the present invention additionally provide a kind of computer storage media, are stored thereon with computer program, Realize that the tune of the multi-process plays method when the computer program is executed by processor.
A kind of tune of multi-process provided in an embodiment of the present invention plays method, apparatus, terminal device and computer storage media, The tune of the multi-process plays method and is applied to Android system, and the primary API of Android system setting includes the first primary API and second Primary API is equipped with multiple application programs on the Android system, and each application program corresponds to multiple processes, transported in each process The multiple services of row.This method includes:The connection that first service monitors the second service for establishing binding relationship with first service disconnects Event, first service and second service are located at the different processes of same application, when the connection disconnected event of second service is triggered When, first service calls the first primary API to start second service, and Android system will be according to the service and process stated in advance Correspondence has adjusted the process where second service.
It can be seen that in the present solution, by different processes first service and second service establish binding relationship, with realize The mutual supervision of first service and second service, if the connection disconnected event of one of service is triggered, another service The service will be restarted and adjusted the process where it, to realize the keep-alive of process.Due to being the mutual binding between service And supervision so that once a side service where process killed by force, another party's service can quick response, to guarantee fast velocity modulation The process where the service killed by force is played, user experience is improved.
To enable the above objects, features and advantages of the present invention to be clearer and more comprehensible, preferred embodiment cited below particularly, and coordinate Appended attached drawing, is described in detail below.
Description of the drawings
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below will be to needed in the embodiment attached Figure is briefly described, it should be understood that the following drawings illustrates only certain embodiments of the present invention, therefore is not construed as pair The restriction of range for those of ordinary skill in the art without creative efforts, can also be according to this A little attached drawings obtain other relevant attached drawings.
Fig. 1 shows a kind of structural schematic diagram of terminal device provided in an embodiment of the present invention.
Fig. 2 shows a kind of flow diagrams for having adjusted method of multi-process provided in an embodiment of the present invention.
Fig. 3 shows the flow diagram for having adjusted method of another multi-process provided in an embodiment of the present invention.
Fig. 4 shows a kind of high-level schematic functional block diagram of the tune lifting device of multi-process provided in an embodiment of the present invention.
Diagram:100- terminal devices;The tune lifting device of 110- multi-process;120- memories;130- storage controls;140- Processor;150- Peripheral Interfaces;160- input-output units;170- audio units;180- display units;111- trigger modules; The first starting modules of 112-;The second starting modules of 113-;114- first monitors module;The first calling modules of 115-;116- first Binding module;117- second monitors module;The second calling modules of 118-;The second binding modules of 119-.
Specific implementation mode
Below in conjunction with attached drawing in the embodiment of the present invention, technical solution in the embodiment of the present invention carries out clear, complete Ground describes, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Usually exist The component of the embodiment of the present invention described and illustrated in attached drawing can be arranged and be designed with a variety of different configurations herein.Cause This, the detailed description of the embodiment of the present invention to providing in the accompanying drawings is not intended to limit claimed invention below Range, but it is merely representative of the selected embodiment of the present invention.Based on the embodiment of the present invention, those skilled in the art are not doing The every other embodiment obtained under the premise of going out creative work, shall fall within the protection scope of the present invention.
It should be noted that:Similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi It is defined, then it further need not be defined and explained in subsequent attached drawing in a attached drawing.Meanwhile the present invention's In description, term " first ", " second " etc. are only used for distinguishing description, are not understood to indicate or imply relative importance.
A kind of tune of multi-process provided in an embodiment of the present invention plays method and is applied in Android system, leads in the Android system Multiple application programs are often installed, when each application program runs offer service, the process that is required to is application providing system Resource so that application program can normal operation provide related service to the user.But in actual use, if electronics is set Standby, such as mobile phone, opening many applications with the period will cause mobile phone EMS memory insufficient, so cell phone system in order to guarantee section it is important Process can trouble-free operation, relatively unessential process will be killed by force, such as the downloading process on backstage.Due to the downloading process on backstage Compared to the process for interface display, priority and significance level are lower, therefore in the case of limited system resources, it will Preferentially killed by force.Since process is by after strong kill, system will limit the process again by self-starting, therefore be brought to user bad User experience.The embodiment of the present invention provides a kind of tune of multi-process method as a result, by mutually tying up the service of each process It is fixed, with the mutual supervision between realization process, the process killed by force by system has been adjusted with timely, has restored service in time, and then improve The experience sense of user.
A kind of tune of multi-process provided in an embodiment of the present invention plays method and is applied to terminal device, is installed on the terminal device There is Android system, then readily comprehensible, which may be, but not limited to, the smart electronics such as tablet computer, smart mobile phone Equipment.Fig. 1 is please referred to, is a kind of structural schematic diagram of terminal device 100 provided in an embodiment of the present invention, the terminal device 100 Tune lifting device 110, memory 120, storage control 130, processor 140, Peripheral Interface 150, input including multi-process are defeated Go out unit 160, audio unit 170 and display unit 180.
The memory 120, storage control 130, processor 140, Peripheral Interface 150, input-output unit 160, sound Frequency unit 170,180 each element of display unit are directly or indirectly electrically connected between each other, to realize the transmission or friendship of data Mutually.It is electrically connected for example, these elements can be realized between each other by one or more communication bus or signal wire.The multi-process Tune lifting device 110 include that at least one can be stored in the memory 120 in the form of software or firmware (firmware) Or it is solidificated in the software function module in the operating system (operating system, OS) of the terminal device 100.The place Reason device 140 is used to execute the executable module stored in memory 120, such as the tune lifting device 110 of the multi-process includes Software function module or computer program.
Wherein, memory 120 may be, but not limited to, random access memory (Random Access Memory, RAM), read-only memory (Read Only Memory, ROM), programmable read only memory (Programmable Read-Only Memory, PROM), erasable read-only memory (Erasable Programmable Read-Only Memory, EPROM), Electricallyerasable ROM (EEROM) (Electric Erasable Programmable Read-Only Memory, EEPROM) etc.. Wherein, memory 120 is for storing program, and the processor 140 executes described program, this hair after receiving and executing instruction The method performed by terminal device 100 that the stream process that bright embodiment any embodiment discloses defines can be applied to processor In 140, or realized by processor 140.
Processor 140 may be a kind of IC chip, the processing capacity with signal.Above-mentioned processor 140 can To be general processor, including central processing unit (Central Processing Unit, abbreviation CPU), network processing unit (Network Processor, abbreviation NP) etc.;Can also be digital signal processor (DSP), application-specific integrated circuit (ASIC), Field programmable gate array (FPGA) either other programmable logic device, discrete gate or transistor logic, discrete hard Part component.It may be implemented or execute disclosed each method, step and the logic diagram in the embodiment of the present invention.General processor Can be microprocessor or the processor 140 can also be any conventional processor 140 etc..
The Peripheral Interface 150 couples various input/output devices to processor 140 and memory 120.At some In embodiment, Peripheral Interface 150, processor 140 and storage control 130 can be realized in one single chip.Other one In a little examples, they can be realized by independent chip respectively.
The interaction that input-output unit 160 is used to that user input data to be supplied to realize user and terminal device 100.It is described Input-output unit 160 may be, but not limited to, mouse and keyboard etc..
Audio unit 170 provides a user audio interface, may include that one or more microphones, one or more raises Sound device and voicefrequency circuit.
Display unit 180 provides an interactive interface (such as user interface) between terminal device 100 and user Or it is referred to user for display image data.In the present embodiment, the display unit 180 can be liquid crystal display or touch Control display.Can be that the capacitance type touch control screen or resistance-type of single-point and multi-point touch operation is supported to touch if touch control display Control screen etc..Single-point and multi-point touch operation is supported to refer to touch control display and can sense on the touch control display one or more The touch control operation generated simultaneously at a position, and transfer to processor 140 to be calculated and handled the touch control operation that this is sensed.
Fig. 2 is please referred to, is a kind of flow diagram for having adjusted method of multi-process provided in an embodiment of the present invention, this method Including:
Step S110 triggers host process.
Specifically, the host process is process for interface display, there are two types of the trigger means are general, the row of user is responded For or Android system behavior trigger host process.As when the user clicks " pp assistant "
When the icon of this application program, it will triggering host process, or when the end for being equipped with " pp assistant " application program When end equipment is networked by no net state connection as there is net state, host process will be also triggered.
Step S120, the host process call the described first primary API to start first service.
The first primary API is the primary application programming interfaces startService that Android system provides, wherein API Full name be Application Program Interface, Chinese translation is application programming interfaces.I other words the host process StartService will be called to start first service.
Step S130, the first service call the described first primary API to start second service, and the Android system root The process where the second service is played according to the mapping relations tune between the service stated in advance and process.
Specifically, after first service starts, the first primary API will be called to start second service, it should be noted that this One service and second service are located in the different processes of same application, so that can be by respective between multiple processes Service is bound and is supervised.In turn, which will be according to the mapping relations tune between the service stated in advance and process The process where second service is played, i other words, which will state the process at place in advance, then after second service starts, The Android system is by the process where having adjusted second service therewith.
Step S140, the first service call the described second primary API to bind the second service, and monitor described the The connection disconnected event of two services.
Wherein, the second primary API is the primary application programming interfaces bindService that Android system provides.I other words After second service starts, which will call the bindService to bind second service, and second is bound in first service When service, " onServiceDisconnected " that generates second service is connected into disconnected event, then, the first service is also The connection disconnected event of second service is monitored by ServiceConnection interfaces.
Step S150, when the connection disconnected event of the second service is triggered, the first service calls described the One primary API starts the second service, and the Android system is by according to the correspondence for the service and process stated in advance, The process where the second service is adjusted.
Specifically, when the connection disconnected event of second service is triggered, the process where showing the second service is System kills by force, and since first service and second service have been set up binding relationship, then timely monitoring is obtained second by first service Service is killed by force.In turn, first service will re-call the first primary API startups second service, which also will According to the correspondence of the service and process stated in advance, the process where second service has been adjusted so where second service Process resumption, second service are able to normal operation, ensure that user experience.
It can be seen that due to mutual indepedent between each process, therefore process can not be bound, but to each process Service is bound, and by the supervision to service state, has reached the supervision to each process status, to work as one of process When being killed by force, the service in another process can carry out " rescue " to the service of binding rapidly.
Step S160, the first service calls the second primary API to bind the second service again, and supervises again Listen the connection disconnected event of the second service.
In order to ensure the long-term supervision of first service and second service, when the process where second service is killed by force, first Service is by starting second service, and after making the process where Android system tune second service, first service should also weigh New binding second service, continues to monitor with the succeeding state to second service.Specifically, first service calling second is primary API binds second service again, and monitors second service by ServiceConnection interfaces " onServiceDisconnected " connects disconnected event.
Other than first service can be bound and be monitored to second service, second service can also to first service into Row binding and monitoring, to realize the two-way supervision between first service and second service.The second service carries out first service Binding and monitoring are executed after first service starts second service, and Fig. 3 is specifically please referred to, and are provided in an embodiment of the present invention another A kind of flow diagram for having adjusted method of multi-process, this method include:
Step S210 triggers host process.
Specifically, the host process is process for interface display, there are two types of the trigger means are general, the row of user is responded For or Android system behavior trigger host process.When such as the icon of " pp assistant " this application program when the user clicks, it will touch Host process is sent out, or has net state when the terminal device for being equipped with " pp assistant " application program networks to become by no net state connection When, it will also trigger host process.
Step S220, the host process call the described first primary API to start first service.
The first primary API is the primary application programming interfaces startService that Android system provides, wherein API Full name be Application Program Interface, Chinese translation is application programming interfaces.I other words the host process StartService will be called to start first service.
Step S230, the first service call the described first primary API to start second service, and the Android system root The process where the second service is played according to the mapping relations tune between the service stated in advance and process.
Specifically, after first service starts, the first primary API will be called to start second service, it should be noted that this One service and second service are located in the different processes of same application, so that can be by respective between multiple processes Service is bound and is supervised.In turn, which will be according to the mapping relations tune between the service stated in advance and process The process where second service is played, i other words, which will state the process at place in advance, then after second service starts, The Android system is by the process where having adjusted second service therewith.
Step S240, the second service call the described second primary API to bind the first service, and monitor described the The connection disconnected event of one service.
I other words after second service startup, it, should while first service calls the second primary API bindings second service Second service will also call the second primary API bindings first service, and monitor the first clothes by ServiceConnection interfaces " onServiceDisconnected " of business connects disconnected event.
Step S250, when the connection disconnected event of the first service is triggered, the second service calls described the One primary API starts the first service, and the Android system will be corresponding with process according to the service stated in advance Relationship has adjusted the process where the first service.
Specifically, when the connection disconnected event of first service is triggered, show the process where first service by system It kills by force, then the second service will re-call the first primary API startups first service, and then the Android system will be according to pre- first sign The correspondence of bright service and process, has adjusted the process where first service, to ensure the normal operation of first service, improves User experience.
Step S260, the second service calls the second primary API to bind the first service again, and supervises again Listen the connection disconnected event of the first service.
Similarly it is found that in order to ensure that second service can supervise the state of first service for a long time, the second service is first Secondary startup first service, and after the process where Android system tune first service, second service should also re-call second Primary API binds first service again, and first service is monitored to continue through ServiceConnection interfaces " onServiceDisconnected " connects disconnected event.
It can be seen that this programme, by the binding between different services, the mutual keep-alive between realization process solves certain A process is killed by force by system, due to being unable to the problem of self-starting causes corresponding service to be suspended, improves user experience.This Outside, startup and binding between being serviced in this programme are all made of primary API, and there is no simultaneous caused by cell phone manufacturer's custom-built system Capacitive problem, has widened application range.
As another embodiment, a kind of tune of multi-process provided in an embodiment of the present invention rise method be not only applicable to it is double Between process, it may also be used between multiple processes.It is illustrated by taking three processes as an example, such as includes the first process, the second process With third process, the first process corresponding with service A, the second process corresponding with service B, third process corresponding with service C, specially:
If after the first process initiation service A, service A, which starts, services B, service B startup services C (or service A startup services C), corresponding second processes of service B, the corresponding third processes of service C and have been adjusted therewith.In turn, service A bindings service B and right The connection disconnected event of service B is monitored, and service B bindings service C simultaneously monitors the connection disconnected event for servicing C, takes Business C bindings service A simultaneously monitors the connection disconnected event for servicing A.Then when the connection disconnected event quilt of any one service When triggering, the service for being responsible for monitoring will all restart the service, and system will adjust the corresponding process of the service, be responsible for monitoring Service also carries out re-starting binding in order to continue to monitor within the subsequent period.
Another way, the first process initiation service A, and service A starts service B, and service B starts service C, and adjusts therewith Service corresponding second processes of B, the corresponding third processes of service C.And then it services A bindings service B and the connection for servicing B is disconnected Event is monitored, and service A bindings service C simultaneously monitors the connection disconnected event for servicing C, and service C bindings service A is simultaneously right The connection disconnected event of service A is monitored.When the connection disconnected event of one or two of service B or service C is triggered When, for service A by restarting service B and/or service C, system will adjust service B and/or the corresponding processes of service C, lay equal stress on Newly bound.It is readily comprehensible, when the connection disconnected event for servicing B and service C is concurrently triggered, also i other words, service B When being killed by force simultaneously with the process where service C, service A need not start service B and service C, selectively Only start one, specific implementation mode can self-defined setting as needed.
It should be noted that only illustratively listing the binding method between multiple processes herein, form is bound It is varied, it can be configured according to actual needs.
Fig. 3 is please referred to, is a kind of function module signal of the tune lifting device 110 of multi-process provided in an embodiment of the present invention Figure, the device include trigger module 111, the first starting module 112, the second starting module 113, first monitoring module 114, first Calling module 115, the first binding module 116, second monitor module 117, the second calling module 118 and the second binding module 119。
Trigger module 111, for triggering host process.
In embodiments of the present invention, step S110 and step S210 can be executed by trigger module 111.
First starting module 112 calls the described first primary API to start first service for the host process.
In embodiments of the present invention, step S120 and step S220 can be executed by the first starting module 112.
Second starting module 113 calls the described first primary API to start second service, and institute for the first service Android system is stated according to the process where the mapping relations tune between the service and process the stated in advance second service.
In embodiments of the present invention, step S130 and step S230 can be executed by the second starting module 113.
First monitors module 114, and the company for the second service that binding relationship is established with first service is monitored for first service Disconnected event is connect, the first service and second service are located at the different processes of same application.
In embodiments of the present invention, step S140 can be executed by the first monitoring module 114.
First calling module 115, for when the connection disconnected event of the second service is triggered, the first service The described first primary API is called to start the second service, and the Android system will be according to the service and process stated in advance Correspondence, adjusted the process where the second service.
In embodiments of the present invention, step S150 can be executed by the first calling module 115.
First binding module 116 calls the second primary API to bind second clothes again for the first service Business, and the connection disconnected event of the second service is monitored again.
In embodiments of the present invention, step S160 can be executed by the first binding module 116.
Second monitors module 117, calls the described second primary API to bind the first service for the second service, And monitor the connection disconnected event of the first service.
In embodiments of the present invention, step S240 can be executed by the second monitoring module 117.
Second calling module 118, for when the connection disconnected event of the first service is triggered, the second service Call the described first primary API to start the first service, and the Android system by according to the service stated in advance with The correspondence of process has adjusted the process where the first service.
In embodiments of the present invention, step S250 can be executed by the second calling module 118.
Second binding module 119 calls the second primary API to bind first clothes again for the second service Business, and the connection disconnected event of the first service is monitored again.
In embodiments of the present invention, step S260 can be executed by the second binding module 119.
Due to being had been described in playing method in the tune of multi-process, details are not described herein.
The embodiment of the present invention further discloses a kind of computer readable storage medium, is stored thereon with computer program, described Computer program realizes that the tune of multi-process provided in an embodiment of the present invention plays method when being executed by processor 140.
In conclusion a kind of tune of multi-process provided in an embodiment of the present invention plays method, apparatus, terminal device and computer Storage medium, the tune of the multi-process play method and are applied to Android system, and the primary API of Android system setting includes first primary The primary API of API and second are equipped with multiple application programs on the Android system, and each application program corresponds to multiple processes, each Multiple services are run in process.This method includes:First service monitoring and first service establish the second service of binding relationship Disconnected event is connected, first service and second service are located at the different processes of same application, when the connection of second service disconnects thing When part is triggered, first service calls the first primary API to start second service, and Android system will be according to the service stated in advance With the correspondence of process, the process where second service has been adjusted.
It can be seen that in the present solution, by different processes first service and second service establish binding relationship, with realize The mutual supervision of first service and second service, if the connection disconnected event of one of service is triggered, another service The service will be restarted and adjusted the process where it, to realize the keep-alive of process.Due to being the mutual binding between service And supervision so that once a side service where process killed by force, another party's service can quick response, to guarantee fast velocity modulation The process where the service killed by force is played, user experience is improved.
In several embodiments provided herein, it should be understood that disclosed device and method can also pass through Other modes are realized.The apparatus embodiments described above are merely exemplary, for example, the flow chart in attached drawing and block diagram Show the device of multiple embodiments according to the present invention, the architectural framework in the cards of method and computer program product, Function and operation.In this regard, each box in flowchart or block diagram can represent the one of a module, section or code Part, a part for the module, section or code, which includes that one or more is for implementing the specified logical function, to be held Row instruction.It should also be noted that at some as in the realization method replaced, the function of being marked in box can also be to be different from The sequence marked in attached drawing occurs.For example, two continuous boxes can essentially be basically executed in parallel, they are sometimes It can execute in the opposite order, this is depended on the functions involved.It is also noted that every in block diagram and or flow chart The combination of box in a box and block diagram and or flow chart can use function or the dedicated base of action as defined in executing It realizes, or can be realized using a combination of dedicated hardware and computer instructions in the system of hardware.
In addition, each function module in each embodiment of the present invention can integrate to form an independent portion Point, can also be modules individualism, can also two or more modules be integrated to form an independent part.
It, can be with if the function is realized and when sold or used as an independent product in the form of software function module It is stored in a computer read/write memory medium.Based on this understanding, technical scheme of the present invention is substantially in other words The part of the part that contributes to existing technology or the technical solution can be expressed in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be People's computer, server or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention. And storage medium above-mentioned includes:USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic disc or CD.It needs Illustrate, herein, relational terms such as first and second and the like be used merely to by an entity or operation with Another entity or operation distinguish, and without necessarily requiring or implying between these entities or operation, there are any this realities The relationship or sequence on border.Moreover, the terms "include", "comprise" or its any other variant are intended to the packet of nonexcludability Contain, so that the process, method, article or equipment including a series of elements includes not only those elements, but also includes Other elements that are not explicitly listed, or further include for elements inherent to such a process, method, article, or device. In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including the element Process, method, article or equipment in there is also other identical elements.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field For art personnel, the invention may be variously modified and varied.All within the spirits and principles of the present invention, any made by repair Change, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.It should be noted that:Similar label and letter exist Similar terms are indicated in following attached drawing, therefore, once being defined in a certain Xiang Yi attached drawing, are then not required in subsequent attached drawing It is further defined and is explained.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain Lid is within protection scope of the present invention.Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (18)

1. a kind of tune of multi-process plays method, it is applied to Android system, the primary API of the Android system setting includes first former The primary API of API and second to be given birth to, multiple application programs are installed on the Android system, each application program corresponds to multiple processes, Multiple services are run in each process, which is characterized in that the method includes:
First service monitor with first service establish binding relationship second service connection disconnected event, the first service and Second service is located at the different processes of same application;
When the connection disconnected event of the second service is triggered, the first service calls the described first primary API to start The second service, and the Android system has adjusted described second by according to the correspondence for the service and process stated in advance Process where servicing.
2. the method as described in claim 1, which is characterized in that the method further includes:
The first service calls the second primary API to bind the second service again, and monitors second clothes again The connection disconnected event of business.
3. the method as described in claim 1, which is characterized in that the first service is monitored establishes binding relationship with first service Second service connection disconnected event before further include:
Trigger host process;
The host process calls the described first primary API to start first service;
The first service calls the described first primary API to start second service, and the Android system is according to the pre- first sign Mapping relations tune between bright service and process plays the process where the second service.
4. method as claimed in claim 3, which is characterized in that the first service is monitored establishes binding relationship with first service Second service connection disconnected event the step of include:
The first service calls the described second primary API to bind the second service, and monitors the connection of the second service Disconnected event.
5. method as claimed in claim 3, which is characterized in that the step of triggering host process includes:
The behavior of the behavior or the Android system that respond user triggers host process.
6. method as claimed in claim 3, which is characterized in that the method further includes:
The second service calls the described second primary API to bind the first service, and monitors the connection of the first service Disconnected event;
When the connection disconnected event of the first service is triggered, the second service calls the described first primary API to start The first service, and the Android system according to the correspondence of the service stated in advance and process, will adjust it is described Process where first service.
7. method as claimed in claim 6, which is characterized in that the method further includes:
The second service calls the second primary API to bind the first service again, and monitors first clothes again The connection disconnected event of business.
8. the method as described in any one of claim 1-7, which is characterized in that the first primary API is StartService, the second primary API are bindService.
9. a kind of tune lifting device of multi-process is applied to Android system, the primary API of the Android system setting includes first former The primary API of API and second to be given birth to, multiple application programs are installed on the Android system, each application program corresponds to multiple processes, Multiple services are run in each process, which is characterized in that described device includes:
First monitors module, and the connection that the second service for establishing binding relationship with first service is monitored for first service disconnects thing Part, the first service and second service are located at the different processes of same application;
First calling module, for when the connection disconnected event of the second service is triggered, the first service to call institute It states the first primary API and starts the second service, and the Android system will be corresponding with process according to the service stated in advance Relationship has adjusted the process where the second service.
10. device as claimed in claim 9, which is characterized in that described device further includes:
First binding module calls the second primary API to bind the second service again, lays equal stress on for the first service Newly monitor the connection disconnected event of the second service.
11. device as claimed in claim 9, which is characterized in that described device further includes:
Trigger module, for triggering host process;
First starting module calls the described first primary API to start first service for the host process;
Second starting module calls the described first primary API to start second service, and the Android system for the first service System plays the process where the second service according to the mapping relations tune between the service stated in advance and process.
12. device as claimed in claim 11, which is characterized in that the first monitoring module is specifically used for:
The first service calls the described second primary API to bind the second service, and monitors the connection of the second service Disconnected event.
13. device as claimed in claim 11, which is characterized in that the trigger module is specifically used for:
The behavior of the behavior or the Android system that respond user triggers host process.
14. device as claimed in claim 11, which is characterized in that described device further includes:
Second monitors module, calls the described second primary API to bind the first service for the second service, and monitor institute State the connection disconnected event of first service;
Second calling module, for when the connection disconnected event of the first service is triggered, the second service to call institute It states the first primary API and starts the first service, and the Android system will be according to the service stated in advance and process Correspondence has adjusted the process where the first service.
15. device as claimed in claim 14, which is characterized in that described device further includes:
Second binding module calls the second primary API to bind the first service again, lays equal stress on for the second service Newly monitor the connection disconnected event of the first service.
16. the device as described in any one of claim 9-15, which is characterized in that the first primary API is StartService, the second primary API are bindService.
17. a kind of terminal device, which is characterized in that be equipped with Android system on the terminal device, the terminal device includes Memory and processor, the memory are stored in described for storing computer program code, the processor for execution Computer program code in memory, to realize the tune method of the multi-process as described in any one of claim 1-8.
18. a kind of computer storage media, is stored thereon with computer program, which is characterized in that the computer program is located Manage the tune method that the multi-process as described in any one of claim 1-8 is realized when device executes.
CN201810494582.1A 2018-05-22 2018-05-22 The tune of multi-process plays method, apparatus, terminal device and computer storage media Pending CN108710534A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810494582.1A CN108710534A (en) 2018-05-22 2018-05-22 The tune of multi-process plays method, apparatus, terminal device and computer storage media

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810494582.1A CN108710534A (en) 2018-05-22 2018-05-22 The tune of multi-process plays method, apparatus, terminal device and computer storage media

Publications (1)

Publication Number Publication Date
CN108710534A true CN108710534A (en) 2018-10-26

Family

ID=63869404

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810494582.1A Pending CN108710534A (en) 2018-05-22 2018-05-22 The tune of multi-process plays method, apparatus, terminal device and computer storage media

Country Status (1)

Country Link
CN (1) CN108710534A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110007981A (en) * 2019-02-28 2019-07-12 Oppo广东移动通信有限公司 Start method, apparatus, electronic equipment and the medium of application program
CN110879726A (en) * 2019-10-24 2020-03-13 深圳数位传媒科技有限公司 Keep-alive method and device for application program of mobile terminal
CN111399924A (en) * 2020-03-18 2020-07-10 山东车微联信息技术股份有限公司 Method, terminal and storage medium for keeping application process alive under android platform
CN111930481A (en) * 2020-07-16 2020-11-13 重庆帮企科技集团有限公司 Android system-based process priority improving method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140013008A1 (en) * 2012-07-05 2014-01-09 Eric Lazarus Managing data in a data queue including synchronization of media on multiple devices
CN105516926A (en) * 2016-01-13 2016-04-20 广东欧珀移动通信有限公司 Network positioning method, device and mobile terminal
CN107704274A (en) * 2017-08-24 2018-02-16 武汉斗鱼网络科技有限公司 Method, storage medium, equipment and the system waken up for Android application host process
CN107844341A (en) * 2017-11-21 2018-03-27 广东欧珀移动通信有限公司 Management-control method, device and the storage medium and mobile terminal of process initiation
CN107944258A (en) * 2017-11-21 2018-04-20 广东欧珀移动通信有限公司 Start control method, device, storage medium and the terminal of application with method of service
CN107957905A (en) * 2017-11-21 2018-04-24 广东欧珀移动通信有限公司 Method, apparatus, storage medium and the intelligent terminal of self-starting are applied in limitation

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140013008A1 (en) * 2012-07-05 2014-01-09 Eric Lazarus Managing data in a data queue including synchronization of media on multiple devices
CN105516926A (en) * 2016-01-13 2016-04-20 广东欧珀移动通信有限公司 Network positioning method, device and mobile terminal
CN107704274A (en) * 2017-08-24 2018-02-16 武汉斗鱼网络科技有限公司 Method, storage medium, equipment and the system waken up for Android application host process
CN107844341A (en) * 2017-11-21 2018-03-27 广东欧珀移动通信有限公司 Management-control method, device and the storage medium and mobile terminal of process initiation
CN107944258A (en) * 2017-11-21 2018-04-20 广东欧珀移动通信有限公司 Start control method, device, storage medium and the terminal of application with method of service
CN107957905A (en) * 2017-11-21 2018-04-24 广东欧珀移动通信有限公司 Method, apparatus, storage medium and the intelligent terminal of self-starting are applied in limitation

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
梦游三万里: "探讨一种新型的双进程守护应用保活方法", 《HTTP://WWW.360DOC.COM/CONTENT/17/0402/10/31477409_642267020.SHTML》 *
黑夜路口: "03.app保活解决方案", 《HTTPS://YQ.ALIYUN.COM/ARTICLES/657340/》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110007981A (en) * 2019-02-28 2019-07-12 Oppo广东移动通信有限公司 Start method, apparatus, electronic equipment and the medium of application program
CN110879726A (en) * 2019-10-24 2020-03-13 深圳数位传媒科技有限公司 Keep-alive method and device for application program of mobile terminal
CN110879726B (en) * 2019-10-24 2023-09-26 深圳数位大数据科技有限公司 Keep-alive method and keep-alive device for mobile terminal application program
CN111399924A (en) * 2020-03-18 2020-07-10 山东车微联信息技术股份有限公司 Method, terminal and storage medium for keeping application process alive under android platform
CN111399924B (en) * 2020-03-18 2023-06-16 山东车微联信息技术股份有限公司 Method, terminal and storage medium for keeping application process alive under android platform
CN111930481A (en) * 2020-07-16 2020-11-13 重庆帮企科技集团有限公司 Android system-based process priority improving method and device

Similar Documents

Publication Publication Date Title
CN108710534A (en) The tune of multi-process plays method, apparatus, terminal device and computer storage media
CN107832100B (en) APK plug-in loading method and terminal thereof
CN111800462B (en) Micro service instance processing method, micro service instance processing device, computer equipment and storage medium
US20180336060A1 (en) Method, terminal and storage medium for displaying media files
US10455542B2 (en) Method of synchronizing notification messages for electronic devices and electronic devices
CN105208047B (en) Inserting method and server on distribution system services device
CN111181804A (en) Intelligent device offline state automatic detection method and device, electronic device and medium
CN110457197B (en) Service testing method, device, computer equipment and storage medium
US10404568B2 (en) Agent manager for distributed transaction monitoring system
CN110933075B (en) Service calling method and device, electronic equipment and storage medium
CN111625810B (en) Equipment login method, equipment and system
CN111858007A (en) Task scheduling method and device based on message middleware
CN110351366A (en) A kind of service scheduling method of Internet application, system and computer readable storage medium
CN109992343A (en) Control method, control system and the electronic equipment of virtual cloud desktop server
CN108900434A (en) Data collection distribution method and device
CN110708366A (en) Plug-in process management method, related method and related device
CN105930249B (en) Using monitoring method and device
CN111698283A (en) Distributed cluster host management and control method, device, equipment and storage medium
CN108319480A (en) Bluetooth service starts method, apparatus and electronic equipment
CN108366098A (en) A kind of data interactive method and device of network node
CN108563668A (en) The method, apparatus and terminal device of the Hybrid page jump H5 pages
CN109948332A (en) A kind of physical machine login password remapping method and device
CN104834553B (en) Service concurrent processing method of user terminal and user terminal
CN108958808A (en) Method for starting terminal and device, terminal and storage medium
CN115951923A (en) Subscription event management method and related product

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

Effective date of registration: 20200610

Address after: 310052 room 508, floor 5, building 4, No. 699, Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province

Applicant after: Alibaba (China) Co.,Ltd.

Address before: 510627 Guangdong city of Guangzhou province Whampoa Tianhe District Road No. 163 Xiping Yun Lu Yun Ping square B radio tower 15 layer self unit 02 (only for office use)

Applicant before: GUANGZHOU UC NETWORK TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
RJ01 Rejection of invention patent application after publication

Application publication date: 20181026

RJ01 Rejection of invention patent application after publication