[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN108984321A - A kind of mobile terminal and its method for limiting, the storage medium of interprocess communication - Google Patents

A kind of mobile terminal and its method for limiting, the storage medium of interprocess communication Download PDF

Info

Publication number
CN108984321A
CN108984321A CN201810701460.5A CN201810701460A CN108984321A CN 108984321 A CN108984321 A CN 108984321A CN 201810701460 A CN201810701460 A CN 201810701460A CN 108984321 A CN108984321 A CN 108984321A
Authority
CN
China
Prior art keywords
server
binder
communication
limiting
client terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810701460.5A
Other languages
Chinese (zh)
Other versions
CN108984321B (en
Inventor
周明君
方攀
陈岩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Oppo Chongqing Intelligent Technology Co Ltd
Original Assignee
Oppo Chongqing Intelligent 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 Oppo Chongqing Intelligent Technology Co Ltd filed Critical Oppo Chongqing Intelligent Technology Co Ltd
Priority to CN201810701460.5A priority Critical patent/CN108984321B/en
Publication of CN108984321A publication Critical patent/CN108984321A/en
Application granted granted Critical
Publication of CN108984321B publication Critical patent/CN108984321B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephonic Communication Services (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

This application discloses a kind of mobile terminal and its method for limiting of interprocess communication, storage medium, the method for limiting of the interprocess communication includes: the first quantity for obtaining the available binder thread of server-side;Wherein, binder thread is provided by server-side, and the binder sent for customer in response end is requested to realize the communication between client and server-side;Judge the first quantity whether less than the first given threshold;If so, the binder between limitation background client terminal and server-side is communicated.By the above-mentioned means, the busy extent of server-side can be reduced, guarantee the fluency of system.

Description

A kind of mobile terminal and its method for limiting, the storage medium of interprocess communication
Technical field
This application involves technical field of mobile terminals, more particularly to a kind of mobile terminal and its limitation of interprocess communication Method, storage medium.
Background technique
It, generally can be using between process using being frequently necessary to carry out data transmission between service in Android operation system The mode of communication, for example, can be transmitted by Binder mechanism, to obtain the data of other side.
During being communicated using Binder mechanism, a usual server-side can be led to multiple client Letter, can aggravate the burden of server-side in this way, when interprocess communication is excessively busy, will affect the fluency of service or system.
Summary of the invention
The technical solution that the application uses is: providing a kind of method for limiting of interprocess communication, the method for limiting packet It includes: obtaining the first quantity of the available binder thread of server-side;Wherein, binder thread is provided by server-side, and for ringing The binder for answering client to send is requested to realize the communication between client and server-side;Judge the first quantity whether less than One given threshold;If so, the binder between limitation background client terminal and server-side is communicated.
Another technical solution that the application uses is: providing a kind of mobile terminal, which includes: acquisition mould Block, the first quantity of the available binder thread for obtaining server-side;Wherein, binder thread is provided by server-side, is used in combination It requests in the binder that customer in response end is sent to realize the communication between client and server-side;Judgment module, for judging Whether the first quantity is less than the first given threshold;Module is limited, for limiting the binder between background client terminal and server-side Communication.
The application use another technical solution be: a kind of mobile terminal is provided, the mobile terminal include processor and Memory, wherein memory is for storing computer program, and computer program is when being executed by processor, for realizing as above The method stated.
Another technical solution that the application uses is: providing a kind of computer storage medium, the computer storage medium For storing computer program, computer program is when being executed by processor, for realizing such as above-mentioned method.
The method for limiting of interprocess communication provided by the present application includes: the first of the available binder thread of acquisition server-side Quantity;Wherein, binder thread is provided by server-side, and the binder sent for customer in response end is requested to realize client Communication between server-side;Judge the first quantity whether less than the first given threshold;If so, limitation background client terminal and service Binder communication between end.By the above-mentioned means, the service condition of the binder thread based on server-side, to backstage client The communication at end is limited, and the normal communication without influencing foreground client is protected so as to reduce the busy extent of server-side The fluency of card system.
Detailed description of the invention
In order to more clearly explain the technical solutions in the embodiments of the present application, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, the drawings in the following description are only some examples of the present application, for For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other Attached drawing.Wherein:
Fig. 1 is the flow diagram of the method for limiting first embodiment of interprocess communication provided by the present application;
Fig. 2 is the schematic illustration of interprocess communication;
Fig. 3 is the schematic illustration of Binder communication mechanism;
Fig. 4 is the interaction schematic diagram of client and server-side;
Fig. 5 is the flow diagram of the method for limiting second embodiment of interprocess communication provided by the present application;
Fig. 6 is the interaction schematic diagram of Fig. 5;
Fig. 7 is the flow diagram of the method for limiting 3rd embodiment of interprocess communication provided by the present application;
Fig. 8 is the interaction schematic diagram of Fig. 7;
Fig. 9 is the flow diagram of the method for limiting fourth embodiment of interprocess communication provided by the present application;
Figure 10 is the flow diagram of the 5th embodiment of method for limiting of interprocess communication provided by the present application;
Figure 11 is the flow diagram of the method for limiting sixth embodiment of interprocess communication provided by the present application;
Figure 12 is the flow diagram of the 7th embodiment of method for limiting of interprocess communication provided by the present application;
Figure 13 is the structural schematic diagram of one embodiment of mobile terminal provided by the present application;
Figure 14 is the structural schematic diagram of another embodiment of mobile terminal provided by the present application;
Figure 15 is the structural schematic diagram of one embodiment of computer storage medium provided by the present application.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete Site preparation description.It is understood that specific embodiment described herein is only used for explaining the application, rather than to the limit of the application It is fixed.It also should be noted that illustrating only part relevant to the application for ease of description, in attached drawing and not all knot Structure.Based on the embodiment in the application, obtained by those of ordinary skill in the art without making creative efforts Every other embodiment, shall fall in the protection scope of this application.
Term " first ", " second " in the application etc. be for distinguishing different objects, rather than it is specific suitable for describing Sequence.In addition, term " includes " and " having " and their any deformations, it is intended that cover and non-exclusive include.Such as comprising The process, method, system, product or equipment of a series of steps or units are not limited to listed step or unit, and It is optionally further comprising the step of not listing or unit, or optionally further comprising for these process, methods, product or equipment Intrinsic other step or units.
Referenced herein " embodiment " is it is meant that a particular feature, structure, or characteristic described can wrap in conjunction with the embodiments It is contained in embodiments herein.The phrase, which occurs, in each position in the description might not each mean identical implementation Example, nor the independent or alternative embodiment with other embodiments mutual exclusion.Those skilled in the art are explicitly and implicitly Understand, embodiment described herein can be combined with other embodiments.
Refering to fig. 1, Fig. 1 is the flow diagram of the method for limiting first embodiment of interprocess communication provided by the present application, This method comprises:
Step 11: obtaining the first quantity of the available binder thread of server-side.
Wherein, binder thread is provided by server-side, and the binder sent for customer in response end is requested to realize visitor Communication between family end and server-side.
Binder is most heavy in a kind of mode and android system of Inter-Process Communication in android system (IPC) One of characteristic wanted.Four big component Activity (workflow) in Android, Service (service), Broadcast (broadcast Receiver), ContentProvider (content provider), different App (application program) etc. operates in different processes In, it is the bridge of these Inter-Process Communications.As its name " adhesive ", various components in system have been adhered to one by it It rises, is the bridge of various components.
As shown in Fig. 2, Fig. 2 is the schematic illustration of interprocess communication, the process of each Android can only be operated in certainly The virtual address space that own process is possessed.For example, the virtual address space of a corresponding 4GB, wherein 3GB is user's sky Between, 1GB is kernel spacing, and the size of certain kernel spacing can be adjusted by parameter configuration.It is different for user's space It cannot be shared each other between process, and kernel spacing is sharable.Client process is to Server process communication, just It is just to be worked using kernel memory headroom sharable between process to complete bottom communication, the end Client and the end Server process Often using the methods of ioctl (function being managed in a kind of device driver to the channel I/O of equipment) with kernel sky Between driving interact.
Fig. 3 is further regarded to, Fig. 3 is the schematic illustration of Binder communication mechanism, and Binder communication uses C/S framework, For component visual angle, comprising Client (client), Server (server-side), ServiceManager (service management) and Binder driving, wherein ServiceManager is for the various services in management system.
Wherein, Client process is the process using service;Server process is the process for the service that provides; The effect of ServiceManager process is that the Binder name of character style is converted in Client to draw the Binder With enabling Client to obtain reference to Binder entity in Server by Binder name;Binder driving is responsible for Between process Binder communicate foundation, transmitting of the Binder between process, Binder reference count management, data packet into A series of basic-level supports such as transmitting and interaction between journey.
Mainly include following three processes in the communication process based on binder mechanism:
Registration service (addService): Server process will first register Service to ServiceManager.The mistake Journey: Server is client, and ServiceManager is server-side.
Obtain service (getService):, must be first to ServiceManager before Client process uses some Service It is middle to obtain corresponding Service.The process: Client is client, and ServiceManager is server-side.
Use service: Client is established and the Server process communication where Service according to obtained Service information Access, then can directly be interacted with Service.The process: client is client, and server is server-side.
It should be understood that Client in Fig. 3, interaction is all that dotted line indicates between Server, Service Manager, It is since they are not directly interactive each other, all by being interacted with Binder driving, to realize IPC Communication mode.Wherein Binder driving is located at kernel spacing, and Client, Server, Service Manager are located at user's sky Between.Binder driving and ServiceManager can regard the architecture of Android platform as, and Client and Server It is the application layer of Android, developer only needs the customized end realization client, Server, by the basic platform of Android Framework can directly carry out IPC communication.
Further, when client and server-side carry out binder communication, server-side can some Binder threads ring The binder of client is answered to request.
Specifically, Binder communication is actually the communication between the thread being located in different processes.If process S is The end Server, provides Binder entity, and thread T1 is asked by the reference of Binder to process S transmission from Client process C1 It asks.S needs to start thread T2 to handle this request, and thread T1 is in the wait state for receiving returned data at this time.T2 Processing result will be returned to T1 by having handled request, and T1 is waken up to obtain processing result.During this, T2 seemingly T1 into Agency in journey S represents T1 and executes remote task, and is exactly to be returned to as traversing to one section of code of execution in S to the feeling of T1 C1.In order to make it is this pass through more true, some attributes of T1 can be assigned to the priority nice of T2, especially T1 by driving, T2 in this way will use the time completion task similar with T1.
For Server process S, it might have many Client while initiating to request, often open up line to improve efficiency The binder request that Cheng Chi concurrent processing receives.
It should be understood that the communication between two processes generally will use multiple threads.For example, android system is advised 32 Binder threads can be created for inter-process data communication by determining SystemServer process at most;SurfaceFlinger Process can at most create 4 Binder threads and communicate for inter-process data;Program application process can at most create 8 Binder thread is communicated for inter-process data.
Based on the principle of above-mentioned binder mechanism, it is known that client and server-side can be any two process, it can To be application, it is also possible to service, for example, it may be being also possible to using the communication between application using between service Communication.
In addition, in an intelligent terminal, multiple applications may obtain same service simultaneously, so, a server-side may be same When and multiple client between carry out interprocess communication, in this case, due to the number of communications of server-side is more, thread use It measures that larger, communication is excessively frequent, will cause the Caton of system, the present embodiment, which mainly passes through, obtains a particular clients and one The quantity of binder thread used in communication between server-side is made to measure the client to the busy extent of server-side At influence, to limit the client.
Optionally, in the present embodiment, which can be server of the system.
Specifically, as shown in figure 4, Fig. 4 is the interaction schematic diagram of client and server-side, in the logical of client and server-side It mainly include three processes during letter, client is initiated logical to server-side initiation communication request, server-side customer in response end Data interaction is carried out between letter request, client and server-side.
It should be understood that when client initiates binder request to server-side, the binder line of also vacant server-side Journey may turn on a binder thread and responded when server is begun to respond to.
It is as shown in the table by taking the total quantity of the binder thread of server-side is 32 as an example:
Server-side binder total number of threads Binder Thread Count is used Idle binder Thread Count
32 20 12
It wherein, may be what multiple client used in used 20 binder threads, including foreground client End and background client terminal.It should be understood that when the quantity of the available binder thread of server-side is very few or exhausts, it will It cannot respond to the binder request of client transmission, normal binder can not be carried out by causing between client and server-side leads to Letter, and then influence the operation of client.
Step 12: judging the first quantity whether less than the first given threshold.
When the judging result of step 12 is to be, the binder request that server-side normal response client is sent carries out visitor Interprocess communication between family end and server-side.
When the judging result of step 12 is no, step 13 is executed.
Wherein, the first given threshold, which can be, is rule of thumb arranged, in addition can be with the binder thread at Reference Services end Total quantity, optionally, first given threshold is typically small, for example, it may be the 10% of binder total number of threads amount.Separately Outside, when there is phenomena such as not smooth, collapse in available system, the quantity of the remaining available binder thread of server-side.It is false If the total quantity of the binder thread of a server-side is 32, it is possible to set 0-10 for the first given threshold.
In a specific embodiment, which is zero, step 12 specifically: judge the first quantity whether be Zero.It should be understood that in this embodiment, being equivalent to and judging whether the available binder thread of server-side exhausts.
Step 13: the binder between limitation background client terminal and server-side is communicated.
Wherein, before background client terminal refers to that the client in running background, the program that usually user is being operated are known as Platform program, and user does not operate but is also known as background program in the program of operation.Here program namely refers to client.
For example, colleague has run A software and B software on mobile phone, wherein A software is being operated in front stage operation, i.e. user A software is interacted accordingly, and B software is then running background, in conjunction with the mode of step 13, at this point, A software maintenance is transported Row, the binder between A software and server-side, which is communicated, also to be kept, and the binder limited between B software and server-side is communicated.
Wherein, it limits there are many modes that the binder between background client terminal and server-side is communicated, for example, can be direct It closes background client terminal, background client terminal is forbidden to send binder request to the server-side, forbid server-side response backstage visitor The binder that family end is sent is requested, waiting list etc. mode is added in the binder request of background client terminal transmission.
It should be understood that client and server-side in above-described embodiment can be with self-definings, therefore aforesaid way It can be adapted for any application or service.
It optionally, in one embodiment, can be when the binder thread of server-side be used to and discharges every time The quantity of the available binder thread at statistical fractals end.For example, note can be N with binder number of threads, when a client is sent out Binder is sent to request to after server-side, come when responding binder request, i.e., currently which initiates a binder thread Available binder thread be that N-1 discharges a binder after sign off of a client and the server-side Thread, i.e., current available binder thread are N+1, in this way, can record the available of server-side in real time The quantity of binder thread.
The method for limiting of interprocess communication provided in this embodiment include: obtain server-side available binder thread the One quantity;Wherein, binder thread is provided by server-side, and the binder sent for customer in response end is requested to realize client Communication between end and server-side;Judge the first quantity whether less than the first given threshold;If so, limitation background client terminal and clothes Binder communication between business end.By the above-mentioned means, the service condition of the binder thread based on server-side, to backstage visitor The communication at family end is limited, the normal communication without influencing foreground client, so as to reduce the busy extent of server-side, The fluency of guarantee system.
It is the flow diagram of the method for limiting second embodiment of interprocess communication provided by the present application refering to Fig. 5, Fig. 5, This method comprises:
Step 51: obtaining the first quantity of the available binder thread of server-side.
Wherein, binder thread is provided by server-side, and the binder sent for customer in response end is requested to realize visitor Communication between family end and server-side.
Step 52: judging the first quantity whether less than the first given threshold.
When the judging result of step 52 is to be, step 53 is executed.
When the judging result of step 52 is no, the binder request that server-side normal response client is sent carries out visitor Interprocess communication between family end and server-side.
Step 53: obtaining target background client terminal and server-side and carry out binder communicates used binder thread the Two quantity.
When the client of running background is multiple, each background client terminal can be obtained respectively and server-side carries out Binder communicates the quantity of used binder thread.
Step 54: judging whether the second quantity is greater than the second given threshold.
When the judging result of step 54 is to be, step 55 is executed.
Step 55: the binder between limited target background client terminal and server-side is communicated.
Step 55 is similar with the step 13 of above-described embodiment, this is repeated no more.
It should be understood that the present embodiment be different from above-described embodiment the difference is that, the present embodiment is not intended to limit institute Some background client terminals, and limit those and occupy the more background client terminal of binder thread.
For example, in the present embodiment, the second given threshold is 5, then, when the quantity of the available binder thread of server-side It when smaller, needs to limit background client terminal at this time, obtains current backstage A client and backstage B client and used Binder thread quantity, wherein A client use 3 binder threads, B client use 6 binder threads, then It does not need to limit A client, and is only to limit B client.
Optionally, in one embodiment, step 55 can specifically include: when target background client terminal is sent to server-side When binder is requested, binder is requested to the end that waiting list is added, responds what target background client terminal was sent to suspend Binder request
In conjunction with Fig. 6, in a specific example, when client, which sends the first binder to server-side, requests, detect The available binder number of threads of server-side is greater than the first given threshold, meets response and requires, requests at this time the first binder It is responded.When client, which sends the 2nd binder to server-side, requests, the available binder Thread Count of server-side is detected Amount is unsatisfactory for response and requires less than the first given threshold, requests the 2nd binder waiting list is added at this time.If detecting again To server-side available binder thread quantity be greater than the first given threshold when, by waiting list the 2nd binder request It is sent to server-side, server-side responds the 2nd binder request.
Wherein, after the available binder thread of server-side is greater than the first given threshold, meet response and require, generally first ring The binder in waiting list is answered to request, then the binder request that customer in response end is currently transmitted.
It should be understood that in the above-described embodiment, which is background client terminal, and further, which can be with It is the background client terminal for being greater than the second given threshold in background client terminal using binder number of threads.
The beneficial effect of the present embodiment is, maintains the existing binder communication of background client terminal, forbids backstage client Hold the further new communication with server-side.
Optionally, in another embodiment, step 55 can specifically include: killing is carried out to target background client terminal, with The binder thread that release destination client uses.
The beneficial effect of the present embodiment is, directly to the more client progress killing of binder thread is occupied, discharges Out after a large amount of binder thread, it is ensured that the binder between other clients and server-side is communicated.
Furthermore it is also possible to which above two embodiment is combined, selective take background client terminal forbids leading to Letter or the limitation mode of killing.It is as follows:
It is the flow diagram of the method for limiting 3rd embodiment of interprocess communication provided by the present application refering to Fig. 7, Fig. 7, This method comprises:
Step 71: obtaining the first quantity of the available binder thread of server-side.
Wherein, binder thread is provided by server-side, and the binder sent for customer in response end is requested to realize visitor Communication between family end and server-side.
Step 72: judging the first quantity whether less than the first given threshold.
When the judging result of step 72 is to be, the binder request that server-side normal response client is sent carries out visitor Interprocess communication between family end and server-side.
When the judging result of step 72 is no, step 73 is executed.
Step 73: obtaining target background client terminal and server-side and carry out binder communicates used binder thread the Two quantity.
Step 74: judging whether second quantity is greater than given threshold.
When the judging result of step 74 is to be, step 75 is executed, when the judging result of step 74 is no, executes step 76。
Step 75: killing being carried out to target background client terminal, to discharge the binder thread that destination client uses.
Step 76: when target background client terminal, which sends binder to server-side, requests, binder being requested waiting is added The end of queue, to suspend the binder request that response target background client terminal is sent.
In conjunction with Fig. 8, in a specific example, when client, which sends the first binder to server-side, requests, detect The available binder number of threads of server-side is greater than the first given threshold, meets response and requires, requests at this time the first binder It is responded.When client, which sends the 2nd binder to server-side, requests, the available binder Thread Count of server-side is detected Amount is unsatisfactory for response and requires less than the first given threshold, and the binder number of threads that client uses is less than the second setting threshold Value requests the 2nd binder waiting list is added at this time.When client, which sends the 3rd binder to server-side, requests, detection Available binder number of threads to server-side is unsatisfactory for response and requires less than the first given threshold, and client uses Binder number of threads is greater than the second given threshold, carries out killing to client at this time, releases the used institute of the client There is binder thread.
It is the flow diagram of the method for limiting fourth embodiment of interprocess communication provided by the present application refering to Fig. 9, Fig. 9, This method comprises:
Step 91: obtaining the first quantity of the available binder thread of server-side.
Wherein, binder thread is provided by server-side, and the binder sent for customer in response end is requested to realize visitor Communication between family end and server-side.
Step 92: judging the first quantity whether less than the first given threshold.
When the judging result of step 92 is to be, the binder request that server-side normal response client is sent carries out visitor Interprocess communication between family end and server-side.
When the judging result of step 92 is no, step 93 is executed.
Step 93: obtaining the memory usage of target background client terminal.
It should be understood that being influenced on the fluency of system more serious when memory usage is higher.
Step 94: judging whether memory usage is greater than third given threshold.
When the judging result of step 94 is to be, step 95 is executed.
Step 95: the binder between limited target background client terminal and server-side is communicated.
Step 95 is similar with the step 13 of above-described embodiment, this is repeated no more.
It should be understood that the present embodiment be different from above-described embodiment the difference is that, the present embodiment is not intended to limit institute Some background client terminals, and limit the more background client terminal of those committed memories, that is, it ensure that the operation of background client terminal, The fluency of system can be improved again.
0, Figure 10 is the process signal of the 5th embodiment of method for limiting of interprocess communication provided by the present application refering to fig. 1 Figure, this method comprises:
Step 101: when client initiates communication request to server-side, recording first time point.
Step 102: at server-side customer in response end when the communication request of initiation, recording for the second time point.
Step 103: being based on first time point and the second time point, obtain service latency.
Here service latency is the period between first time point and the second time point.
Step 104: service latency is saved, to be monitored based on service latency to the communication of server-side.
1, Figure 11 is the process signal of the method for limiting sixth embodiment of interprocess communication provided by the present application refering to fig. 1 Figure, this method comprises:
Step 111: at server-side customer in response end when the communication request of initiation, recording for the second time point.
Step 112: when the interprocess communication of client and server-side is completed, recording third time point.
Step 113: being based on the second time point and third time point, obtain the communication service time.
Here the communication service time is the period between the second time point and third time point.
Step 114: the communication service time is saved, to be monitored based on the communication service time to the communication of server-side.
2, Figure 12 is the process signal of the 7th embodiment of method for limiting of interprocess communication provided by the present application refering to fig. 1 Figure, this method comprises:
Step 121: when client initiates communication request to server-side, recording first time point.
Step 122: when the interprocess communication of client and server-side is completed, recording third time point.
Step 123: being based on first time point and third time point, obtain interprocess communication total time.
Here interprocess communication total time is the period between first time point and third time point.
Step 124: saving and obtain interprocess communication total time, to be based on obtaining interprocess communication total time to server-side Communication be monitored.
The embodiment of above-mentioned Figure 10-Figure 12 can be combined with above-mentioned other embodiments to be implemented, from three differences Aspect get the duration of communication, including service waiting time, communication service duration and total duration.
Wherein, the average value or total duration of specific available each duration.It is as shown in the table:
For example, the average value of service waiting time is exactly the average value of a1, b1 and c1;The average value of communication service duration is just It is the average value of a2, b2 and c2;Interprocess communication total duration is exactly the average value of a3, b3 and c3.
Optionally, above-mentioned data can also be counted using other statistical statistical methods, such as variance.
In addition, to above-mentioned number of communications, service waiting time, communication service duration and interprocess communication total duration into When row statistics and monitoring, histogram can be drawn and intuitively shown, the busy of system is further got using histogram Degree guarantees the fluency of system so as to be optimized to system by the subsequent restriction to client.
3, Figure 13 is the structural schematic diagram of one embodiment of mobile terminal provided by the present application, the mobile terminal 130 refering to fig. 1 Including obtaining module 131, judgment module 132 and limitation module 133.
Wherein, the first quantity that module 131 is used to obtain the available binder thread of server-side is obtained;Wherein, binder Thread is provided by server-side, and the binder request for customer in response end to be sent is logical between client and server-side to realize Letter;Whether judgment module 132 is for judging the first quantity less than the first given threshold;Module 133 is limited to be used in judgment module 132 judging result is when being, the binder limited between background client terminal and server-side is communicated.
4, Figure 14 is the structural schematic diagram of another embodiment of mobile terminal provided by the present application, the mobile terminal refering to fig. 1 140 include processor 141 and memory 142, wherein processor 141 and memory 142 can pass through a data bus coupling It connects.
Wherein, memory 142 is for storing computer program, and computer program by processor 141 when being executed, for real Existing following method and step:
Obtain the first quantity of the available binder thread of server-side;Wherein, binder thread is provided by server-side, is used in combination It requests in the binder that customer in response end is sent to realize the communication between client and server-side;Judge whether the first quantity is small In the first given threshold;If so, the binder between limitation background client terminal and server-side is communicated.
5, Figure 15 is the structural schematic diagram of one embodiment of computer storage medium provided by the present application, the calculating refering to fig. 1 Machine storage medium 150 is for storing computer program 151, and computer program 151 is when being executed by processor, for realizing as follows Method and step:
Obtain the first quantity of the available binder thread of server-side;Wherein, binder thread is provided by server-side, is used in combination It requests in the binder that customer in response end is sent to realize the communication between client and server-side;Judge whether the first quantity is small In the first given threshold;If so, the binder between limitation background client terminal and server-side is communicated.
It should be understood that in step performed by virtual module in above-mentioned Figure 13 and Figure 14 and Figure 15 embodiment Computer program is when being executed by processor, the limitation of the method and step and above-mentioned mobile terminal realized and its interprocess communication The embodiment of method is similar, and which is not described herein again.
Embodiments herein is realized in the form of SFU software functional unit and when sold or used as an independent product, can To be stored in a computer readable storage medium.Based on this understanding, the technical solution of the application substantially or Say that all or part of the part that contributes to existing technology or the technical solution can embody in the form of software products Out, which is stored in a storage medium, including some instructions are used so that a computer equipment (can be personal computer, server or the network equipment etc.) or processor (processor) execute each implementation of the application The all or part of the steps of mode the method.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic or disk Etc. the various media that can store program code.
The foregoing is merely presently filed embodiments, are not intended to limit the scope of the patents of the application, all to utilize this Equivalent structure or equivalent flow shift made by application specification and accompanying drawing content, it is relevant to be applied directly or indirectly in other Technical field similarly includes in the scope of patent protection of the application.

Claims (13)

1. a kind of method for limiting of interprocess communication characterized by comprising
Obtain the first quantity of the available binder thread of server-side;Wherein, the binder thread is provided by the server-side, And the binder sent for customer in response end is requested to realize the communication between the client and the server-side;
Judge first quantity whether less than the first given threshold;
If so, limitation background client terminal is communicated with the binder between the server-side.
2. the method for limiting of interprocess communication according to claim 1, which is characterized in that
The step of binder between the limitation background client terminal and the server-side is communicated, comprising:
It obtains target background client terminal and carries out the second quantity that binder communicates used binder thread with the server-side;
Judge whether second quantity is greater than the second given threshold;
It is communicated if so, limiting the target background client terminal with the binder between the server-side.
3. the method for limiting of interprocess communication according to claim 2, which is characterized in that
The step of binder limited between the target background client terminal and the server-side is communicated, comprising:
When the target background client terminal, which sends binder to the server-side, requests, the binder is requested waiting is added The end of queue, to suspend the binder request for responding the target background client terminal and sending.
4. the method for limiting of interprocess communication according to claim 3, which is characterized in that
It is described judge the step of whether first quantity is less than the first given threshold after, further includes:
If it is not, first responding the binder request in the waiting list, then the binder request that customer in response end is sent.
5. the method for limiting of interprocess communication according to claim 2, which is characterized in that
The step of binder limited between the target background client terminal and the server-side is communicated, comprising:
Killing is carried out to the target background client terminal, to discharge the binder thread that the destination client uses.
6. the method for limiting of interprocess communication according to claim 1, which is characterized in that
It is described to judge the step of whether first quantity is less than the first given threshold, specifically:
Judge whether first quantity is zero.
7. the method for limiting of interprocess communication according to claim 1, which is characterized in that
The step of binder between the limitation background client terminal and the server-side is communicated, comprising:
Obtain the memory usage of target background client terminal;
Judge whether the memory usage is greater than third given threshold;
It is communicated if so, limiting the target background client terminal with the binder between the server-side.
8. the method for limiting of interprocess communication according to claim 1, which is characterized in that
The method also includes:
When the client initiates communication request to the server-side, first time point is recorded;
When the server-side responds the communication request that the client is initiated, recorded for the second time point;
Based on the first time point and second time point, service latency is obtained;
The service latency is saved, to be monitored based on the service latency to the communication of the server-side.
9. the method for limiting of interprocess communication according to claim 8, which is characterized in that
The method also includes:
When the interprocess communication of the client and the server-side is completed, third time point is recorded;
Based on second time point and the third time point, the communication service time is obtained;
The communication service time is saved, to be monitored based on the communication service time to the communication of the server-side.
10. the method for limiting of interprocess communication according to claim 9, which is characterized in that
The method also includes:
Based on the first time point and the third time point, interprocess communication total time is obtained;
The acquisition interprocess communication total time is saved, to be based on the acquisition interprocess communication total time to the server-side Communication be monitored.
11. a kind of mobile terminal characterized by comprising
Obtain module, the first quantity of the available binder thread for obtaining server-side;Wherein, the binder thread is by institute Server-side offer is stated, and the binder sent for customer in response end is requested to realize between the client and the server-side Communication;
Judgment module, for judging first quantity whether less than the first given threshold;
Module is limited, is to limit between background client terminal and the server-side when being for the judging result in judgment module Binder communication.
12. a kind of mobile terminal, which is characterized in that including processor and memory, wherein the memory is calculated for storing Machine program, the computer program are described in any item for realizing such as claim 1-10 when being executed by the processor Method.
13. a kind of computer storage medium, which is characterized in that for storing computer program, the computer program is being located When managing device execution, for realizing such as described in any item methods of claim 1-10.
CN201810701460.5A 2018-06-29 2018-06-29 Mobile terminal, limiting method for interprocess communication of mobile terminal and storage medium Active CN108984321B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810701460.5A CN108984321B (en) 2018-06-29 2018-06-29 Mobile terminal, limiting method for interprocess communication of mobile terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810701460.5A CN108984321B (en) 2018-06-29 2018-06-29 Mobile terminal, limiting method for interprocess communication of mobile terminal and storage medium

Publications (2)

Publication Number Publication Date
CN108984321A true CN108984321A (en) 2018-12-11
CN108984321B CN108984321B (en) 2021-03-19

Family

ID=64539712

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810701460.5A Active CN108984321B (en) 2018-06-29 2018-06-29 Mobile terminal, limiting method for interprocess communication of mobile terminal and storage medium

Country Status (1)

Country Link
CN (1) CN108984321B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527476A (en) * 2019-09-19 2021-03-19 华为技术有限公司 Resource scheduling method and electronic equipment
CN114077519A (en) * 2020-08-21 2022-02-22 荣耀终端有限公司 System service recovery method and device and electronic equipment
CN115202902A (en) * 2022-07-01 2022-10-18 荣耀终端有限公司 Method for controlling process interaction and related device

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1578307A (en) * 2003-07-28 2005-02-09 华为技术有限公司 Method for communicating between telecommunication equipment service terminal and customer terminal
CN101127685A (en) * 2007-09-20 2008-02-20 中兴通讯股份有限公司 An inter-process communication device and inter-process communication method
CN103986762A (en) * 2014-05-15 2014-08-13 京信通信系统(中国)有限公司 Process state detection method and device
US20140280493A1 (en) * 2013-03-15 2014-09-18 Microsoft Corporation Application Architecture Supporting Multiple Services and Caching
CN104850460A (en) * 2015-06-02 2015-08-19 上海斐讯数据通信技术有限公司 Service program thread management method
CN106776080A (en) * 2016-12-29 2017-05-31 北京奇虎科技有限公司 The connection method for building up and device of worker thread
CN107608785A (en) * 2017-08-15 2018-01-19 深圳天珑无线科技有限公司 Process management method, mobile terminal and readable storage medium
US9875182B1 (en) * 2015-05-26 2018-01-23 EMC IP Holding Company LLC Lock free container packing
CN107800768A (en) * 2017-09-13 2018-03-13 平安科技(深圳)有限公司 Open platform control method and system

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1578307A (en) * 2003-07-28 2005-02-09 华为技术有限公司 Method for communicating between telecommunication equipment service terminal and customer terminal
CN101127685A (en) * 2007-09-20 2008-02-20 中兴通讯股份有限公司 An inter-process communication device and inter-process communication method
US20140280493A1 (en) * 2013-03-15 2014-09-18 Microsoft Corporation Application Architecture Supporting Multiple Services and Caching
CN103986762A (en) * 2014-05-15 2014-08-13 京信通信系统(中国)有限公司 Process state detection method and device
US9875182B1 (en) * 2015-05-26 2018-01-23 EMC IP Holding Company LLC Lock free container packing
CN104850460A (en) * 2015-06-02 2015-08-19 上海斐讯数据通信技术有限公司 Service program thread management method
CN106776080A (en) * 2016-12-29 2017-05-31 北京奇虎科技有限公司 The connection method for building up and device of worker thread
CN107608785A (en) * 2017-08-15 2018-01-19 深圳天珑无线科技有限公司 Process management method, mobile terminal and readable storage medium
CN107800768A (en) * 2017-09-13 2018-03-13 平安科技(深圳)有限公司 Open platform control method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王汝言,蒋子泉,刘乔寿,吴大鹏: "Android下Binder进程间通信机制的分析与研究", 《计算机技术与发展》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527476A (en) * 2019-09-19 2021-03-19 华为技术有限公司 Resource scheduling method and electronic equipment
WO2021052415A1 (en) * 2019-09-19 2021-03-25 华为技术有限公司 Resource scheduling method and electronic device
CN112527476B (en) * 2019-09-19 2024-03-26 华为技术有限公司 Resource scheduling method and electronic equipment
CN114077519A (en) * 2020-08-21 2022-02-22 荣耀终端有限公司 System service recovery method and device and electronic equipment
CN115202902A (en) * 2022-07-01 2022-10-18 荣耀终端有限公司 Method for controlling process interaction and related device

Also Published As

Publication number Publication date
CN108984321B (en) 2021-03-19

Similar Documents

Publication Publication Date Title
US10628216B2 (en) I/O request scheduling method and apparatus by adjusting queue depth associated with storage device based on hige or low priority status
WO2020181813A1 (en) Task scheduling method based on data processing and related device
CN109032812A (en) A kind of mobile terminal and its method for limiting, the storage medium of interprocess communication
WO2021109767A1 (en) Network device and method for reducing transmission delay therefor
CN106021358A (en) Abnormal information recording method and system
CN109117280B (en) Electronic device, method for limiting inter-process communication thereof and storage medium
CN108984321A (en) A kind of mobile terminal and its method for limiting, the storage medium of interprocess communication
CN107085542A (en) IPC communication means and server
CN108681481A (en) The processing method and processing device of service request
US20070239890A1 (en) Method, system and program storage device for preventing a real-time application from running out of free threads when the real-time application receives a device interface request
CN109818810A (en) A kind of access server connection optimization method, access server and communication system
CN111586140A (en) Data interaction method and server
CN108924128A (en) A kind of mobile terminal and its method for limiting, the storage medium of interprocess communication
CN101114984A (en) Multithreading network load control method
CN109117278A (en) A kind of mobile terminal and its method for limiting, the storage medium of interprocess communication
CN108037898A (en) A kind of method, system and device of the dpdk communications based on Ceph
CN111352710B (en) Process management method and device, computing equipment and storage medium
CN109117279A (en) The method that is communicated between electronic device and its limiting process, storage medium
CN111831411A (en) Task processing method and device, storage medium and electronic equipment
CN115439250A (en) Transaction request processing method and device, storage medium and electronic device
CN108429703B (en) DHCP client-side online method and device
CN109032814A (en) A kind of mobile terminal and its monitoring method, the storage medium of interprocess communication
CN116414534A (en) Task scheduling method, device, integrated circuit, network equipment and storage medium
CN109117340A (en) A kind of mobile terminal and its monitoring method, the storage medium of interprocess communication
CN109039952A (en) A kind of mobile terminal and its method for limiting, the storage medium of interprocess communication

Legal Events

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