CN109117340B - Mobile terminal, method for monitoring interprocess communication of mobile terminal and storage medium - Google Patents

Mobile terminal, method for monitoring interprocess communication of mobile terminal and storage medium Download PDF

Info

Publication number
CN109117340B
CN109117340B CN201810701485.5A CN201810701485A CN109117340B CN 109117340 B CN109117340 B CN 109117340B CN 201810701485 A CN201810701485 A CN 201810701485A CN 109117340 B CN109117340 B CN 109117340B
Authority
CN
China
Prior art keywords
communication
server
client
time
time point
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.)
Active
Application number
CN201810701485.5A
Other languages
Chinese (zh)
Other versions
CN109117340A (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 CN201810701485.5A priority Critical patent/CN109117340B/en
Publication of CN109117340A publication Critical patent/CN109117340A/en
Application granted granted Critical
Publication of CN109117340B publication Critical patent/CN109117340B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Quality & Reliability (AREA)
  • Computer And Data Communications (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The application discloses a mobile terminal and a monitoring method and a storage medium for interprocess communication thereof, wherein the monitoring method for interprocess communication comprises the following steps: acquiring the communication frequency between a server and at least one client in the process of carrying out interprocess communication between the server and the at least one client based on a binder mechanism; judging whether the communication times are larger than a set threshold value or not; if so, limiting the communication between the first client and the server; the first client is the client which communicates with the server side the most frequently in at least one client. By the method, the busy degree of the server can be reduced, and the fluency of the system is ensured.

Description

Mobile terminal, method for monitoring interprocess communication of mobile terminal and storage medium
Technical Field
The present application relates to the field of mobile terminal technologies, and in particular, to a mobile terminal, a method for monitoring interprocess communication of the mobile terminal, and a storage medium.
Background
In the Android operating system, data transmission is often required between an application and a service, and a mode of inter-process communication can be generally adopted, for example, transmission can be performed through a Binder mechanism, so that data of an opposite side is acquired.
In the process of communicating by using the Binder mechanism, usually one server communicates with a plurality of clients, which burdens the server, and affects the fluency of the service or system when the interprocess communication is too busy.
Disclosure of Invention
The technical scheme adopted by the application is as follows: a method for monitoring interprocess communication is provided, which comprises the following steps: acquiring the communication frequency between a server and at least one client in the process of carrying out interprocess communication between the server and the at least one client based on a binder mechanism; judging whether the communication times are larger than a set threshold value or not; if so, limiting the communication between the first client and the server; the first client is the client which communicates with the server side the most frequently in at least one client.
Another technical scheme adopted by the application is as follows: there is provided a mobile terminal including: the acquisition module is used for acquiring the communication times between the server and at least one client in the process of carrying out interprocess communication between the server and the at least one client based on the binder mechanism; the judging module is used for judging whether the communication frequency is greater than a set threshold value or not; the limiting module is used for limiting the communication between the first client and the server when the judgment result of the judging module is yes; the first client is the client which communicates with the server side the most frequently in at least one client.
Another technical scheme adopted by the application is as follows: there is provided a mobile terminal comprising a processor and a memory, wherein the memory is for storing a computer program for performing the method as described above when executed by the processor.
Another technical scheme adopted by the application is as follows: there is provided a computer storage medium for storing a computer program for implementing the method as described above when executed by a processor.
Different from the situation of the prior art, the monitoring method for interprocess communication provided by the application comprises the following steps: in the process of inter-process communication between the server and at least one client based on the binder mechanism, the communication frequency between the server and at least one client is obtained, and the busyness of the server can be reduced and the fluency of the system can be ensured by limiting the communication of the client with the largest communication frequency with the server.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts. Wherein:
FIG. 1 is a flowchart illustrating a first embodiment of a method for monitoring interprocess communication provided by the present application;
FIG. 2 is a schematic illustration of interprocess communication;
FIG. 3 is a schematic diagram of a Binder communication mechanism;
FIG. 4 is an interaction diagram of a client and a server;
FIG. 5 is a flowchart illustrating a second embodiment of a method for monitoring interprocess communication provided by the present application;
FIG. 6 is a flowchart illustrating a third embodiment of a method for monitoring interprocess communication provided by the present application;
FIG. 7 is a flowchart illustrating a fourth embodiment of a method for monitoring interprocess communication provided by the present application;
FIG. 8 is a flowchart illustrating a fifth embodiment of a method for monitoring interprocess communication provided by the present application;
FIG. 9 is a flowchart illustrating a sixth embodiment of a method for monitoring interprocess communication provided by the present application;
FIG. 10 is a flowchart illustrating a seventh embodiment of a method for monitoring interprocess communication provided by the present application;
FIG. 11 is a block diagram of an embodiment of a mobile terminal provided herein;
fig. 12 is a schematic structural diagram of another embodiment of a mobile terminal provided in the present application;
FIG. 13 is a schematic structural diagram of an embodiment of a computer storage medium provided in the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be further noted that, for the convenience of description, only some of the structures related to the present application are shown in the drawings, not all of the structures. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first", "second", etc. in this application are used to distinguish between different objects and not to describe a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
Referring to fig. 1, fig. 1 is a schematic flowchart of a first embodiment of a monitoring method for interprocess communication provided by the present application, where the method includes:
step 11: in the process of carrying out interprocess communication between the server and at least one client based on the binder mechanism, the communication frequency between the server and at least one client is obtained.
The Binder is a mode of inter-process communication (IPC) in the Android system, and is one of the most important characteristics in the Android system. The four major components in Android, Activity, Service, Broadcast receiver, ContentProvider, App, etc., operate in different processes, which are bridges for communication between these processes. As its name "adhesive" is used to bond components of a system together as a bridge between the components.
As shown in fig. 2, fig. 2 is a schematic diagram of a principle of inter-process communication, and each Android process can only run in a virtual address space owned by its own process. For example, the virtual address space corresponds to 4GB, where 3GB is the user space and 1GB is the kernel space, and the size of the kernel space can be adjusted by parameter configuration. For user space, different processes are not shared with each other, while kernel space is shareable. The Client process communicates with the Server process, and the underlying communication work is completed by using the kernel memory space sharable among the processes, and the Client process and the Server process often adopt methods such as ioctl (a function for managing an I/O channel of a device in a device driver) and the like to interact with the drive of the kernel space.
Referring to fig. 3, fig. 3 is a schematic diagram of a Binder communication mechanism, in which the Binder communication employs a C/S architecture, and from a component perspective, includes a Client (Client), a Server (Server), a ServiceManager (service management) and a Binder driver, where the ServiceManager is used for managing various services in the system.
Wherein, the Client process is a process using service; the Server process is a process for providing service; the ServiceManager process is used for converting the Binder name in a character form into a reference to the Binder in the Client, so that the Client can obtain the reference to the Binder entity in the Server through the Binder name; the Binder driver is responsible for establishing Binder communication between processes, transmitting the Binder between the processes, managing the reference count of the Binder, transmitting and interacting data packets between the processes and the like.
In the communication process based on the binder mechanism, the following three processes are mainly included:
registration service (addService): the Server process registers Service to the ServiceManager first. The process comprises the following steps: the Server is a client and the ServiceManager is a Server.
Get service (getService): before a Client process uses a certain Service, the Client process needs to acquire the corresponding Service from the ServiceManager. The process comprises the following steps: the Client is a Client and the ServiceManager is a server.
Using the service: the Client establishes a communication path with the Server process where the Service is located according to the obtained Service information, and then can directly interact with the Service. The process comprises the following steps: the client is a client and the server is a server.
It can be understood that the interactions among the Client, the Server and the Service Manager in fig. 3 are all represented by dotted lines, because they are not directly interacted with each other, but are interacted with the Binder driver, thereby implementing an IPC communication mode. The Binder driver is positioned in the kernel space, and the Client, the Server and the Service Manager are positioned in the user space. The Binder driver and the ServiceManager can be regarded as basic frameworks of an Android platform, the Client and the Server are application layers of the Android, and developers can directly carry out IPC communication by means of the basic platform framework of the Android by only customizing the Client and the Server.
Based on the principle of the binder mechanism, it is known that the client and the server may be any two processes, which may be an application or a service, for example, communication between applications or communication between applications.
In addition, in the intelligent terminal, a plurality of applications may acquire the same service at the same time, and therefore, one server may perform inter-process communication with a plurality of clients at the same time, in this case, the number of communications of the server is large, the thread usage amount is large, and the communications are too frequent, which may cause a system jam.
Optionally, in this embodiment, the server may be a system server.
Specifically, as shown in fig. 4, fig. 4 is an interaction schematic diagram of a client and a server, and the communication process between the client and the server mainly includes three processes, where the client initiates a communication request to the server, the server responds to the communication request initiated by the client, and data interaction is performed between the client and the server.
The communication process is completed through the above process, and therefore, the number of times of communication can be accumulated by any one of the three nodes.
Optionally, step 11 may specifically be: and when at least one client initiates a communication request to the server, accumulating the communication times.
Optionally, step 11 may specifically be: and when the server side responds to the communication request initiated by at least one client side, accumulating the communication times.
Optionally, step 11 may specifically be: and accumulating the communication times when the interprocess communication between at least one client and the server is completed.
In one embodiment, the server may not respond to the communication request of the client due to busy reasons, or the client may not be able to complete communication with the server due to breakdown reasons, and therefore, in this embodiment, the number of times of communication may be accumulated when the inter-process communication between the client and the server is completed. Therefore, the excessive communication times caused by the error accumulation can be avoided.
Optionally, in an embodiment, only the number of communications between a specific client and a specific server may be accumulated, and one-to-one statistics may be performed.
Step 12: and judging whether the communication frequency is greater than a set threshold value.
If the determination result in step 12 is yes, step 13 is executed.
The set threshold may be set empirically, for example, by obtaining an average value of the communication times within a period of time, when the communication times reaches a certain critical value, the system is prone to be unsmooth, collapse, and the like.
The communication frequency can reflect the busy degree of the server, and particularly when a plurality of clients communicate with the same server at the same time, data support can be provided for subsequent system optimization by monitoring the communication frequency. The subsequent system optimization includes limiting communication of the client, and specifically, killing, freezing and the like can be performed on the client.
The following is illustrated by a specific example, which is illustrated according to chronological order:
1. carrying out binder communication between the first process of the application program A and the first process of the application program B;
2. carrying out binder communication between the second process of the application program A and the system service;
3. the first process of the application program C is in binder communication with the system service;
4. carrying out binder communication between a first process of the application program D and system service;
5. the second process of application D is in binder communication with the system services.
In the above example, the total number of communications is 5. Wherein, for the application program A, the communication times are 2; for application program B, the number of communications is 1; for application C, the number of communications is 1; for the application program D, the communication times are 2; for the system service, the number of communication times is 4.
Optionally, if the communication of the system service is monitored, the obtained number of times of communication is 4.
Step 13: limiting communication between the first client and the server; the first client is the client which communicates with the server side the most frequently in at least one client.
Optionally, since the communication between the first client and the server is limited in step 13, the client may be marked during the communication between the client and the server in step 12. Specifically, step 12 may be: and when the server communicates with each client, accumulating the communication times, marking the corresponding client, and taking the client with the largest mark as a first client.
The following is illustrated by a specific example, which is illustrated according to chronological order:
1. carrying out binder communication between a first process of the application program A and system services, accumulating the communication times for 1 time, and marking the application program A;
2. carrying out binder communication between the second process of the application program A and the system service, accumulating the communication times for 2 times, and marking the application program A again;
3. carrying out binder communication between the first process of the application program B and system service, accumulating the communication times for 3 times, and marking the application program B;
4. carrying out binder communication between the first process of the application program C and the system service, accumulating the communication times for 4 times, and marking the application program C;
5. the first process of application D communicates binder with the system services, accumulates the number of communications 5 times, and marks application D.
In the above example, the total number of communications is 5. For the application program A, two marks are marked, and the communication frequency is 2; 1 for other applications; application a is treated as the first client and communication between application a and the system services is restricted.
Optionally, in an embodiment, the method for restricting communication between the first client and the server includes: and limiting the number of times of communication, the communication frequency and the number of thread usage between the first client and the server.
The number of communications is a total number of communications between the first client and the server, and may be limited to 5, for example, the number of communications is accumulated from the first time the first client communicates with the server, and when the number of communications between the first client and the server reaches 5, the first client and the server are prohibited from communicating with each other.
The communication frequency is generally the number of communications within a period of time, for example, may be limited to 5 times per hour, and the number of communications between the first client and the server is accumulated and counted from the first time of communications between the first client and the server, and when the number of communications between the first client and the server reaches 5 times within an hour, the first client and the server are prohibited from communicating with each other. After one hour, communication between the first client and the server is allowed.
The thread usage number refers to the number of threads of the server used by the first client and the server in the communication process. Taking the system service as an example, there are generally 32 threads, and if the number of threads is 10, only the communication between the first client and the server is allowed to occupy 10 threads at most.
It is understood that the client and the server in the above embodiments are self-definable, and thus the above manner may be applied to any application or service to monitor the communication times thereof.
Different from the prior art, the inter-process communication monitoring method provided in this embodiment monitors the busy level of the server by acquiring the number of times of communication between the server and at least one client, and limits the client with a large number of times of communication by using the monitoring result. Through the method, on one hand, the busy degree of the server can be rapidly and effectively acquired, data support is provided for optimization of the system, on the other hand, the communication times can be well limited from the perspective of the client, the burden of the server is effectively reduced, the busy degree of the server is reduced, and the flow performance of the system is guaranteed.
Referring to fig. 5, fig. 5 is a schematic flowchart of a second embodiment of a monitoring method for interprocess communication provided by the present application, where the method includes:
step 51: in the process of carrying out interprocess communication between a server side and at least one client side based on a binder mechanism, when the communication times are accumulated each time, the current time point is recorded at the same time.
Step 52: based on the time point of each communication, the accumulated number of times of communication within a set time period is acquired.
Taking the time point of completing the communication as an example, the same server completes 5 times of communication in a period of time, as shown in the following table:
number of communications Point in time when communication is completed
Communication 1 Time 1
2 nd communication Time point 2
3 rd communication Time point 3
4 th communication Time point 4
Communication 5 Time point 5
Specifically, the accumulation may be performed from a certain time point, for example, from time point 1 or a certain time point before time point 1, and then the length of the time period may be arbitrarily set, for example, 10 minutes.
For example, if the join is to accumulate the number of communications within 10 minutes from time 1, then the time of the last statistical time deadline is time 1+10 minutes, and if time 1-5 are within this time period, then the accumulated number of communications is 5.
In addition, the previous steps may be repeated, again taking 10 minutes as an example, counted every 10 minutes, and the number of consecutive counts may be compared. For example, the number of communications may be monitored by a change in data, with 5 communications in the first 10 minutes, 10 communications in the second 10 minutes, and 20 communications in the third 10 minutes.
Referring to fig. 6, fig. 6 is a schematic flowchart of a third embodiment of a monitoring method for interprocess communication provided by the present application, where the method includes:
step 61: and judging whether the server side meets a preset condition or not in the process of carrying out interprocess communication between the server side and at least one client side based on a binder mechanism.
If the determination result in step 61 is yes, step 62 is executed.
Step 62: and accumulating the communication times between the server and at least one client in a set time period from the time when the server meets the preset condition.
It can be understood that the purpose of monitoring the number of times of communication of the server is to monitor the busy degree of the server, so that the monitoring can be started again when the busy degree of the server meets a certain condition.
Optionally, the preset condition is that the number of available threads of the server is less than a set threshold. It will be appreciated that communication between two processes typically uses multiple threads. For example, the Android system specifies that a SystemServer process can create 32 Binder threads at most for interprocess data communication; the SurfaceFlinger process can create 4 Binder threads at most for interprocess data communication; the program application process can create up to 8 Binder threads for interprocess data communication.
Therefore, the number of communications can be monitored when the number of threads used by the server meets the requirement, for example, one server has 32 threads in total, 16 threads are used, and the remaining 16 threads are available, that is, when the number of threads used is more than half, the number of communications between the server and at least one client in the set time period starts to be accumulated.
Of course, the preset condition may also be the occupancy rate of the CPU, the number of clients simultaneously communicating with the same server, the communication frequency, and the like, which are not listed here.
And step 63: and storing the communication times so as to monitor the communication of the server side based on the communication times.
Referring to fig. 7, fig. 7 is a schematic flowchart of a fourth embodiment of a monitoring method for interprocess communication provided by the present application, where the method includes:
step 71: when at least one client side initiates a communication request to a server side, a first time point is recorded.
Step 72: and recording the second time point when the server side responds to the communication request initiated by the at least one client side.
Step 73: and acquiring the service waiting time based on the first time point and the second time point.
The service waiting time is a time period between the first time point and the second time point.
Step 74: and saving the service waiting time so as to monitor the communication of the service end based on the service waiting time.
Referring to fig. 8, fig. 8 is a schematic flowchart of a fifth embodiment of a monitoring method for interprocess communication provided by the present application, where the method includes:
step 81: and recording the second time point when the server side responds to the communication request initiated by the at least one client side.
Step 82: and recording the third time point when the inter-process communication between the at least one client and the server is completed.
Step 83: and acquiring the communication service time based on the second time point and the third time point.
The communication service time is a time period between the second time point and the third time point.
Step 84: and saving the communication service time so as to monitor the communication of the service terminal based on the communication service time.
Referring to fig. 9, fig. 9 is a schematic flowchart of a sixth embodiment of a method for monitoring inter-process communication provided by the present application, where the method includes:
step 91: when at least one client side initiates a communication request to a server side, a first time point is recorded.
And step 92: and recording the third time point when the inter-process communication between the at least one client and the server is completed.
Step 93: and acquiring the total time of the inter-process communication based on the first time point and the third time point.
The total time of inter-process communication is the time period between the first time point and the third time point.
Step 94: and saving the total time for acquiring the interprocess communication so as to monitor the communication of the server based on the total time for acquiring the interprocess communication.
The embodiments of fig. 7-9 may be implemented in combination with other embodiments described above, and obtain the duration of the communication from three different aspects, including the service waiting duration, the communication service duration, and the total duration.
Specifically, an average value or a total time length of each time length may be obtained. As shown in the following table:
number of communications Service wait duration Duration of communication service Total duration of inter-process communication
1 a1 a2 a3
2 b1 b2 b3
3 c1 c2 c3
For example, the average value of the service waiting time periods is the average value of a1, b1, and c 1; the average value of the communication service duration is the average value of a2, b2 and c 2; the total inter-process communication duration is the average of a3, b3, and c 3.
Alternatively, other statistical methods of statistics may be used to make statistics on the data, such as variance.
In addition, when the communication times, the service waiting time length, the communication service time length and the total inter-process communication time length are counted and monitored, a histogram can be drawn for visual display, and the busyness degree of the system can be further obtained by using the histogram, so that the system can be optimized through subsequent limitation measures on the client side, and the fluency of the system is ensured.
Referring to fig. 10, fig. 10 is a schematic flowchart of a seventh embodiment of a monitoring method for interprocess communication provided by the present application, where the method includes:
step 101: in the process of carrying out interprocess communication between the server and at least one client based on the binder mechanism, the communication frequency between the server and at least one client is obtained.
Step 102: and judging whether the communication frequency is greater than a set threshold value.
Step 103: and acquiring the service condition of the server.
The service usage of the server at least includes the number of available threads of the server, the number of clients in communication with the client, the communication efficiency of the server, and the like, and may also be the CPU occupation.
Step 104: and judging whether the service condition of the server side meets the set condition.
Taking the number of available threads as an example, it can be determined whether the number of available threads of the server is smaller than a set threshold.
Step 105: communication between the first client and the server is restricted.
It can be understood that, in the embodiment, after the communication times are counted, other indexes for detecting whether the server is busy are obtained based on the communication times, and the communication times are used as a basic index. Therefore, the busy degree of the server can be judged through multiple conditions, the communication of the client side is limited, the fluency of the mobile terminal is facilitated, and the situation that the client side is forbidden by mistake and the use of a user is inconvenient can be prevented.
Referring to fig. 11, fig. 11 is a schematic structural diagram of an embodiment of a mobile terminal provided in the present application, where the mobile terminal 110 includes an obtaining module 111, a determining module 112, and a limiting module 113.
The obtaining module 111 is configured to obtain the number of times of communication between the server and the at least one client in a process that the server and the at least one client perform inter-process communication based on a binder mechanism; the judging module 112 is configured to judge whether the number of times of communication is greater than a set threshold; the limiting module 113 is configured to limit, when the determination result of the determining module is yes, communication between the first client and the server; the first client is the client which communicates with the server side the most frequently in at least one client.
Optionally, the obtaining module 111 is specifically configured to accumulate communication times when the server communicates with each client, and mark the corresponding client; and taking the client with the most marks as the first client.
Optionally, the limiting module 113 is specifically configured to limit the number of times of communication, the communication frequency, and the number of threads used between the first client and the server.
Optionally, the obtaining module 111 is specifically configured to accumulate the communication times when at least one client initiates a communication request to the server, or when the server responds to the communication request initiated by at least one client, or when the inter-process communication between at least one client and the server is completed.
Optionally, the obtaining module 111 is further configured to record a current time point when the communication times are accumulated each time; based on the time point of each communication, the accumulated number of times of communication within a set time period is acquired.
Referring to fig. 12, fig. 12 is a schematic structural diagram of another embodiment of the mobile terminal provided in the present application, where the mobile terminal 120 includes a processor 121 and a memory 122, where the processor 121 and the memory 122 may be coupled by a data bus.
Wherein the memory 122 is adapted to store a computer program which, when being executed by the processor 121, is adapted to carry out the method steps of:
acquiring the communication frequency between a server and at least one client in the process of carrying out interprocess communication between the server and the at least one client based on a binder mechanism; judging whether the communication times are larger than a set threshold value or not; if so, limiting the communication between the first client and the server; the first client is the client which communicates with the server side the most frequently in at least one client.
Optionally, the computer program, when being executed by the processor 121, is further adapted to carry out the following method steps: when at least one client initiates a communication request to a server, or when the server responds to the communication request initiated by at least one client, or when the inter-process communication between at least one client and the server is completed, the communication times are accumulated.
Optionally, the computer program, when being executed by the processor 121, is further adapted to carry out the following method steps: judging whether the server side meets a preset condition or not; if yes, starting from the condition that the server side meets the preset condition, accumulating the communication times between the server side and at least one client side in the set time period; the preset condition is that the number of available threads of the server is smaller than a set threshold.
Optionally, the computer program, when being executed by the processor 121, is further adapted to carry out the following method steps: when at least one client initiates a communication request to a server, recording a first time point; when the server side responds to a communication request initiated by at least one client side, recording a second time point; acquiring service waiting time based on the first time point and the second time point; and saving the service waiting time so as to monitor the communication of the service end based on the service waiting time. And
recording a third time point when the inter-process communication between at least one client and the server is completed; acquiring communication service time based on the second time point and the third time point; and saving the communication service time so as to monitor the communication of the service terminal based on the communication service time. And
acquiring total inter-process communication time based on the first time point and the third time point; and saving the total time for acquiring the interprocess communication so as to monitor the communication of the server based on the total time for acquiring the interprocess communication.
Optionally, the computer program, when being executed by the processor 121, is further adapted to carry out the following method steps: when the communication frequency between the server and at least one client is greater than a set frequency threshold value, acquiring the service condition of the client; storing the use condition of the client so as to monitor the communication of the server based on the use condition of the client; the use condition of the client at least comprises the number of available threads of the client.
Referring to fig. 13, fig. 13 is a schematic structural diagram of an embodiment of a computer storage medium provided in the present application, the computer storage medium 130 is used for storing a computer program 131, and the computer program 131 is used for implementing the following method steps when being executed by a processor:
acquiring the communication frequency between a server and at least one client in the process of carrying out interprocess communication between the server and the at least one client based on a binder mechanism; judging whether the communication times are larger than a set threshold value or not; if so, limiting the communication between the first client and the server; the first client is the client which communicates with the server side the most frequently in at least one client.
It is understood that the steps of the method implemented by the computer program 131 when executed by the processor are similar to the above-described embodiment of the mobile terminal, and are not described here again.
Embodiments of the present application may be implemented in software functional units and may be stored in a computer readable storage medium when sold or used as a stand-alone product. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the purpose of illustrating embodiments of the present application and is not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application or are directly or indirectly applied to other related technical fields, are also included in the scope of the present application.

Claims (14)

1. A method for monitoring interprocess communication is characterized by comprising the following steps:
in the process of carrying out interprocess communication between a server and at least one client based on a binder mechanism, acquiring the communication frequency between the server and the at least one client; when the communication times are accumulated every time, the current time point is recorded at the same time, so that the communication times in a set time period are obtained based on the time point of each communication;
judging whether the communication times are larger than a set threshold value or not;
if so, limiting the communication between the first client and the server; the first client is the client which communicates with the server side the most times in the at least one client.
2. The method for monitoring interprocess communication according to claim 1,
the step of obtaining the number of times of communication between the server and the at least one client includes:
when the server communicates with each client, accumulating the communication times and marking the corresponding client;
and taking the client with the most marks as the first client.
3. The method for monitoring interprocess communication according to claim 1,
the step of restricting communication between the first client and the server comprises:
and limiting the number of times of communication, the communication frequency and the number of thread usage between the first client and the server.
4. The method for monitoring interprocess communication according to claim 1,
the step of obtaining the number of times of communication between the server and the at least one client includes:
and when the at least one client initiates a communication request to the server, accumulating the communication times.
5. The method for monitoring interprocess communication according to claim 1,
the step of obtaining the number of times of communication between the server and the at least one client includes:
and when the server side responds to the communication request initiated by the at least one client side, accumulating the communication times.
6. The method for monitoring interprocess communication according to claim 1,
the step of obtaining the number of times of communication between the server and the at least one client includes:
and accumulating the communication times when the interprocess communication between the at least one client and the server is completed.
7. The method for monitoring interprocess communication according to claim 1,
the step of obtaining the number of times of communication between the server and the at least one client includes:
judging whether the server side meets a preset condition or not;
if so, accumulating the communication times between the server and the at least one client within a set time period from the time when the server meets a preset condition;
the preset condition is that the number of the available threads of the server is smaller than a set threshold value.
8. The method for monitoring interprocess communication according to claim 1,
the monitoring method further comprises the following steps:
when the at least one client side initiates a communication request to the server side, recording a first time point;
when the server side responds to the communication request initiated by the at least one client side, recording a second time point;
acquiring service waiting time based on the first time point and the second time point;
and saving the service waiting time so as to monitor the communication of the server side based on the service waiting time.
9. The method for monitoring interprocess communication according to claim 8,
the monitoring method further comprises the following steps:
recording a third time point when the inter-process communication between the at least one client and the server is completed;
acquiring communication service time based on the second time point and the third time point;
and saving the communication service time so as to monitor the communication of the server based on the communication service time.
10. The method for monitoring interprocess communication according to claim 9,
the monitoring method further comprises the following steps:
acquiring total inter-process communication time based on the first time point and the third time point;
and saving the total time of the communication between the acquisition processes so as to monitor the communication of the server based on the total time of the communication between the acquisition processes.
11. The method for monitoring interprocess communication according to claim 1,
the step of restricting communication between the first client and the server comprises:
acquiring the service condition of the server; the service condition of the server at least comprises the number of available threads of the server;
judging whether the service condition of the server side meets a set condition;
and if so, limiting the communication between the first client and the server.
12. A mobile terminal, comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring the communication times between a server and at least one client in the process of carrying out interprocess communication between the server and the at least one client based on a binder mechanism; the acquisition module is further used for simultaneously recording the current time point when the communication times are accumulated each time so as to acquire the communication times in a set time period based on the time point of each communication;
the judging module is used for judging whether the communication frequency is greater than a set threshold value;
the limiting module is used for limiting the communication between the first client and the server when the judgment result of the judging module is yes; the first client is the client which communicates with the server side the most times in the at least one client.
13. A mobile terminal, characterized in that it comprises a processor and a memory, wherein the memory is adapted to store a computer program which, when executed by the processor, is adapted to carry out the method according to any of claims 1-11.
14. A computer storage medium for storing a computer program which, when executed by a processor, is adapted to carry out the method of any one of claims 1 to 11.
CN201810701485.5A 2018-06-29 2018-06-29 Mobile terminal, method for monitoring interprocess communication of mobile terminal and storage medium Active CN109117340B (en)

Priority Applications (1)

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

Applications Claiming Priority (1)

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

Publications (2)

Publication Number Publication Date
CN109117340A CN109117340A (en) 2019-01-01
CN109117340B true CN109117340B (en) 2022-03-29

Family

ID=64822339

Family Applications (1)

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

Country Status (1)

Country Link
CN (1) CN109117340B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116662024B (en) * 2022-12-30 2023-11-07 荣耀终端有限公司 Inter-process communication monitoring method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103150220A (en) * 2011-12-07 2013-06-12 腾讯科技(深圳)有限公司 Method and system for interprocess communications
CN103902390A (en) * 2014-03-12 2014-07-02 深圳创维-Rgb电子有限公司 Inter-process communication method based on Android application layer and basis application communication system
CN105843738A (en) * 2016-03-22 2016-08-10 汉柏科技有限公司 Inter-process communication statistics and debugging method and system
CN108073499A (en) * 2016-11-10 2018-05-25 腾讯科技(深圳)有限公司 The test method and device of application program

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6667967B1 (en) * 1999-05-14 2003-12-23 Omninet Capital, Llc High-speed network of independently linked nodes
US20130067492A1 (en) * 2011-09-09 2013-03-14 Eli Joshua FIDLER Content-filter publish-subscribe system that optimizes interprocess communications
CN103108320A (en) * 2011-11-15 2013-05-15 网秦无限(北京)科技有限公司 Method and system for monitoring application program of mobile device
CN102891843B (en) * 2012-09-18 2015-04-29 北京深思洛克软件技术股份有限公司 Method for authorizing application program at android client side through local service unit
CN102970356A (en) * 2012-11-08 2013-03-13 百度在线网络技术(北京)有限公司 Communication method, system and device for cloud side server and client side
CN103139010B (en) * 2012-11-13 2016-09-21 深圳中兴网信科技有限公司 Terminal, testing service device and method of testing
CN105335238B (en) * 2014-08-12 2020-04-21 腾讯科技(深圳)有限公司 Inter-process communication method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103150220A (en) * 2011-12-07 2013-06-12 腾讯科技(深圳)有限公司 Method and system for interprocess communications
CN103902390A (en) * 2014-03-12 2014-07-02 深圳创维-Rgb电子有限公司 Inter-process communication method based on Android application layer and basis application communication system
CN105843738A (en) * 2016-03-22 2016-08-10 汉柏科技有限公司 Inter-process communication statistics and debugging method and system
CN108073499A (en) * 2016-11-10 2018-05-25 腾讯科技(深圳)有限公司 The test method and device of application program

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Android Binder通信数据结构介绍;快乐安卓;《https://blog.csdn.net/yangwen123/article/details/9100599》;20130627;1-2页 *

Also Published As

Publication number Publication date
CN109117340A (en) 2019-01-01

Similar Documents

Publication Publication Date Title
CN109936511B (en) Token obtaining method, device, server, terminal equipment and medium
CN106452818B (en) Resource scheduling method and system
CN105471933B (en) Server overload guard method, server overload protection system and server
CN109117280B (en) Electronic device, method for limiting inter-process communication thereof and storage medium
WO2010062423A1 (en) Method and apparatus for enforcing a resource-usage policy in a compute farm
CN108984321B (en) Mobile terminal, limiting method for interprocess communication of mobile terminal and storage medium
CN109117278B (en) Mobile terminal, limiting method for interprocess communication of mobile terminal and storage medium
WO2005017736A1 (en) System and program for detecting bottle neck in disc array device
WO2020220748A1 (en) Application control method and apparatus, terminal, and computer-readable storage medium
CN110300040A (en) A kind of communication means and relevant device
CN109032812B (en) Mobile terminal, limiting method for interprocess communication of mobile terminal and storage medium
CN109032814B (en) Mobile terminal, method for monitoring interprocess communication of mobile terminal and storage medium
CN109117340B (en) Mobile terminal, method for monitoring interprocess communication of mobile terminal and storage medium
CN110825505B (en) Task scheduling method, device, computer equipment and storage medium
CN109002381B (en) Process communication monitoring method, electronic device and computer readable storage medium
CN109818977B (en) Access server communication optimization method, access server and communication system
CN108924128A (en) A kind of mobile terminal and its method for limiting, the storage medium of interprocess communication
CN109039952B (en) Mobile terminal, limiting method for interprocess communication of mobile terminal and storage medium
US10327206B2 (en) Method and apparatus for controlling TCP packets in communication system
CN112817772A (en) Data communication method, device, equipment and storage medium
CN110311963A (en) Information push method, device, computer equipment and computer readable storage medium
CN110597631B (en) Resource management method, monitoring server, proxy server, and storage medium
CN106534231B (en) Method, device and system for controlling use limit of network resources
CN108804152B (en) Method and device for adjusting configuration parameters
CN109062706B (en) Electronic device, method for limiting inter-process communication thereof and storage medium

Legal Events

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